Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
755d7c2
Added printIgnore, reordered fields
snipe Jan 23, 2026
6833955
Moved files into table directory
snipe Jan 23, 2026
e7f70cc
Moved to new component structure
snipe Jan 23, 2026
0b82902
Fixed background loading color
snipe Jan 23, 2026
b3a4fb2
Use new user bulk edit blade
snipe Jan 23, 2026
c963c0b
Updated path for new table component location
snipe Jan 23, 2026
5c4f3a5
Removed unneeded body blade
snipe Jan 23, 2026
0ba8ee1
Added bulkactions named slot in box index
snipe Jan 23, 2026
1b4552c
Refactorered bulk action component
snipe Jan 23, 2026
066cf81
Added model bulk component
snipe Jan 23, 2026
a5e818f
More moved to new box+table method
snipe Jan 23, 2026
44fa9e2
Handle status label index
snipe Jan 23, 2026
b7ee3a2
Updated groups index to use new components
snipe Jan 23, 2026
4d60592
Fixed typos
snipe Jan 23, 2026
2048eb7
Removed unneeded presenter methods
snipe Jan 23, 2026
3ec8ba0
Updated manufacturer with new tabs
snipe Jan 23, 2026
302a60f
Better breadcrumb
snipe Jan 23, 2026
ffbc831
Include the box footer if there is a route passed
snipe Jan 23, 2026
b99ae9b
Form component (will move the other things later)
snipe Jan 23, 2026
b2c9438
Switched from stupid layouts/edit-form to new form component
snipe Jan 23, 2026
2151595
Fixed a few typos
snipe Jan 23, 2026
34fe64b
Fixed spacing
snipe Jan 23, 2026
d75f5b8
Fixed label
snipe Jan 23, 2026
bb9b145
Updated helper icon
snipe Jan 24, 2026
f7b7ef8
Updated suppliers view
snipe Jan 24, 2026
11b7dfc
Added icons
snipe Jan 24, 2026
b4658f2
Added address presenter
snipe Jan 24, 2026
c2ad0de
Added contact component
snipe Jan 24, 2026
429ca8d
Added info components
snipe Jan 24, 2026
d5997e2
Added new classes
snipe Jan 24, 2026
141794c
Use new contact panel in suppliers view
snipe Jan 24, 2026
4b22b1c
Better defaults in nav-item component
snipe Jan 24, 2026
1074bc2
More conversions
snipe Jan 24, 2026
e0c53c3
Merge classes
snipe Jan 24, 2026
2238f8e
More icons
snipe Jan 24, 2026
c39d165
Added space
snipe Jan 24, 2026
a38c8a0
Merge more into contact card
snipe Jan 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion app/Helpers/IconHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,12 @@ public static function icon($type) {
return 'fa-regular fa-clipboard';
case 'paperclip':
return 'fas fa-paperclip';
case 'contact-card':
return 'fa-regular fa-id-card';
case 'files':
return 'fa-regular fa-file';
case 'more-info':
case 'support':
return 'far fa-life-ring';
case 'calendar':
return 'fas fa-calendar';
Expand All @@ -144,7 +147,7 @@ public static function icon($type) {
case 'more-files':
return 'fa-solid fa-laptop-file';
case 'maintenances':
return 'fas fa-wrench';
return 'fa-solid fa-screwdriver-wrench';
case 'seats':
return 'far fa-list-alt';
case 'globe-us':
Expand Down Expand Up @@ -203,6 +206,12 @@ public static function icon($type) {
return 'fa-solid fa-lightbulb';
case 'highlight':
return 'fa-solid fa-highlighter';
case 'manager':
return 'fa-solid fa-building-user';
case 'company':
return 'fa-regular fa-building';
case 'parent':
return 'fa-solid fa-building-flag';
}
}
}
17 changes: 9 additions & 8 deletions app/Presenters/AccessoryPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ public static function dataTableLayout()
'title' => trans('general.id'),
'visible' => false,
'printIgnore' => true,
], [
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'formatter' => 'accessoriesLinkFormatter',
], [
'field' => 'image',
'searchable' => false,
Expand All @@ -38,14 +45,7 @@ public static function dataTableLayout()
'title' => trans('admin/companies/table.title'),
'visible' => false,
'formatter' => 'companiesLinkObjFormatter',
], [
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'formatter' => 'accessoriesLinkFormatter',
], [
], [
'field' => 'category',
'searchable' => true,
'sortable' => true,
Expand Down Expand Up @@ -172,6 +172,7 @@ public static function dataTableLayout()
'visible' => true,
'title' => trans('general.change'),
'formatter' => 'accessoriesInOutFormatter',
'printIgnore' => true,
], [
'field' => 'available_actions',
'searchable' => false,
Expand Down
16 changes: 8 additions & 8 deletions app/Presenters/ComponentPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ public static function dataTableLayout()
'switchable' => true,
'title' => trans('general.id'),
'visible' => false,
], [
'field' => 'name',
'searchable' => true,
'sortable' => true,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'componentsLinkFormatter',
],
[
'field' => 'company',
Expand All @@ -31,14 +38,7 @@ public static function dataTableLayout()
'visible' => false,
'formatter' => 'companiesLinkObjFormatter',
],
[
'field' => 'name',
'searchable' => true,
'sortable' => true,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'componentsLinkFormatter',
], [
[
'field' => 'image',
'searchable' => false,
'sortable' => true,
Expand Down
22 changes: 11 additions & 11 deletions app/Presenters/ConsumablePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,24 @@ public static function dataTableLayout()
'switchable' => true,
'title' => trans('general.id'),
'visible' => false,
],
[
'field' => 'company',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.company'),
'visible' => false,
'formatter' => 'companiesLinkObjFormatter',
],
[
], [
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'consumablesLinkFormatter',
], [
'field' => 'company',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.company'),
'visible' => false,
'formatter' => 'companiesLinkObjFormatter',
],

[
'field' => 'image',
'searchable' => false,
Expand Down Expand Up @@ -172,6 +171,7 @@ public static function dataTableLayout()
'visible' => true,
'title' => trans('general.change'),
'formatter' => 'consumablesInOutFormatter',
'printIgnore' => true,
], [
'field' => 'actions',
'searchable' => false,
Expand Down
21 changes: 10 additions & 11 deletions app/Presenters/DepartmentPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,22 @@ public static function dataTableLayout()
'switchable' => true,
'title' => trans('general.id'),
'visible' => false,
],
[
'field' => 'company',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.company'),
'visible' => false,
'formatter' => 'companiesLinkObjFormatter'
],
[
], [
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'departmentsLinkFormatter',
], [
'field' => 'company',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.company'),
'visible' => false,
'formatter' => 'companiesLinkObjFormatter'
], [
'field' => 'image',
'searchable' => false,
Expand Down Expand Up @@ -112,6 +110,7 @@ public static function dataTableLayout()
'title' => trans('table.actions'),
'visible' => true,
'formatter' => 'departmentsActionsFormatter',
'printIgnore' => true,
],
];

Expand Down
78 changes: 78 additions & 0 deletions app/Presenters/GroupPresenter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php

namespace App\Presenters;

/**
* Class GroupPresenter
*/
class GroupPresenter extends Presenter
{
/**
* Json Column Layout for bootstrap table
*/
public static function dataTableLayout()
{
$layout = [
[
'field' => 'id',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('general.id'),
'visible' => false,
],
[
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'visible' => true,
'formatter' => 'groupsAdminLinkFormatter',
],
[
'field' => 'users_count',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/groups/table.users'),
'visible' => true,
'class' => 'css-users',
], [
'field' => 'notes',
'searchable' => true,
'sortable' => true,
'visible' => true,
'title' => trans('general.notes'),
], [
'field' => 'created_by',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.created_by'),
'visible' => true,
'formatter' => 'usersLinkObjFormatter',
], [
'field' => 'updated_at',
'searchable' => true,
'sortable' => true,
'switchable' => true,
'title' => trans('general.updated_at'),
'visible' => true,
'formatter' => 'dateDisplayFormatter',
], [
'field' => 'actions',
'searchable' => false,
'sortable' => false,
'switchable' => false,
'title' => trans('table.actions'),
'visible' => true,
'formatter' => 'groupsActionsFormatter',
'printIgnore' => true,
],
];

return json_encode($layout);
}

}
14 changes: 7 additions & 7 deletions app/Presenters/LicensePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ public static function dataTableLayout()
'switchable' => true,
'title' => trans('general.id'),
'visible' => false,
], [
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'formatter' => 'licensesLinkFormatter',
], [
'field' => 'company',
'searchable' => true,
Expand All @@ -29,13 +36,6 @@ public static function dataTableLayout()
'title' => trans('admin/companies/table.title'),
'visible' => false,
'formatter' => 'companiesLinkObjFormatter',
], [
'field' => 'name',
'searchable' => true,
'sortable' => true,
'switchable' => false,
'title' => trans('general.name'),
'formatter' => 'licensesLinkFormatter',
], [
'field' => 'product_key',
'searchable' => true,
Expand Down
1 change: 1 addition & 0 deletions app/Presenters/LocationPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ public static function assignedAccessoriesDataTableLayout()
'switchable' => false,
'title' => trans('table.actions'),
'formatter' => 'accessoriesInOutFormatter',
'printIgnore' => true,
],
];

Expand Down
56 changes: 32 additions & 24 deletions app/Presenters/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,35 @@ public function __construct(SnipeModel $model)
$this->model = $model;
}

public function displayAddress() {
$address = '';
if ($this->model->address) {
$address .= e($this->model->address)."\n";
}

if ($this->model->address2) {
$address .= e($this->model->address2)."\n";
}

if ($this->model->city) {
$address .= e($this->model->city).', ';
}

if ($this->model->state) {
$address .= e($this->model->state).' ';
}

if ($this->model->zip) {
$address .= e($this->model->zip).' ';
}

if ($this->model->country) {
$address .= e($this->model->country).' ';
}

return $address;
}

// Convenience functions for datatables stuff
public function categoryUrl()
{
Expand Down Expand Up @@ -70,30 +99,7 @@ public function manufacturerUrl()
return '';
}

// public function name()
// {
// return $this->model->name;
// }
//
// public function display_name()
// {
// return $this->model->display_name;
// }


// protected function displayName(): Attribute
// {
// // This override should only kick in if the model has a display_name prope
// if ($this->getRawOriginal('display_name')) {
// return Attribute:: make (
// get: fn(mixed $value) => 'Poop:'.$this->display_name
// );
// }
//
// return Attribute:: make(
// get: fn(mixed $value) => 'Fart: '.$this->name,
// );
// }


public function __get($property)
{
Expand All @@ -108,4 +114,6 @@ public function __call($method, $args)
{
return $this->model->$method($args);
}


}
2 changes: 1 addition & 1 deletion app/Presenters/SupplierPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Presenters;

/**
* Class LocationPresenter
* Class SupplierPresenter
*/
class SupplierPresenter extends Presenter
{
Expand Down
1 change: 1 addition & 0 deletions app/Presenters/UploadedFilesPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public static function dataTableLayout()
'title' => trans('table.actions'),
'visible' => true,
'formatter' => 'deleteUploadFormatter',
'printIgnore' => true,
],
];

Expand Down
Loading
Loading