This commit is contained in:
2024-04-21 14:42:52 +02:00
parent 4b69674ede
commit 8a25f53c99
10700 changed files with 55767 additions and 14201 deletions

View File

@ -0,0 +1,85 @@
@extends('layouts/edit-form', [
'createText' => trans('admin/statuslabels/table.create') ,
'updateText' => trans('admin/statuslabels/table.update'),
'helpTitle' => trans('admin/statuslabels/table.about'),
'helpText' => trans('admin/statuslabels/table.info'),
'formAction' => (isset($item->id)) ? route('statuslabels.update', ['statuslabel' => $item->id]) : route('statuslabels.store'),
])
{{-- Page content --}}
@section('content')
<style>
.input-group-addon {
width: 30px;
}
</style>
@parent
@stop
@section('inputFields')
@include ('partials.forms.edit.name', ['translated_name' => trans('general.name')])
<!-- Label type -->
<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>
<div class="col-md-7 required">
{{ Form::select('statuslabel_types', $statuslabel_types, $item->getStatuslabelType(), array('class'=>'select2', 'style'=>'width: 100%; min-width:400px', 'aria-label'=>'statuslabel_types')) }}
{!! $errors->first('statuslabel_types', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>
<!-- Chart color -->
<div class="form-group{{ $errors->has('color') ? ' has-error' : '' }}">
{{ Form::label('color', trans('admin/statuslabels/table.color'), ['class' => 'col-md-3 control-label']) }}
<div class="col-md-9">
<div class="input-group color">
{{ Form::text('color', Request::old('color', $item->color), array('class' => 'form-control col-md-10', 'maxlength'=>'20')) }}
<div class="input-group-addon"><i></i></div>
</div><!-- /.input group -->
{!! $errors->first('color', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
</div>
</div>
@include ('partials.forms.edit.notes')
<!-- Show in Nav -->
<div class="form-group{{ $errors->has('notes') ? ' has-error' : '' }}">
<div class="col-md-9 col-md-offset-3">
<label class="form-control">
<input type="checkbox" value="1" name="show_in_nav" id="show_in_nav" {{ Request::old('show_in_nav', $item->show_in_nav) == '1' ? ' checked="checked"' : '' }}> {{ trans('admin/statuslabels/table.show_in_nav') }}
</label>
</div>
</div>
<!-- Set as Default -->
<div class="form-group{{ $errors->has('default_label') ? ' has-error' : '' }}">
<div class="col-md-9 col-md-offset-3">
<label class="form-control">
<input type="checkbox" value="1" name="default_label" id="default_label" {{ Request::old('default_label', $item->default_label) == '1' ? ' checked="checked"' : '' }}>
{{ trans('admin/statuslabels/table.default_label') }}
</label>
<p class="help-block"> {{ trans('admin/statuslabels/table.default_label_help') }}</p>
</div>
</div>
@stop
@section('moar_scripts')
<!-- bootstrap color picker -->
<script nonce="{{ csrf_token() }}">
$(function() {
$('.color').colorpicker({
color: `{{ old('color', $item->color) ?: '#AA3399' }}`,
format: 'hex'
});
});
</script>
@stop

View File

@ -0,0 +1,148 @@
@extends('layouts/default', [
'helpText' => trans('admin/statuslabels/table.info') ,
'helpPosition' => 'right',
])
{{-- Page title --}}
@section('title')
{{ trans('admin/statuslabels/table.title') }}
@parent
@stop
@section('header_right')
@can('create', \App\Models\Statuslabel::class)
<a href="{{ route('statuslabels.create') }}" class="btn btn-primary pull-right">
{{ trans('general.create') }}</a>
@endcan
@stop
{{-- Page content --}}
@section('content')
<div class="row">
<div class="col-md-9">
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
data-cookie-id-table="statuslabelsTable"
data-pagination="true"
data-id-table="statuslabelsTable"
data-search="true"
data-show-footer="false"
data-side-pagination="server"
data-show-columns="true"
data-show-export="true"
data-show-fullscreen="true"
data-show-refresh="true"
data-sort-order="asc"
data-sort-name="name"
id="statuslabelsTable"
class="table table-striped snipe-table"
data-url="{{ route('api.statuslabels.index') }}"
data-export-options='{
"fileName": "export-statuslabels-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
<thead>
<tr>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-sortable="true" data-field="name" data-formatter="statuslabelsAssetLinkFormatter">{{ trans('admin/statuslabels/table.name') }}</th>
<th data-sortable="false" data-field="type" data-formatter="statusLabelTypeFormatter">{{ trans('admin/statuslabels/table.status_type') }}</th>
<th data-sortable="true" data-field="assets_count">{{ trans('general.assets') }}</th>
<th data-sortable="true" data-field="color" data-formatter="colorSqFormatter">{{ trans('admin/statuslabels/table.color') }}</th>
<th class="text-center" data-sortable="true" data-field="show_in_nav" data-formatter="trueFalseFormatter">{{ trans('admin/statuslabels/table.show_in_nav') }}</th>
<th class="text-center" data-sortable="true" data-field="default_label" data-formatter="trueFalseFormatter">{{ trans('admin/statuslabels/table.default_label') }}</th>
<th data-sortable="true" data-field="notes" data-visible="false">{{ trans('general.notes') }}</th>
<th data-formatter="statuslabelsActionsFormatter" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
<!-- side address column -->
<div class="col-md-3">
<h2>{{ trans('admin/statuslabels/table.about') }}</h2>
<div class="box box-success">
<div class="box-body">
<p><i class="fas fa-circle text-green"></i> <strong>{{ trans('admin/statuslabels/table.deployable') }}</strong>: {!! trans('admin/statuslabels/message.help.deployable') !!}</p>
</div>
</div>
<div class="box box-warning">
<div class="box-body">
<p><i class="fas fa-circle text-orange"></i> <strong>{{ trans('admin/statuslabels/table.pending') }}</strong>: {{ trans('admin/statuslabels/message.help.pending') }}</p>
</div>
</div>
<div class="box box-danger">
<div class="box-body">
<p><i class="fas fa-times text-red"></i> <strong>{{ trans('admin/statuslabels/table.undeployable') }}</strong>: {{ trans('admin/statuslabels/message.help.undeployable') }}</p>
</div>
</div>
<div class="box box-danger">
<div class="box-body">
<p><i class="fas fa-times text-red"></i> <strong>{{ trans('admin/statuslabels/table.archived') }}</strong>: {{ trans('admin/statuslabels/message.help.archived') }}</p>
</div>
</div>
</div>
</div>
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table')
<script nonce="{{ csrf_token() }}">
function colorSqFormatter(value, row) {
if (value) {
return '<span class="label" style="background-color: ' + value + ';">&nbsp;</span> ' + value;
}
}
function statuslabelsAssetLinkFormatter(value, row) {
if ((row) && (row.name)) {
return '<a href="{{ config('app.url') }}/hardware/?status_id=' + row.id + '"> ' + row.name + '</a>';
}
}
function statusLabelTypeFormatter (row, value) {
switch (value.type) {
case 'deployable':
text_color = 'green';
icon_style = 'fa-circle';
trans = '{{ strtolower(trans('admin/hardware/general.deployable')) }}';
break;
case 'pending':
text_color = 'orange';
icon_style = 'fa-circle';
trans = '{{ strtolower(trans('general.pending')) }}';
break;
case 'undeployable':
text_color = 'red';
icon_style = 'fa-circle';
trans ='{{ trans('admin/statuslabels/table.undeployable') }}';
break;
default:
text_color = 'red';
icon_style = 'fa-times';
trans = '{{ strtolower(trans('general.archived')) }}';
}
var typename_lower = trans;
var typename = typename_lower.charAt(0).toUpperCase() + typename_lower.slice(1);
return '<i class="fa ' + icon_style + ' text-' + text_color + '"></i> ' + typename;
}
</script>
@stop

View File

@ -0,0 +1,57 @@
@extends('layouts/default')
{{-- Page title --}}
@section('title')
{{ $statuslabel->name }} {{ trans('general.assets') }}
@parent
@stop
{{-- Page content --}}
@section('content')
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-body">
@include('partials.asset-bulk-actions')
<table
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
data-cookie-id-table="assetsListingTable"
data-pagination="true"
data-id-table="assetsListingTable"
data-search="true"
data-side-pagination="server"
data-show-columns="true"
data-show-fullscreen="true"
data-show-export="true"
data-show-refresh="true"
data-sort-order="asc"
data-toolbar="#assetsBulkEditToolbar"
data-bulk-button-id="#bulkAssetEditButton"
data-bulk-form-id="#assetsBulkForm"
data-click-to-select="true"
id="assetsListingTable"
class="table table-striped snipe-table"
data-url="{{route('api.assets.index', ['status_id' => $statuslabel->id]) }}"
data-export-options='{
"fileName": "export-assets-{{ str_slug($statuslabel->name) }}-assets-{{ date('Y-m-d') }}",
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
}'>
</table>
</div><!-- /.col -->
</div><!-- /.row -->
{{ Form::close() }}
</div><!-- ./box-body -->
</div><!-- /.box -->
</div>
</div>
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', [
'exportFile' => 'assets-export',
'search' => true,
'columns' => \App\Presenters\AssetPresenter::dataTableLayout()
])
@stop