Small QoL improvements

This commit is contained in:
Michael Rodin 2023-10-20 13:13:22 +02:00
parent 7b2140b52e
commit 3c79c3c688
4 changed files with 9 additions and 9 deletions

View file

@ -172,7 +172,7 @@ def searchpage():
## FUNCTIONS
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
## OUTPUT: (if sesskey valid) logged_in:bool=True, userdata:tuple

View file

@ -25,7 +25,7 @@ class db:
ID int PRIMARY KEY AUTO_INCREMENT,
NAME text NOT NULL,
HASH text NOT NULL UNIQUE,
SIZE int NOT NULL,
SIZE bigint NOT NULL,
IMPORTED int,
CATEGORY int,
OWNER int

View file

@ -10,17 +10,17 @@
<div class="grid-selection">
<b>Sort by:</b>
<select name="sort">
<option value="time">Import Time</option>
<option value="az">A-Z</option>
<option value="za">Z-A</option>
<option value="size">Archive Size</option>
<option value="time" {% if "time" == request.args.get('sort') %}selected="selected"{% endif %}>Import Time</option>
<option value="az" {% if "az" == request.args.get('sort') %}selected="selected"{% endif %}>A-Z</option>
<option value="za" {% if "za" == request.args.get('sort') %}selected="selected"{% endif %}>Z-A</option>
<option value="size" {% if "size" == request.args.get('sort') %}selected="selected"{% endif %}>Archive Size</option>
</select>
</div>
<div class="grid-selection">
<b>Category:</b>
<select name="category">
{% 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 %}
</select>
</div>

View file

@ -5,12 +5,12 @@
{% endblock %}
{% 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="archive-info">
<b>Hash: </b><span>{{archive[2]}}</span>
<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>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>