Adding archives

Added functionality to add archives.
This commit is contained in:
Michael Rodin 2023-10-19 13:25:59 +02:00
parent 978c634067
commit c3bd73a068
7 changed files with 212 additions and 61 deletions

34
flask/templates/add.html Normal file
View file

@ -0,0 +1,34 @@
{% extends "base.html" %}
{% block meta %}
<link rel="stylesheet" href="/static/add.css" />
{% endblock %}
{% block content %}
<form action="/add" method="post">
<div class="grid-container">
<div><b>Name: </b></div>
<div><input type="text" name="name" placeholder="Archive Name"></div>
<div><b>Hash: </b></div>
<div><input type="text" name="hash" placeholder="Hash"></div>
<div><b>Category: </b></div>
<div>
<select name="category">
{% for i in categories %}
<option value="{{i[0]}}">{{i[1]}}</option>
{% endfor %}
</select>
</div>
<div><b>Size: </b></div>
<div>
<input type="number" name="size" step="0.01" min="0" placeholder="Size">
<select name="size_multiplier">
{% for val,size in ((1,"B"),(1000,"KB"),(1000000,"MB"),(1000000000,"GB"),(1000000000000,"TB")) %}
<option value="{{val}}">{{size}}</option>
{% endfor %}
</select>
</div>
<input type="submit" value="Add Archive">
</div>
</form>
{% endblock %}

View file

@ -10,6 +10,7 @@
<body>
<header>
<a href="/"><img src="/static/favicon.ico" alt="favicon"></a>
<span id="title">{{title}}</span>
<div id="container">
<!-- BUTTONS IF USER LOGGED IN -->