From ee76f2f91fa626d0a24530efebf59ad35d6ebd44 Mon Sep 17 00:00:00 2001 From: Philippe Barbosa Date: Wed, 6 Apr 2016 18:45:57 +0200 Subject: [PATCH] Location style, to be updated --- app/festival/static/css/index.css | 97 +++++++++++++++++++ app/festival/static/js/index.js | 12 +++ app/festival/static/js/plugins.js | 85 ++++++++++++++++ app/festival/static/scss/index.scss | 1 + app/templates/agenda/event_location_list.html | 45 +++++---- 5 files changed, 221 insertions(+), 19 deletions(-) diff --git a/app/festival/static/css/index.css b/app/festival/static/css/index.css index dcc7877f..95c34531 100755 --- a/app/festival/static/css/index.css +++ b/app/festival/static/css/index.css @@ -3473,6 +3473,92 @@ th { color: #555; } +/** + * Tabs navigation + */ +/* line 4, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tabs-nav { + display: block; + float: left; + text-align: left; + width: 30%; +} + +/* line 11, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tabs-nav__link { + color: #d2ba88; + display: block; + transition: color 0.3s; +} + +/* line 22, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tabs-nav__link:last-child { + margin-right: 0; +} + +/* line 30, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tabs-nav__link.is-active { + color: #b18d43; +} + +/* line 35, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tabs-nav__link i, +.c-tabs-nav__link span { + margin: 0; + padding: 0; + line-height: 1; +} + +/* line 42, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tabs-nav__link i { + font-size: 18px; +} + +/* line 46, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tabs-nav__link span { + display: none; + font-size: 18px; +} + +/** + * Tab + */ +/* line 64, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tab { + display: none; + float: left; + width: 70%; +} + +/* line 71, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tab.is-active { + display: block; +} + +/* line 75, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tab__content { + padding-left: .5rem; +} + +/** + * Tabs no-js fallback + */ +/* line 82, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tabs.no-js .c-tabs-nav { + display: none; +} + +/* line 86, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tabs.no-js .c-tab { + display: block; + margin-bottom: 1.5rem; +} + +/* line 91, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ +.c-tabs.no-js .c-tab:last-child { + margin-bottom: 0; +} + /* line 1, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/user.scss */ .user__panel { margin: 1rem auto; @@ -3481,6 +3567,17 @@ th { color: #000; text-transform: uppercase; } +@media all and (min-width: 720px){ + /* line 52, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ + .c-tabs-nav__link i{ + margin-bottom: 12px; + font-size: 22px; + } + /* line 56, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/modules/tabs.scss */ + .c-tabs-nav__link span{ + display: block; + } +} @media (min-width: 769px){ /* line 137, /Users/philippebarbosa/Sites/ircam-manifeste/app/festival/static/scss/base/_forms.scss */ .sticked-form{ diff --git a/app/festival/static/js/index.js b/app/festival/static/js/index.js index e2569fd4..ef5fa0ee 100644 --- a/app/festival/static/js/index.js +++ b/app/festival/static/js/index.js @@ -126,4 +126,16 @@ $(function() { $("#instafeed").length && t.run(); + /** + * + */ + + var myTabs = tabs({ + el: '#tabs', + tabNavigationLinks: '.c-tabs-nav__link', + tabContentContainers: '.c-tab' + }); + + myTabs.init(); + }); \ No newline at end of file diff --git a/app/festival/static/js/plugins.js b/app/festival/static/js/plugins.js index c6ac99b2..4aa6875f 100755 --- a/app/festival/static/js/plugins.js +++ b/app/festival/static/js/plugins.js @@ -1531,3 +1531,88 @@ */ (function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,s=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if(e instanceof RegExp){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;t= 0 && index <= tabNavigationLinks.length) { + tabNavigationLinks[activeIndex].classList.remove('is-active'); + tabNavigationLinks[index].classList.add('is-active'); + tabContentContainers[activeIndex].classList.remove('is-active'); + tabContentContainers[index].classList.add('is-active'); + activeIndex = index; + } + }; + + /** + * Returns init and goToTab + */ + return { + init: init, + goToTab: goToTab + }; + + }; + + /** + * Attach to global namespace + */ + window.tabs = tabs; + +})(); \ No newline at end of file diff --git a/app/festival/static/scss/index.scss b/app/festival/static/scss/index.scss index b5642dc8..d09cbf5a 100755 --- a/app/festival/static/scss/index.scss +++ b/app/festival/static/scss/index.scss @@ -82,4 +82,5 @@ 'modules/share-links', 'modules/push-calendar', 'modules/calendar', + 'modules/tabs', 'modules/user'; \ No newline at end of file diff --git a/app/templates/agenda/event_location_list.html b/app/templates/agenda/event_location_list.html index 0d226e4f..8ff66638 100644 --- a/app/templates/agenda/event_location_list.html +++ b/app/templates/agenda/event_location_list.html @@ -28,27 +28,34 @@ {% block main %} -{% for location in object_list %} - {{ location.title }}
-{% endfor %} +
+
+ {% for location in object_list %} + {{ location.title }} + {% endfor %} +
+ {% for location in object_list %} +
+
+

{{ location.title }}

+ {% block event_detail_location %} + {% editable event.location %} +

+ {{ location.address }}
+ + Get Directions + +

+ + {% google_static_map location 900 300 15 %} + + {% endeditable %} + {% endblock %} +
+
+ {% endfor %} -{% for location in object_list %} -

{{ location.title }}

- {% block event_detail_location %} - {% editable event.location %} -

- {{ location.address|linebreaksbr }}
- - Get Directions - -

- - {% google_static_map location 900 300 15 %} - - {% endeditable %} - {% endblock %} -{% endfor %} {% endblock %} -- 2.39.5