]> git.parisson.com Git - mezzo.git/commitdiff
Update logo, language switcher and breadcrumb
authorJérémy Fabre <blackmagik88@gmail.com>
Tue, 19 Jul 2016 13:15:56 +0000 (15:15 +0200)
committerJérémy Fabre <blackmagik88@gmail.com>
Tue, 19 Jul 2016 13:15:56 +0000 (15:15 +0200)
15 files changed:
app/static/src/assets/img/logo-ircam.png [new file with mode: 0644]
app/static/src/assets/img/logo-manifest.png [new file with mode: 0644]
app/static/src/js/index.js
app/static/src/js/modules/lang-selector.js [new file with mode: 0644]
app/static/src/sass/config/_colors.scss
app/static/src/sass/config/_variables.scss
app/static/src/sass/global/_helpers.scss
app/static/src/sass/layout/_header.scss
app/static/src/sass/modules/_all.scss
app/static/src/sass/modules/_breadcrumb.scss
app/static/src/sass/modules/_lang-switcher.scss
app/static/src/sass/modules/navs/_nav-header.scss [new file with mode: 0644]
app/templates/base.html
app/templates/pages/menus/breadcrumb.html
app/templates/pages/menus/header.html

diff --git a/app/static/src/assets/img/logo-ircam.png b/app/static/src/assets/img/logo-ircam.png
new file mode 100644 (file)
index 0000000..7110541
Binary files /dev/null and b/app/static/src/assets/img/logo-ircam.png differ
diff --git a/app/static/src/assets/img/logo-manifest.png b/app/static/src/assets/img/logo-manifest.png
new file mode 100644 (file)
index 0000000..7b364f5
Binary files /dev/null and b/app/static/src/assets/img/logo-manifest.png differ
index 0cdeb11809d7e934d43ce169af0c26d340b3cb4d..a55e5d1bbd4daf43ac40205571658f6628409280 100644 (file)
@@ -1,7 +1,9 @@
 //
 // Require all the modules
 //
+var LangSelector = require('./modules/lang-selector');
 
 //
 // Init all the modules
 //
+window[LangSelector] = new LangSelector();
diff --git a/app/static/src/js/modules/lang-selector.js b/app/static/src/js/modules/lang-selector.js
new file mode 100644 (file)
index 0000000..954ae62
--- /dev/null
@@ -0,0 +1,51 @@
+var LangSelector = function() {
+
+    this.$element = null;
+
+    //
+    // Init
+    //
+    this.init();
+
+};
+
+LangSelector.prototype.init = function() {
+
+    var that = this;
+
+    that.$element = $('#langSelector');
+    that.$element.find('li:first-child a').click(function(e) {
+
+        e.preventDefault();
+        that.$element.toggleClass('open');
+
+        if(that.$element.hasClass('open')) {
+
+            that.$element.one('mouseleave', function() {
+                that.$element.removeClass('open');
+            })
+
+        }
+
+        return false;
+
+    });
+
+    that.$element.find('li:not(:first-child) a').click(function(e) {
+
+        e.preventDefault();
+        that.changeLanguage($(this).attr('data-lang'));
+        return false;
+
+    });
+
+};
+
+LangSelector.prototype.changeLanguage = function(lang) {
+
+    $('#language_selector_select').val(lang);
+    $('#language_selector_form').submit();
+
+}
+
+module.exports = LangSelector;
index b576fbaee89345a31d6f1cc42a6a522c0898f172..a6ec95a51b618f6426d6d32015251793d41a5d7b 100755 (executable)
@@ -10,6 +10,7 @@ $color-soundcloud: #f50;
 $color-vimeo: #4bf;
 $color-youtube: #bb0000;
 
+$color-white: #FFFFFF;
 $color-main: #F8E71C;
 $color-gray: #C3C3C3;
 $color-black: #1D1D1B;
index 22e49328b310a262e52887734bed825dbd641085..a744d3e71aae4d7db4c9a3a8018f464dc7f9aa76 100755 (executable)
@@ -35,6 +35,7 @@ $headings-font-family: $primary-font-family;
 // Layout
 
 $header-pre-height: 34px;
+$header-height: 78px;
 
 // Typey
 
index 2482a64d796844f48f7a2998b0b3ba4630a2373d..8cba3fd89ca4258a41e8b78dce1eefc32bfa3e93 100755 (executable)
         display: none;
     }
 }
+.ffss {
+    @include typeface(sans-serif);
+}
+.ffs {
+    @include typeface(serif);
+}
+.fsxxxl {
+    @include font-size(xxxl);
+}
+.fsxxl {
+    @include font-size(xxl);
+}
+.fsxl {
+    @include font-size(xl);
+}
+.fsl {
+    @include font-size(l);
+}
+.fsm {
+    @include font-size(m);
+}
+.fss {
+    @include font-size(s);
+}
+.fsxs {
+    @include font-size(xs);
+}
index 17f173b5c0b32c57a226b625cdcb810a4bd5772a..c53e71bf34f4edd1a5d4a20bddc833c0807f075c 100755 (executable)
@@ -10,4 +10,10 @@ $module: ".header";
 
     }
 
+    &__nav {
+
+        background: $color-white;
+
+    }
+
 }
index 1baec8ae5ff1368ccb6d7809a1dea5310257a726..e46c42176433aa20760bb3f15be8c0bfa2aee366 100755 (executable)
@@ -1,7 +1,9 @@
 // Navs
 @import "navs/nav-actions";
+@import "navs/nav-header";
 
 @import 'breadcrumb';
+@import 'lang-switcher';
 @import 'dashed';
 @import 'dotted';
 @import 'tag';
index e3b9a9f3d6b2419a6e7ea04aa0a8382ab9ca3ca1..119a1532639dc11d4d86a49a37096c1c22e50218 100644 (file)
@@ -6,6 +6,9 @@ $module: ".breadcrumb";
     margin: 0;
     padding: 0;
 
+    background: white;
+    @include padding(0 1);
+
     @include clearfix;
     @include font-size(xs);
     @include line-height(1);
index 54a216b45cca83b186f3e7a5b0669c8b5760dad8..e7e08218e7c5f0c4162ba70a2546561cd76d7b77 100644 (file)
@@ -3,5 +3,66 @@ $module: ".lang-switcher";
 #{$module} {
 
     list-style-type: none;
+    padding: 0;
+    margin: 0;
+    @include padding-right(.5);
+
+    position: absolute;
+    top: 0;
+    right: .25rem;
+
+    &__item {
+
+        @include font-size(s);
+        @include line-height($header-pre-height);
+        @include typeface(sans-serif);
+
+        @include padding(0 .5);
+
+        text-transform: uppercase;
+        display: none;
+
+        >a {
+            color: white;
+        }
+
+        &.active {
+            display: block;
+        }
+
+    }
+
+    &.open {
+
+        #{$module}__item {
+
+            display: block;
+            background: $color-black;
+
+        }
+
+        &:after {
+
+            @include transform(rotate(180deg));
+
+        }
+
+    }
+
+    &:after {
+        display: block;
+        content: '\f107';
+        color: white;
+        position: absolute;
+        top: 0;
+        right: 0;
+
+        font-family: FontAwesome;
+        font-size: 0.8em;
+
+        @include line-height($header-pre-height);
+        @include margin-right(.5);
+        @include transition(all 0.2s ease-in-out);
+    }
 
 }
diff --git a/app/static/src/sass/modules/navs/_nav-header.scss b/app/static/src/sass/modules/navs/_nav-header.scss
new file mode 100644 (file)
index 0000000..825d7f1
--- /dev/null
@@ -0,0 +1,76 @@
+$module: ".nav-header";
+
+#{$module} {
+
+    list-style-type: none;
+    margin: 0;
+    padding: 0;
+    text-align: center;
+
+    @include margin(.5 0);
+
+    &__item {
+
+        display: inline-block;
+        color: black;
+        text-transform: lowercase;
+        vertical-align: top;
+        position: relative;
+
+        @include padding-right(.5);
+
+        &:after {
+            content: "";
+            display: block;
+            height: $header-height;
+            width: 1px;
+            background: black;
+            position: absolute;
+            top: 0;
+            right: 0;
+
+            @include margin-left(.5);
+        }
+
+        &:last-child {
+            &:after {
+                display: none;
+            }
+        }
+
+        &--image {
+            vertical-align: top;
+            @include margin(0 0 0 .5);
+        }
+
+        &--special {
+            vertical-align: top;
+            @include margin(0 0 0 .5);
+        }
+
+        &--centered {
+            line-height: $header-height;
+        }
+
+    }
+
+    &__item-link {
+
+        color: inherit;
+        text-decoration: none;
+
+        vertical-align: top;
+
+        @include font-size(xl);
+        @include line-height($header-pre-height);
+        @include typeface(sans-serif);
+
+        &:before {
+            display: inline;
+            content: '.';
+            vertical-align: top;
+        }
+
+    }
+
+}
index 39d6deb8b3b92cc34ad6f959dee99288f83b7615..eac5ed0a8d69fb7a7194cd9d3ef76ba9fe8a2580 100644 (file)
 
     {% compress css %}
     <link rel="stylesheet" href="{% static "css/index.min.css" %}">
+    <link rel="stylesheet" href="{% static "font-awesome/css/font-awesome.css" %}">
     {% endcompress %}
 
     {% block extra_head %}{% endblock %}
 </head>
 
 <body id="{% block body_id %}body{% endblock %}">
+
+    {% nevercache %}
+        {% if messages %}
+            {% for message in messages %}
+                <div class="notification" id="js-notificationContainer">
+                    <button type="button" class="btn btn-small js-notificationClose">X</button>
+                    {{ message }}
+                </div>
+            {% endfor %}
+        {% endif %}
+    {% endnevercache %}
+
     <div class="banner" role="banner">
         <div class="header">
             <div class="container">
                             {% nevercache %}
                             {% include "includes/language_selector.html" %}
                             {% endnevercache %}
-                            <ul class="lang-switcher">
+                            <ul class="lang-switcher" id="langSelector">
                                 {% for language in languages %}
-                                    <li class="nav__complementary__item__lang {% if language.code == LANGUAGE_CODE %}active{% endif %}">
-                                        <a href="#" onclick="$('#language_selector_select').val('{{ language.code }}'); $('#language_selector_form').submit();">
-                                          {{ language.code|title }}
-                                        </a>
-                                    </li>
+                                    {% if language.code == LANGUAGE_CODE %}
+                                        <li class="lang-switcher__item active">
+                                            <a href="#">
+                                              {{ language.code|title }}
+                                            </a>
+                                        </li>
+                                    {% endif %}
+                                {% endfor %}
+                                {% for language in languages %}
+                                    {% if language.code != LANGUAGE_CODE %}
+                                        <li class="lang-switcher__item">
+                                            <a href="#" data-lang="{{ language.code }}">
+                                              {{ language.code|title }}
+                                            </a>
+                                        </li>
+                                    {% endif %}
                                 {% endfor %}
                             </ul>
                         {% endif %}
                     </div>
                 </div>
-
-                {% if settings.SITE_TITLE %}
-                <h1>
-                    <div class="header__logo">
-                        <a href="http://www.ircam.fr" title="Url site ircam">
-                            <img class="header__logo__img" src="{% static "img/logo_ircam_black.png" %}" alt="Logo Manifeste 2016 ircam" width="200">
-                        </a>
+                <div class="row header__nav">
+                    <div class="col-md-10 col-md-push-1 tac">
+                        {% page_menu "pages/menus/header.html" %}
+                    </div>
+                </div>
+                {% if not on_home %}
+                    <div class="row">
+                        <div class="col-md-8 col-md-push-2">
+                            <ul class="breadcrumb">
+                                {% spaceless %}
+                                {% block breadcrumb_menu %}{% page_menu "pages/menus/breadcrumb.html" %}{% endblock %}
+                                {% endspaceless %}
+                            </ul>
+                        </div>
                     </div>
-                </h1>
                 {% endif %}
-
             </div>
         </div>
 
-        <div class="navigation" role="navigation">
-            {% page_menu "pages/menus/header.html" %}
-        </div>
-        
     </div>
 
     {% if on_home %}
-     {% include "includes/slider.html" %}
-    {% endif %}
-
-    {% nevercache %}
-    {% if messages %}
-        {% for message in messages %}
-        <div class="notification" id="js-notificationContainer">
-            <button type="button" class="btn btn-small js-notificationClose">X</button>
-            {{ message }}
-        </div>
-        {% endfor %}
+        {% include "includes/slider.html" %}
     {% endif %}
-    {% endnevercache %}
-
-    {% comment %}
-    <ul class="breadcrumb">
-    {% spaceless %}
-    {% block breadcrumb_menu %}{% page_menu "pages/menus/breadcrumb.html" %}{% endblock %}
-    {% endspaceless %}
-    </ul>
-    {% endcomment %}
 
     {% featured as featured_list %}
 
index 5bd1a7f8eac71d1f42f07a29fb13aec10a58bacb..f7c3c2fbef5e50f96b9b56a86e2eb6a0a95efdaa 100644 (file)
@@ -6,18 +6,18 @@
 {% for page in page_branch %}
 
     {% if not has_home and page.is_primary and forloop.first %}
-    <li id="breadcrumb-menu-home">
-        <a href="{% url "home" %}">{% trans "Home" %}</a>
+    <li class="breadcrumb__item" id="breadcrumb-menu-home">
+        <a class="breadcrumb__link" href="{% url "home" %}">{% trans "Home" %}</a>
     </li>
     {% endif %}
 
     {% if page.is_current_or_ascendant %}
     {% if page.is_current %}
-    <li id="breadcrumb-menu-{{ page.html_id }}"
+    <li class="breadcrumb__item" id="breadcrumb-menu-{{ page.html_id }}"
         class="active">{{ page.title }}</li>
     {% else %}
-    <li id="breadcrumb-menu-{{ page.html_id }}">
-        <a href="{{ page.get_absolute_url }}">{{ page.title }}</a>
+    <li class="breadcrumb__item" id="breadcrumb-menu-{{ page.html_id }}">
+        <a class="breadcrumb__link" href="{{ page.get_absolute_url }}">{{ page.title }}</a>
     </li>
     {% endif %}
     {% if page.has_children %}{% page_menu page %}{% endif %}
index 8a5b1a092d4a590699f730e4a9eda23f709f2d0b..6b8e6535bb4fb5b167763e88a6ea013bb76f8b86 100644 (file)
@@ -1,35 +1,36 @@
-{% load i18n pages_tags %}
+{% load i18n pages_tags staticfiles %}
 {% 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>
+    {% for page in page_branch %}
+        {% if page.is_primary %}
+            {% if forloop.first %}
+                <ul class="nav-header" role="navigation">
+                    <li class="nav-header__item nav-header__item--image">
+                        <a href="/" title="{% trans 'Home' %}"><img src="{% static "img/logo-ircam.png" %}" width="118" height="80" /></a>
+                    </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 %}
+        {% endif %}
+        {% if page.in_menu %}
+            <li class="nav-header__item {% if page.is_current_or_ascendant %}active{% endif %}">
+                <a class="nav-header__item-link" href="{{ page.get_absolute_url }}" title="{{ page.title }}">{{ page.title }}</a>
             </li>
+        {% endif %}
+        {% if page.is_primary %}
+            {% if forloop.last %}
+                <li class="nav-header__item nav-header__item--special">
+                    <a href="{% url 'event_list' %}"><span class="fss ffss">rendez-vous</span><br /><span class="fsxxxl ffss">15.16</span></a>
+                </li>
+                <li class="nav-header__item nav-header__item--image">
+                    <a href="http://manifeste.ircam.fr" target="_blank" title="{% trans 'Manifest' %}"><img src="{% static "img/logo-manifest.png" %}" width="83" height="65" /></a>
+                </li>
+                <li class="nav-header__item nav-header__item--special nav-header__item--centered">
+                    <a href="" class="fsxl"><i class="fa fa-search" aria-hidden="true"></i></a>
+                </li>
+            </ul>
             {% endif %}
-            {% endfor %}
-        </ul>
-    {% endif %}
+        {% endif %}
+    {% endfor %}
 {% endif %}
 {% endspaceless %}