2022-04-10 22:21:45 +00:00
|
|
|
{% include "header.html" %}
|
2022-04-11 13:41:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
{% if pastas.is_empty() %}
|
2022-05-02 15:53:10 +00:00
|
|
|
<br>
|
2022-04-11 13:41:28 +00:00
|
|
|
<p>
|
2022-10-12 15:13:21 +00:00
|
|
|
No pastas yet. 😔 Create one <a href="{{ args.public_path }}/">here</a>.
|
2022-04-11 13:41:28 +00:00
|
|
|
</p>
|
2022-05-02 15:53:10 +00:00
|
|
|
<br>
|
2022-04-11 13:41:28 +00:00
|
|
|
{%- else %}
|
2022-11-07 18:30:33 +00:00
|
|
|
<h3>Pastas</h3>
|
2022-06-03 16:24:34 +00:00
|
|
|
{% if args.pure_html %}
|
2022-11-07 18:30:33 +00:00
|
|
|
<table border="1" style="width: 100%; white-space: nowrap;">
|
2022-10-27 14:23:39 +00:00
|
|
|
{% else %}
|
|
|
|
<table style="width: 100%">
|
|
|
|
{% endif %}
|
|
|
|
<thead>
|
2022-11-07 18:30:33 +00:00
|
|
|
<th style="width: 30%">
|
|
|
|
Key
|
|
|
|
</th>
|
|
|
|
<th style="width: 20%">
|
|
|
|
Created
|
|
|
|
</th>
|
|
|
|
<th style="width: 20%">
|
|
|
|
Expiration
|
|
|
|
</th>
|
|
|
|
<th style="width: 30%">
|
|
|
|
</th>
|
2022-10-27 14:23:39 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for pasta in pastas %}
|
|
|
|
{% if pasta.pasta_type == "text" && !pasta.private %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a href="{{ args.public_path }}/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="{{ args.public_path }}/raw/{{pasta.id_as_animals()}}">Raw</a>
|
|
|
|
{% if pasta.file.is_some() %}
|
|
|
|
<a style="margin-right:1rem"
|
|
|
|
href="{{ args.public_path }}/file/{{pasta.id_as_animals()}}/{{pasta.file.as_ref().unwrap().name()}}">File</a>
|
|
|
|
{%- endif %}
|
|
|
|
{% if pasta.editable %}
|
|
|
|
<a style="margin-right:1rem" href="{{ args.public_path }}/edit/{{pasta.id_as_animals()}}">Edit</a>
|
|
|
|
{%- endif %}
|
|
|
|
<a href="{{ args.public_path }}/remove/{{pasta.id_as_animals()}}">Remove</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2022-06-03 16:24:34 +00:00
|
|
|
{%- endif %}
|
2022-10-27 14:23:39 +00:00
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<br>
|
2022-11-07 18:30:33 +00:00
|
|
|
<h3>URL Redirects</h3>
|
2022-10-27 14:23:39 +00:00
|
|
|
{% if args.pure_html %}
|
|
|
|
<table border="1" style="width: 100%">
|
|
|
|
{% else %}
|
|
|
|
<table style="width: 100%">
|
|
|
|
{% endif %}
|
|
|
|
<thead>
|
2022-11-07 18:30:33 +00:00
|
|
|
<th style="width: 30%">
|
|
|
|
Key
|
|
|
|
</th>
|
|
|
|
<th style="width: 20%">
|
|
|
|
Created
|
|
|
|
</th>
|
|
|
|
<th style="width: 20%">
|
|
|
|
Expiration
|
|
|
|
</th>
|
|
|
|
<th style="width: 30%">
|
|
|
|
</th>
|
2022-10-27 14:23:39 +00:00
|
|
|
</thead>
|
|
|
|
{% for pasta in pastas %}
|
|
|
|
{% if pasta.pasta_type == "url" && !pasta.private %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
2022-11-07 18:30:33 +00:00
|
|
|
<a href="{{ args.public_path }}/pasta/{{pasta.id_as_animals()}}">{{pasta.id_as_animals()}}</a>
|
2022-10-27 14:23:39 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{pasta.created_as_string()}}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{pasta.expiration_as_string()}}
|
|
|
|
</td>
|
|
|
|
<td>
|
2022-11-07 18:30:33 +00:00
|
|
|
<a style="margin-right:1rem" href="{{ args.public_path }}/url/{{pasta.id_as_animals()}}">Open</a>
|
2022-10-29 11:11:55 +00:00
|
|
|
<a style="margin-right:1rem; cursor: pointer;" id="copy-button"
|
2022-10-27 14:23:39 +00:00
|
|
|
data-url="{{ args.public_path }}/url/{{pasta.id_as_animals()}}">Copy</a>
|
|
|
|
{% if pasta.editable %}
|
|
|
|
<a style="margin-right:1rem" href="{{ args.public_path }}/edit/{{pasta.id_as_animals()}}">Edit</a>
|
|
|
|
{%- endif %}
|
|
|
|
<a href="{{ args.public_path }}/remove/{{pasta.id_as_animals()}}">Remove</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2022-06-03 16:24:34 +00:00
|
|
|
{%- endif %}
|
2022-10-27 14:23:39 +00:00
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<br>
|
|
|
|
{%- endif %}
|
|
|
|
|
|
|
|
<script>
|
|
|
|
// const btn = document.getElementById("copy-button")
|
|
|
|
const btn = document.querySelector("#copy-button");
|
|
|
|
btn.addEventListener("click", () => {
|
|
|
|
navigator.clipboard.writeText(btn.dataset.url)
|
|
|
|
btn.innerHTML = "Copied"
|
|
|
|
setTimeout(() => {
|
|
|
|
btn.innerHTML = "Copy"
|
|
|
|
}, 1000)
|
|
|
|
})
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{% include "footer.html" %}
|