mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
In terms of performance, most queries on this page win over PHP in query times, with the exception of sorting by Voted or Notify (https://gitlab.archlinux.org/archlinux/aurweb/-/issues/102). Otherwise, there are a few modifications: described below. * Pagination * The `paginate` Python module has been used in the FastAPI project here to implement paging on the packages search page. This changes how pagination is displayed, however it serves the same purpose. We'll take advantage of this module in other places as well. * Form action * The form action for actions now use `POST /packages` to perform. This is currently implemented and will be addressed in a follow-up commit. * Input names and values * Input names and values have been modified to satisfy the snake_case naming convention we'd like to use as much as possible. * Some input names and values were modified to comply with FastAPI Forms: (IDs[<id>]) -> (IDs, <id>). Signed-off-by: Kevin Morris <kevr@0cost.org>
73 lines
4.3 KiB
HTML
73 lines
4.3 KiB
HTML
<div id="pkglist-search" class="box filter-criteria">
|
|
<h2>{% trans %}Search Criteria{% endtrans %}</h2>
|
|
<form action='/packages/' method='get'>
|
|
<p><input type='hidden' name='O' value='0'/></p>
|
|
|
|
<fieldset>
|
|
<legend>{{ "Enter search criteria" | tr }}</legend>
|
|
<div>
|
|
<label for="id_method">{{ "Search by" | tr }}</label>
|
|
<select name='SeB'>
|
|
<option value="nd" {% if SeB == "nd" %}selected{% endif %}>{{ "Name, Description" | tr }}</option>
|
|
<option value="n" {% if SeB == "n" %}selected{% endif %}>{{ "Name Only" | tr }}</option>
|
|
<option value="b" {% if SeB == "b" %}selected{% endif%}>{{ "Package Base" | tr }}</option>
|
|
<option value="N" {% if SeB == "N" %}selected{% endif %}>{{ "Exact Name" | tr }}</option>
|
|
<option value="B" {% if SeB == "B" %}selected{% endif %}>{{ "Exact Package Base" | tr }}</option>
|
|
<option value="k" {% if SeB == "k" %}selected{% endif %}>{{ "Keywords" | tr }}</option>
|
|
<option value="m" {% if SeB == "m" %}selected{% endif %}>{{ "Maintainer" | tr }}</option>
|
|
<option value="c" {% if SeB == "c" %}selected{% endif %}>{{ "Co-maintainer" | tr }}</option>
|
|
<option value="M" {% if SeB == "M" %}selected{% endif %}>{{ "Maintainer, Co-maintainer" | tr }}</option>
|
|
<option value="s" {% if SeB == "s" %}selected{% endif %}>{{ "Submitter" | tr }}</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="id_q">{{ "Keywords" | tr }}</label>
|
|
<input type='text' name='K' size='30' value="{{ K or '' }}" maxlength='35'/>
|
|
</div>
|
|
<div>
|
|
<label for="id_out_of_date">{{ "Out of Date" | tr }}</label>
|
|
<select name='outdated'>
|
|
<option value=''>{{ "All" | tr }}</option>
|
|
<option value='on' {% if outdated == "on" %}selected{% endif %}>{{ "Flagged" | tr }}</option>
|
|
<option value='off' {% if outdated == "off" %}selected{% endif %}>{{ "Not Flagged" | tr }}</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="id_sort_by">{{ "Sort by" | tr }}</label>
|
|
<select name='SB'>
|
|
<option value='n' {% if SB == "n" %}selected{% endif %}>{{ "Name" | tr }}</option>
|
|
<option value='v' {% if SB == "v" %}selected{% endif %}>{{ "Votes" | tr }}</option>
|
|
<option value='p' {% if SB == "p" %}selected{% endif %}>{{ "Popularity" | tr }}</option>
|
|
<option value='w' {% if SB == "w" %}selected{% endif %}>{{ "Voted" | tr }}</option>
|
|
<option value='o' {% if SB == "o" %}selected{% endif %}>{{ "Notify" | tr }}</option>
|
|
<option value='m' {% if SB == "m" %}selected{% endif %}>{{ "Maintainer" | tr }}</option>
|
|
<option value='l' {% if SB == "l" %}selected{% endif %}>{{ "Last modified" | tr }}</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="id_order_by">{{ "Sort order" | tr }}</label>
|
|
<select name='SO'>
|
|
<option value='a' {% if SO == "a" %}selected{% endif %}>{{ "Ascending" | tr }}</option>
|
|
<option value='d' {% if SO == "d" %}selected{% endif %}>{{ "Descending" | tr }}</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label for="id_per_page">{{ "Per page" | tr }}</label>
|
|
<select name='PP'>
|
|
<option value="50" {% if PP == 50 %}selected{% endif %}>50</option>
|
|
<option value="100" {% if PP == 100 %}selected{% endif %}>100</option>
|
|
<option value="250" {% if PP == 250 %}selected{% endif %}>250</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label> </label>
|
|
<button type='submit' class='button' name='submit' value='Go'>
|
|
{{ "Go" | tr }}
|
|
</button>
|
|
<button type='submit' class='button' name='submit' value='Orphans'>
|
|
{{ "Orphans" | tr }}
|
|
</button>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|