karton/templates/pastalist.html
Daniel Szabo 36fa6598a8 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
2022-05-02 16:53:10 +01:00

101 lines
1.9 KiB
HTML

{% include "header.html" %}
{% if pastas.is_empty() %}
<br>
<p>
No pastas yet. 😔 Create one <a href="/">here</a>.
</p>
<br>
{%- else %}
<br>
<table style="width: 100%">
<thead>
<tr>
<th colspan="4">Pastas</th>
</tr>
<tr>
<th>
Key
</th>
<th>
Created
</th>
<th>
Expiration
</th>
<th>
</th>
</tr>
</thead>
<tbody>
{% for pasta in pastas %}
{% if pasta.pasta_type == "text" %}
<tr>
<td>
<a href="/pasta/{{pasta.id_as_animals()}}">{{pasta.id_as_animals()}}</a>
</td>
<td>
{{pasta.created_as_string()}}
</td>
<td>
{{pasta.expiration_as_string()}}
</td>
<td>
<a style="margin-right:1rem" href="/raw/{{pasta.id_as_animals()}}">Raw</a>
{% if pasta.file != "no-file" %}
<a style="margin-right:1rem" href="/file/{{pasta.id_as_animals()}}/{{pasta.file}}">File</a>
{%- endif %}
<a href="/remove/{{pasta.id_as_animals()}}">Remove</a>
</td>
</tr>
{%- endif %}
{% endfor %}
</tbody>
</table>
<br>
<table>
<thead>
<tr>
<th colspan="4">URL Redirects</th>
</tr>
<tr >
<th>
Key
</th>
<th>
Created
</th>
<th>
Expiration
</th>
<th>
</th>
</tr>
</thead>
{% for pasta in pastas %}
{% if pasta.pasta_type == "url" %}
<tr>
<td>
<a href="/url/{{pasta.id_as_animals()}}">{{pasta.id_as_animals()}}</a>
</td>
<td>
{{pasta.created_as_string()}}
</td>
<td>
{{pasta.expiration_as_string()}}
</td>
<td>
<a style="margin-right:1rem" href="/raw/{{pasta.id_as_animals()}}">Raw</a>
<a href="/remove/{{pasta.id_as_animals()}}">Remove</a>
</td>
</tr>
{%- endif %}
{% endfor %}
</tbody>
</table>
<br>
{%- endif %}
{% include "footer.html" %}