Skip to content

Commit

Permalink
Cosmetic on UI : sort order, icons instead of png, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
csavelief committed Jun 2, 2024
1 parent 051dfcc commit ea5eb99
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 42 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public function index(Request $request)
}

$backups = collect();

if ($tab === 'backups') {
$backups = $servers->flatMap(fn(YnhServer $server) => $server->backups);
}
Expand Down
Binary file removed public/images/download.png
Binary file not shown.
8 changes: 5 additions & 3 deletions resources/views/home/cards/_applications.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,22 @@
<table class="table table-hover">
<thead>
<tr>
<th>{{ __('Name') }}</th>
<th>
<i class="zmdi zmdi-long-arrow-down"></i>&nbsp;{{ __('Name') }}
</th>
<th>{{ __('Description') }}</th>
<th>{{ __('Sku') }}</th>
<th>{{ __('Version') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($applications->sortBy('name') as $app)
@foreach($applications->sortBy('name', SORT_NATURAL|SORT_FLAG_CASE) as $app)
<tr>
<td>
<span class="font-lg mb-3 fw-bold">
<a href="https://{{ $app->path }}" target="_blank">
{{ $app->name }}
{{ $app->name }}&nbsp;&nbsp;<i class="zmdi zmdi-open-in-new"></i>
</a>
</span>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<tr>
<th class="ps-4" width="25px"></th>
<th width="70px"></th>
<th>
<i class="zmdi zmdi-long-arrow-down"></i>&nbsp;{{ __('Date') }}
</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Categories') }}</th>
<th>{{ __('Order') }}</th>
Expand All @@ -41,6 +44,9 @@
alt="{{ $order->name() }}"
class="mw-100" style="height: 2.5em;"/>
</td>
<td>
{{ $order->updated_at->format('Y-m-d H:i') }}
</td>
<td>
<span class="font-lg mb-3 fw-bold">
{{ $order->name() }}
Expand Down
6 changes: 4 additions & 2 deletions resources/views/home/cards/_backups.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ function formatBytes($bytes, $precision = 2)
<table class="table table-hover">
<thead>
<tr>
<th>{{ __('Date') }}</th>
<th>
<i class="zmdi zmdi-long-arrow-up"></i>&nbsp;{{ __('Date') }}
</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Size') }}</th>
<th></th>
Expand All @@ -69,7 +71,7 @@ function formatBytes($bytes, $precision = 2)
<a href="/ynh/servers/{{ $server->id }}/backup/{{ $backup->id }}"
class="cursor-pointer"
title="download">
<img src="{{ asset('images/download.png') }}" height="20" class="float-end">
<i class="zmdi zmdi-download"></i>
</a>
@endif
</td>
Expand Down
6 changes: 4 additions & 2 deletions resources/views/home/cards/_domains.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
<table class="table table-hover">
<thead>
<tr>
<th>{{ __('Name') }}</th>
<th>
<i class="zmdi zmdi-long-arrow-down"></i>&nbsp;{{ __('Name') }}
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($domains->sortBy('name') as $domain)
@foreach($domains->sortBy('name', SORT_NATURAL|SORT_FLAG_CASE) as $domain)
<tr>
<td>
{{ $domain->name }}
Expand Down
1 change: 1 addition & 0 deletions resources/views/home/cards/_my_apps.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class="mw-100" style="height: 2.5em;"/>
@else
{{ $app->application->name }}
@endif
&nbsp;&nbsp;<i class="zmdi zmdi-open-in-new"></i>
</a>
</span>
<div class="text-muted">
Expand Down
4 changes: 3 additions & 1 deletion resources/views/home/cards/_orders.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
<tr>
<th class="ps-4" width="25px"></th>
<th width="70px"></th>
<th>{{ __('Date') }}</th>
<th>
<i class="zmdi zmdi-long-arrow-up"></i>&nbsp;{{ __('Date') }}
</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Categories') }}</th>
<th>{{ __('Order') }}</th>
Expand Down
6 changes: 4 additions & 2 deletions resources/views/home/cards/_servers.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
<thead>
<tr>
<th class="ps-4" width="25px"></th>
<th>{{ __('Name') }}</th>
<th>
<i class="zmdi zmdi-long-arrow-down"></i>&nbsp;{{ __('Name') }}
</th>
<th>{{ __('IP V4') }}</th>
<th>{{ __('IP V6') }}</th>
<th>{{ __('Domain') }}</th>
Expand All @@ -45,7 +47,7 @@
</tr>
</thead>
<tbody>
@foreach($servers->sortBy('name') as $server)
@foreach($servers->sortBy('name', SORT_NATURAL|SORT_FLAG_CASE) as $server)
<tr>
<td class="ps-4" width="25px">
@if($server->isFrozen())
Expand Down
6 changes: 4 additions & 2 deletions resources/views/home/cards/_towerify_applications.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
<thead>
<tr>
<th>{{ __('Server') }}</th>
<th>{{ __('Name') }}</th>
<th>
<i class="zmdi zmdi-long-arrow-down"></i>&nbsp;{{ __('Name') }}
</th>
<th>{{ __('Description') }}</th>
<th>{{ __('Sku') }}</th>
<th>{{ __('Version') }}</th>
Expand All @@ -41,7 +43,7 @@
<td>
<span class="font-lg mb-3 fw-bold">
<a href="https://{{ $app->path }}" target="_blank">
{{ $app->name }}
{{ $app->name }}&nbsp;&nbsp;<i class="zmdi zmdi-open-in-new"></i>
</a>
</span>
</td>
Expand Down
6 changes: 4 additions & 2 deletions resources/views/home/cards/_towerify_backups.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ function formatBytes($bytes, $precision = 2)
<thead>
<tr>
<th>{{ __('Server') }}</th>
<th>{{ __('Date') }}</th>
<th>
<i class="zmdi zmdi-long-arrow-up"></i>&nbsp;{{ __('Date') }}
</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Size') }}</th>
<th></th>
Expand Down Expand Up @@ -64,7 +66,7 @@ function formatBytes($bytes, $precision = 2)
<a href="/ynh/servers/{{ $backup->server->id }}/backup/{{ $backup->id }}"
class="cursor-pointer"
title="download">
<img src="{{ asset('images/download.png') }}" height="20" class="float-end">
<i class="zmdi zmdi-download"></i>
</a>
@endif
</td>
Expand Down
6 changes: 4 additions & 2 deletions resources/views/home/cards/_towerify_domains.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
<th>{{ __('Server') }}</th>
<th>{{ __('IP V4') }}</th>
<th>{{ __('IP V6') }}</th>
<th>{{ __('Domain') }}</th>
<th>
<i class="zmdi zmdi-long-arrow-down"></i>&nbsp;{{ __('Domain') }}
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($domains->sortBy('name') as $domain)
@foreach($domains->sortBy('name', SORT_NATURAL|SORT_FLAG_CASE) as $domain)
<tr>
<td>
<span class="font-lg mb-3 fw-bold">
Expand Down
10 changes: 6 additions & 4 deletions resources/views/home/cards/_towerify_invitations.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
@if(Auth::user()->canManageUsers())
<div class="align-items-end">
<h3 class="m-0">
<h3 class="m-0 cursor-pointer">
<a onclick="toggleForm()">
{{ __('+ new') }}
</a>
Expand Down Expand Up @@ -52,20 +52,22 @@ class="form-control btn btn-xs btn-outline-success float-end">
<table class="table table-hover">
<thead>
<tr>
<th>{{ __('Username') }}</th>
<th>
<i class="zmdi zmdi-long-arrow-down"></i>&nbsp;{{ __('Username') }}
</th>
<th>{{ __('Email') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($invitations->sortBy('name') as $invitation)
@foreach($invitations->sortBy('name', SORT_NATURAL|SORT_FLAG_CASE) as $invitation)
<tr>
<td>
{{ $invitation->name }}
</td>
<td>
<a href="mailto:{{ $invitation->email }}" target="_blank">
{{ $invitation->email }}
{{ $invitation->email }}&nbsp;&nbsp;<i class="zmdi zmdi-open-in-new"></i>
</a>
</td>
<td>
Expand Down
8 changes: 5 additions & 3 deletions resources/views/home/cards/_towerify_users.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,23 @@
<table class="table table-hover">
<thead>
<tr>
<th>{{ __('Username') }}</th>
<th>
<i class="zmdi zmdi-long-arrow-down"></i>&nbsp;{{ __('Username') }}
</th>
<th>{{ __('Email') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($users->sortBy('name') as $user)
@foreach($users->sortBy('name', SORT_NATURAL|SORT_FLAG_CASE) as $user)
<tr>
<td>
{{ $user->name }}
</td>
<td>
<a href="mailto:{{ $user->email }}" target="_blank">
{{ $user->email }}
{{ $user->email }}&nbsp;&nbsp;<i class="zmdi zmdi-open-in-new"></i>
</a>
</td>
<td>
Expand Down
41 changes: 22 additions & 19 deletions resources/views/home/cards/_users.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@
<table class="table table-hover">
<thead>
<tr>
<th>{{ __('Name') }}</th>
<th>
<i class="zmdi zmdi-long-arrow-down"></i>&nbsp;{{ __('Name') }}
</th>
<th>{{ __('Username') }}</th>
<th>{{ __('Email') }}</th>
<th>{{ __('Permissions') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($users->sortBy('fullname') as $user)
@foreach($users->sortBy('fullname', SORT_NATURAL|SORT_FLAG_CASE) as $user)
<tr>
<td>
<span class="font-lg mb-3 fw-bold">
Expand All @@ -41,24 +42,9 @@
</td>
<td>
<a href="mailto:{{ $user->email }}" target="_blank">
{{ $user->email }}
{{ $user->email }}&nbsp;&nbsp;<i class="zmdi zmdi-open-in-new"></i>
</a>
</td>
<td>
@php
$userPermissions = $user
->permissions
->filter(fn($perm) => $perm->application->ynh_server_id === $server->id)
->sortBy('application.name');
@endphp
@foreach($userPermissions as $permission)
<span class="tw-pill rounded-pill bg-primary">
<a href="https://{{ $permission->application->path }}" target="_blank" class="text-white">
{{ $permission->application->name }}
</a>
</span>
@endforeach
</td>
<td>
@if(Auth::user()->canManageUsers())
@php
Expand Down Expand Up @@ -124,6 +110,23 @@ class="dropdown-item">
@endif
</td>
</tr>
<tr>
<td colspan="5">
@php
$userPermissions = $user
->permissions
->filter(fn($perm) => $perm->application->ynh_server_id === $server->id)
->sortBy('application.name');
@endphp
@foreach($userPermissions as $permission)
<span class="tw-pill rounded-pill bg-primary">
<a href="https://{{ $permission->application->path }}" target="_blank" class="text-white">
{{ $permission->application->name }}
</a>
</span>
@endforeach
</td>
</tr>
@endforeach
</tbody>
</table>
Expand Down
2 changes: 2 additions & 0 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
<link href="https://cdn.jsdelivr.net/npm/tom-select/dist/css/tom-select.bootstrap4.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/tom-select"></script>

<!-- Icons -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css" media="all" type="text/css" rel="stylesheet" integrity="sha256-3sPp8BkKUE7QyPSl6VfBByBroQbKxKG7tsusY2mhbVY=" crossorigin="anonymous">
</head>
<body>
<div id="app">
Expand Down

0 comments on commit ea5eb99

Please sign in to comment.