2018-08-25 19:20:45 +02:00
|
|
|
{% macro render_topics_table(topics, show_author=True) -%}
|
2018-06-06 00:45:15 +02:00
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th>Id</th>
|
2018-07-07 00:15:56 +02:00
|
|
|
<th></th>
|
2018-06-06 00:45:15 +02:00
|
|
|
<th>Title</th>
|
|
|
|
{% if show_author %}<th>Author</th>{% endif %}
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Link</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
{% for topic in topics %}
|
2018-07-07 00:15:56 +02:00
|
|
|
<tr{% if topic.wip %} class="wiptopic"{% endif %}>
|
2018-06-06 00:45:15 +02:00
|
|
|
<td>{{ topic.topic_id }}</td>
|
2018-07-07 00:15:56 +02:00
|
|
|
<td>
|
|
|
|
[{{ topic.type.value }}]
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a>
|
|
|
|
{% if topic.wip %}[WIP]{% endif %}
|
|
|
|
</td>
|
2018-06-06 00:45:15 +02:00
|
|
|
{% if show_author %}
|
|
|
|
<td><a href="{{ url_for('user_profile_page', username=topic.author.username) }}">{{ topic.author.display_name}}</a></td>
|
|
|
|
{% endif %}
|
|
|
|
<td>{{ topic.name or ""}}</td>
|
2018-07-04 01:14:37 +02:00
|
|
|
<td>{% if topic.link %}<a href="{{ topic.link }}">{{ topic.link | domain }}</a>{% endif %}</td>
|
2018-06-06 00:45:15 +02:00
|
|
|
<td>
|
2018-06-06 00:51:40 +02:00
|
|
|
<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>
|
2018-06-06 00:45:15 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
{% endmacro %}
|
2018-08-25 19:20:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
{% macro render_topics(topics, current_user, show_author=True) -%}
|
|
|
|
<ul>
|
|
|
|
{% for topic in topics %}
|
|
|
|
<li{% if topic.wip %} class="wiptopic"{% endif %}>
|
|
|
|
<a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a>
|
|
|
|
{% if topic.wip %}[WIP]{% endif %}
|
|
|
|
{% if topic.name %}[{{ topic.name }}]{% endif %}
|
|
|
|
{% if show_author %}
|
|
|
|
by <a href="{{ url_for('user_profile_page', username=topic.author.username) }}">{{ topic.author.display_name }}</a>
|
|
|
|
{% endif %}
|
2018-08-25 20:10:11 +02:00
|
|
|
{% if topic.author.checkPerm(current_user, "CHANGE_AUTHOR") %}
|
|
|
|
| <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>
|
2018-08-25 19:20:45 +02:00
|
|
|
{% endif %}
|
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endmacro %}
|