1
0
mirror of https://github.com/Kovah/LinkAce.git synced 2025-04-21 23:42:10 +02:00

Implement a nicer list view

This commit is contained in:
Kovah 2019-11-20 14:43:05 +01:00
parent 6afc0e6e34
commit ffe0bcd116
No known key found for this signature in database
GPG Key ID: AAAA031BA9830D7B
8 changed files with 106 additions and 58 deletions

View File

@ -20,15 +20,8 @@ class ListController extends Controller
*/
public function index(Request $request)
{
$lists = LinkList::byUser(auth()->id());
if ($request->has('orderBy') && $request->has('orderDir')) {
$lists->orderBy($request->get('orderBy'), $request->get('orderDir'));
} else {
$lists->orderBy('name', 'ASC');
}
$lists = $lists->paginate(getPaginationLimit());
$lists = LinkList::byUser(auth()->id())
->paginate(getPaginationLimit());
return view('models.lists.index', [
'lists' => $lists,
@ -133,7 +126,7 @@ class ListController extends Controller
* Update the specified resource in storage.
*
* @param ListUpdateRequest $request
* @param int $id
* @param int $id
* @return \Illuminate\Http\RedirectResponse
*/
public function update(ListUpdateRequest $request, $id)
@ -160,7 +153,7 @@ class ListController extends Controller
* Remove the specified resource from storage.
*
* @param ListDeleteRequest $request
* @param int $id
* @param int $id
* @return \Illuminate\Http\RedirectResponse
* @throws \Exception
*/

View File

@ -27,7 +27,7 @@ services:
- db
volumes:
- .:/app:delegated
- ./resources/docker/php/php.ini:/opt/bitnami/php/etc/conf.d/php.ini:ro
- ./resources/docker/php/php-dev.ini:/opt/bitnami/php/etc/conf.d/php.ini:ro
# --- nginx 1.14
nginx:

View File

@ -0,0 +1,38 @@
; miscellaneous
; -------------
expose_php = Off
; resource limits
; ---------------
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
upload_max_filesize = 20M
post_max_size = 20M
; xDebug
; -------
;zend_extension = /opt/bitnami/php/lib/php/extensions/xdebug.so
;xdebug.idekey = "phpstorm"
;xdebug.remote_enable = 1
;xdebug.remote_host = docker.for.mac.localhost
;xdebug.remote_port = 10000
;xdebug.remote_connect_back = 0
;xdebug.remote_log = /tmp/xdebug_remote.log
;xdebug.max_nesting_level = 300
;xdebug.scream = 0
;xdebug.cli_color = 1
;xdebug.show_local_vars = 1
; opcache
; -------
opcache.enable = 1
opcache.revalidate_freq = 2
opcache.validate_timestamps = 1
opcache.interned_strings_buffer = 32
opcache.memory_consumption = 256

View File

@ -2,7 +2,7 @@
; miscellaneous
; -------------
expose_php = off
expose_php = Off
; resource limits
; ---------------
@ -15,8 +15,8 @@ post_max_size = 20M
; opcache
; -------
opcache.enable = 1
opcache.fast_shutdown = 1
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 7963
opcache.memory_consumption = 192
opcache.validate_timestamps = 0
opcache.interned_strings_buffer = 32
opcache.memory_consumption = 256

View File

@ -4,6 +4,7 @@ return [
'links' => 'Links',
'all_links' => 'All Links',
'recent_links' => 'Recent Links',
'no_links' => 'No Links',
'add' => 'Add Link',
'add_quick' => 'Quick Add Link',

View File

@ -18,6 +18,8 @@ return [
'no_lists' => 'No Lists',
'number_links' => ':number Link in this List|:number Links in this List',
'added_successfully' => 'List added successfully.',
'updated_successfully' => 'List updated successfully.',
'deleted_successfully' => 'List deleted successfully.',

View File

@ -12,23 +12,21 @@
</a>
</header>
<div class="card my-3">
<div class="card-table">
@if(!$lists->isEmpty())
@include('models.lists.partials.table')
@else
<div class="alert alert-info m-3">
@lang('linkace.no_results_found', ['model' => trans('list.lists')])
</div>
@endif
@if(!$lists->isEmpty())
<div class="row my-3">
@foreach($lists as $list)
@include('models.lists.partials.single')
@endforeach
</div>
</div>
@else
<div class="alert alert-info m-3">
@lang('linkace.no_results_found', ['model' => trans('list.lists')])
</div>
@endif
@if(!$lists->isEmpty())
{!! $lists->links() !!}

View File

@ -1,28 +1,44 @@
<tr>
<td>
<a href="{{ route('lists.show', [$list->id]) }}">
{{ $list->name }}
</a>
</td>
<td>
{{ $list->links->count() }}
</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ route('lists.edit', [$list->id]) }}" class="btn btn-outline-primary">
<i class="fas fa-edit"></i>
</a>
<a onclick="event.preventDefault();document.getElementById('list-delete-{{ $list->id }}').submit();"
title=" @lang('list.delete')" class="btn btn-outline-danger">
<i class="fas fa-trash"></i>
</a>
<div class="col-12 col-sm-6 col-md-4 mb-4">
<div class="h-100 card">
<div class="card-header">
<div class="d-flex align-items-top">
<div class="mr-2">
@if($list->is_private)
<i class="fas fa-lock text-muted mr-1" title="@lang('list.private')"></i>
@endif
<a href="{{ route('lists.show', [$list->id]) }}">{{ $list->name }}</a>
</div>
</div>
</div>
<form id="list-delete-{{ $list->id }}" method="POST" style="display: none;"
action="{{ route('lists.destroy', [$list->id]) }}">
@method('DELETE')
@csrf
<input type="hidden" name="list_id" value="{{ $list->id }}">
</form>
</td>
</tr>
<ul class="list-group list-group-flush h-100">
<li class="list-group-item h-100 small">
@if($list->links->count() > 0)
{{ trans_choice('list.number_links', $list->links->count(), ['number' => $list->links->count()]) }}
@else
<span class="text-muted">@lang('link.no_links')</span>
@endif
</li>
</ul>
<div class="card-footer">
<div class="btn-group w-100">
<a href="{{ route('lists.edit', [$list->id]) }}" class="card-link">
<i class="fas fa-edit"></i>
</a>
<a href="#" onclick="event.preventDefault();document.getElementById('list-delete-{{ $list->id }}').submit();"
title=" @lang('list.delete')" class="card-link cursor-pointer">
<i class="fas fa-trash"></i>
</a>
</div>
<form id="list-delete-{{ $list->id }}" method="POST" style="display: none;"
action="{{ route('lists.destroy', [$list->id]) }}">
@method('DELETE')
@csrf
<input type="hidden" name="list_id" value="{{ $list->id }}">
</form>
</div>
</div>
</div>