2024-02-07 17:31:12 +13:00
|
|
|
{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') %}
|
|
|
|
{% extends 'themes/' + theme() + '/base.html' %}
|
|
|
|
{% else %}
|
|
|
|
{% extends "base.html" %}
|
2024-12-10 12:16:52 +01:00
|
|
|
{% endif %}
|
2024-01-04 16:00:19 +13:00
|
|
|
{% from 'bootstrap/form.html' import render_form %}
|
2024-04-14 20:05:40 +12:00
|
|
|
{% set active_child = 'admin_topics' %}
|
2024-01-04 16:00:19 +13:00
|
|
|
|
|
|
|
{% block app_content %}
|
2024-03-04 12:13:14 +13:00
|
|
|
{% macro render_topic(topic, depth) %}
|
|
|
|
<tr>
|
2024-06-29 19:43:09 +02:00
|
|
|
<td nowrap="nowrap">{{ '--' * depth }} <a href="/topic/{{ topic['topic'].path() }}">{{ topic['topic'].name }}</a></td>
|
2024-03-04 12:13:14 +13:00
|
|
|
<td>{{ topic['topic'].num_communities }}</td>
|
|
|
|
<td><a href="{{ url_for('admin.admin_topic_edit', topic_id=topic['topic'].id) }}">Edit</a> |
|
|
|
|
{% if topic['topic'].num_communities == 0 %}
|
|
|
|
<a href="{{ url_for('admin.admin_topic_delete', topic_id=topic['topic'].id) }}" class="confirm_first">Delete</a>
|
|
|
|
{% else %}
|
|
|
|
Delete
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% if topic['children'] %}
|
|
|
|
{% for topic in topic['children'] %}
|
|
|
|
{{ render_topic(topic, depth + 1)|safe }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
2024-01-04 16:00:19 +13:00
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
2024-04-14 20:05:40 +12:00
|
|
|
<h1><a href="{{ url_for('admin.admin_topic_add') }}" class="btn btn-primary" style="float: right;">{{ _('Add topic') }}</a>{{ _('Topics') }}</h1>
|
2024-01-04 16:00:19 +13:00
|
|
|
<table class="table table-striped">
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th># Communities</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
{% for topic in topics %}
|
2024-03-04 12:13:14 +13:00
|
|
|
{{ render_topic(topic, 0)|safe }}
|
2024-01-04 16:00:19 +13:00
|
|
|
{% endfor %}
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-04-14 20:05:40 +12:00
|
|
|
<hr />
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
{% include 'admin/_nav.html' %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr />
|
2024-01-04 16:00:19 +13:00
|
|
|
{% endblock %}
|