Skip to content

Commit 0361a80

Browse files
authored
Merge pull request #22 from AntNavDev/update-adjust_taxa_details_page
order taxa details page and fix text visual error
2 parents 2e3c3ba + ce0a87a commit 0361a80

3 files changed

Lines changed: 54 additions & 9 deletions

File tree

app/Http/Controllers/TaxonController.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public function show(string $name): View
196196

197197
$totalCount = $occurrences->total ?: count($occurrences->items);
198198
$fetchedCount = count($occurrences->items);
199+
$isLimited = $fetchedCount >= 1000;
199200

200201
// Compute classification breakdown from the occurrence set.
201202
$byPhylum = [];
@@ -223,6 +224,7 @@ public function show(string $name): View
223224
'occurrences',
224225
'totalCount',
225226
'fetchedCount',
227+
'isLimited',
226228
'byPhylum',
227229
'byClass',
228230
'byEnvironment',

resources/views/layouts/app.blade.php

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
@vite(['resources/css/app.css', 'resources/js/app.js'])
2626
</head>
2727
<body class="bg-bg text-text antialiased">
28-
<nav class="relative z-[1100] border-b border-border bg-surface" aria-label="Main navigation">
28+
<nav x-data="{ open: false }" class="relative z-[1100] border-b border-border bg-surface" aria-label="Main navigation">
2929
<div class="flex h-16 items-center justify-between px-4 sm:px-6">
3030
<a href="/" class="text-lg font-semibold tracking-tight text-text">
3131
Eonmap
3232
</a>
33-
<div class="flex items-center gap-6">
33+
34+
{{-- Desktop link row --}}
35+
<div class="hidden sm:flex items-center gap-6">
3436
<x-nav.nav-link href="{{ route('map') }}" :active="request()->routeIs('map')">
3537
Map
3638
</x-nav.nav-link>
@@ -46,6 +48,49 @@
4648
<livewire:recently-viewed />
4749
<x-theme-toggle />
4850
</div>
51+
52+
{{-- Mobile: theme toggle + hamburger --}}
53+
<div class="flex items-center gap-1 sm:hidden">
54+
<x-theme-toggle />
55+
<button
56+
x-on:click="open = !open"
57+
:aria-expanded="open"
58+
aria-controls="mobile-menu"
59+
aria-label="Toggle navigation menu"
60+
class="rounded-md p-2 text-muted hover:bg-surface-hover hover:text-text transition-colors"
61+
>
62+
{{-- Hamburger --}}
63+
<svg x-show="!open" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" aria-hidden="true">
64+
<path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" />
65+
</svg>
66+
{{-- Close --}}
67+
<svg x-show="open" x-cloak class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" aria-hidden="true">
68+
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
69+
</svg>
70+
</button>
71+
</div>
72+
</div>
73+
74+
{{-- Mobile menu panel --}}
75+
<div
76+
id="mobile-menu"
77+
x-show="open"
78+
x-cloak
79+
x-on:click.outside="open = false"
80+
class="sm:hidden border-t border-border bg-surface"
81+
>
82+
<x-nav.responsive-nav-link href="{{ route('map') }}" :active="request()->routeIs('map')">
83+
Map
84+
</x-nav.responsive-nav-link>
85+
<x-nav.responsive-nav-link href="{{ route('browse') }}" :active="request()->routeIs('browse')">
86+
Browse
87+
</x-nav.responsive-nav-link>
88+
<x-nav.responsive-nav-link href="{{ route('taxa.index') }}" :active="request()->routeIs('taxa.*')">
89+
Taxa
90+
</x-nav.responsive-nav-link>
91+
<x-nav.responsive-nav-link href="{{ route('guide') }}" :active="request()->routeIs('guide')">
92+
Guide
93+
</x-nav.responsive-nav-link>
4994
</div>
5095
</nav>
5196

resources/views/taxa/show.blade.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
{{ number_format($totalCount) }} occurrences
1212
</span>
1313

14-
@if ($fetchedCount < $totalCount)
15-
<span class="text-sm text-muted">
16-
(charts based on first {{ number_format($fetchedCount) }})
17-
</span>
14+
@if ($isLimited)
15+
<span class="text-sm text-muted">Limited to 1,000 results</span>
1816
@endif
1917

2018
<a
@@ -97,7 +95,7 @@ class="h-96 w-full rounded-lg overflow-hidden"
9795
</tbody>
9896
</table>
9997
@else
100-
<p class="text-sm text-muted">No data.</p>
98+
<p class="py-1.5 text-sm text-muted">No data.</p>
10199
@endif
102100
</div>
103101

@@ -118,7 +116,7 @@ class="h-96 w-full rounded-lg overflow-hidden"
118116
</tbody>
119117
</table>
120118
@else
121-
<p class="text-sm text-muted">No data.</p>
119+
<p class="py-1.5 text-sm text-muted">No data.</p>
122120
@endif
123121
</div>
124122

@@ -139,7 +137,7 @@ class="h-96 w-full rounded-lg overflow-hidden"
139137
</tbody>
140138
</table>
141139
@else
142-
<p class="text-sm text-muted">No data.</p>
140+
<p class="py-1.5 text-sm text-muted">No data.</p>
143141
@endif
144142
</div>
145143

0 commit comments

Comments
 (0)