Commit bf50a293 authored by Simon Daron's avatar Simon Daron

Make active tab visible on metaNav

parent 25383a80
......@@ -86,9 +86,11 @@ def emission_inline(context, date=None):
def player():
return {'unique': uuid.uuid4()}
@register.inclusion_tag('includes/metaNav.html', takes_context=False)
def metanav():
return {}
@register.inclusion_tag('includes/metaNav.html', takes_context=True)
def metanav(context, active=None):
return {
'sectionName': context.get('sectionName')
}
@register.inclusion_tag('includes/week.html', takes_context=True)
def weekview(context, year=None, week=None, weekday=None, fragment= None):
......
......@@ -33,9 +33,6 @@ a {
a.block:hover,nav a:hover{
text-decoration: none;
}
button:hover {
opacity:0.5;
}
button, .button{
margin:0 0 0 0;
padding: 0 0 0 0;
......
......@@ -106,17 +106,16 @@ button.tag, a.tag {
}
button.check, a.check {
font-size:0.9em;
background:white;
text-transform: none;
display:inline-block;
border: 1px solid #CCC !important;
color:#342E2E !important;
margin: 0.2em;
padding: 0.3em;
border-radius: 0.7em;
-moz-border-radius: 0.7em;
-webkit-border-radius: 0.7em;
padding: 0.5em !important;
border-radius: 0.2em;
-moz-border-radius: 0.2em;
-webkit-border-radius: 0.2em;
}
#Nav .check{background:#222;}
button.check:before, a.check:before {
display:inline-block;
width:1.5em;
......@@ -140,8 +139,13 @@ body{
#Home #Main{
min-height:0;
}
#Changing a:hover {
#Changing a:hover,#Changing button:hover {
opacity:0.6;
text-decoration:none;
}
#Nav a:hover,#Nav button:hover {
opacity:1;
color:white !important;
}
/* GLOBAL SITE NAV */
#userLog{
......@@ -196,6 +200,7 @@ body{
#metaNav ul{
}
#metaNav li{
height: 2em;
border-left:1px solid #333;
border-right:1px solid #333;
}
......@@ -209,9 +214,8 @@ body{
display:inline-block !important;
color:white;
}
#metaNav *:focus, #metaNav .active{
color:black;
background-color:white;
#metaNav .active{
background:#003446;
}
@media screen and (max-width:500px){
#metaNav .iconLabel {display:none;}
......@@ -250,13 +254,9 @@ body{
-webkit-box-shadow: 0px 0px 100px rgb(0, 0, 0) inset;
box-shadow: 0px 0px 100px rgb(0, 0, 0) inset;
}
#Nav form{
background-color:#333;
color: white;
}
#Nav nav{padding:0.1em;}
#Nav *{ color:#ccc;border-color:#ddd;}
#Nav .active,#Nav .active *{color:white !important;}
#Nav *{ color:#ddd;border-color:#ddd;}
#Nav .active,#Nav .active *{color:white !important;font-weight:bold;}
#Nav nav ul.columns {column-rule:2px solid #342E2E;-moz-column-rule:2px solid #342E2E;-webkit-column-rule:2px solid #342E2E;}
#Nav nav.right{
......@@ -616,7 +616,6 @@ background-color:#ff6633; border-color:#fff;}
.list.news li {
}
.news a .content{padding:1em;}
.news a.block:hover{text-decoration:none;}
.news .date{padding:1em;}
.news .inline .title{
......@@ -801,19 +800,19 @@ background-color:#ff6633; border-color:#fff;}
#player-container{}
#Nav{}
#Search a.icon-check-empty.count-0{
display:none;
.search a.icon-check-empty.count-0{
display:none !important;
}
#Search li.previous-page {
.search li.previous-page {
margin-bottom: 2ex;
text-align: left;
margin-left: 0ex;
font-style: italic;
}
#Search li.next-page {
.search li.next-page {
margin-top: 2ex;
text-align: right;
margin-right: 0;
......
......@@ -7,6 +7,7 @@ $(function() {
});
}
var $main = $("#Changing");
var $metaNav = $("#metaNav");
var $log = $("#userLog");
/****************************************************/
......@@ -23,6 +24,10 @@ $(function() {
}
new_content = $($.parseHTML(html)).find('#Changing>*');
$main.hide().empty().append(new_content).fadeIn();
new_menu = $($.parseHTML(html)).find('#metaNav>*');
$metaNav.empty().append(new_menu);
var newTitle = html.match(/<title>(.*?)<\/title>/);
if(newTitle){document.title = newTitle[1].trim().decodeHTML();}
......
......@@ -31,7 +31,7 @@
<body id="{{sectionName}}" class="section-{{sectionName}}">
<div id="All">
{% block meta %}<div id="metaNav">{% metanav %}</div>{% endblock %}
{% block meta %}<div id="metaNav">{% metanav active=sectionName %}</div>{% endblock %}
<div id="Commons">
<a href="{% url 'home' %}" id="mainHeader" class="block center">
<h1><span id="radioPanik" class="inBlock">Radio Panik</span> <span id="frequence" class="inBlock">105.4 FM</span></h1>
......
......@@ -2,47 +2,29 @@
<nav class="contextual-menu wrapper">
<ul class="distributed">
<!--<li><a href="{% url 'get' %}">☰</a></li>-->
<li><a href="{% url 'home' %}">
<span class="icon-home" ></span>
<li class="{% if sectionName = "Home" %}active{% endif %}"><a href="{% url 'home' %}">
<span class="icon-home"></span>
<span class="iconLabel">Home</span>
</a></li>
<li><a href="{% url 'news' %}">
<li class="{% if sectionName = "News" %}active{% endif %}"><a href="{% url 'news' %}">
<span class="icon-bullhorn" ></span>
<span class="iconLabel">News</span>
</a></li>
<li><a href="{% url 'listen' %}">
<li class="{% if sectionName = "Listen" %}active{% endif %}"><a href="{% url 'listen' %}">
<span class="icon-headphones" ></span>
<span class="iconLabel">Listen</span>
</a></li>
<li><a href="{% url 'emissions' %}">
<li class="{% if sectionName = "Emissions" %}active{% endif %}"><a href="{% url 'emissions' %}">
<span class="icon-calendar" ></span>
<span class="iconLabel">Program</span>
</a></li>
<!--
-->
<!--
<li><a href="{% url 'grid' %}">
<span class="icon-th-large" ></span>
<span class="iconLabel">Grid</span>
</a></li>
-->
<li><a href="/la-radio/">
<li class="{% if sectionName = "About" %}active{% endif %}"><a href="/la-radio/">
<span class="icon-info-sign" ></span>
<span class="iconLabel">About</span>
</a></li>
<li><a href="{% url 'search' %}">
<li class="{% if sectionName = "Search" %}active{% endif %}"><a href="{% url 'search' %}">
<span class="icon-search" ></span>
<span class="iconLabel">Search</span>
</a></li>
</ul>
</nav>
<!--
<div id="SearchForm">
<form id="search" action="{% url 'search' %}">
<button class="icon-search" >Search</button>
<input name="q" type="search" placeholder="Rechercher..."></input>
</form>
</div>
-->
......@@ -4,32 +4,32 @@
{% block bodyID %}Search{% endblock %}
{% block title %}Recherche{% endblock %}
{% block nav %}
<div class="padded">
<div class="padded search">
<form method="get" action="." class="big center" id="search-form">
{{ form.as_table }}<button class="icon-search"></button>
</form>
{% if query %}
<nav id="gridNav">
<nav>
{% if facets.fields.categories %}
<ul class="custom">
<ul class="custom padded">
{# Provide only the top 5 categories #}
{% for category in facets.fields.categories|slice:":5" %}
<li>
{% if category.0 in selected_categories %}
<a class="check icon-check count-{{ category.1 }}" href="{{ request.get_full_path|remove_category_facet:category.0 }}">
{{ category.0 }} | {{ category.1 }}
</a>
{% else %}
<a class="check icon-check-empty count-{{ category.1 }}" href="{{ request.get_full_path|append_category_facet:category.0 }}">{{ category.0 }} | {{ category.1 }}</a></span>
{% endif %}
</li>
{% endfor %}
{% for category in facets.fields.categories|slice:":5" %}
<li>
{% if category.0 in selected_categories %}
<a class="check icon-check count-{{ category.1 }}" href="{{ request.get_full_path|remove_category_facet:category.0 }}">
{{ category.0 }} | {{ category.1 }}
</a>
{% else %}
<a class="check icon-check-empty count-{{ category.1 }}" href="{{ request.get_full_path|append_category_facet:category.0 }}">{{ category.0 }} | {{ category.1 }}</a></span>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</nav>
<nav id="gridNav2">
<nav>
{% if facets.fields.tags %}
<ul class="tag-facets custom">
<ul class="tag-facets custom padded">
{# Provide only the top 5 tags #}
{% for tag in facets.fields.tags|slice:":20" %}
<li>
......@@ -55,6 +55,7 @@
{% if query %}
<div class="wrapper">
<div class="padded">
<nav>
{% if not page.object_list %}
<div class="big error padded center">Sorry, no result with your query!</div>
{% endif %}
......@@ -82,6 +83,7 @@
<a class="button big right" href="?q={{ query }}&amp;page={{ page.next_page_number }}">Résultats suivants &raquo;</a>
</div>
{% endif %}
</nav>
</div>
</div>
{% endif %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment