From 85df4b3dc87003ae738f2676a99b88a83f3ac05a Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Sun, 13 Feb 2022 21:47:21 -0500 Subject: add expiry, and wsgi usage to support that The flask dev server seems incapable of using the @timer decorator, so we need the whole wsgi implementation, for which I've added a script. Arbitrary expiration options are available in the config file. --- templates/admin.html | 6 ++++-- templates/new_paste.html | 7 +++++-- templates/show_paste.html | 4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/templates/admin.html b/templates/admin.html index a815fb5..4991d7c 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -4,13 +4,15 @@

Administration for {{ appname }}

{% if pastes %} - +{##} {% for p in pastes %} - +{# #} {# magic string is from utf8icons.com #} + +
idprivatetitleuserparentchildrenActions
idprivatetitleuserpublishedexpiresparentchildrenActions
{{ p.id }}{{ p.id }}{% if p.private %}✓{% endif %}{{ p.title }} {% if p.user %}{{ p.user }}{% endif%}{{ p.pub_date.strftime('%FT%TZ') }}{% if p.exp_date != p.pub_date %}{{ p.exp_date.strftime('%FT%TZ') }}{% endif %} {% if p.parent[0] %}{{ p.parent[1] }}{% endif %} {% if p.children %}{% for c in p.children %}{% if not loop.first %},{% endif %} {{ c[1] }}{% endfor %}{% endif %} diff --git a/templates/new_paste.html b/templates/new_paste.html index 977ef22..b5a78aa 100644 --- a/templates/new_paste.html +++ b/templates/new_paste.html @@ -2,11 +2,14 @@ {% block title %}New Paste{% endblock %} {% block body %}
-

+

{%- if parent %} - Reply to {{ parent.title }} {%- endif %} - Private + + {% if exp_opts %}{% endif %}

diff --git a/templates/show_paste.html b/templates/show_paste.html index 03d57b1..e9ed02a 100644 --- a/templates/show_paste.html +++ b/templates/show_paste.html @@ -9,7 +9,9 @@

{{ paste.user.display_name }} {% endif %}
Date -
{{ paste.pub_date.strftime('%Y-%m-%dT%H:%M:%SZ') }} +
{{ paste.pub_date.strftime('%FT%TZ') }} + {% if paste.exp_date and paste.exp_date != paste.pub_date %}
Expires +
{{ paste.exp_date.strftime('%FT%TZ') }}{% endif %}
Actions
{% if not paste.is_private %} -- cgit