Skip to content

Commit

Permalink
collections/list cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MuchQuak committed Nov 1, 2024
1 parent 8241e09 commit 604abf7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
23 changes: 18 additions & 5 deletions resources/views/core/pages/collections/list.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
@props(['occurrences' => []])
@php
$dataset_str = request('db');
if(is_array($dataset_str)) {
$dataset_str = implode(',', $dataset_str);
}
$taxa_str = request('taxa');
if(is_array($taxa_str)) {
$taxa_str = implode(',', $taxa_str);
}
@endphp
<x-layout class="grid grid-col-1 gap-4 grow-0">
<div>
<x-breadcrumbs :items="[
Expand Down Expand Up @@ -29,12 +40,12 @@
</div>

{{-- Occurrence Records --}}
<div class="grid grid-col-1 gap-4">
<div id="occurrence_result" class="grid grid-col-1 gap-4">
<div class="flex flex-wrap">
<div>
<div>Dataset: All collections</div>
<div>Taxa: (Taxa list)</div>
<div>Search Criteria: ( Figure out what this is for )</div>
<div>Dataset: {{ $dataset_str ?? 'All collections'}}</div>
<div>Taxa: {{ $taxa_str ?? '' }}</div>
<div>Search Criteria: ( TODO )</div>
</div>
<div class="flex items-center gap-4 grow justify-end">
<x-tooltip text="Display as Table">
Expand Down Expand Up @@ -65,7 +76,9 @@

{{-- Maps --}}
<div class="flex items-center gap-4 h-60">
<x-button class="w-fit">Display coordinates in Map</x-button>
<a href="{{ url(config('portal.name') . '/collections/map/index.php?') . http_build_query(request()->all()) }}" target="_blank">
<x-button class="w-fit">Display coordinates in Map</x-button>
</a>
<x-button class="w-fit">Create KML</x-button>
{{-- Investigate but pretty sure this just adds info to download --}}
<x-link>Add Extra Fields</x-link>
Expand Down
27 changes: 13 additions & 14 deletions resources/views/core/pagination.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{-- See Laravel Paginator Docs For LengthAwarePaginator properties and methods --}}
@props(['lengthAwarePaginator'])
@props(['lengthAwarePaginator', 'hx_target' => 'body'])
@php
$start = ($lengthAwarePaginator->currentPage() - 1 ) * $lengthAwarePaginator->perPage();
$end = $start + $lengthAwarePaginator->perPage();
Expand All @@ -14,32 +14,31 @@
<nav>
<ul class="flex items-center text-sm leading-tight bg-base-100 border divide-x rounded h-9 text-base-content/75 divide-base-300 border-base-300">
<li class="h-full divide-r">
<a href="{{ $lengthAwarePaginator->previousPageUrl() }}" class="relative inline-flex items-center h-full px-3 ml-0 rounded-l group hover:text-base-content outline-none focus:ring ring-inset focus:ring-accent">
<a hx-push-url="true" hx-target="{{$hx_target}}" hx-get="{{ $lengthAwarePaginator->previousPageUrl() }}" class="relative inline-flex items-center h-full px-3 ml-0 rounded-l group hover:text-base-content outline-none focus:ring ring-inset focus:ring-accent cursor-pointer">
<span>Previous</span>
<span class="box-content absolute bottom-0 w-0 h-px -mx-px duration-200 ease-out translate-y-px border-transparent bg-base-content group-hover:border-l group-hover:border-r group-hover:border-base-300 left-1/2 group-hover:left-0 group-hover:w-full"></span>
</a>
</li>
@for ($i = 1; $i <= ceil($lengthAwarePaginator->total() / $lengthAwarePaginator->perPage()); $i++)
@php $isCurrent = $lengthAwarePaginator->currentPage() === $i; @endphp
@if($isCurrent)
<li class="hidden h-full md:block">
<a href="{{$lengthAwarePaginator->url($i)}}" class="relative inline-flex items-center h-full px-3 text-base-content group bg-base-200/50 outline-none ring-inset focus:ring focus:ring-accent">
<a hx-push-url="true" hx-target="{{$hx_target}}" hx-get="{{ $lengthAwarePaginator->url($i) }}" @class([
'relative inline-flex items-center h-full px-3 outline-none ring-inset focus:ring focus:ring-accent cursor-pointer',
'text-base-content group bg-base-300/50' => $isCurrent,
'group hover:text-base-content outline-none focus:ring ring-inset focus:ring-accent' => !$isCurrent,
])>
<span>{{ $i }}</span>
<span class="box-content absolute bottom-0 left-0 w-full h-px -mx-px translate-y-px border-l border-r bg-base-content border-base-300"></span>
<span @class([
'box-content absolute bottom-0 translate-y-px bg-base-content',
'left-0 w-full h-px mx-px border-l border-r border-base-300' => $isCurrent,
'w-0 h-px mx-px duration-200 ease-out border-transparent group-hover:border-l group-hover:border-r group-hover:border-base-300 left-1/2 group-hover:left-0 group-hover:w-full' => !$isCurrent
])></span>
</a>
</li>
@else
<li class="hidden h-full md:block">
<a href="{{$lengthAwarePaginator->url($i)}}" class="relative inline-flex items-center h-full px-3 group hover:text-base-content outline-none focus:ring ring-inset focus:ring-accent">
<span>{{ $i }}</span>
<span class="box-content absolute bottom-0 w-0 h-px -mx-px duration-200 ease-out translate-y-px border-transparent bg-base-content group-hover:border-l group-hover:border-r group-hover:border-base-300 left-1/2 group-hover:left-0 group-hover:w-full"></span>
</a>
</li>
@endif
@endfor

<li class="h-full">
<a href="{{ $lengthAwarePaginator->nextPageUrl() }}" class="relative inline-flex items-center h-full px-3 rounded-r group hover:text-base-content outline-none focus:ring ring-inset focus:ring-accent">
<a hx-push-url="true" hx-target="{{$hx_target}}" hx-get="{{ $lengthAwarePaginator->nextPageUrl() }}" class="relative inline-flex items-center h-full px-3 rounded-r group hover:text-base-content outline-none focus:ring ring-inset focus:ring-accent cursor-pointer">
<span>Next</span>
<span class="box-content absolute bottom-0 w-0 h-px -mx-px duration-200 ease-out translate-y-px border-transparent bg-base-content group-hover:border-l group-hover:border-r group-hover:border-base-300 left-1/2 group-hover:left-0 group-hover:w-full"></span>
</a>
Expand Down

0 comments on commit 604abf7

Please sign in to comment.