view templates/sat_website/menu.html @ 27:eda4deefecd1

reorganisation of the menu using submenus
author souliane <souliane@mailoo.org>
date Wed, 21 Jan 2015 20:07:20 +0100
parents
children 30a1edf90fae
line wrap: on
line source

{% comment %}
SàT website: Salut à Toi's presentation website
Copyright (C) 2012  Jérôme Poisson (goffi@goffi.org)

This file is part of SàT website.

SàT website is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Foobar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}

{% load utils %}

<ul class="{{ style }}">
    {% for cat_url, item in categories.items %}
        {% if item|is_tuple %}
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
                    {{ item.0 }}
                    <span class="caret"></span>
                </a>
                <ul class="dropdown-menu" role="menu">
                    {% for subcat_url, cat_name in item.1.items %}
                        <li><a href="{{ subcat_url }}.html">{{ cat_name }}</a></li>
                    {% endfor %}
                </ul>
            </li>
        {% else %}
            <li><a href="{{ cat_url }}.html"><strong>{{ item }}</strong></a></li>
        {% endif %}
    {% endfor %}
</ul>