1 {% macro render_topics_table(topics, show_author=True, show_discard=False, current_user=current_user) -%}
6 {% if show_author %}<th>Author</th>{% endif %}
11 {% for topic in topics %}
12 <tr class="{% if topic.wip %}wiptopic{% endif %}{% if topic.discarded %}discardtopic{% endif %}">
14 [{{ topic.type.value }}]
17 <a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a>
18 {% if topic.wip %}[WIP]{% endif %}
21 <td><a href="{{ url_for('users.profile', username=topic.author.username) }}">{{ topic.author.display_name}}</a></td>
23 <td>{{ topic.name or ""}}</td>
24 <td>{{ topic.created_at | date }}</td>
25 <td class="btn-group">
26 {% if current_user == topic.author or topic.author.checkPerm(current_user, "CHANGE_AUTHOR") %}
27 <a class="btn btn-primary"
28 href="{{ url_for('packages.create_edit', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">
32 {% if show_discard and current_user.is_authenticated and topic.checkPerm(current_user, "TOPIC_DISCARD") %}
33 <a class="btn btn-{% if topic.discarded %}success{% else %}danger{% endif %} topic-discard" data-tid={{ topic.topic_id }}>
34 {% if topic.discarded %}
42 <a class="btn btn-info" href="{{ topic.link }}">{{ topic.link | domain | truncate(18) }}</a>
51 {% macro render_topics(topics, current_user, show_author=True) -%}
53 {% for topic in topics %}
54 <li{% if topic.wip %} class="wiptopic"{% endif %}>
55 <a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a>
56 {% if topic.wip %}[WIP]{% endif %}
57 {% if topic.discarded %}[Old]{% endif %}
58 {% if topic.name %}[{{ topic.name }}]{% endif %}
60 by <a href="{{ url_for('users.profile', username=topic.author.username) }}">{{ topic.author.display_name }}</a>
62 {% if topic.author == current_user or topic.author.checkPerm(current_user, "CHANGE_AUTHOR") %}
63 | <a href="{{ url_for('packages.create_edit', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">Create</a>