|
10 | 10 | @stop |
11 | 11 |
|
12 | 12 | @section('header_right') |
| 13 | + |
| 14 | + <a href="{{ URL::previous() }}" class="btn btn-primary" style="margin-right: 10px;"> |
| 15 | + {{ trans('general.back') }}</a> |
| 16 | + |
13 | 17 | <div class="btn-group pull-right"> |
14 | 18 | <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }} |
15 | 19 | <span class="caret"></span> |
|
18 | 22 | <li><a href="{{ route('categories.edit', ['category' => $category->id]) }}">{{ trans('admin/categories/general.edit') }}</a></li> |
19 | 23 | <li><a href="{{ route('categories.create') }}">{{ trans('general.create') }}</a></li> |
20 | 24 | </ul> |
| 25 | + |
21 | 26 | </div> |
22 | 27 | @stop |
23 | 28 |
|
24 | 29 | {{-- Page content --}} |
25 | 30 | @section('content') |
26 | 31 |
|
27 | | -<div class="row"> |
28 | | - <div class="col-md-12"> |
29 | | - <div class="box box-default"> |
30 | | - <div class="box-body"> |
31 | | - @if ($category->category_type=='asset') |
32 | | - @include('partials.asset-bulk-actions') |
33 | | - @endif |
34 | 32 |
|
35 | | - <table |
36 | 33 |
|
37 | | - @if ($category->category_type=='asset') |
| 34 | + <div class="row"> |
| 35 | + <div class="col-md-12"> |
| 36 | + |
| 37 | + <div class="nav-tabs-custom"> |
| 38 | + <ul class="nav nav-tabs"> |
| 39 | + <li class="active"> |
| 40 | + <a href="#items" data-toggle="tab" title="{{ trans('general.items') }}"> {{ ucwords($category_type_route) }} |
| 41 | + @if ($category->category_type=='asset') |
| 42 | + <badge class="badge badge-secondary"> {{ $category->assets->count() }}</badge> |
| 43 | + @endif |
| 44 | + </a> |
| 45 | + </li> |
| 46 | + @if ($category->category_type=='asset') |
| 47 | + <li> |
| 48 | + <a href="#models" data-toggle="tab" title="{{ trans('general.asset_models') }}">{{ trans('general.asset_models') }} |
| 49 | + <badge class="badge badge-secondary"> {{ $category->models->count()}}</badge> |
| 50 | + </a> |
| 51 | + </li> |
| 52 | + @endif |
| 53 | + </ul> |
| 54 | + <div class="tab-content"> |
| 55 | + <div class="tab-pane fade in active" id="items"> |
| 56 | + <div class="row"> |
| 57 | + <div class="col-md-12"> |
| 58 | + <div class="table-responsive"> |
| 59 | + @if ($category->category_type=='asset') |
| 60 | + @include('partials.asset-bulk-actions') |
| 61 | + @endif |
| 62 | + |
| 63 | + <table |
38 | 64 |
|
39 | | - data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}" |
40 | | - data-cookie-id-table="categoryAssetsTable" |
41 | | - id="categoryAssetsTable" |
42 | | - data-id-table="categoryAssetsTable" |
43 | | - data-export-options='{ |
| 65 | + @if ($category->category_type=='asset') |
| 66 | + |
| 67 | + data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}" |
| 68 | + data-cookie-id-table="categoryAssetsTable" |
| 69 | + id="categoryAssetsTable" |
| 70 | + data-id-table="categoryAssetsTable" |
| 71 | + data-toolbar="#assetsBulkEditToolbar" |
| 72 | + data-bulk-button-id="#bulkAssetEditButton" |
| 73 | + data-bulk-form-id="#assetsBulkForm" |
| 74 | + data-export-options='{ |
44 | 75 | "fileName": "export-{{ str_slug($category->name) }}-assets-{{ date('Y-m-d') }}", |
45 | 76 | "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] |
46 | 77 | }' |
47 | | - @elseif ($category->category_type=='accessory') |
48 | | - data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}" |
49 | | - data-cookie-id-table="categoryAccessoryTable" |
50 | | - id="categoryAccessoryTable" |
51 | | - data-id-table="categoryAccessoryTable" |
52 | | - data-export-options='{ |
| 78 | + @elseif ($category->category_type=='accessory') |
| 79 | + data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}" |
| 80 | + data-cookie-id-table="categoryAccessoryTable" |
| 81 | + id="categoryAccessoryTable" |
| 82 | + data-id-table="categoryAccessoryTable" |
| 83 | + data-export-options='{ |
53 | 84 | "fileName": "export-{{ str_slug($category->name) }}-accessories-{{ date('Y-m-d') }}", |
54 | 85 | "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] |
55 | 86 | }' |
56 | | - @elseif ($category->category_type=='consumable') |
57 | | - data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}" |
58 | | - data-cookie-id-table="categoryConsumableTable" |
59 | | - id="categoryConsumableTable" |
60 | | - data-id-table="categoryConsumableTable" |
61 | | - data-export-options='{ |
| 87 | + @elseif ($category->category_type=='consumable') |
| 88 | + data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}" |
| 89 | + data-cookie-id-table="categoryConsumableTable" |
| 90 | + id="categoryConsumableTable" |
| 91 | + data-id-table="categoryConsumableTable" |
| 92 | + data-export-options='{ |
62 | 93 | "fileName": "export-{{ str_slug($category->name) }}-consumables-{{ date('Y-m-d') }}", |
63 | 94 | "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] |
64 | 95 | }' |
65 | | - @elseif ($category->category_type=='component') |
66 | | - data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}" |
67 | | - data-cookie-id-table="categoryCompomnentTable" |
68 | | - id="categoryCompomnentTable" |
69 | | - data-id-table="categoryCompomnentTable" |
70 | | - data-export-options='{ |
| 96 | + @elseif ($category->category_type=='component') |
| 97 | + data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}" |
| 98 | + data-cookie-id-table="categoryCompomnentTable" |
| 99 | + id="categoryCompomnentTable" |
| 100 | + data-id-table="categoryCompomnentTable" |
| 101 | + data-export-options='{ |
71 | 102 | "fileName": "export-{{ str_slug($category->name) }}-components-{{ date('Y-m-d') }}", |
72 | 103 | "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] |
73 | 104 | }' |
74 | | - @elseif ($category->category_type=='license') |
75 | | - data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}" |
76 | | - data-cookie-id-table="categoryLicenseTable" |
77 | | - id="categoryLicenseTable" |
78 | | - data-id-table="categoryLicenseTable" |
79 | | - data-export-options='{ |
| 105 | + @elseif ($category->category_type=='license') |
| 106 | + data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}" |
| 107 | + data-cookie-id-table="categoryLicenseTable" |
| 108 | + id="categoryLicenseTable" |
| 109 | + data-id-table="categoryLicenseTable" |
| 110 | + data-export-options='{ |
80 | 111 | "fileName": "export-{{ str_slug($category->name) }}-licenses-{{ date('Y-m-d') }}", |
81 | 112 | "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] |
82 | 113 | }' |
83 | | - @endif |
84 | | - |
85 | | - data-pagination="true" |
86 | | - data-search="true" |
87 | | - data-show-footer="true" |
88 | | - data-side-pagination="server" |
89 | | - data-show-columns="true" |
90 | | - data-show-export="true" |
91 | | - data-show-refresh="true" |
92 | | - data-sort-order="asc" |
93 | | - class="table table-striped snipe-table" |
94 | | - data-url="{{ route('api.'.$category_type_route.'.index',['category_id'=> $category->id]) }}"> |
95 | | - |
96 | | - </table> |
97 | | - |
98 | | - </div> |
99 | | - </div> |
100 | | - </div> |
101 | | -</div> |
| 114 | + @endif |
| 115 | + |
| 116 | + data-pagination="true" |
| 117 | + data-search="true" |
| 118 | + data-show-footer="true" |
| 119 | + data-side-pagination="server" |
| 120 | + data-show-columns="true" |
| 121 | + data-show-export="true" |
| 122 | + data-show-refresh="true" |
| 123 | + data-sort-order="asc" |
| 124 | + class="table table-striped snipe-table" |
| 125 | + data-url="{{ route('api.'.$category_type_route.'.index',['category_id'=> $category->id]) }}"> |
| 126 | + |
| 127 | + </table> |
| 128 | + </div> |
| 129 | + </div> |
| 130 | + </div> |
| 131 | + </div> |
| 132 | + |
| 133 | + <div class="tab-pane fade" id="models"> |
| 134 | + <div class="row"> |
| 135 | + <div class="col-md-12"> |
| 136 | + |
| 137 | + @can('update', \App\Models\AssetModel::class) |
| 138 | + @if ($category->models->count() > 0) |
| 139 | + @if ($category->category_type=='asset') |
| 140 | + @include('partials.models-bulk-actions') |
| 141 | + @endif |
| 142 | + @endif |
| 143 | + @endcan |
| 144 | + |
| 145 | + <table |
| 146 | + data-columns="{{ \App\Presenters\AssetModelPresenter::dataTableLayout() }}" |
| 147 | + data-cookie-id-table="asssetModelsTable" |
| 148 | + data-pagination="true" |
| 149 | + data-id-table="asssetModelsTable" |
| 150 | + data-search="true" |
| 151 | + data-show-footer="true" |
| 152 | + data-side-pagination="server" |
| 153 | + data-show-columns="true" |
| 154 | + data-toolbar="#modelsBulkEditToolbar" |
| 155 | + data-bulk-button-id="#bulkModelsEditButton" |
| 156 | + data-bulk-form-id="#modelsBulkForm" |
| 157 | + data-show-export="true" |
| 158 | + data-show-refresh="true" |
| 159 | + data-sort-order="asc" |
| 160 | + id="asssetModelsTable" |
| 161 | + class="table table-striped snipe-table" |
| 162 | + data-url="{{ route('api.models.index', ['status' => request('status'), 'category_id' => $category->id]) }}" |
| 163 | + data-export-options='{ |
| 164 | + "fileName": "export-models-{{ date('Y-m-d') }}", |
| 165 | + "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] |
| 166 | + }'> |
| 167 | + </table> |
| 168 | + |
| 169 | + </div> |
| 170 | + </div> |
| 171 | + </div> |
| 172 | + |
| 173 | + </div> <!-- .tab-content--> |
| 174 | + </div> <!-- .nav-tabs-custom --> |
| 175 | + </div> <!-- .col-md-12> --> |
| 176 | + </div> <!-- .row --> |
102 | 177 | @stop |
103 | 178 |
|
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
104 | 183 | @section('moar_scripts') |
105 | 184 | @include ('partials.bootstrap-table') |
106 | 185 | @stop |
0 commit comments