2016-01-26 23:20:08 -05:00
|
|
|
@extends('dashboard.core')
|
|
|
|
|
|
|
|
@section('dashboard-heading')
|
2018-01-21 19:48:30 -05:00
|
|
|
@if($export && count($rows) > 0)
|
2018-04-16 00:45:32 -04:00
|
|
|
<a href="/dashboard/export/{{ $model }}"><button type="button" class="btn btn-secondary">Export</button></a>
|
2016-12-19 22:31:04 -05:00
|
|
|
@endif
|
|
|
|
|
2016-12-22 00:20:44 -05:00
|
|
|
@if($create)
|
2020-04-24 00:22:42 -04:00
|
|
|
<a href="/dashboard/edit/{{ $model }}/new" class="new-button btn btn-secondary">New</a>
|
2016-12-19 22:45:11 -05:00
|
|
|
@endif
|
2016-01-26 23:20:08 -05:00
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('dashboard-body')
|
2016-12-22 00:20:44 -05:00
|
|
|
<div id="edit-list-wrapper">
|
2018-01-21 20:55:07 -05:00
|
|
|
<input type="hidden" id="token" value="{{ csrf_token() }}" />
|
2018-01-12 00:15:04 -05:00
|
|
|
|
2020-04-24 00:22:42 -04:00
|
|
|
@if(count($paramdisplay))
|
|
|
|
@foreach($paramdisplay as $param)
|
|
|
|
<div>Showing {{ $heading }} with a {{ $param['title'] }} of "{{ $param['value'] }}"</div>
|
|
|
|
@endforeach
|
|
|
|
@endif
|
|
|
|
|
2016-12-22 00:20:44 -05:00
|
|
|
@if($filter)
|
2020-04-24 00:22:42 -04:00
|
|
|
@if(!$paginate)
|
|
|
|
<input id="filter-input" class="search" placeholder="Filter" />
|
|
|
|
@else
|
|
|
|
<form
|
|
|
|
id="search-form"
|
|
|
|
class="search-form"
|
|
|
|
data-url="{{ url()->current() }}">
|
|
|
|
|
|
|
|
<input
|
|
|
|
class="search-form-input search"
|
|
|
|
placeholder="Search"
|
|
|
|
value="{{ request()->query('search') }}"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<input
|
|
|
|
type="submit"
|
|
|
|
class="search-form-submit"
|
|
|
|
value="Search"
|
|
|
|
/>
|
|
|
|
</form>
|
|
|
|
@endif
|
2016-12-22 00:20:44 -05:00
|
|
|
@endif
|
|
|
|
|
2020-04-24 00:22:42 -04:00
|
|
|
@if($paginate && $rows->lastPage() !== 1)
|
|
|
|
<div class="pagination-navigation-bar">
|
|
|
|
<a
|
|
|
|
class="pagination-navigation-bar-arrow prev btn btn-primary {{ $rows->onFirstPage() ? 'btn-disabled' : '' }}"
|
|
|
|
href="/dashboard/edit/{{ $model }}?page={{ $rows->onFirstPage() ? 1 : $rows->currentPage() - 1 }}{{ $query !== '' ? ('&' . $query) : '' }}">
|
|
|
|
|
|
|
|
Previous Page
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<div class="pagination-navigation-bar-page-count">
|
2022-05-23 21:01:33 -04:00
|
|
|
@php
|
|
|
|
$pages_around = 2;
|
|
|
|
$start_page = $rows->currentPage() - $pages_around;
|
|
|
|
@endphp
|
2020-04-24 00:22:42 -04:00
|
|
|
|
|
|
|
@if($start_page < 1)
|
2022-05-23 21:01:33 -04:00
|
|
|
@php
|
|
|
|
$start_page = 1;
|
|
|
|
@endphp
|
2020-04-24 00:22:42 -04:00
|
|
|
@elseif($start_page + $pages_around > $rows->lastPage())
|
2022-05-23 21:01:33 -04:00
|
|
|
@php
|
|
|
|
$start_page = $rows->lastPage() - $pages_around;
|
|
|
|
@endphp
|
2020-04-24 00:22:42 -04:00
|
|
|
@endif
|
|
|
|
|
|
|
|
@if($start_page > 1)
|
|
|
|
<a
|
|
|
|
class="pagination-navigation-bar-pages-number btn btn-outline space"
|
|
|
|
href="/dashboard/edit/{{ $model }}?page=1{{ $query !== '' ? ('&' . $query) : '' }}">
|
|
|
|
|
|
|
|
1
|
|
|
|
</a>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@for($page = $start_page; $page < $start_page + 1 + $pages_around * 2; $page++)
|
|
|
|
@if($page === $rows->currentPage())
|
|
|
|
<div class="pagination-navigation-bar-pages-number btn btn-inactive">{{ $page }}</div>
|
|
|
|
@elseif($page <= $rows->lastPage())
|
|
|
|
<a
|
|
|
|
class="pagination-navigation-bar-pages-number btn btn-outline"
|
|
|
|
href="/dashboard/edit/{{ $model }}?page={{ $page }}{{ $query !== '' ? ('&' . $query) : '' }}">
|
|
|
|
|
|
|
|
{{ $page }}
|
|
|
|
</a>
|
2018-01-21 22:47:59 -05:00
|
|
|
@endif
|
2020-04-24 00:22:42 -04:00
|
|
|
@endfor
|
|
|
|
|
|
|
|
@if($start_page + $pages_around * 2 < $rows->lastPage())
|
|
|
|
<a
|
|
|
|
class="pagination-navigation-bar-pages-number btn btn-outline space"
|
|
|
|
href="/dashboard/edit/{{ $model }}?page={{ $rows->lastPage() }}{{ $query !== '' ? ('&' . $query) : '' }}">
|
2016-12-22 00:20:44 -05:00
|
|
|
|
2020-04-24 00:22:42 -04:00
|
|
|
{{ $rows->lastPage() }}
|
|
|
|
</a>
|
|
|
|
@endif
|
|
|
|
</div>
|
2016-12-22 00:20:44 -05:00
|
|
|
|
2020-04-24 00:22:42 -04:00
|
|
|
<a
|
|
|
|
class="pagination-navigation-bar-arrow next btn btn-primary {{ $rows->hasMorePages() ? '' : 'btn-disabled' }}"
|
|
|
|
href="/dashboard/edit/{{ $model }}?page={{ $rows->hasMorePages() ? $rows->currentPage() + 1 : $rows->currentPage() }}{{ $query !== '' ? ('&' . $query) : '' }}">
|
|
|
|
|
|
|
|
Next Page
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if(request()->query('search', null) != null && count($rows) == 0)
|
|
|
|
<div class="help-text text-center">No Matching {{ $heading }} Found</div>
|
|
|
|
@else
|
|
|
|
<ul id="edit-list" class="list-group edit-list list" data-model="{{ $model }}" {{ $sortcol != false ? "data-sort=$sortcol" : '' }}>
|
|
|
|
@foreach($rows as $row)
|
|
|
|
<li class="list-group-item {{ $sortcol != false ? 'sortable' : '' }}" data-id="{{ $row['id'] }}">
|
|
|
|
<div class="title-column">
|
|
|
|
@if($sortcol != false)
|
|
|
|
<div class="sort-icon" title="Click and drag to reorder">
|
|
|
|
<div class="sort-icon-inner">
|
|
|
|
<div class="sort-icon-inner-bar"></div>
|
|
|
|
<div class="sort-icon-inner-bar"></div>
|
|
|
|
<div class="sort-icon-inner-bar"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2022-05-23 21:01:33 -04:00
|
|
|
@foreach($display as $index => $display_column)
|
2022-07-25 17:16:55 -04:00
|
|
|
@php
|
|
|
|
$name = null;
|
|
|
|
$type = null;
|
|
|
|
|
|
|
|
foreach ($columns as $column) {
|
|
|
|
if ($column['name'] == $display_column) {
|
|
|
|
$name = $column['name'];
|
|
|
|
$type = $column['type'];
|
|
|
|
$ext = array_key_exists('ext', $column) ? $column['ext'] : $row::$default_image_ext;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($type == 'image') {
|
|
|
|
$image = $row->getUploadsPath('image') . $row->id . "-$name.$ext";
|
|
|
|
$thumbnail = $row->getUploadsPath('thumb') . $row->id . "-$name.$ext";
|
|
|
|
|
|
|
|
if (!file_exists(public_path($image))) {
|
|
|
|
$image = null;
|
|
|
|
$thumbnail = null;
|
|
|
|
} else if (!file_exists(public_path($thumbnail))) {
|
|
|
|
$thumbnail = $image;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@endphp
|
|
|
|
|
|
|
|
@if($name != null && $type != null && ($row[$display_column] != '' || ($type == 'image') && $thumbnail !== null))
|
|
|
|
<div class="column">
|
|
|
|
@if($type == 'image')
|
|
|
|
<a
|
|
|
|
class="image-preview"
|
|
|
|
href="{{ $image }}"
|
|
|
|
target="_blank"
|
|
|
|
style="background-image: url({{ $thumbnail }})">
|
|
|
|
</a>
|
|
|
|
@else
|
|
|
|
{{ $row[$display_column] }}
|
|
|
|
@endif
|
|
|
|
</div>
|
2020-04-24 00:22:42 -04:00
|
|
|
|
2022-05-23 21:01:33 -04:00
|
|
|
@if($index < count($display) - 1)
|
2020-04-24 00:22:42 -04:00
|
|
|
<div class="spacer">|</div>
|
|
|
|
@endif
|
2018-01-11 23:57:49 -05:00
|
|
|
@endif
|
2020-04-24 00:22:42 -04:00
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="button-column">
|
|
|
|
@if(!empty($button))
|
|
|
|
<button type="button" class="action-button btn btn-secondary" data-confirmation="{{ $button[1] }}" data-success="{{ $button[2] }}" data-error="{{ $button[3] }}" data-url="{{ $button[4] }}">{{ $button[0] }}</button>
|
2018-04-18 00:38:11 -04:00
|
|
|
@endif
|
2016-01-26 23:20:08 -05:00
|
|
|
|
2020-04-24 00:22:42 -04:00
|
|
|
@if(!empty($idlink))
|
|
|
|
<a class="btn btn-secondary" href="{{ $idlink[1] }}{{ $row['id'] }}">{{ $idlink[0] }}</a>
|
|
|
|
@endif
|
2017-01-04 23:23:26 -05:00
|
|
|
|
2020-04-24 00:22:42 -04:00
|
|
|
<a class="edit-button btn btn-warning" href="/dashboard/edit/{{ $model }}/{{ $row['id'] }}">Edit</a>
|
2016-12-19 22:31:04 -05:00
|
|
|
|
2020-04-24 00:22:42 -04:00
|
|
|
@if($delete)
|
|
|
|
<button type="button" class="delete-button btn btn-danger">Delete</button>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
@endforeach
|
|
|
|
</ul>
|
|
|
|
@endif
|
2016-12-22 00:20:44 -05:00
|
|
|
</div>
|
2016-01-26 23:20:08 -05:00
|
|
|
@endsection
|