Added footer style for nicer number cell padding

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2025-03-12 21:17:41 +00:00
parent 7421d089ff
commit 083cf78305
18 changed files with 1815 additions and 1733 deletions

View file

@ -84,13 +84,14 @@ class AccessoryPresenter extends Presenter
'sortable' => true, 'sortable' => true,
'title' => trans('general.min_amt'), 'title' => trans('general.min_amt'),
'formatter' => 'minAmtFormatter', 'formatter' => 'minAmtFormatter',
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
], [ ], [
'field' => 'qty', 'field' => 'qty',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
'title' => trans('admin/accessories/general.total'), 'title' => trans('admin/accessories/general.total'),
'footerFormatter' => 'qtySumFormatter', 'footerFormatter' => 'qtySumFormatter',
'class' => 'text-right text-padding-number-cell',
], [ ], [
'field' => 'remaining', 'field' => 'remaining',
'searchable' => false, 'searchable' => false,
@ -98,6 +99,7 @@ class AccessoryPresenter extends Presenter
'visible' => false, 'visible' => false,
'title' => trans('admin/accessories/general.remaining'), 'title' => trans('admin/accessories/general.remaining'),
'footerFormatter' => 'qtySumFormatter', 'footerFormatter' => 'qtySumFormatter',
'class' => 'text-right text-padding-number-cell',
],[ ],[
'field' => 'checkouts_count', 'field' => 'checkouts_count',
'searchable' => false, 'searchable' => false,
@ -105,6 +107,7 @@ class AccessoryPresenter extends Presenter
'visible' => true, 'visible' => true,
'title' => trans('general.checked_out'), 'title' => trans('general.checked_out'),
'footerFormatter' => 'qtySumFormatter', 'footerFormatter' => 'qtySumFormatter',
'class' => 'text-right text-padding-number-cell',
], [ ], [
'field' => 'purchase_date', 'field' => 'purchase_date',
'searchable' => true, 'searchable' => true,
@ -118,7 +121,7 @@ class AccessoryPresenter extends Presenter
'sortable' => true, 'sortable' => true,
'title' => trans('general.purchase_cost'), 'title' => trans('general.purchase_cost'),
'footerFormatter' => 'sumFormatterQuantity', 'footerFormatter' => 'sumFormatterQuantity',
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
], [ ], [
'field' => 'order_number', 'field' => 'order_number',
'searchable' => true, 'searchable' => true,

View file

@ -75,7 +75,7 @@ class AssetModelPresenter extends Presenter
'title' => trans('mail.min_QTY'), 'title' => trans('mail.min_QTY'),
'visible' => true, 'visible' => true,
'formatter' => 'minAmtFormatter', 'formatter' => 'minAmtFormatter',
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
], ],
[ [
@ -85,7 +85,7 @@ class AssetModelPresenter extends Presenter
'switchable' => true, 'switchable' => true,
'title' => trans('admin/models/table.numassets'), 'title' => trans('admin/models/table.numassets'),
'visible' => true, 'visible' => true,
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter', 'footerFormatter' => 'qtySumFormatter',
], ],
@ -96,7 +96,7 @@ class AssetModelPresenter extends Presenter
'switchable' => true, 'switchable' => true,
'title' => trans('general.remaining'), 'title' => trans('general.remaining'),
'visible' => true, 'visible' => true,
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter', 'footerFormatter' => 'qtySumFormatter',
], ],
[ [

View file

@ -85,7 +85,7 @@ class ComponentPresenter extends Presenter
'sortable' => true, 'sortable' => true,
'title' => trans('general.min_amt'), 'title' => trans('general.min_amt'),
'visible' => true, 'visible' => true,
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
'formatter' => 'minAmtFormatter', 'formatter' => 'minAmtFormatter',
], [ ], [
'field' => 'qty', 'field' => 'qty',
@ -93,7 +93,7 @@ class ComponentPresenter extends Presenter
'sortable' => true, 'sortable' => true,
'title' => trans('admin/components/general.total'), 'title' => trans('admin/components/general.total'),
'visible' => true, 'visible' => true,
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter', 'footerFormatter' => 'qtySumFormatter',
], [ ], [
'field' => 'remaining', 'field' => 'remaining',
@ -101,7 +101,7 @@ class ComponentPresenter extends Presenter
'sortable' => false, 'sortable' => false,
'title' => trans('admin/components/general.remaining'), 'title' => trans('admin/components/general.remaining'),
'visible' => true, 'visible' => true,
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter', 'footerFormatter' => 'qtySumFormatter',
], [ ], [
'field' => 'location', 'field' => 'location',

View file

@ -79,14 +79,14 @@ class ConsumablePresenter extends Presenter
'title' => trans('general.min_amt'), 'title' => trans('general.min_amt'),
'visible' => true, 'visible' => true,
'formatter' => 'minAmtFormatter', 'formatter' => 'minAmtFormatter',
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
], [ ], [
'field' => 'qty', 'field' => 'qty',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
'title' => trans('admin/components/general.total'), 'title' => trans('admin/components/general.total'),
'visible' => true, 'visible' => true,
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter', 'footerFormatter' => 'qtySumFormatter',
], [ ], [
'field' => 'remaining', 'field' => 'remaining',
@ -94,6 +94,7 @@ class ConsumablePresenter extends Presenter
'sortable' => true, 'sortable' => true,
'title' => trans('admin/components/general.remaining'), 'title' => trans('admin/components/general.remaining'),
'visible' => true, 'visible' => true,
'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter', 'footerFormatter' => 'qtySumFormatter',
], [ ], [
'field' => 'location', 'field' => 'location',
@ -128,7 +129,7 @@ class ConsumablePresenter extends Presenter
'title' => trans('general.purchase_cost'), 'title' => trans('general.purchase_cost'),
'visible' => true, 'visible' => true,
'footerFormatter' => 'sumFormatterQuantity', 'footerFormatter' => 'sumFormatterQuantity',
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
], [ ], [
'field' => 'notes', 'field' => 'notes',
'searchable' => true, 'searchable' => true,

View file

@ -86,20 +86,20 @@ class LicensePresenter extends Presenter
'sortable' => true, 'sortable' => true,
'title' => trans('mail.min_QTY'), 'title' => trans('mail.min_QTY'),
'formatter' => 'minAmtFormatter', 'formatter' => 'minAmtFormatter',
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
], [ ], [
'field' => 'seats', 'field' => 'seats',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
'title' => trans('admin/accessories/general.total'), 'title' => trans('admin/accessories/general.total'),
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter', 'footerFormatter' => 'qtySumFormatter',
], [ ], [
'field' => 'free_seats_count', 'field' => 'free_seats_count',
'searchable' => false, 'searchable' => false,
'sortable' => true, 'sortable' => true,
'title' => trans('admin/accessories/general.remaining'), 'title' => trans('admin/accessories/general.remaining'),
'class' => 'text-right', 'class' => 'text-right text-padding-number-cell',
'footerFormatter' => 'qtySumFormatter', 'footerFormatter' => 'qtySumFormatter',
], [ ], [
'field' => 'purchase_date', 'field' => 'purchase_date',

View file

@ -1418,4 +1418,12 @@ input[type="radio"]:checked::before {
.bootstrap-table .fixed-table-container .table tbody tr .card-view { .bootstrap-table .fixed-table-container .table tbody tr .card-view {
display: table-row !important; display: table-row !important;
} }
td.text-right.text-padding-number-cell {
padding-right: 30px !important;
white-space: nowrap;
}
th.text-right.text-padding-number-footer-cell {
padding-right: 20px !important;
white-space: nowrap;
}

View file

@ -1049,4 +1049,12 @@ input[type="radio"]:checked::before {
.bootstrap-table .fixed-table-container .table tbody tr .card-view { .bootstrap-table .fixed-table-container .table tbody tr .card-view {
display: table-row !important; display: table-row !important;
} }
td.text-right.text-padding-number-cell {
padding-right: 30px !important;
white-space: nowrap;
}
th.text-right.text-padding-number-footer-cell {
padding-right: 20px !important;
white-space: nowrap;
}

View file

@ -22753,6 +22753,14 @@ input[type="radio"]:checked::before {
.bootstrap-table .fixed-table-container .table tbody tr .card-view { .bootstrap-table .fixed-table-container .table tbody tr .card-view {
display: table-row !important; display: table-row !important;
} }
td.text-right.text-padding-number-cell {
padding-right: 30px !important;
white-space: nowrap;
}
th.text-right.text-padding-number-footer-cell {
padding-right: 20px !important;
white-space: nowrap;
}
.select2-container { .select2-container {
@ -24288,4 +24296,12 @@ input[type="radio"]:checked::before {
.bootstrap-table .fixed-table-container .table tbody tr .card-view { .bootstrap-table .fixed-table-container .table tbody tr .card-view {
display: table-row !important; display: table-row !important;
} }
td.text-right.text-padding-number-cell {
padding-right: 30px !important;
white-space: nowrap;
}
th.text-right.text-padding-number-footer-cell {
padding-right: 20px !important;
white-space: nowrap;
}

File diff suppressed because it is too large Load diff

1712
public/js/dist/all.js vendored

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,9 @@
{ {
"/js/build/app.js": "/js/build/app.js?id=65d7af7b9fa7fd0e05737526a0d1d282", "/js/build/app.js": "/js/build/app.js?id=607de09b70b83ef82a427e4b36341682",
"/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=06c13e817cc022028b3f4a33c0ca303a", "/css/dist/skins/skin-black-dark.css": "/css/dist/skins/skin-black-dark.css?id=06c13e817cc022028b3f4a33c0ca303a",
"/css/dist/skins/_all-skins.css": "/css/dist/skins/_all-skins.css?id=79aa889a1a6691013be6c342ca7391cd", "/css/dist/skins/_all-skins.css": "/css/dist/skins/_all-skins.css?id=79aa889a1a6691013be6c342ca7391cd",
"/css/build/overrides.css": "/css/build/overrides.css?id=6528155ed5ed8fddf4047de7f0d0298d", "/css/build/overrides.css": "/css/build/overrides.css?id=f188c07f91348503bc38f4b6683993aa",
"/css/build/app.css": "/css/build/app.css?id=3422f2ca2056b952c3c361adf00c10b8", "/css/build/app.css": "/css/build/app.css?id=7f6827b6d2149b8eab327d00e2dd66f0",
"/css/build/AdminLTE.css": "/css/build/AdminLTE.css?id=4ea0068716c1bb2434d87a16d51b98c9", "/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.css": "/css/dist/skins/skin-yellow.css?id=7b315b9612b8fde8f9c5b0ddb6bba690",
"/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=ea22079836a432d7f46a5d390c445e13", "/css/dist/skins/skin-yellow-dark.css": "/css/dist/skins/skin-yellow-dark.css?id=ea22079836a432d7f46a5d390c445e13",
@ -19,7 +19,7 @@
"/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=a82b065847bf3cd5d713c04ee8dc86c6", "/css/dist/skins/skin-blue.css": "/css/dist/skins/skin-blue.css?id=a82b065847bf3cd5d713c04ee8dc86c6",
"/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=6ea836d8126de101081c49abbdb89417", "/css/dist/skins/skin-blue-dark.css": "/css/dist/skins/skin-blue-dark.css?id=6ea836d8126de101081c49abbdb89417",
"/css/dist/skins/skin-black.css": "/css/dist/skins/skin-black.css?id=76482123f6c70e866d6b971ba91de7bb", "/css/dist/skins/skin-black.css": "/css/dist/skins/skin-black.css?id=76482123f6c70e866d6b971ba91de7bb",
"/css/dist/all.css": "/css/dist/all.css?id=18ebb9c284b49dcf6c8e4fdb923ad923", "/css/dist/all.css": "/css/dist/all.css?id=fe65a4b6cd3acaf2737dec72b98b650b",
"/css/dist/signature-pad.css": "/css/dist/signature-pad.css?id=6a89d3cd901305e66ced1cf5f13147f7", "/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", "/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", "/js/select2/i18n/af.js": "/js/select2/i18n/af.js?id=4f6fcd73488ce79fae1b7a90aceaecde",
@ -111,5 +111,5 @@
"/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=ceded08e0cc745a83c13647035b03406", "/css/dist/bootstrap-table.css": "/css/dist/bootstrap-table.css?id=ceded08e0cc745a83c13647035b03406",
"/js/build/vendor.js": "/js/build/vendor.js?id=89dffa552c6e3abe3a2aac6c9c7b466b", "/js/build/vendor.js": "/js/build/vendor.js?id=89dffa552c6e3abe3a2aac6c9c7b466b",
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=61285c8ac5ea7b46002ea8c451c94e60", "/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=61285c8ac5ea7b46002ea8c451c94e60",
"/js/dist/all.js": "/js/dist/all.js?id=21e041dec60e0785db6d64961b13a9b0" "/js/dist/all.js": "/js/dist/all.js?id=cae553daff19b328b3ba51a62f891442"
} }

View file

@ -1164,3 +1164,14 @@ input[type="radio"]:checked::before {
.bootstrap-table .fixed-table-container .table tbody tr .card-view { .bootstrap-table .fixed-table-container .table tbody tr .card-view {
display: table-row !important; display: table-row !important;
} }
td.text-right.text-padding-number-cell {
padding-right: 30px !important;
white-space: nowrap;
}
th.text-right.text-padding-number-footer-cell {
padding-right: 20px !important;
white-space: nowrap;
}

View file

@ -34,6 +34,7 @@
data-show-refresh="true" data-show-refresh="true"
data-show-footer="true" data-show-footer="true"
data-sort-order="asc" data-sort-order="asc"
data-footer-style="footerStyle"
id="accessoriesTable" id="accessoriesTable"
class="table table-striped snipe-table" class="table table-striped snipe-table"
data-url="{{route('api.accessories.index') }}" data-url="{{route('api.accessories.index') }}"

View file

@ -25,6 +25,7 @@
data-id-table="componentsTable" data-id-table="componentsTable"
data-search="true" data-search="true"
data-side-pagination="server" data-side-pagination="server"
data-footer-style="footerStyle"
data-show-columns="true" data-show-columns="true"
data-show-fullscreen="true" data-show-fullscreen="true"
data-show-export="true" data-show-export="true"

View file

@ -27,6 +27,7 @@
data-id-table="consumablesTable" data-id-table="consumablesTable"
data-search="true" data-search="true"
data-side-pagination="server" data-side-pagination="server"
data-footer-style="footerStyle"
data-show-columns="true" data-show-columns="true"
data-show-export="true" data-show-export="true"
data-show-fullscreen="true" data-show-fullscreen="true"

View file

@ -33,6 +33,7 @@
data-pagination="true" data-pagination="true"
data-search="true" data-search="true"
data-side-pagination="server" data-side-pagination="server"
data-footer-style="footerStyle"
data-show-columns="true" data-show-columns="true"
data-show-fullscreen="true" data-show-fullscreen="true"
data-show-export="true" data-show-export="true"

View file

@ -45,6 +45,7 @@
data-search="true" data-search="true"
data-show-footer="true" data-show-footer="true"
data-side-pagination="server" data-side-pagination="server"
data-footer-style="footerStyle"
data-show-columns="true" data-show-columns="true"
data-toolbar="#modelsBulkEditToolbar" data-toolbar="#modelsBulkEditToolbar"
data-bulk-button-id="#bulkModelsEditButton" data-bulk-button-id="#bulkModelsEditButton"

View file

@ -13,6 +13,7 @@
<script nonce="{{ csrf_token() }}"> <script nonce="{{ csrf_token() }}">
$(function () { $(function () {
var blockedFields = "searchable,sortable,switchable,title,visible,formatter,class".split(","); var blockedFields = "searchable,sortable,switchable,title,visible,formatter,class".split(",");
var keyBlocked = function(key) { var keyBlocked = function(key) {
@ -242,6 +243,34 @@
// This specifies the footer columns that should have special styles associated
// (usually numbers)
window.footerStyle = column => ({
remaining: {
classes: 'text-padding-number-footer-cell'
},
qty: {
classes: 'text-padding-number-footer-cell',
},
purchase_cost: {
classes: 'text-padding-number-footer-cell'
},
checkouts_count: {
classes: 'text-padding-number-footer-cell'
},
assets_count: {
classes: 'text-padding-number-footer-cell'
},
seats: {
classes: 'text-padding-number-footer-cell'
},
free_seats_count: {
classes: 'text-padding-number-footer-cell'
},
}[column.field]);
// This only works for model index pages because it uses the row's model ID // This only works for model index pages because it uses the row's model ID
function genericRowLinkFormatter(destination) { function genericRowLinkFormatter(destination) {
@ -674,6 +703,7 @@
} }
// Create a linked phone number in the table list // Create a linked phone number in the table list
function phoneFormatter(value) { function phoneFormatter(value) {
if (value) { if (value) {