comparison sat_templates/default/forum/overview.html @ 149:e5ec33c4a8a8

forum/overview.html: classes modification + better global design
author Goffi <goffi@goffi.org>
date Sun, 03 Jun 2018 18:01:32 +0200
parents 33c7ce833d3f
children
comparison
equal deleted inserted replaced
148:a4b6b8b6fc58 149:e5ec33c4a8a8
1 {% extends 'base/base.html' %} 1 {% extends 'base/base.html' %}
2 2
3 {% macro generate_forums(forums_data) %} 3 {% macro generate_forums(forums_data, level=0) %}
4 <ul class="forum"> 4 {% set panel_type = "main" if level==0 else "sub" %}
5 <ul class="forum forum__panel_{{panel_type}}">
5 {% for forum in forums_data %} 6 {% for forum in forums_data %}
6 <li> 7 <li class="forum forum__cat_{{panel_type}} forum__level_{{level}}">
7 {% if 'http_url' in forum %} 8 {% if 'http_url' in forum %}
8 <a href="{{forum['http_url']}}" class="forum_actif"> 9 <a href="{{forum['http_url']}}" class="forum_active">
9 {% else %} 10 {% else %}
10 <a> 11 <a>
11 {% endif %} 12 {% endif %}
12 <span class="forum_title">{{ forum.title }}</span> 13 <span class="forum_title">{{ forum.title }}</span>
13 {% if 'short-desc' in forum %} 14 {% if 'short-desc' in forum %}
14 <p class="forum_short-desc">{{ forum['short-desc'] }}</p> 15 <p class="forum_short-desc">{{ forum['short-desc'] }}</p>
15 {% endif %} 16 {% endif %}
16 </a> 17 </a>
17 18
18 {% if 'sub-forums' in forum %} 19 {% if 'sub-forums' in forum %}
19 {{ generate_forums(forum['sub-forums']) }} 20 {{ generate_forums(forum['sub-forums'], level=level+1) }}
20 {% endif %} 21 {% endif %}
21 </li> 22 </li>
22 {% endfor %} 23 {% endfor %}
23 </ul> 24 </ul>
24 {% endmacro %} 25 {% endmacro %}
25 26
26 {% block body %} 27 {% block body %}
27 {% if not forums %} 28 {% if not forums %}
28 <p class="message--info">{% trans %}No forums found on this server!{% endtrans %}</p> 29 <p class="message--info">{% trans %}No forums found on this server!{% endtrans %}</p>
29 {% else %} 30 {% else %}
30 <div id="forums"> 31 <div class="forums">
31 {{ generate_forums(forums) }} 32 {{ generate_forums(forums) }}
32 </div> 33 </div>
33 {% endif %} 34 {% endif %}
34 {% endblock body %} 35 {% endblock body %}