ajout app
This commit is contained in:
65
SNIPE-IT/resources/views/categories/edit.blade.php
Normal file
65
SNIPE-IT/resources/views/categories/edit.blade.php
Normal file
@ -0,0 +1,65 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/categories/general.create') ,
|
||||
'updateText' => trans('admin/categories/general.update'),
|
||||
'helpPosition' => 'right',
|
||||
'helpText' => trans('help.categories'),
|
||||
'topSubmit' => 'true',
|
||||
'formAction' => (isset($item->id)) ? route('categories.update', ['category' => $item->id]) : route('categories.store'),
|
||||
])
|
||||
|
||||
@section('inputFields')
|
||||
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/categories/general.name')])
|
||||
|
||||
<!-- Type -->
|
||||
<div class="form-group {{ $errors->has('category_type') ? ' has-error' : '' }}">
|
||||
<label for="category_type" class="col-md-3 control-label">{{ trans('general.type') }}</label>
|
||||
<div class="col-md-7 required">
|
||||
{{ Form::select('category_type', $category_types , old('category_type', $item->category_type), array('class'=>'select2', 'style'=>'min-width:350px', 'aria-label'=>'category_type', ($item->category_type!='') || ($item->itemCount() > 0) ? 'disabled' : '')) }}
|
||||
{!! $errors->first('category_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
<div class="col-md-7 col-md-offset-3">
|
||||
<p class="help-block">{!! trans('admin/categories/message.update.cannot_change_category_type') !!} </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<livewire:category-edit-form
|
||||
:default-eula-text="$snipeSettings->default_eula_text"
|
||||
:eula-text="old('eula_text', $item->eula_text)"
|
||||
:require-acceptance="old('require_acceptance', $item->require_acceptance)"
|
||||
:send-check-in-email="old('checkin_email', $item->checkin_email)"
|
||||
:use-default-eula="old('use_default_eula', $item->use_default_eula)"
|
||||
/>
|
||||
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('categories_upload_path')])
|
||||
|
||||
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@parent
|
||||
|
||||
|
||||
@if ($snipeSettings->default_eula_text!='')
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="eulaModal" tabindex="-1" role="dialog" aria-labelledby="eulaModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h2 class="modal-title" id="eulaModalLabel">{{ trans('admin/settings/general.default_eula_text') }}</h2>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ \App\Models\Setting::getDefaultEula() }}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('button.cancel') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@stop
|
59
SNIPE-IT/resources/views/categories/index.blade.php
Normal file
59
SNIPE-IT/resources/views/categories/index.blade.php
Normal file
@ -0,0 +1,59 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.categories') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('categories.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\CategoryPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryTable"
|
||||
data-pagination="true"
|
||||
data-id-table="categoryTable"
|
||||
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"
|
||||
id="categoryTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.categories.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-categories-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table',
|
||||
['exportFile' => 'category-export',
|
||||
'search' => true,
|
||||
'columns' => \App\Presenters\CategoryPresenter::dataTableLayout()
|
||||
])
|
||||
@stop
|
||||
|
186
SNIPE-IT/resources/views/categories/view.blade.php
Normal file
186
SNIPE-IT/resources/views/categories/view.blade.php
Normal file
@ -0,0 +1,186 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
|
||||
{{ $category->name }}
|
||||
{{ ucwords($category_type_route) }}
|
||||
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary" style="margin-right: 10px;">
|
||||
{{ trans('general.back') }}</a>
|
||||
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ route('categories.edit', ['category' => $category->id]) }}">{{ trans('admin/categories/general.edit') }}</a></li>
|
||||
<li><a href="{{ route('categories.create') }}">{{ trans('general.create') }}</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#items" data-toggle="tab" title="{{ trans('general.items') }}"> {{ ucwords($category_type_route) }}
|
||||
@if ($category->category_type=='asset')
|
||||
<badge class="badge badge-secondary"> {{ $category->showableAssets()->count() }}</badge>
|
||||
@endif
|
||||
</a>
|
||||
</li>
|
||||
@if ($category->category_type=='asset')
|
||||
<li>
|
||||
<a href="#models" data-toggle="tab" title="{{ trans('general.asset_models') }}">{{ trans('general.asset_models') }}
|
||||
<badge class="badge badge-secondary"> {{ $category->models->count()}}</badge>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active" id="items">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
@if ($category->category_type=='asset')
|
||||
@include('partials.asset-bulk-actions')
|
||||
@endif
|
||||
|
||||
<table
|
||||
|
||||
@if ($category->category_type=='asset')
|
||||
|
||||
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryAssetsTable"
|
||||
id="categoryAssetsTable"
|
||||
data-id-table="categoryAssetsTable"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
data-click-to-select="true"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-assets-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@elseif ($category->category_type=='accessory')
|
||||
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryAccessoryTable"
|
||||
id="categoryAccessoryTable"
|
||||
data-id-table="categoryAccessoryTable"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-accessories-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@elseif ($category->category_type=='consumable')
|
||||
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryConsumableTable"
|
||||
id="categoryConsumableTable"
|
||||
data-id-table="categoryConsumableTable"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-consumables-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@elseif ($category->category_type=='component')
|
||||
data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryCompomnentTable"
|
||||
id="categoryCompomnentTable"
|
||||
data-id-table="categoryCompomnentTable"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-components-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@elseif ($category->category_type=='license')
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryLicenseTable"
|
||||
id="categoryLicenseTable"
|
||||
data-id-table="categoryLicenseTable"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-licenses-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@endif
|
||||
|
||||
data-pagination="true"
|
||||
data-search="true"
|
||||
data-show-footer="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.'.$category_type_route.'.index',['category_id'=> $category->id]) }}">
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="models">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@can('update', \App\Models\AssetModel::class)
|
||||
@if ($category->models->count() > 0)
|
||||
@if ($category->category_type=='asset')
|
||||
@include('partials.models-bulk-actions')
|
||||
@endif
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetModelPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="asssetModelsTable"
|
||||
data-pagination="true"
|
||||
data-id-table="asssetModelsTable"
|
||||
data-search="true"
|
||||
data-show-footer="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-toolbar="#modelsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkModelsEditButton"
|
||||
data-bulk-form-id="#modelsBulkForm"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="asssetModelsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.models.index', ['status' => request('status'), 'category_id' => $category->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-models-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- .tab-content-->
|
||||
</div> <!-- .nav-tabs-custom -->
|
||||
</div> <!-- .col-md-12> -->
|
||||
</div> <!-- .row -->
|
||||
@stop
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
Reference in New Issue
Block a user