Small QoL improvements
This commit is contained in:
parent
7b2140b52e
commit
3c79c3c688
|
@ -172,7 +172,7 @@ def searchpage():
|
||||||
## FUNCTIONS
|
## FUNCTIONS
|
||||||
|
|
||||||
def errorpage(message):
|
def errorpage(message):
|
||||||
return "<h2>ERROR: " + message + "</h2>Go back and try again"
|
return "<h2>ERROR: " + str(message) + "</h2>Go back and try again"
|
||||||
|
|
||||||
## Checks if given sesskey is valid and returns user data
|
## Checks if given sesskey is valid and returns user data
|
||||||
## OUTPUT: (if sesskey valid) logged_in:bool=True, userdata:tuple
|
## OUTPUT: (if sesskey valid) logged_in:bool=True, userdata:tuple
|
||||||
|
|
|
@ -25,7 +25,7 @@ class db:
|
||||||
ID int PRIMARY KEY AUTO_INCREMENT,
|
ID int PRIMARY KEY AUTO_INCREMENT,
|
||||||
NAME text NOT NULL,
|
NAME text NOT NULL,
|
||||||
HASH text NOT NULL UNIQUE,
|
HASH text NOT NULL UNIQUE,
|
||||||
SIZE int NOT NULL,
|
SIZE bigint NOT NULL,
|
||||||
IMPORTED int,
|
IMPORTED int,
|
||||||
CATEGORY int,
|
CATEGORY int,
|
||||||
OWNER int
|
OWNER int
|
||||||
|
|
|
@ -10,17 +10,17 @@
|
||||||
<div class="grid-selection">
|
<div class="grid-selection">
|
||||||
<b>Sort by:</b>
|
<b>Sort by:</b>
|
||||||
<select name="sort">
|
<select name="sort">
|
||||||
<option value="time">Import Time</option>
|
<option value="time" {% if "time" == request.args.get('sort') %}selected="selected"{% endif %}>Import Time</option>
|
||||||
<option value="az">A-Z</option>
|
<option value="az" {% if "az" == request.args.get('sort') %}selected="selected"{% endif %}>A-Z</option>
|
||||||
<option value="za">Z-A</option>
|
<option value="za" {% if "za" == request.args.get('sort') %}selected="selected"{% endif %}>Z-A</option>
|
||||||
<option value="size">Archive Size</option>
|
<option value="size" {% if "size" == request.args.get('sort') %}selected="selected"{% endif %}>Archive Size</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid-selection">
|
<div class="grid-selection">
|
||||||
<b>Category:</b>
|
<b>Category:</b>
|
||||||
<select name="category">
|
<select name="category">
|
||||||
{% for i in categories %}
|
{% for i in categories %}
|
||||||
<option value="{{i[0]}}">{{i[1]}}</option>
|
<option value="{{i[0]}}" {% if i[0] == request.args.get('category')|int %}selected="selected"{% endif %}>{{i[1]}}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if login and userdata[0] == archive[8] %}<a href="/delete/{{archive[0]}}"><button class="big-button"><b>Delete</b></button></a>{% endif %}<h2>{{archive[1]}}</h2>
|
{% if login and userdata[0] == archive[8] %}<a href="/delete/{{archive[0]}}"><button class="big-button"><b style="color:red;">Delete</b></button></a>{% endif %}<h2>{{archive[1]}}</h2>
|
||||||
<div class="grid-container">
|
<div class="grid-container">
|
||||||
<div class="archive-info">
|
<div class="archive-info">
|
||||||
<b>Hash: </b><span>{{archive[2]}}</span>
|
<b>Hash: </b><span>{{archive[2]}}</span>
|
||||||
<b>Owner: </b><a href="/user/{{archive[-2]}}">{{archive[-1]}}</a>
|
<b>Owner: </b><a href="/user/{{archive[-2]}}">{{archive[-1]}}</a>
|
||||||
<b>Category: </b><span>{{category[4]}}/{{category[1]}}</span>
|
<b>Category: </b><a href="/search?category={{category[0]}}"><span>{{category[4]}}/{{category[1]}}</span></a>
|
||||||
<b>Imported: </b><span>{{archive[4]|ctime}}</span>
|
<b>Imported: </b><span>{{archive[4]|ctime}}</span>
|
||||||
<b>Size: </b><span>{{archive[4]|spacer}}</span>
|
<b>Size: </b><span>{{archive[4]|spacer}}</span>
|
||||||
<b>Labels: {% if login and userdata[0] == archive[8] %}<a href="/labels/{{archive[0]}}">Edit</a>{% endif %}</b>
|
<b>Labels: {% if login and userdata[0] == archive[8] %}<a href="/labels/{{archive[0]}}">Edit</a>{% endif %}</b>
|
||||||
|
|
Loading…
Reference in a new issue