Func
This commit is contained in:
21 files changed
+590
-70
No files matched your search
@@ -0,0 +1,52 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Your pastes · Pastable{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Your pastes and short links</h1>
|
||||
<div class="table-scroll">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Type</th>
|
||||
<th scope="col">Content</th>
|
||||
<th scope="col">Language</th>
|
||||
<th scope="col">Views / limit</th>
|
||||
<th scope="col">Created at</th>
|
||||
<th scope="col">Updated at</th>
|
||||
<th scope="col">Expires at</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for note in notes %}
|
||||
<tr>
|
||||
{% match note.paste_type %}
|
||||
{% when PasteType::TextV1 %}
|
||||
<td><a href="/{{ note.id|urlencode_strict }}">{{ note.id }}</a></td>
|
||||
<td>Paste</td>
|
||||
{% when PasteType::UrlV1 %}
|
||||
<td><a href="/to/{{ note.id|urlencode_strict }}">{{ note.id }}</a></td>
|
||||
<td>URL</td>
|
||||
{% endmatch %}
|
||||
<td><pre><code>{{ note.content }}</code></pre></td>
|
||||
<td>{% match note.language %}{% when Some with (language) %}{{ language }}{% when None %}—{% endmatch %}</td>
|
||||
<td>{{ note.views }} / {% match note.max_views %}{% when Some with (max) %}{{ max }}{% when None %}∞{% endmatch %}</td>
|
||||
<td><time data-unix="{{ note.created_at }}">{{ note.created_at }}</time></td>
|
||||
<td>{% match note.updated_at %}{% when Some with (updated) %}<time data-unix="{{ updated }}">{{ updated }}</time>{% when None %}—{% endmatch %}</td>
|
||||
<td>{% match note.expiration %}{% when Some with (expiration) %}<time data-unix="{{ expiration }}">{{ expiration }}</time>{% when None %}Never{% endmatch %}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="8">No pastes or short links yet.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script>
|
||||
document.querySelectorAll('time[data-unix]').forEach(time => {
|
||||
const date = new Date(Number(time.dataset.unix) * 1000);
|
||||
if (!Number.isNaN(date.getTime())) {
|
||||
time.dateTime = date.toISOString();
|
||||
time.textContent = date.toLocaleString();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user