pyfedi/app/templates/admin/topics.html

51 lines
1.7 KiB
HTML
Raw Normal View History

{% if theme() and file_exists('app/templates/themes/' + theme() + '/base.html') %}
{% extends 'themes/' + theme() + '/base.html' %}
{% else %}
{% extends "base.html" %}
{% endif %} %}
{% from 'bootstrap/form.html' import render_form %}
2024-04-14 20:05:40 +12:00
{% set active_child = 'admin_topics' %}
{% 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 %}
<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>
<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 }}
{% 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 />
{% endblock %}