Mercurial > libervia-templates
annotate sat_templates/templates/default/forum/overview.html @ 166:178f55b825b7
small refactoring/redesign, better BEM integration:
- blog has been redesigned, and almost all blog CSS has been made generic and moved to main styles.css file.
- better noscript handling, dynamic elements are created using "magic" classes (dom_update.js)
- using better icons for older/newer messages
- better state handling, classes now use "state_XXX"
- more classes now use BEM convention
- menu labels have been moved to a separate template (components/menu_labels.html), so it can be overriden easily by other sites
- better styles.css organisation
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 03 Oct 2018 21:00:24 +0200 |
parents | e9f0a4215e46 |
children |
rev | line source |
---|---|
119
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1 {% extends 'base/base.html' %} |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
2 |
149
e5ec33c4a8a8
forum/overview.html: classes modification + better global design
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
3 {% macro generate_forums(forums_data, level=0) %} |
e5ec33c4a8a8
forum/overview.html: classes modification + better global design
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
4 {% set panel_type = "main" if level==0 else "sub" %} |
e5ec33c4a8a8
forum/overview.html: classes modification + better global design
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
5 <ul class="forum forum__panel_{{panel_type}}"> |
119
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
6 {% for forum in forums_data %} |
149
e5ec33c4a8a8
forum/overview.html: classes modification + better global design
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
7 <li class="forum forum__cat_{{panel_type}} forum__level_{{level}}"> |
119
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
8 {% if 'http_url' in forum %} |
149
e5ec33c4a8a8
forum/overview.html: classes modification + better global design
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
9 <a href="{{forum['http_url']}}" class="forum_active"> |
119
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
10 {% else %} |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
11 <a> |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
12 {% endif %} |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
13 <span class="forum_title">{{ forum.title }}</span> |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
14 {% if 'short-desc' in forum %} |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
15 <p class="forum_short-desc">{{ forum['short-desc'] }}</p> |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
16 {% endif %} |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
17 </a> |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
18 |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
19 {% if 'sub-forums' in forum %} |
149
e5ec33c4a8a8
forum/overview.html: classes modification + better global design
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
20 {{ generate_forums(forum['sub-forums'], level=level+1) }} |
119
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
21 {% endif %} |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
22 </li> |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
23 {% endfor %} |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
24 </ul> |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
25 {% endmacro %} |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
26 |
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
27 {% block body %} |
137
efbf5423d7be
forum(overview): display a message if no forums are available on the server
Goffi <goffi@goffi.org>
parents:
119
diff
changeset
|
28 {% if not forums %} |
efbf5423d7be
forum(overview): display a message if no forums are available on the server
Goffi <goffi@goffi.org>
parents:
119
diff
changeset
|
29 <p class="message--info">{% trans %}No forums found on this server!{% endtrans %}</p> |
efbf5423d7be
forum(overview): display a message if no forums are available on the server
Goffi <goffi@goffi.org>
parents:
119
diff
changeset
|
30 {% else %} |
149
e5ec33c4a8a8
forum/overview.html: classes modification + better global design
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
31 <div class="forums"> |
137
efbf5423d7be
forum(overview): display a message if no forums are available on the server
Goffi <goffi@goffi.org>
parents:
119
diff
changeset
|
32 {{ generate_forums(forums) }} |
efbf5423d7be
forum(overview): display a message if no forums are available on the server
Goffi <goffi@goffi.org>
parents:
119
diff
changeset
|
33 </div> |
efbf5423d7be
forum(overview): display a message if no forums are available on the server
Goffi <goffi@goffi.org>
parents:
119
diff
changeset
|
34 {% endif %} |
119
b085ede4d9af
forum/overview: forum template first draft.
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
35 {% endblock body %} |