pyfedi/app/templates/list_topics.html

40 lines
1.4 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 %} %}
2024-01-12 12:34:08 +13:00
{% from 'bootstrap5/form.html' import render_form %}
2024-02-19 15:56:56 +13:00
{% set active_child = 'list_topics' %}
2024-01-12 12:34:08 +13:00
{% block app_content %}
{% if len(topics) > 0 %}
2024-04-08 19:48:25 +12:00
{% macro render_topic(topic, depth) %}
<tr>
2024-04-08 20:01:08 +12:00
<td nowrap="nowrap">{{ '--' * depth }}
{% if depth == 0 %}<strong>{% endif %}
<a href="/topic/{{ topic['topic'].path() }}">{{ topic['topic'].name }}</a>
{% if depth == 0 %}</strong>{% endif %}
</td>
2024-04-08 19:48:25 +12:00
</tr>
{% if topic['children'] %}
{% for topic in topic['children'] %}
{{ render_topic(topic, depth + 1)|safe }}
{% endfor %}
{% endif %}
{% endmacro %}
2024-01-12 12:34:08 +13:00
<h1>{{ _('Choose a topic') }}</h1>
<div class="table-responsive-md mt-4">
<table class="communities_table table table-striped table-hover w-100">
<tbody>
{% for topic in topics %}
2024-04-08 19:48:25 +12:00
{{ render_topic(topic, 0)|safe }}
2024-01-12 12:34:08 +13:00
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p>{{ _('There are no communities yet.') }}</p>
{% endif %}
2024-01-28 18:11:32 +13:00
<p><a href="/communities" class="btn btn-primary">{{ _('Explore communities') }}</a></p>
2024-01-12 12:34:08 +13:00
{% endblock %}