Replace sorting buttons with drop-down menu, including new sorting methods

This commit is contained in:
Evan Hall 2019-04-13 17:04:49 -05:00 committed by Alex Cabal
parent 52a5e6056f
commit f361c1a552

View file

@ -118,9 +118,17 @@ catch(\Exception $ex){
<? } ?> <? } ?>
<? if($query === null && $tag === null && $collection === null){ ?> <? if($query === null && $tag === null && $collection === null){ ?>
<aside class="sort"> <aside class="sort">
<p>Sort by</p> <form action="" method="get">
<a class="button<? if($sort == SORT_NEWEST){ ?> check<? } ?>" href="/ebooks/">newest</a> <label>Sort by
<a class="button<? if($sort == SORT_AUTHOR_ALPHA){ ?> check<? } ?>" href="/ebooks/?sort=<?= SORT_AUTHOR_ALPHA ?>">alpha by author</a> <select>
<option value="<?= SORT_NEWEST ?>"<? if($sort == SORT_NEWEST){ ?> selected<? } ?>>newest</option>
<option value="<?= SORT_AUTHOR_ALPHA ?>"<? if($sort == SORT_AUTHOR_ALPHA){ ?> selected<? } ?>>author name</option>
<option value="<?= SORT_READING_EASE ?>"<? if($sort == SORT_READING_EASE){ ?> selected<? } ?>>reading ease</option>
<option value="<?= SORT_LENGTH ?>"<? if($sort == SORT_LENGTH){ ?> selected<? } ?>>length</option>
</select>
</label>
<button>Sort</button>
</form>
</aside> </aside>
<? if($page == 1){ ?> <? if($page == 1){ ?>
<?= Template::ContributeAlert() ?> <?= Template::ContributeAlert() ?>