changeset 119:b085ede4d9af

forum/overview: forum template first draft.
author Goffi <goffi@goffi.org>
date Tue, 30 Jan 2018 07:48:50 +0100 (2018-01-30)
parents c744170fd597
children 5f4e147e9895
files default/components/common.html default/forum/overview.html
diffstat 2 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/default/components/common.html	Tue Jan 30 07:47:29 2018 +0100
+++ b/default/components/common.html	Tue Jan 30 07:48:50 2018 +0100
@@ -2,6 +2,7 @@
 {% set ml = {
     'login': _('Session') if profile else _('Log in'),
     'blog_view': _('Blog'),
+    'forums': _('Forums'),
     'merge-requests_list': _('Merge requests'),
     'merge-request_new': _('Create new merge request'),
     'tickets_list': _('Tickets'),
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/default/forum/overview.html	Tue Jan 30 07:48:50 2018 +0100
@@ -0,0 +1,30 @@
+{% extends 'base/base.html' %}
+
+{% macro generate_forums(forums_data) %}
+    <ul class="forum">
+    {% for forum in forums_data %}
+        <li>
+            {% if 'http_url' in forum %}
+                <a href="{{forum['http_url']}}" class="forum_actif">
+            {% else %}
+                <a>
+            {% endif %}
+                <span class="forum_title">{{ forum.title }}</span>
+                {% if 'short-desc' in forum %}
+                    <p class="forum_short-desc">{{ forum['short-desc'] }}</p>
+                {% endif %}
+            </a>
+
+            {% if 'sub-forums' in forum %}
+                {{ generate_forums(forum['sub-forums']) }}
+            {% endif %}
+        </li>
+    {% endfor %}
+    </ul>
+{% endmacro %}
+
+{% block body %}
+<div id="forums">
+    {{ generate_forums(forums) }}
+</div>
+{% endblock body %}