diff options
| author | Zach DeCook <zachdecook@librem.one> | 2021-02-12 00:44:51 +0000 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2021-02-12 00:44:51 +0000 |
| commit | d99588ac37284194202a677ea9cc2a2ccb5846a1 (patch) | |
| tree | 3d86bfd0a47ec2353597152d535f9c9e7e7ccbeb /laravel/public | |
| parent | b1859f40277da1d9ba53b8416f1d681f52f68cc2 (diff) | |
| download | prosongsa-d99588ac37284194202a677ea9cc2a2ccb5846a1.tar.gz | |
homepage: add server-side sorting
Diffstat (limited to 'laravel/public')
| -rwxr-xr-x | laravel/public/index.gmi | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/laravel/public/index.gmi b/laravel/public/index.gmi index 89db27b..492ed92 100755 --- a/laravel/public/index.gmi +++ b/laravel/public/index.gmi @@ -9,8 +9,15 @@ $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); use App\Song; printf("20 text/gemini\r\n"); ?> -<?php foreach(Song::all()->pluck('title','id') as $id => $title): ?> -=> /song.gmi.php/<?= $id ?> <?= $title ?> +# Prosongsa Songs + +<?php foreach(['title','author'] as $key): ?> +=> /?<?=$key?> Sort by <?=$key?> + +<?php endforeach; ?> + +<?php foreach(Song::all()->sortBy(getenv('QUERY_STRING')??'title')->pluck('title','id') as $id => $title): ?> +=> /song.gmi.php/<?=$id?> <?= $title ?> <?php endforeach; ?> |
