pyfedi/app/templates/list_topics.html

39 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 -%} -%}
{% from 'bootstrap5/form.html' import render_form -%}
{% set active_child = 'list_topics' -%}
2024-01-12 12:34:08 +13:00
{% block app_content -%}
{% if len(topics) > 0 -%}
{% macro render_topic(topic, depth) -%}
2024-05-24 17:29:25 +12:00
<li>
{% if depth == 0 -%}<strong>{% endif -%}
2024-05-24 17:29:25 +12:00
<a href="/topic/{{ topic['topic'].path() }}">{{ topic['topic'].name }}</a>
{% if depth == 0 -%}</strong>{% endif -%}
{% if topic['children'] -%}
2024-05-24 17:29:25 +12:00
<ul>
{% for topic in topic['children'] -%}
2024-05-24 17:29:25 +12:00
{{ render_topic(topic, depth + 1)|safe }}
{% endfor -%}
2024-05-24 17:29:25 +12:00
</ul>
{% endif -%}
2024-05-24 17:29:25 +12:00
</li>
{% endmacro -%}
2024-01-12 12:34:08 +13:00
<h1>{{ _('Choose a topic') }}</h1>
<div class="table-responsive-md mt-4">
2024-05-24 17:29:25 +12:00
<ul class="topics_list">
{% for topic in topics -%}
2024-05-24 17:29:25 +12:00
{{ render_topic(topic, 0)|safe }}
{% endfor -%}
2024-05-24 17:29:25 +12:00
</ul>
2024-01-12 12:34:08 +13:00
</div>
{% else -%}
2024-01-12 12:34:08 +13:00
<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>
<p><a href="/suggest-topics" class="btn btn-primary">{{ _('Suggest A Topic') }}</a></p>
{% endblock -%}