Fixed license checkin form UI

This commit is contained in:
snipe 2017-10-01 15:08:32 -07:00
parent afc8133acf
commit e26d038589
2 changed files with 26 additions and 27 deletions

View file

@ -357,12 +357,12 @@ class LicensesController extends Controller
public function getCheckin($seatId = null, $backTo = null)
{
// Check if the asset exists
if (is_null($licenseseat = LicenseSeat::find($seatId))) {
if (is_null($licenseSeat = LicenseSeat::find($seatId))) {
// Redirect to the asset management page with error
return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.not_found'));
}
$this->authorize('checkin', $licenseseat);
return view('licenses/checkin', compact('licenseseat'))->with('backto', $backTo);
$this->authorize('checkin', $licenseSeat);
return view('licenses/checkin', compact('licenseSeat'))->with('backto', $backTo);
}

View file

@ -6,28 +6,31 @@
@parent
@stop
@section('header_right')
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">{{ trans('general.back') }}</a>
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
{{ trans('general.back') }}</a>
@stop
{{-- Page content --}}
@section('content')
<div class="row form-wrapper">
<!-- left column -->
<div class="col-md-10 column">
<div class="row">
<!-- left column -->
<div class="col-md-7">
<form class="form-horizontal" method="post" action="{{ route('licenses.checkin.save', $licenseSeat) }}" autocomplete="off">
{{csrf_field()}}
@if ($backto=='user')
<form class="form-horizontal" method="post" action="{{ route('licenses.checkin', array('licenseeat_id'=> $licenseseat->id, 'backto'=>'user')) }}" autocomplete="off">
@else
<form class="form-horizontal" method="post" action="{{ route('licenses.checkin', $licenseseat->id) }}" autocomplete="off">
@endif
{{csrf_field()}}
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title"> {{ $licenseSeat->license->name }}</h3>
</div>
<div class="box-body">
<!-- Asset name -->
<!-- license name -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ trans('admin/hardware/form.name') }}</label>
<div class="col-md-6">
<p class="form-control-static">{{ $licenseseat->license->name }}</p>
<p class="form-control-static">{{ $licenseSeat->license->name }}</p>
</div>
</div>
@ -35,7 +38,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">{{ trans('admin/hardware/form.serial') }}</label>
<div class="col-md-6">
<p class="form-control-static">{{ $licenseseat->license->serial }}</p>
<p class="form-control-static">{{ $licenseSeat->license->serial }}</p>
</div>
</div>
@ -43,20 +46,16 @@
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
<label for="note" class="col-md-2 control-label">{{ trans('admin/hardware/form.notes') }}</label>
<div class="col-md-7">
<textarea class="col-md-6 form-control" id="note" name="note">{{ Input::old('note', $licenseseat->note) }}</textarea>
<textarea class="col-md-6 form-control" id="note" name="note">{{ Input::old('note', $licenseSeat->note) }}</textarea>
{!! $errors->first('note', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
</div>
</div>
<!-- Form actions -->
<div class="form-group">
<label class="col-md-2 control-label"></label>
<div class="col-md-7">
<a class="btn btn-link" href="{{ route('licenses.index') }}">{{ trans('button.cancel') }}</a>
<button type="submit" class="btn btn-success"><i class="fa fa-check icon-white"></i> {{ trans('general.checkin') }}</button>
</div>
<div class="box-footer">
<a class="btn btn-link" href="{{ route('licenses.index') }}">{{ trans('button.cancel') }}</a>
<button type="submit" class="btn btn-success pull-right"><i class="fa fa-check icon-white"></i> {{ trans('general.checkin') }}</button>
</div>
</form>
</div> <!-- .col-md-10-->
</div>
</div> <!-- /.box-->
</div> <!-- /.col-->
</div> <!-- /.row-->
@stop