]> git.parisson.com Git - mezzo.git/commitdiff
Adding tree menu : action / header / footer
authorEmilie <zawadzki@ircam.fr>
Tue, 5 Jul 2016 13:36:53 +0000 (15:36 +0200)
committerEmilie <zawadzki@ircam.fr>
Tue, 5 Jul 2016 13:36:53 +0000 (15:36 +0200)
app/settings.py
app/templates/base.html
app/templates/includes/footer_scripts.html
app/templates/pages/menus/action.html [new file with mode: 0644]
app/templates/pages/menus/dropdown.html [deleted file]
app/templates/pages/menus/header.html

index 07a1896ba0965f6262a60b8a89086952cc2ea64a..778bc3d5cb1cb3717ae3acd72744194f2d7d520f 100644 (file)
@@ -42,9 +42,9 @@ from django.utils.translation import ugettext_lazy as _
 # that doesn't appear in this setting, all pages will appear in it.
 
 PAGE_MENU_TEMPLATES = (
-    (1, _("Top header"), "pages/menus/header.html"),
-    (2, _("Top navigation bar"), "pages/menus/dropdown.html"),
-    (3, _("Footer"), "pages/menus/footer.html"),
+    (1, _("Action"), "pages/menus/action.html"),
+    (2, _("Departement"), "pages/menus/header.html"),
+    (3, _("Footer"), "pages/menus/footer.html")
 )
 
 # A sequence of fields that will be injected into Mezzanine's (or any
@@ -224,7 +224,7 @@ INSTALLED_APPS = [
     "meta",
     "mezzanine_agenda",
     "festival",
-    "organization",
+    "organization"
 ]
 
 
index 371a4d8d3d1829b8e49240925016e0a0c3b9a46b..1cf860e876f8e41a10f68094c3a88e41e357ca94 100644 (file)
@@ -47,6 +47,8 @@
                     <span></span>
                 </button>
 
+                {% page_menu "pages/menus/action.html" %}
+
                 {% if settings.SITE_TAGLINE %}
                 <p class="header__baseline">{{ settings.SITE_TAGLINE }}</p>
                 {% endif %}
@@ -55,7 +57,7 @@
         </div>
 
         <div class="navigation" role="navigation">
-            {% page_menu "pages/menus/dropdown.html" %}
+            {% page_menu "pages/menus/header.html" %}
         </div>
 
         <div class="nav__complementary">
@@ -80,7 +82,7 @@
                     {% if settings.USE_MODELTRANSLATION and languages|length > 1 %}
                         {% for language in languages %}
                             <li class="nav__complementary__item__lang {% if language.code == LANGUAGE_CODE %}is-active{% endif %}">
-                                <a href="#" onclick="$('#language_selector_select').val('{{ language.code }}'); $('#language_selector_form').submit();">
+                                <a href="#" onclic"$('#language_selector_select').val('{{ language.code }}'); $('#language_selector_form').submit();">
                                   {{ language.code|title }}
                                 </a>
                             </li>
 
     <footer class="footer" role="footer">
         <div class="container">
-            <div class="footer-logo">
-                <img src="{% static "img/logo_manifeste16_black.png" %}" alt="Logo Manifeste 2016 ircam" width="80">
-            </div>
+
             {% page_menu "pages/menus/footer.html" %}
 
-            <ul class="footer-partners list-inline">
-                <li>
-                    <a href="http://www.culturecommunication.gouv.fr/" target="_blank">
-                        <img src="{% static "img/logo_mmc.png" %}" alt="Logo Ministere Culture et Communication">
-                    </a>
-                </li>
-                <li>
-                    <a href="http://www.cnrs.fr/" target="_blank">
-                        <img src="{% static "img/logo_cnrs.png" %}" alt="Logo CNRS">
-                    </a>
-                </li>
-                <li>
-                    <a href="http://www.upmc.fr/" target="_blank">
-                        <img src="{% static "img/logo_upmc.png" %}" alt="Logo UPMC">
-                    </a>
-                </li>
-                <li>
-                    <a href="http://www.inria.fr/" target="_blank">
-                        <img src="{% static "img/logo_inra.png" %}" alt="Logo Inria">
-                    </a>
-                </li>
-            </ul>
-
-            <div class="footer-legals">
-                <p>
-                    {# {% trans "Powered by" %} #}
-                    Conception & réalisation : <br><br>
-                    <a href="http://www.philippebarbosa.com" target="_blank" titre="Développeur front-end freelance & photographe professionnel à Paris">
-                        Philippe Barbosa</a>,
-                        <a href="http://www.ircam.com" target="_blank" titre="IRCAM">Mary Delacour & Guillaume Pellerin</a>
-
-                </p>
-            </div>
+
         </div>
     </footer>
     {% include "includes/footer_scripts.html" %}
index 409bea0611de14455b73a76b3399ef7bfb99aafa..4b6c8e75a17d1a699be983bfd3e3e80ced92e848 100644 (file)
@@ -2,7 +2,7 @@
 
 {% compress js %}
     <script src="{{ STATIC_URL }}jquery/dist/jquery.min.js"></script>
-    <script src="{% static "js/plugins.js" %}"></script>#}
+    <script src="{% static "js/plugins.js" %}"></script>
     <script src="{% static "js/index.js" %}"></script>
 {% block extra_js %}{% endblock %}
 {% editable_loader %}
diff --git a/app/templates/pages/menus/action.html b/app/templates/pages/menus/action.html
new file mode 100644 (file)
index 0000000..2059152
--- /dev/null
@@ -0,0 +1,43 @@
+{% load i18n pages_tags %}
+{% get_language_info_list for LANGUAGES as languages %}
+
+{% spaceless %}
+{% if page_branch_in_menu %}
+    {% for page in page_branch %}
+        {% if page.is_primary %}
+            {% if forloop.first %}
+                <div>
+                <ul>
+            {% endif %}
+            {% if page.in_menu %}
+                {# <ul class="list-unstyled"> #}
+            {% endif %}
+        {% endif %}
+        {% if page.in_menu %}
+            {% if forloop.first and not page.parent.in_menu and not page.is_primary %}
+            {% endif %}
+            <li>
+                <h2>
+                    <a href="{{ page.get_absolute_url }}">{{ page.title }}</a>
+                </h2>
+            </li>
+        {% endif %}
+        {% if page.in_menu and page.has_children_in_menu %}{% page_menu page %}{% endif %}
+        {% if page.in_menu %}
+            {% if forloop.first and not page.parent.in_menu and not page.is_primary %}
+            {# </li> #}
+            {% endif %}
+            {# </ul> #}
+        {% endif %}
+        {% if page.is_primary %}
+            {% if page.in_menu %}
+            {# </ul> #}
+            {% endif %}
+            {% if forloop.last %}
+            </ul>
+            </div>
+            {% endif %}
+        {% endif %}
+    {% endfor %}
+{% endif %}
+{% endspaceless %}
diff --git a/app/templates/pages/menus/dropdown.html b/app/templates/pages/menus/dropdown.html
deleted file mode 100644 (file)
index 8d9c3cf..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-{% load i18n pages_tags %}
-{% get_language_info_list for LANGUAGES as languages %}
-
-{% spaceless %}
-{% if page_branch_in_menu %}
-    {% if branch_level == 0 %}
-        <ul class="menu">
-            {% for page in page_branch %}
-            {% if not has_home and page.is_primary and forloop.first %}
-            <li class="menu__item{% if on_home %} active{% endif %}">
-                <a href="{% url "home" %}" class="menu__item__link">{% trans "Home" %}</a>
-            </li>
-            {% endif %}
-            {% if page.in_menu %}
-            <li class="menu__item{% if page.has_children_in_menu %}dropdown{% endif %}{% if page.is_current_or_ascendant %} active{% endif %}" id="{{ page.html_id }}">
-                <a href="{{ page.get_absolute_url }}" class="menu__item__link" {% if page.has_children_in_menu %} data-toggle="dropdown"{% endif %}>{{ page.title }}{% if page.has_children_in_menu %}<b class="caret"></b>{% endif %}</a>
-                {% if page.has_children_in_menu %}{% page_menu page %}{% endif %}
-            </li>
-            {% endif %}
-            {% endfor %}
-        </ul>
-        {% else %}
-        <ul class="dropdown-menu">
-            {% for page in page_branch %}
-            {% if page.in_menu %}
-            <li class="{% if page.has_children_in_menu %}dropdown-submenu{% endif %}{% if page.is_current_or_ascendant %} active{% endif %}"id="{{ page.html_id }}">
-                <a href="{{ page.get_absolute_url }}">{{ page.title }}</a>
-                {% if page.has_children_in_menu %}{% page_menu page %}{% endif %}
-            </li>
-            {% endif %}
-            {% endfor %}
-        </ul>
-    {% endif %}
-{% endif %}
-{% endspaceless %}
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8a5b1a092d4a590699f730e4a9eda23f709f2d0b 100644 (file)
@@ -0,0 +1,35 @@
+{% load i18n pages_tags %}
+{% get_language_info_list for LANGUAGES as languages %}
+
+{% spaceless %}
+{% if page_branch_in_menu %}
+    {% if branch_level == 0 %}
+        <ul class="menu">
+            {% for page in page_branch %}
+            {% if not has_home and page.is_primary and forloop.first %}
+            <li class="menu__item{% if on_home %} active{% endif %}">
+                <a href="{% url "home" %}" class="menu__item__link">{% trans "Home" %}</a>
+            </li>
+            {% endif %}
+            {% if page.in_menu %}
+            <li class="menu__item{% if page.has_children_in_menu %}header{% endif %}{% if page.is_current_or_ascendant %} active{% endif %}" id="{{ page.html_id }}">
+                <a href="{{ page.get_absolute_url }}" class="menu__item__link" {% if page.has_children_in_menu %} data-toggle="header"{% endif %}>{{ page.title }}{% if page.has_children_in_menu %}<b class="caret"></b>{% endif %}</a>
+                {% if page.has_children_in_menu %}{% page_menu page %}{% endif %}
+            </li>
+            {% endif %}
+            {% endfor %}
+        </ul>
+        {% else %}
+        <ul class="header-menu">
+            {% for page in page_branch %}
+            {% if page.in_menu %}
+            <li class="{% if page.has_children_in_menu %}header-submenu{% endif %}{% if page.is_current_or_ascendant %} active{% endif %}"id="{{ page.html_id }}">
+                <a href="{{ page.get_absolute_url }}">{{ page.title }}</a>
+                {% if page.has_children_in_menu %}{% page_menu page %}{% endif %}
+            </li>
+            {% endif %}
+            {% endfor %}
+        </ul>
+    {% endif %}
+{% endif %}
+{% endspaceless %}