mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Added show in nav for status label views and controller
This commit is contained in:
parent
fb402e138d
commit
ad22293f4b
|
@ -120,6 +120,7 @@ class StatuslabelsController extends Controller
|
||||||
$statuslabel->pending = $statustype['pending'];
|
$statuslabel->pending = $statustype['pending'];
|
||||||
$statuslabel->archived = $statustype['archived'];
|
$statuslabel->archived = $statustype['archived'];
|
||||||
$statuslabel->color = e(Input::get('color'));
|
$statuslabel->color = e(Input::get('color'));
|
||||||
|
$statuslabel->show_in_nav = e(Input::get('show_in_nav'),0);
|
||||||
|
|
||||||
|
|
||||||
// Was the asset created?
|
// Was the asset created?
|
||||||
|
@ -208,6 +209,7 @@ class StatuslabelsController extends Controller
|
||||||
$statuslabel->pending = $statustype['pending'];
|
$statuslabel->pending = $statustype['pending'];
|
||||||
$statuslabel->archived = $statustype['archived'];
|
$statuslabel->archived = $statustype['archived'];
|
||||||
$statuslabel->color = e(Input::get('color'));
|
$statuslabel->color = e(Input::get('color'));
|
||||||
|
$statuslabel->show_in_nav = e(Input::get('show_in_nav'),0);
|
||||||
|
|
||||||
|
|
||||||
// Was the asset created?
|
// Was the asset created?
|
||||||
|
@ -258,7 +260,7 @@ class StatuslabelsController extends Controller
|
||||||
|
|
||||||
public function getDatatable()
|
public function getDatatable()
|
||||||
{
|
{
|
||||||
$statuslabels = Statuslabel::select(array('id','name','deployable','pending','archived','color'))
|
$statuslabels = Statuslabel::select(array('id','name','deployable','pending','archived','color','show_in_nav'))
|
||||||
->whereNull('deleted_at');
|
->whereNull('deleted_at');
|
||||||
|
|
||||||
if (Input::has('search')) {
|
if (Input::has('search')) {
|
||||||
|
@ -314,6 +316,7 @@ class StatuslabelsController extends Controller
|
||||||
'type' => e($label_type),
|
'type' => e($label_type),
|
||||||
'name' => e($statuslabel->name),
|
'name' => e($statuslabel->name),
|
||||||
'color' => $color,
|
'color' => $color,
|
||||||
|
'show_in_nav' => ($statuslabel->show_in_nav=='1') ? trans('general.yes') : trans('general.no'),
|
||||||
'actions' => $actions
|
'actions' => $actions
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -405,6 +405,16 @@
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ URL::to('hardware') }}">@lang('general.list_all')</a>
|
<a href="{{ URL::to('hardware') }}">@lang('general.list_all')</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<?php $status_navs = \App\Models\Statuslabel::where('show_in_nav','=',1)->get(); ?>
|
||||||
|
@if (count($status_navs) > 0)
|
||||||
|
<li class="divider"> </li>
|
||||||
|
@foreach ($status_navs as $status_nav)
|
||||||
|
<li><a href="{{ URL::to('hardware?status_id='.$status_nav->id) }}"}> {{ $status_nav->name }}</a></li>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
<li{!! (Request::query('status') == 'Deployed' ? ' class="active"' : '') !!}>
|
<li{!! (Request::query('status') == 'Deployed' ? ' class="active"' : '') !!}>
|
||||||
<a href="{{ URL::to('hardware?status=Deployed') }}">@lang('general.deployed')
|
<a href="{{ URL::to('hardware?status=Deployed') }}">@lang('general.deployed')
|
||||||
</a>
|
</a>
|
||||||
|
@ -490,7 +500,6 @@
|
||||||
<li><a href="{{ URL::to('reports/unaccepted_assets') }}" {{ (Request::is('reports/unaccepted_assets') ? ' class="active"' : '') }} >@lang('general.unaccepted_asset_report')</a></li>
|
<li><a href="{{ URL::to('reports/unaccepted_assets') }}" {{ (Request::is('reports/unaccepted_assets') ? ' class="active"' : '') }} >@lang('general.unaccepted_asset_report')</a></li>
|
||||||
<li><a href="{{ URL::to('reports/accessories') }}" {{ (Request::is('reports/accessories') ? ' class="active"' : '') }} >@lang('general.accessory_report')</a></li>
|
<li><a href="{{ URL::to('reports/accessories') }}" {{ (Request::is('reports/accessories') ? ' class="active"' : '') }} >@lang('general.accessory_report')</a></li>
|
||||||
<li><a href="{{ URL::to('reports/custom') }}" {{ (Request::is('reports/custom') ? ' class="active"' : '') }}>@lang('general.custom_report')</a></li>
|
<li><a href="{{ URL::to('reports/custom') }}" {{ (Request::is('reports/custom') ? ' class="active"' : '') }}>@lang('general.custom_report')</a></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
@endcan
|
@endcan
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
<!-- Asset Title -->
|
<!-- Asset Title -->
|
||||||
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
|
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
|
||||||
<label for="name" class="col-md-3 control-label">{{ trans('general.name') }}</label>
|
<label for="name" class="col-md-3 control-label">{{ trans('general.name') }}</label>
|
||||||
</label>
|
|
||||||
<div class="col-md-7 required">
|
<div class="col-md-7 required">
|
||||||
<input class="form-control" type="text" name="name" id="name" value="{{ Input::old('name', $statuslabel->name) }}" />
|
<input class="form-control" type="text" name="name" id="name" value="{{ Input::old('name', $statuslabel->name) }}" />
|
||||||
{!! $errors->first('name', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
{!! $errors->first('name', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||||
|
@ -49,8 +48,7 @@
|
||||||
|
|
||||||
<!-- Label type -->
|
<!-- Label type -->
|
||||||
<div class="form-group{{ $errors->has('statuslabel_types') ? ' has-error' : '' }}">
|
<div class="form-group{{ $errors->has('statuslabel_types') ? ' has-error' : '' }}">
|
||||||
<label for="statuslabel_types" class="col-md-3 control-label">{{ trans('admin/statuslabels/table.status_type') }}
|
<label for="statuslabel_types" class="col-md-3 control-label">{{ trans('admin/statuslabels/table.status_type') }} </label>
|
||||||
</label>
|
|
||||||
<div class="col-md-7 required">
|
<div class="col-md-7 required">
|
||||||
{{ Form::select('statuslabel_types', $statuslabel_types, $statuslabel->getStatuslabelType(), array('class'=>'select2', 'style'=>'min-width:400px')) }}
|
{{ Form::select('statuslabel_types', $statuslabel_types, $statuslabel->getStatuslabelType(), array('class'=>'select2', 'style'=>'min-width:400px')) }}
|
||||||
{!! $errors->first('statuslabel_types', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
{!! $errors->first('statuslabel_types', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||||
|
@ -65,8 +63,6 @@
|
||||||
{{ Form::text('color', Input::old('color', $statuslabel->color), array('class' => 'form-control', 'style' => 'width: 100px;', 'maxlength'=>'10')) }}
|
{{ Form::text('color', Input::old('color', $statuslabel->color), array('class' => 'form-control', 'style' => 'width: 100px;', 'maxlength'=>'10')) }}
|
||||||
<div class="input-group-addon"><i></i></div>
|
<div class="input-group-addon"><i></i></div>
|
||||||
</div><!-- /.input group -->
|
</div><!-- /.input group -->
|
||||||
|
|
||||||
|
|
||||||
{!! $errors->first('header_color', '<span class="alert-msg">:message</span>') !!}
|
{!! $errors->first('header_color', '<span class="alert-msg">:message</span>') !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -80,6 +76,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Show in Nav -->
|
||||||
|
<div class="form-group{{ $errors->has('notes') ? ' has-error' : '' }}">
|
||||||
|
|
||||||
|
<label class="col-md-offset-3" style="padding-left: 15px;">
|
||||||
|
<input type="checkbox" value="1" name="show_in_nav" id="show_in_nav" class="minimal" {{ Input::old('show_in_nav', $statuslabel->show_in_nav) == '1' ? ' checked="checked"' : '' }}> {{ trans('admin/statuslabels/table.show_in_nav') }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
<th data-sortable="true" data-field="name">{{ trans('admin/statuslabels/table.name') }}</th>
|
<th data-sortable="true" data-field="name">{{ trans('admin/statuslabels/table.name') }}</th>
|
||||||
<th data-sortable="false" data-field="type">{{ trans('admin/statuslabels/table.status_type') }}</th>
|
<th data-sortable="false" data-field="type">{{ trans('admin/statuslabels/table.status_type') }}</th>
|
||||||
<th data-sortable="false" data-field="color">{{ trans('admin/statuslabels/table.color') }}</th>
|
<th data-sortable="false" data-field="color">{{ trans('admin/statuslabels/table.color') }}</th>
|
||||||
|
<th data-sortable="true" data-field="show_in_nav">{{ trans('admin/statuslabels/table.show_in_nav') }}</th>
|
||||||
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th>
|
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
Loading…
Reference in a new issue