]> git.0d.be Git - panikweb.git/commitdiff
Add sectionName in view
authorlaron <simon@surlaterre.org>
Fri, 30 Aug 2013 11:21:59 +0000 (13:21 +0200)
committerlaron <simon@surlaterre.org>
Fri, 30 Aug 2013 11:21:59 +0000 (13:21 +0200)
panikweb/views.py
panikweb_templates/static/css/specifics.css
panikweb_templates/templates/base.html
panikweb_templates/templates/emissions/nav.html
panikweb_templates/templates/program.html

index 94f9c4e145387a10bba085aacae89a93c5439799..413d8dc203e89094377f0f6f4261d52478a0bc27 100644 (file)
@@ -21,6 +21,7 @@ class EmissionDetailView(DetailView):
 
     def get_context_data(self, **kwargs):
         context = super(EmissionDetailView, self).get_context_data(**kwargs)
+        context['sectionName'] = "emissions"
         context['schedules'] = Schedule.objects.filter(emission=self.object).order_by('datetime')
 
         # get all episodes, with an additional attribute to get the date of
@@ -56,6 +57,7 @@ class EpisodeDetailView(DetailView):
 
     def get_context_data(self, **kwargs):
         context = super(EpisodeDetailView, self).get_context_data(**kwargs)
+        context['sectionName'] = "emissions"
         context['diffusions'] = Diffusion.objects.filter(episode=self.object.id)
         context['soundfiles'] = SoundFile.objects.filter(episode=self.object.id)
         context['emission'] = Emission.objects.get(slug=self.kwargs.get('emission_slug'))
@@ -92,6 +94,7 @@ class ProgramView(TemplateView):
 
     def get_context_data(self, year=None, week=None, **kwargs):
         context = super(ProgramView, self).get_context_data(**kwargs)
+        context['sectionName'] = "emissions"
         schedules = Schedule.objects.select_related().order_by('datetime')
         days = []
         for day in range(7):
@@ -141,6 +144,7 @@ class Grid(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(Grid, self).get_context_data(**kwargs)
+        context['sectionName'] = "emissions"
 
         nb_lines = 2 * 24 # the cells are half hours
         grid = []
@@ -344,6 +348,7 @@ class Home(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(Home, self).get_context_data(**kwargs)
+        context['sectionName'] = "home"
         context['news'] = list(NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[:10])
         context['emissions'] = list(Emission.objects.filter(archived=False).order_by('title'))
         schedules = Schedule.objects.select_related().order_by('datetime')
@@ -359,6 +364,7 @@ home = Home.as_view()
 class NewsItemDetailView(DetailView):
     model = NewsItem
     def get_context_data(self, **kwargs):
+        context['sectionName'] = "news"
         context = super(NewsItemDetailView, self).get_context_data(**kwargs)
         context['news'] = list(NewsItem.objects.all().order_by('-datetime')[:60])
         context['categories'] = list(NewsCategory.objects.all())
@@ -370,6 +376,7 @@ class News(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(News, self).get_context_data(**kwargs)
+        context['sectionName'] = "news"
         context['newsImaged'] = list(NewsItem.objects.all().exclude(image__isnull=True).exclude(image__exact='').order_by('-datetime')[:3])
         context['news'] = list(NewsItem.objects.all().order_by('-datetime')[:60])
         context['categories'] = list(NewsCategory.objects.all())
@@ -382,6 +389,7 @@ class Emissions(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(Emissions, self).get_context_data(**kwargs)
+        context['sectionName'] = "emissions"
         context['emissions'] = Emission.objects.all().order_by('title')
         context['categories'] = Category.objects.all()
         return context
@@ -390,7 +398,6 @@ emissions = Emissions.as_view()
 
 class Get(TemplateView):
     template_name = 'get.html'
-
     def get_context_data(self, **kwargs):
         context = super(Get, self).get_context_data(**kwargs)
         context['emissions'] = Emission.objects.all().order_by('title')
@@ -403,6 +410,7 @@ class Listen(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(Listen, self).get_context_data(**kwargs)
+        context['sectionName'] = "listen"
         context['sounds'] = SoundFile.objects.all()[:15]
         listenable = []
         x=0
index f66ff55580116dcdb28f20451fa0b9a9be7cab25..088713273faeb4eed3339531e62f3ea054d38b7c 100644 (file)
@@ -231,7 +231,8 @@ body{
        background:#003446;
 }
 #Nav nav{padding:0.1em;}
-#Nav *{        color:#ddd;border-color:#ddd;}
+#Nav *{        color:#ccc;border-color:#ddd;}
+#Nav .active,#Nav .active *{color:white !important;}
 #Nav nav ul.columns {column-rule:2px solid #342E2E;-moz-column-rule:2px solid #342E2E;-webkit-column-rule:2px solid #342E2E;}
 
 #Nav nav.right{
index 98f30dfbf1ead6335f36e9ed727fbfaa1e80750f..9adabd74a621ee26c44ff73df693eb80f1886477 100644 (file)
@@ -29,7 +29,7 @@
     {% block extrascripts %}{% endblock %}
 </head>
 
-<body id="{% block bodyID %}{% endblock %}">
+<body id="{% block bodyID %}{% endblock %}" class="section-{{sectionName}}">
        <div id="All">
                {% block meta %}<div id="metaNav">{% metanav %}</div>{% endblock %}
                <div id="Commons">
index eeef0a1e44d5d32e0cac2341d592e938a1cd0f5a..f3fdec9ad50e5af49406d4f3a560926e65c16ae0 100644 (file)
@@ -1,14 +1,14 @@
 <nav>
        <ul class="inline">
-               <li><a href="{% url 'emissions' %}">
+               <li><a href="{% url 'emissions' %}" class="{% if class != "program" or class != "grid" %}active{% endif %}">
                        <span class="icon-microphone" ></span>
                        <span class="iconLabel">Emissions</span>
                </a></li>
-               <li><a href="{% url 'program' %}">
+               <li><a href="{% url 'program' %}" class="{% if class = "program" %}active{% endif %}">
                        <span class="icon-calendar" ></span>
                        <span class="iconLabel">Cette semaine</span>
                </a></li>
-               <li><a href="{% url 'grid' %}">
+               <li><a href="{% url 'grid' %}" class="{% if class = "grid" %}active{% endif %}">
                        <span class="icon-th-large" ></span>
                        <span class="iconLabel">La grille</span>
                </a></li>
index ce22e584426f031f03e25fead9a15eb63769425a..41e530664089c425e004bf78d91629bfccd9b539 100644 (file)
@@ -3,7 +3,7 @@
 {% block bodyID %}Program{% endblock %}
 {% block title %}Programme{% endblock %}
 {% block nav %}
-       {% emission_nav with klass="week" %}
+       {% emission_nav with klass="program" %}
        {% if week %}
        <div class="program">
                <nav class="center">