Added label search and pages
This commit is contained in:
parent
78ed396c36
commit
e6b69eb7b4
7 changed files with 130 additions and 39 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
{% block content %}
|
||||
{% if archives|length > 0 %}
|
||||
<h2>Newest archives</h2>
|
||||
<div class="grid-container">
|
||||
<div class="grid-header"><b>ARCHIVE</b></div>
|
||||
<div class="grid-header"><b>SIZE</b></div>
|
||||
|
@ -18,6 +19,6 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p>No matching archives</p>
|
||||
<p>Add some archives first!</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -18,7 +18,7 @@
|
|||
<option value="size" {% if "size" == request.args.get('sort') %}selected="selected"{% endif %}>Archive Size</option>
|
||||
</select>
|
||||
<b>Category:</b>
|
||||
<select name="category">
|
||||
<select onchange="this.form.submit()" name="category">
|
||||
<option value="0">None</option>
|
||||
{% for i in categories %}
|
||||
<option value="{{i[0]}}" {% if i[0] == request.args.get('category')|int %}selected="selected"{% endif %}>{{i[1]}}</option>
|
||||
|
@ -26,7 +26,6 @@
|
|||
</select>
|
||||
<b>Count: </b><input type="number" name="count" step="1" placeholder="Number of items" {% if request.args.get('count') %}value="{{request.args.get('count')}}"{% else %} value="20"{% endif %}>
|
||||
</div>
|
||||
{# <!-- Can't get that to work
|
||||
<div class="labels-container">
|
||||
{% for ltype in res_labels %}
|
||||
<div class="flex-item"><b>{{ltype}}</b>
|
||||
|
@ -35,8 +34,7 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>-->
|
||||
#}
|
||||
</div>
|
||||
</div>
|
||||
{% if request.args.get('q') %}
|
||||
<input type="text" name="q" value="{{request.args.get('q')}}" placeholder="Keywords">
|
||||
|
@ -44,20 +42,46 @@
|
|||
<input type="text" name="q" placeholder="Keywords">
|
||||
{% endif %}
|
||||
<input type="submit" value="Search!">
|
||||
</form>
|
||||
{% if archives|length > 0 %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-header"><b>ARCHIVE</b></div>
|
||||
<div class="grid-header"><b>SIZE</b></div>
|
||||
<div class="grid-header"><b>IMPORTED</b></div>
|
||||
{% for arch in archives %}
|
||||
<a class="grid-item" href="/view/{{arch[0]}}"><div class="grid-item clickable"><b>{{arch[1]}}</b></div></a>
|
||||
<div class="grid-item"><p> {{arch[2]|spacer}} </p></div>
|
||||
<div class="grid-item"><p> {{arch[3]|ctime}} </p></div>
|
||||
|
||||
{% endfor %}
|
||||
{% if archives|length > 0 %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-header"><b>ARCHIVE</b></div>
|
||||
<div class="grid-header"><b>SIZE</b></div>
|
||||
<div class="grid-header"><b>IMPORTED</b></div>
|
||||
{% for arch in archives %}
|
||||
<a class="grid-item" href="/view/{{arch[0]}}"><div class="grid-item clickable"><b>{{arch[1]}}</b></div></a>
|
||||
<div class="grid-item"><p> {{arch[2]|spacer}} </p></div>
|
||||
<div class="grid-item"><p> {{arch[3]|ctime}} </p></div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p>No matching archives</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p>No matching archives</p>
|
||||
{% endif %}
|
||||
{% if total_count > page*count %}
|
||||
<div class="pageselect">
|
||||
<div class="align-right">
|
||||
{% if page-3 > 1 %}
|
||||
<div class="pageitem">…</div>
|
||||
{% endif %}
|
||||
{% for pagenum in range(page-3,page) %}
|
||||
{% if pagenum > 0 %}
|
||||
<input class="pagebutton" type=submit formaction="/search/{{pagenum}}" value="{{pagenum}}">
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="pageitem" id="currentpage">{{page}}</div>
|
||||
<div class="align-left">
|
||||
{% for pagenum in range(page+1,page+4) %}
|
||||
{% if (pagenum-1)*count < total_count %}
|
||||
<input class="pagebutton" type=submit formaction="/search/{{pagenum}}" value="{{pagenum}}">
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if (page+4)*count < total_count %}
|
||||
<div class="pageitem">…</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endblock %}
|
|
@ -20,6 +20,6 @@
|
|||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<img id="cover" src="/static/covers/{{archive[0]}}.webp" onerror="this.onerror=null; this.src='/static/covers/default.webp'" alt="Cover image">
|
||||
<img id="cover" src="/static/covers/custom/{{archive[0]}}.webp" onerror="this.onerror=null; this.src='/static/covers/default.webp'" alt="Cover image">
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue