mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
nicer topic list layout
This commit is contained in:
parent
77e06b6a50
commit
d40cdf08cc
3 changed files with 36 additions and 19 deletions
|
@ -551,6 +551,15 @@ fieldset legend {
|
|||
display: inline-block;
|
||||
}
|
||||
|
||||
.topics_list {
|
||||
list-style-type: none;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
|
||||
}
|
||||
.topics_list > li {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.community_header {
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
|
|
|
@ -123,6 +123,16 @@ html {
|
|||
}
|
||||
}
|
||||
|
||||
.topics_list {
|
||||
list-style-type: none;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit,minmax(132px, 1fr));
|
||||
|
||||
> li {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.community_header {
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
|
|
|
@ -9,28 +9,26 @@
|
|||
{% block app_content %}
|
||||
{% if len(topics) > 0 %}
|
||||
{% macro render_topic(topic, depth) %}
|
||||
<tr>
|
||||
<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>
|
||||
</tr>
|
||||
{% if topic['children'] %}
|
||||
{% for topic in topic['children'] %}
|
||||
{{ render_topic(topic, depth + 1)|safe }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<li>
|
||||
{% if depth == 0 %}<strong>{% endif %}
|
||||
<a href="/topic/{{ topic['topic'].path() }}">{{ topic['topic'].name }}</a>
|
||||
{% if depth == 0 %}</strong>{% endif %}
|
||||
{% if topic['children'] %}
|
||||
<ul>
|
||||
{% for topic in topic['children'] %}
|
||||
{{ render_topic(topic, depth + 1)|safe }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endmacro %}
|
||||
<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 %}
|
||||
{{ render_topic(topic, 0)|safe }}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<ul class="topics_list">
|
||||
{% for topic in topics %}
|
||||
{{ render_topic(topic, 0)|safe }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% else %}
|
||||
<p>{{ _('There are no communities yet.') }}</p>
|
||||
|
|
Loading…
Add table
Reference in a new issue