diff --git a/app/Http/Controllers/Api/LocationsController.php b/app/Http/Controllers/Api/LocationsController.php index f38e72e840..0f1d8d28b7 100644 --- a/app/Http/Controllers/Api/LocationsController.php +++ b/app/Http/Controllers/Api/LocationsController.php @@ -75,6 +75,7 @@ class LocationsController extends Controller ])->withCount('assignedAssets as assigned_assets_count') ->withCount('assets as assets_count') ->withCount('assignedAccessories as assigned_accessories_count') + ->withCount('accessories as accessories_count') ->withCount('rtd_assets as rtd_assets_count') ->withCount('children as children_count') ->withCount('users as users_count'); diff --git a/app/Http/Transformers/LocationsTransformer.php b/app/Http/Transformers/LocationsTransformer.php index bf79e04c30..72bbd293dd 100644 --- a/app/Http/Transformers/LocationsTransformer.php +++ b/app/Http/Transformers/LocationsTransformer.php @@ -46,6 +46,7 @@ class LocationsTransformer 'phone' => ($location->phone!='') ? e($location->phone): null, 'fax' => ($location->fax!='') ? e($location->fax): null, 'assigned_assets_count' => (int) $location->assigned_assets_count, + 'accessories_count' => (int) $location->assigned_accessories, 'assigned_accessories_count' => (int) $location->assigned_accessories_count, 'assets_count' => (int) $location->assets_count, 'rtd_assets_count' => (int) $location->rtd_assets_count, diff --git a/app/Presenters/LocationPresenter.php b/app/Presenters/LocationPresenter.php index d6d663058a..2b6e284b64 100644 --- a/app/Presenters/LocationPresenter.php +++ b/app/Presenters/LocationPresenter.php @@ -70,9 +70,10 @@ class LocationPresenter extends Presenter 'sortable' => true, 'switchable' => true, 'title' => trans('admin/hardware/form.default_location'), + 'titleTooltip' => trans('admin/hardware/form.default_location'), + 'tooltip' => 'true', 'visible' => false, 'class' => 'css-house-flag', - 'tooltip' => true, ], [ @@ -81,6 +82,7 @@ class LocationPresenter extends Presenter 'sortable' => true, 'switchable' => true, 'title' => trans('admin/locations/message.assigned_assets'), + 'titleTooltip' => trans('admin/locations/message.assigned_assets'), 'visible' => true, 'class' => 'css-house-laptop', ], @@ -89,16 +91,28 @@ class LocationPresenter extends Presenter 'searchable' => false, 'sortable' => true, 'switchable' => true, - 'title' => trans('general.accessories_assigned'), + 'title' => trans('general.accessories'), + 'titleTooltip' => trans('general.accessories'), 'visible' => true, 'class' => 'css-accessory', ], + [ + 'field' => 'assigned_accessories_count', + 'searchable' => false, + 'sortable' => true, + 'switchable' => true, + 'title' => trans('general.accessories_assigned'), + 'titleTooltip' => trans('general.accessories_assigned'), + 'visible' => true, + 'class' => 'css-accessory-alt', + ], [ 'field' => 'users_count', 'searchable' => false, 'sortable' => true, 'switchable' => true, 'title' => trans('general.people'), + 'titleTooltip' => trans('general.people'), 'visible' => true, 'class' => 'css-house-user', ], diff --git a/public/css/build/app.css b/public/css/build/app.css index 9ff01e2006..b3f63ac47c 100644 Binary files a/public/css/build/app.css and b/public/css/build/app.css differ diff --git a/public/css/build/overrides.css b/public/css/build/overrides.css index f30dc7b858..c71f688bd3 100644 Binary files a/public/css/build/overrides.css and b/public/css/build/overrides.css differ diff --git a/public/css/dist/all.css b/public/css/dist/all.css index 13be0c286e..9eed8a9841 100644 Binary files a/public/css/dist/all.css and b/public/css/dist/all.css differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index e8d6308fe1..b834d4e4df 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -2,8 +2,8 @@ "/js/build/app.js": "/js/build/app.js?id=da3f7fee4a180ba924f6a3920c94eb71", "/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=f0b08873a06bb54daeee176a9459f4a9", "/css/dist/skins/_all-skins.css": "/css/dist/skins/_all-skins.css?id=f4397c717b99fce41a633ca6edd5d1f4", - "/css/build/overrides.css": "/css/build/overrides.css?id=c4d85e7547ae9ddbb5aef45729d73f20", - "/css/build/app.css": "/css/build/app.css?id=c953eea1937a2c5f78dfc8fe411324ae", + "/css/build/overrides.css": "/css/build/overrides.css?id=ea66574be6a42601abd07ca02f43060f", + "/css/build/app.css": "/css/build/app.css?id=e4d85acd9b8f14a91378b4b180ae22dc", "/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=4ea0068716c1bb2434d87a16d51b98c9", "/css/dist/skins/skin-yellow.css": "/css/dist/skins/skin-yellow.css?id=7b315b9612b8fde8f9c5b0ddb6bba690", "/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=393aaa7b368b0670fc42434c8cca7dc7", @@ -19,7 +19,7 @@ "/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=f677207c6cf9678eb539abecb408c374", "/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=0640e45bad692dcf62873c6e85904899", "/css/dist/skins/skin-black.css": "/css/dist/skins/skin-black.css?id=76482123f6c70e866d6b971ba91de7bb", - "/css/dist/all.css": "/css/dist/all.css?id=7669e3b5dff0e448ae3ed2d6c38fc06a", + "/css/dist/all.css": "/css/dist/all.css?id=e6be50490a74eff42d177d942686de2b", "/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7", "/css/dist/signature-pad.min.css": "/css/dist/signature-pad.min.css?id=6a89d3cd901305e66ced1cf5f13147f7", "/js/select2/i18n/af.js": "/js/select2/i18n/af.js?id=4f6fcd73488ce79fae1b7a90aceaecde", diff --git a/resources/assets/less/overrides.less b/resources/assets/less/overrides.less index 0ead8623c0..2e8f90e02b 100644 --- a/resources/assets/less/overrides.less +++ b/resources/assets/less/overrides.less @@ -590,6 +590,7 @@ th.css-location > .th-inner, th.css-house-user > .th-inner, th.css-house-flag > .th-inner, th.css-house-laptop > .th-inner, +th.css-accessory-alt > .th-inner, th.css-accessory > .th-inner { font-size: 0px; line-height: 0.75 !important; @@ -609,6 +610,7 @@ th.css-location > .th-inner::before, th.css-house-user > .th-inner::before, th.css-house-laptop > .th-inner::before, th.css-house-flag > .th-inner::before, +th.css-accessory-alt > .th-inner::before, th.css-accessory > .th-inner::before { display: inline-block; @@ -681,6 +683,12 @@ th.css-house-laptop > .th-inner::before { font-size: 19px; margin-bottom: 0px; } +th.css-accessory-alt > .th-inner::before { + content: "\f11c"; + font-family: "Font Awesome 5 Free"; + font-size: 19px; + margin-bottom: 0px; +} .small-box .inner { padding-left: 15px; diff --git a/resources/views/locations/view.blade.php b/resources/views/locations/view.blade.php index 17be54d541..2e4465805a 100644 --- a/resources/views/locations/view.blade.php +++ b/resources/views/locations/view.blade.php @@ -75,6 +75,20 @@ @endif + @if ($location->accessories->count() > 0) +
  • + + + + {{ number_format($location->accessories->count()) }} + + + {{ trans('general.accessories') }} + + +
  • + @endif + @if ($location->assignedAccessories->count() > 0)
  • @@ -89,19 +103,6 @@
  • @endif - @if ($location->accessories->count() > 0) -
  • - - - - {{ number_format($location->accessories->count()) }} - - - {{ trans('general.accessories') }} - - -
  • - @endif @if ($location->consumables->count() > 0)
  • diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 837a95b3be..26d5bec90c 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -410,6 +410,8 @@ } } + + // Check if checkbox should be selectable // Selectability is determined by the API field "selectable" which is set at the Presenter/API Transformer // However since different bulk actions have different requirements, we have to walk through the available_actions object