Skip to content

Commit 161eb3a

Browse files
committed
Administration design enhancement
1 parent 476f22c commit 161eb3a

12 files changed

Lines changed: 166 additions & 223 deletions

app/View/Components/Administration.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@
66

77
class Administration extends Component
88
{
9-
/**
10-
* Create a new component instance.
11-
*
12-
* @return void
13-
*/
14-
public function __construct()
15-
{
16-
//
17-
}
189

1910
/**
2011
* Get the view / contents that represent the component.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
namespace App\View\Components;
4+
5+
use Illuminate\View\Component;
6+
7+
class AdministrationLayout extends Component
8+
{
9+
10+
public $menu;
11+
12+
public function __construct()
13+
{
14+
$this->menu = [
15+
[
16+
'title' => __('Manage users'),
17+
'route' => 'administration.users',
18+
'permissions' => ['View all users', 'View company users']
19+
],
20+
[
21+
'title' => __('Manage companies'),
22+
'route' => 'administration.companies',
23+
'permissions' => ['View all companies', 'View own companies']
24+
],
25+
[
26+
'title' => __('Manage statuses'),
27+
'route' => 'administration.ticket-statuses',
28+
'permissions' => ['Manage ticket statuses']
29+
],
30+
[
31+
'title' => __('Manage types'),
32+
'route' => 'administration.ticket-types',
33+
'permissions' => ['Manage ticket types']
34+
],
35+
[
36+
'title' => __('Activity logs'),
37+
'route' => 'administration.activity-logs',
38+
'permissions' => ['View activity log']
39+
],
40+
];
41+
}
42+
43+
/**
44+
* Get the view / contents that represent the component.
45+
*
46+
* @return \Illuminate\Contracts\View\View|\Closure|string
47+
*/
48+
public function render()
49+
{
50+
return view('components.administration-layout');
51+
}
52+
}

database/help_desk.sql

Lines changed: 70 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -124,75 +124,76 @@ INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at
124124
(39, 'Update companies', 'web', '2022-09-25 17:19:38', '2022-09-25 17:19:38'),
125125
(40, 'Delete companies', 'web', '2022-09-25 17:19:38', '2022-09-25 17:19:38');
126126

127+
TRUNCATE TABLE model_has_permissions;
127128
INSERT INTO `model_has_permissions` (`permission_id`, `model_type`, `model_id`) VALUES
128-
(1, 'App\Models\User', 4),
129-
(2, 'App\Models\User', 4),
130-
(3, 'App\Models\User', 4),
131-
(4, 'App\Models\User', 4),
132-
(5, 'App\Models\User', 4),
133-
(6, 'App\Models\User', 4),
134-
(7, 'App\Models\User', 4),
135-
(8, 'App\Models\User', 4),
136-
(9, 'App\Models\User', 4),
137-
(10, 'App\Models\User', 4),
138-
(11, 'App\Models\User', 4),
139-
(12, 'App\Models\User', 4),
140-
(13, 'App\Models\User', 4),
141-
(14, 'App\Models\User', 4),
142-
(15, 'App\Models\User', 4),
143-
(16, 'App\Models\User', 4),
144-
(17, 'App\Models\User', 4),
145-
(18, 'App\Models\User', 4),
146-
(19, 'App\Models\User', 4),
147-
(20, 'App\Models\User', 4),
148-
(21, 'App\Models\User', 4),
149-
(22, 'App\Models\User', 4),
150-
(25, 'App\Models\User', 4),
151-
(26, 'App\Models\User', 4),
152-
(27, 'App\Models\User', 4),
153-
(28, 'App\Models\User', 4),
154-
(29, 'App\Models\User', 4),
155-
(30, 'App\Models\User', 4),
156-
(31, 'App\Models\User', 4),
157-
(32, 'App\Models\User', 4),
158-
(33, 'App\Models\User', 4),
159-
(34, 'App\Models\User', 4),
160-
(38, 'App\Models\User', 4),
161-
(39, 'App\Models\User', 4),
162-
(40, 'App\Models\User', 4),
163-
(5, 'App\Models\User', 5),
164-
(11, 'App\Models\User', 5),
165-
(12, 'App\Models\User', 5),
166-
(13, 'App\Models\User', 5),
167-
(14, 'App\Models\User', 5),
168-
(15, 'App\Models\User', 5),
169-
(16, 'App\Models\User', 5),
170-
(17, 'App\Models\User', 5),
171-
(18, 'App\Models\User', 5),
172-
(19, 'App\Models\User', 5),
173-
(5, 'App\Models\User', 6),
174-
(11, 'App\Models\User', 6),
175-
(12, 'App\Models\User', 6),
176-
(13, 'App\Models\User', 6),
177-
(14, 'App\Models\User', 6),
178-
(17, 'App\Models\User', 6),
179-
(18, 'App\Models\User', 6),
180-
(19, 'App\Models\User', 6),
181-
(20, 'App\Models\User', 6),
182-
(22, 'App\Models\User', 6),
183-
(29, 'App\Models\User', 6),
184-
(30, 'App\Models\User', 6),
185-
(34, 'App\Models\User', 6),
186-
(39, 'App\Models\User', 6),
187-
(5, 'App\Models\User', 10),
188-
(11, 'App\Models\User', 10),
189-
(12, 'App\Models\User', 10),
190-
(13, 'App\Models\User', 10),
191-
(14, 'App\Models\User', 10),
192-
(15, 'App\Models\User', 10),
193-
(16, 'App\Models\User', 10),
194-
(17, 'App\Models\User', 10),
195-
(18, 'App\Models\User', 10),
196-
(19, 'App\Models\User', 10);
129+
(1, 'App\\Models\\User', 4),
130+
(2, 'App\\Models\\User', 4),
131+
(3, 'App\\Models\\User', 4),
132+
(4, 'App\\Models\\User', 4),
133+
(5, 'App\\Models\\User', 4),
134+
(6, 'App\\Models\\User', 4),
135+
(7, 'App\\Models\\User', 4),
136+
(8, 'App\\Models\\User', 4),
137+
(9, 'App\\Models\\User', 4),
138+
(10, 'App\\Models\\User', 4),
139+
(11, 'App\\Models\\User', 4),
140+
(12, 'App\\Models\\User', 4),
141+
(13, 'App\\Models\\User', 4),
142+
(14, 'App\\Models\\User', 4),
143+
(15, 'App\\Models\\User', 4),
144+
(16, 'App\\Models\\User', 4),
145+
(17, 'App\\Models\\User', 4),
146+
(18, 'App\\Models\\User', 4),
147+
(19, 'App\\Models\\User', 4),
148+
(20, 'App\\Models\\User', 4),
149+
(21, 'App\\Models\\User', 4),
150+
(22, 'App\\Models\\User', 4),
151+
(25, 'App\\Models\\User', 4),
152+
(26, 'App\\Models\\User', 4),
153+
(27, 'App\\Models\\User', 4),
154+
(28, 'App\\Models\\User', 4),
155+
(29, 'App\\Models\\User', 4),
156+
(30, 'App\\Models\\User', 4),
157+
(31, 'App\\Models\\User', 4),
158+
(32, 'App\\Models\\User', 4),
159+
(33, 'App\\Models\\User', 4),
160+
(34, 'App\\Models\\User', 4),
161+
(38, 'App\\Models\\User', 4),
162+
(39, 'App\\Models\\User', 4),
163+
(40, 'App\\Models\\User', 4),
164+
(5, 'App\\Models\\User', 5),
165+
(11, 'App\\Models\\User', 5),
166+
(12, 'App\\Models\\User', 5),
167+
(13, 'App\\Models\\User', 5),
168+
(14, 'App\\Models\\User', 5),
169+
(15, 'App\\Models\\User', 5),
170+
(16, 'App\\Models\\User', 5),
171+
(17, 'App\\Models\\User', 5),
172+
(18, 'App\\Models\\User', 5),
173+
(19, 'App\\Models\\User', 5),
174+
(5, 'App\\Models\\User', 6),
175+
(11, 'App\\Models\\User', 6),
176+
(12, 'App\\Models\\User', 6),
177+
(13, 'App\\Models\\User', 6),
178+
(14, 'App\\Models\\User', 6),
179+
(17, 'App\\Models\\User', 6),
180+
(18, 'App\\Models\\User', 6),
181+
(19, 'App\\Models\\User', 6),
182+
(20, 'App\\Models\\User', 6),
183+
(22, 'App\\Models\\User', 6),
184+
(29, 'App\\Models\\User', 6),
185+
(30, 'App\\Models\\User', 6),
186+
(34, 'App\\Models\\User', 6),
187+
(39, 'App\\Models\\User', 6),
188+
(5, 'App\\Models\\User', 10),
189+
(11, 'App\\Models\\User', 10),
190+
(12, 'App\\Models\\User', 10),
191+
(13, 'App\\Models\\User', 10),
192+
(14, 'App\\Models\\User', 10),
193+
(15, 'App\\Models\\User', 10),
194+
(16, 'App\\Models\\User', 10),
195+
(17, 'App\\Models\\User', 10),
196+
(18, 'App\\Models\\User', 10),
197+
(19, 'App\\Models\\User', 10);
197198

198199
SET foreign_key_checks = 1;

resources/views/administration.blade.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,6 @@
33
<x-slot:title>Administration</x-slot:title>
44

55
<div class="w-full flex flex-col justify-start items-start gap-5">
6-
<div class="w-full flex md:flex-row flex-col justify-between items-start gap-2">
7-
<div class="flex flex-col justify-center items-start gap-1">
8-
<span class="lg:text-4xl md:text-2xl text-xl font-medium text-gray-700">
9-
@lang('Administration')
10-
</span>
11-
<span class="lg:text-lg md:text-sm text-xs font-light text-gray-500">
12-
@lang('Below you can configure the different components of :app', [
13-
'app' => config('app.name')
14-
])
15-
</span>
16-
</div>
17-
</div>
186
<div class="w-full mt-5">
197

208
<x-administration />
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<div>
2+
<div class="w-full flex md:flex-row flex-col justify-between items-start gap-2">
3+
<div class="flex flex-col justify-center items-start gap-1">
4+
<span class="lg:text-4xl md:text-2xl text-xl font-medium text-gray-700">
5+
@lang('Administration')
6+
</span>
7+
</div>
8+
</div>
9+
<div class="w-full flex flex-row flex-wrap border-t border-gray-200 mt-8 pt-3">
10+
11+
<div class="xl:w-1/5 lg:w-1/4 w-full flex flex-col space-y-5 py-5">
12+
@foreach($menu as $item)
13+
@if(auth()->user()->hasAnyPermission($item['permissions']))
14+
<a href="{{ route($item['route']) }}" class="w-full px-5 text-lg hover:text-primary-500 border-l-2 border-transparent {{ (Route::is($item['route']) || Route::is($item['route'] . '.*')) ? 'text-primary-500 font-medium border-primary-500' : 'text-gray-500 font-base hover:border-primary-500' }}">
15+
<span>{{ $item['title'] }}</span>
16+
</a>
17+
@endif
18+
@endforeach
19+
</div>
20+
21+
<div class="xl:w-4/5 lg:w-3/4 w-full flex flex-col gap-2 py-5">
22+
{{ $slot }}
23+
</div>
24+
</div>
25+
</div>
Lines changed: 7 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,9 @@
1-
<div class="w-full flex flex-row flex-wrap">
1+
<x-administration-layout>
22

3-
@if(auth()->user()->hasAnyPermission(['View all users', 'View company users']))
4-
<div class="flex flex-row xl:w-1/2 w-full items-center bg-white w-full hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700">
5-
<div class="w-52 h-36 bg-cover bg-center bg-no-repeat rounded-tl-lg rounded-bl-lg" style="background-image: url('{{ asset('images/administration/users.jpg') }}')"></div>
6-
<div class="flex flex-col justify-between p-4 leading-normal w-full">
7-
<h5 class="mb-2 text-2xl font-medium tracking-tight text-gray-900 dark:text-white">@lang('User Management')</h5>
8-
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400">@lang('Here you can show and manage the users list configured on :app', [
9-
'app' => config('app.name')
10-
])</p>
11-
<div class="w-full flex items-center">
12-
<a href="{{ route('administration.users') }}" class="inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-gray-700 rounded-lg hover:bg-gray-800 focus:ring-4 focus:outline-none focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800">
13-
@lang('Manage users')
14-
<svg aria-hidden="true" class="ml-2 -mr-1 w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
15-
</a>
16-
</div>
17-
</div>
18-
</div>
19-
@endif
3+
<p class="text-gray-500 text-xl font-light">
4+
@lang('You can use the administration panel to configure the different component of the :app application.', [
5+
'app' => config('app.name')
6+
])
7+
</p>
208

21-
@if(auth()->user()->hasAnyPermission(['View all companies', 'View own companies']))
22-
<div class="flex flex-row xl:w-1/2 w-full items-center bg-white w-full hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700">
23-
<div class="w-52 h-36 bg-cover bg-center bg-no-repeat rounded-tl-lg rounded-bl-lg" style="background-image: url('{{ asset('images/administration/companies.jpeg') }}')"></div>
24-
<div class="flex flex-col justify-between p-4 leading-normal w-full">
25-
<h5 class="mb-2 text-2xl font-medium tracking-tight text-gray-900 dark:text-white">@lang('Companies Management')</h5>
26-
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400">@lang('Here you can show and manage the companies list configured on :app', [
27-
'app' => config('app.name')
28-
])</p>
29-
<div class="w-full flex items-center">
30-
<a href="{{ route('administration.companies') }}" class="inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-gray-700 rounded-lg hover:bg-gray-800 focus:ring-4 focus:outline-none focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800">
31-
@lang('Manage companies')
32-
<svg aria-hidden="true" class="ml-2 -mr-1 w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
33-
</a>
34-
</div>
35-
</div>
36-
</div>
37-
@endcan
38-
39-
@can('Manage ticket statuses')
40-
<div class="flex flex-row xl:w-1/2 w-full items-center bg-white w-full hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700">
41-
<div class="w-52 h-36 bg-cover bg-center bg-no-repeat rounded-tl-lg rounded-bl-lg" style="background-image: url('{{ asset('images/administration/workflow.jpg') }}')"></div>
42-
<div class="flex flex-col justify-between p-4 leading-normal w-full">
43-
<h5 class="mb-2 text-2xl font-medium tracking-tight text-gray-900 dark:text-white">@lang('Statuses Management')</h5>
44-
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400">@lang('Here you can show and manage the tickets statuses list configured on :app', [
45-
'app' => config('app.name')
46-
])</p>
47-
<div class="w-full flex items-center">
48-
<a href="{{ route('administration.ticket-statuses') }}" class="inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-gray-700 rounded-lg hover:bg-gray-800 focus:ring-4 focus:outline-none focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800">
49-
@lang('Manage statuses')
50-
<svg aria-hidden="true" class="ml-2 -mr-1 w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
51-
</a>
52-
</div>
53-
</div>
54-
</div>
55-
@endcan
56-
57-
@can('Manage ticket priorities')
58-
<div class="flex flex-row xl:w-1/2 w-full items-center bg-white w-full hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700">
59-
<div class="w-52 h-36 bg-cover bg-center bg-no-repeat rounded-tl-lg rounded-bl-lg" style="background-image: url('{{ asset('images/administration/priorities.jpg') }}')"></div>
60-
<div class="flex flex-col justify-between p-4 leading-normal w-full">
61-
<h5 class="mb-2 text-2xl font-medium tracking-tight text-gray-900 dark:text-white">@lang('Priorities Management')</h5>
62-
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400">@lang('Here you can show and manage the tickets priorities list configured on :app', [
63-
'app' => config('app.name')
64-
])</p>
65-
<div class="w-full flex items-center">
66-
<a href="{{ route('administration.ticket-priorities') }}" class="inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-gray-700 rounded-lg hover:bg-gray-800 focus:ring-4 focus:outline-none focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800">
67-
@lang('Manage priorities')
68-
<svg aria-hidden="true" class="ml-2 -mr-1 w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
69-
</a>
70-
</div>
71-
</div>
72-
</div>
73-
@endcan
74-
75-
@can('Manage ticket types')
76-
<div class="flex flex-row xl:w-1/2 w-full items-center bg-white w-full hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700">
77-
<div class="w-52 h-36 bg-cover bg-center bg-no-repeat rounded-tl-lg rounded-bl-lg" style="background-image: url('{{ asset('images/administration/types.jpg') }}')"></div>
78-
<div class="flex flex-col justify-between p-4 leading-normal w-full">
79-
<h5 class="mb-2 text-2xl font-medium tracking-tight text-gray-900 dark:text-white">@lang('Types Management')</h5>
80-
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400">@lang('Here you can show and manage the tickets types list configured on :app', [
81-
'app' => config('app.name')
82-
])</p>
83-
<div class="w-full flex items-center">
84-
<a href="{{ route('administration.ticket-types') }}" class="inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-gray-700 rounded-lg hover:bg-gray-800 focus:ring-4 focus:outline-none focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800">
85-
@lang('Manage types')
86-
<svg aria-hidden="true" class="ml-2 -mr-1 w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
87-
</a>
88-
</div>
89-
</div>
90-
</div>
91-
@endcan
92-
93-
@can('View activity log')
94-
<div class="flex flex-row xl:w-1/2 w-full items-center bg-white w-full hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700">
95-
<div class="w-52 h-36 bg-cover bg-center bg-no-repeat rounded-tl-lg rounded-bl-lg" style="background-image: url('{{ asset('images/administration/activity-logs.jpg') }}')"></div>
96-
<div class="flex flex-col justify-between p-4 leading-normal w-full">
97-
<h5 class="mb-2 text-2xl font-medium tracking-tight text-gray-900 dark:text-white">@lang('Activity logs')</h5>
98-
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400">@lang('Here you can see all activity logs of :app', [
99-
'app' => config('app.name')
100-
])</p>
101-
<div class="w-full flex items-center">
102-
<a href="{{ route('administration.activity-logs') }}" class="inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-gray-700 rounded-lg hover:bg-gray-800 focus:ring-4 focus:outline-none focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800">
103-
@lang('See details')
104-
<svg aria-hidden="true" class="ml-2 -mr-1 w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
105-
</a>
106-
</div>
107-
</div>
108-
</div>
109-
@endcan
110-
111-
</div>
9+
</x-administration-layout>

resources/views/livewire/administration/activity-logs.blade.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1+
<x-administration-layout>
12
<div class="w-full flex flex-col justify-start items-start gap-5">
23
<div class="w-full flex md:flex-row flex-col justify-between items-start gap-2">
34
<div class="flex flex-col justify-center items-start gap-1">
4-
<a href="{{ route('administration') }}" class="text-xs text-blue-500 hover:text-blue-600 font-light flex items-center gap-2">
5-
<i class="fa fa-long-arrow-left"></i>
6-
@lang('Go back to administration')
7-
</a>
85
<span class="lg:text-4xl md:text-2xl text-xl font-medium text-gray-700">
96
@lang('Activity logs')
107
</span>
@@ -73,3 +70,4 @@
7370
</div>
7471
</div>
7572
</div>
73+
</x-administration-layout>

0 commit comments

Comments
 (0)