mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 07:40:39 -04:00
For different reasons, setting multiple="multiple" on <select> tags doesn't work on Kobo and Kindle browsers. On Kobo: * the <option> tags don't appear * the <option> tags in other <select> tags also don't appear * the labels on the other form elements get offset On Kindle: * the full set of <option> tags don't appear, and the <select> won't scroll to show them
47 lines
2.1 KiB
PHP
47 lines
2.1 KiB
PHP
<?
|
|
$allSelected = sizeof($tags) == 0 || in_array('all', $tags);
|
|
?>
|
|
<form action="/ebooks" method="get" rel="search">
|
|
<label class="tags">Subjects
|
|
<select <? if(!Template::IsEreaderBrowser()){ ?> multiple="multiple"<? } ?> name="tags[]" size="1">
|
|
<option value="all">All</option>
|
|
<? foreach(Library::GetTags() as $tag){ ?>
|
|
<option value="<?= $tag->UrlName ?>"<? if(!$allSelected && in_array($tag->UrlName, $tags)){ ?> selected="selected"<? } ?>><?= Formatter::ToPlainText($tag->Name) ?></option>
|
|
<? } ?>
|
|
</select>
|
|
</label>
|
|
<label class="search">Keywords
|
|
<input type="search" name="query" value="<?= Formatter::ToPlainText($query ?? '') ?>"/>
|
|
</label>
|
|
<label class="select sort">
|
|
<span>Sort</span>
|
|
<span>
|
|
<select name="sort">
|
|
<option value="<?= SORT_NEWEST ?>"<? if($sort == SORT_NEWEST){ ?> selected="selected"<? } ?>>S.E. release date (new → old)</option>
|
|
<option value="<?= SORT_AUTHOR_ALPHA ?>"<? if($sort == SORT_AUTHOR_ALPHA){ ?> selected="selected"<? } ?>>Author name (a → z)</option>
|
|
<option value="<?= SORT_READING_EASE ?>"<? if($sort == SORT_READING_EASE){ ?> selected="selected"<? } ?>>Reading ease (easy → hard)</option>
|
|
<option value="<?= SORT_LENGTH ?>"<? if($sort == SORT_LENGTH){ ?> selected="selected"<? } ?>>Length (short → long)</option>
|
|
</select>
|
|
</span>
|
|
</label>
|
|
<label class="select view">
|
|
<span>View</span>
|
|
<span>
|
|
<select name="view">
|
|
<option value="<?= VIEW_GRID ?>"<? if($view == VIEW_GRID){ ?> selected="selected"<? } ?>>Grid</option>
|
|
<option value="<?= VIEW_LIST ?>"<? if($view == VIEW_LIST){ ?> selected="selected"<? } ?>>List</option>
|
|
</select>
|
|
</span>
|
|
</label>
|
|
<label class="select per-page">
|
|
<span>Per page</span>
|
|
<span>
|
|
<select name="per-page">
|
|
<option value="12"<? if($perPage == 12){ ?> selected="selected"<? } ?>>12</option>
|
|
<option value="24"<? if($perPage == 24){ ?> selected="selected"<? } ?>>24</option>
|
|
<option value="48"<? if($perPage == 48){ ?> selected="selected"<? } ?>>48</option>
|
|
</select>
|
|
</span>
|
|
</label>
|
|
<button>Filter</button>
|
|
</form>
|