File upload and persistence extension

- index.html extended with form input
- pasta.html and pastalist.html show link to /file/{pasta.id}/{filename} path
- files are saved in pasta_data folder
- all data is now stored in pasta_data/database.json
- changed pastalist.html date format to exclude year
- added custom 404 error handler
This commit is contained in:
Daniel Szabo 2022-05-02 16:53:10 +01:00
parent c98aad7256
commit 36fa6598a8
9 changed files with 371 additions and 223 deletions

View file

@ -1,4 +1,9 @@
{% include "header.html" %}
<a href="/raw/{{pasta.idAsAnimals()}}">Raw Pasta</a>
<a style="margin-right: 0.5rem" href="/raw/{{pasta.id_as_animals()}}">Raw Text Content</a>
{% if pasta.file != "no-file" %}
<a style="margin-right: 0.5rem; margin-left: 0.5rem" href="/file/{{pasta.id_as_animals()}}/{{pasta.file}}">Attached file '{{pasta.file}}'</a>
{%- endif %}
<a style="margin-right: 0.5rem; margin-left: 0.5rem" href="/remove/{{pasta.id_as_animals()}}">Remove</a>
<pre><code>{{pasta}}</code></pre>
{% include "footer.html" %}