aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-02-13 21:47:21 -0500
committerB. Stack <bgstack15@gmail.com>2022-02-13 21:54:20 -0500
commit85df4b3dc87003ae738f2676a99b88a83f3ac05a (patch)
tree15b892a06b81451d83f73cf0f8822c9bf262c4af /templates
parentadd redirects after delete, and simplify css calls (diff)
downloadstackbin-85df4b3dc87003ae738f2676a99b88a83f3ac05a.tar.gz
stackbin-85df4b3dc87003ae738f2676a99b88a83f3ac05a.tar.bz2
stackbin-85df4b3dc87003ae738f2676a99b88a83f3ac05a.zip
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.
Diffstat (limited to 'templates')
-rw-r--r--templates/admin.html6
-rw-r--r--templates/new_paste.html7
-rw-r--r--templates/show_paste.html4
3 files changed, 12 insertions, 5 deletions
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 @@
<h1>Administration for {{ appname }}</h1>
{% if pastes %}
<table>
-<tr><th>id</th><th>private</th><th>title</th><th>user</th><th>parent</th><th>children</th><th>Actions</th></tr>
+<tr>{#<th>id</th>#}<th>private</th><th>title</th><th>user</th><th>published</th><th>expires</th><th>parent</th><th>children</th><th>Actions</th></tr>
{% for p in pastes %}
<tr>
-<td>{{ p.id }}</td>
+{# <td>{{ p.id }}</td> #}
<td>{% if p.private %}&#10003;{% endif %}</td>{# magic string is from utf8icons.com #}
<td><a href="{% if not p.private %}{{ url_for('show_paste', paste_id=p.id) }}{% else %}{{ url_for('show_paste', paste_id=p.id, s=p.private) }}{% endif %}">{{ p.title }}</a></td>
<td>{% if p.user %}{{ p.user }}{% endif%}</td>
+<td>{{ p.pub_date.strftime('%FT%TZ') }}</td>
+<td>{% if p.exp_date != p.pub_date %}{{ p.exp_date.strftime('%FT%TZ') }}{% endif %}</td>
<td>{% if p.parent[0] %}<a href="{{ url_for('show_paste', paste_id=p.parent[0]) }}">{{ p.parent[1] }}</a>{% endif %}</td>
<td>{% if p.children %}{% for c in p.children %}{% if not loop.first %},{% endif %}
<a href="{{ url_for('show_paste', paste_id=c[0]) }}">{{ c[1] }}</a>{% 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 %}
<form action="" method=post>
- <h2><div class="pastetitle"><textarea rows="1" name="pastetitle">Enter title here</textarea></div>
+ <h2><div class="pastetitle"><textarea rows="1" name="pastetitle" placeholder="Untitled paste"></textarea></div>
{%- if parent %}
- Reply to {{ parent.title }}
{%- endif %}
- <span class="chk-private"><input name="is_private" type="checkbox"/>Private</span>
+ <span class="chk-private"><input name="is_private" id="is_private" type="checkbox"/><label for="is_private">Private</label></span>
+ {% if exp_opts %}<span class="drop-expiration"><label for="exp">Expires:</label><select name="exp" id="exp">
+ {% for o in exp_opts %}<option value="{{ o }}">{{ o }}</option>{% endfor %}
+ </select></span>{% endif %}
</h2>
<div class=code><textarea name=code cols=60 rows=12>{{ parent.code }}</textarea></div>
<p><input type=submit value="New Paste">
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 @@
<dd>{{ paste.user.display_name }}
{% endif %}
<dt>Date
- <dd>{{ paste.pub_date.strftime('%Y-%m-%dT%H:%M:%SZ') }}
+ <dd>{{ paste.pub_date.strftime('%FT%TZ') }}
+ {% if paste.exp_date and paste.exp_date != paste.pub_date %}<dt>Expires
+ <dd>{{ paste.exp_date.strftime('%FT%TZ') }}{% endif %}
<dt>Actions
<dd>
{% if not paste.is_private %}
bgstack15