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('user_profile_page', 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 <a class="btn btn-primary"
27 href="{{ url_for('create_edit_package_page', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">
30 {% if show_discard and current_user.is_authenticated and topic.checkPerm(current_user, "TOPIC_DISCARD") %}
31 <a class="btn btn-{% if topic.discarded %}success{% else %}danger{% endif %} topic-discard" data-tid={{ topic.topic_id }}>
32 {% if topic.discarded %}
40 <a class="btn btn-info" href="{{ topic.link }}">{{ topic.link | domain | truncate(18) }}</a>
49 {% macro render_topics(topics, current_user, show_author=True) -%}
51 {% for topic in topics %}
52 <li{% if topic.wip %} class="wiptopic"{% endif %}>
53 <a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a>
54 {% if topic.wip %}[WIP]{% endif %}
55 {% if topic.name %}[{{ topic.name }}]{% endif %}
57 by <a href="{{ url_for('user_profile_page', username=topic.author.username) }}">{{ topic.author.display_name }}</a>
59 {% if topic.author == current_user or topic.author.checkPerm(current_user, "CHANGE_AUTHOR") %}
60 | <a href="{{ url_for('create_edit_package_page', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">Create</a>