summaryrefslogtreecommitdiff
path: root/resources/views
diff options
context:
space:
mode:
authorDeveloper2026-06-27 04:03:30 +0200
committerDeveloper2026-06-27 04:03:30 +0200
commit972cd677ab19a6603214f8d61c5f4014a7e5ac4e (patch)
tree067341f9cb34d346c5af08873ae96f4532c2be58 /resources/views
parenta2199efc94bf7ff26e7dd1f3db9e9ae0e4e4cc3a (diff)
downloadcurious-972cd677ab19a6603214f8d61c5f4014a7e5ac4e.tar.gz
feat: add sort buttons to cinema listing
Order options: Hacker News Mentions (default), Rating, Number of Votes, Accolades, Release Date. Active sort is highlighted in primary color.
Diffstat (limited to 'resources/views')
-rw-r--r--resources/views/cinema.blade.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/resources/views/cinema.blade.php b/resources/views/cinema.blade.php
index af09b91..ea2bdeb 100644
--- a/resources/views/cinema.blade.php
+++ b/resources/views/cinema.blade.php
@@ -114,6 +114,22 @@ html {
<input name="q" class="form-control mr-sm-2" type="text" placeholder="Search movies..." aria-label="Search" value="{{ isset($search_query) ? $search_query : '' }}">
<button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
</form>
+ <div class="mt-2">
+ <span class="text-muted">Sort by:</span>
+ @foreach ([
+ ['ref_count', 'Hacker News Mentions'],
+ ['score', 'Rating'],
+ ['num_votes', 'Number of Votes'],
+ ['num_accolades', 'Accolades'],
+ ['start_year', 'Release Date'],
+ ] as [$key, $label])
+ @if ( (isset($order) ? $order : 'ref_count') == $key )
+ <a class="btn btn-sm btn-primary my-1" href="{{ url()->current() }}?order={{ $key }}">{{ $label }}</a>
+ @else
+ <a class="btn btn-sm btn-outline-secondary my-1" href="{{ url()->current() }}?order={{ $key }}">{{ $label }}</a>
+ @endif
+ @endforeach
+ </div>
</div>
</div>