Add create date to topic list

This commit is contained in:
rubenwardy 2018-12-24 00:11:15 +00:00
parent 50889ccca5
commit fa0506f58a
2 changed files with 9 additions and 2 deletions

View File

@ -5,7 +5,7 @@
<th>Title</th>
{% if show_author %}<th>Author</th>{% endif %}
<th>Name</th>
<th>Link</th>
<th>Date</th>
<th>Actions</th>
</tr>
{% for topic in topics %}
@ -21,7 +21,7 @@
<td><a href="{{ url_for('user_profile_page', username=topic.author.username) }}">{{ topic.author.display_name}}</a></td>
{% endif %}
<td>{{ topic.name or ""}}</td>
<td>{% if topic.link %}<a href="{{ topic.link }}">{{ topic.link | domain }}</a>{% endif %}</td>
<td>{{ topic.created_at | date }}</td>
<td class="btn-group">
<a class="btn btn-primary"
href="{{ url_for('create_edit_package_page', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">
@ -36,6 +36,9 @@
{% endif %}
</a>
{% endif %}
{% if topic.link %}
<a class="btn btn-info" href="{{ topic.link }}">{{ topic.link | domain }}</a>
{% endif %}
</td>
</tr>
{% endfor %}

View File

@ -32,6 +32,10 @@ def throw(err):
def domain(url):
return urlparse(url).netloc
@app.template_filter()
def date(value):
return value.strftime("%Y-%m-%d")
@app.template_filter()
def datetime(value):
return value.strftime("%Y-%m-%d %H:%M") + " UTC"