]> git.0d.be Git - panikweb.git/commitdiff
program description
authorlaron <simon@surlaterre.org>
Sat, 31 Aug 2013 06:35:42 +0000 (08:35 +0200)
committerlaron <simon@surlaterre.org>
Sat, 31 Aug 2013 06:35:42 +0000 (08:35 +0200)
panikweb/views.py
panikweb_templates/static/js/specifics.js
panikweb_templates/templates/base.html
panikweb_templates/templates/emissions/detail.html
panikweb_templates/templates/includes/audio.html
panikweb_templates/templates/includes/week.html

index 7de76b2781b1d35daa5371be0f27c66056c257f7..dcb1d99884f063ef0f68cbba950534a45ee22992 100644 (file)
@@ -23,7 +23,7 @@ class EmissionDetailView(DetailView):
 
     def get_context_data(self, **kwargs):
         context = super(EmissionDetailView, self).get_context_data(**kwargs)
-        context['sectionName'] = "emissions"
+        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
@@ -59,7 +59,7 @@ class EpisodeDetailView(DetailView):
 
     def get_context_data(self, **kwargs):
         context = super(EpisodeDetailView, self).get_context_data(**kwargs)
-        context['sectionName'] = "emissions"
+        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'))
@@ -96,7 +96,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"
+        context['sectionName'] = "Emissions"
         schedules = Schedule.objects.select_related().order_by('datetime')
         days = []
         for day in range(7):
@@ -150,7 +150,7 @@ class Grid(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(Grid, self).get_context_data(**kwargs)
-        context['sectionName'] = "emissions"
+        context['sectionName'] = "Emissions"
 
         nb_lines = 2 * 24 # the cells are half hours
         grid = []
@@ -354,7 +354,7 @@ class Home(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(Home, self).get_context_data(**kwargs)
-        context['sectionName'] = "home"
+        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')
@@ -370,7 +370,7 @@ home = Home.as_view()
 class NewsItemDetailView(DetailView):
     model = NewsItem
     def get_context_data(self, **kwargs):
-        context['sectionName'] = "news"
+        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())
@@ -382,7 +382,7 @@ class News(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(News, self).get_context_data(**kwargs)
-        context['sectionName'] = "news"
+        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())
@@ -395,7 +395,7 @@ class Emissions(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(Emissions, self).get_context_data(**kwargs)
-        context['sectionName'] = "emissions"
+        context['sectionName'] = "Emissions"
         context['emissions'] = Emission.objects.all().filter(archived=False).order_by('title')
         context['categories'] = Category.objects.all()
         return context
@@ -406,7 +406,7 @@ class Archives(TemplateView):
     template_name = 'archives.html'
     def get_context_data(self, **kwargs):
         context = super(Archives, self).get_context_data(**kwargs)
-        context['sectionName'] = "emissions"
+        context['sectionName'] = "Emissions"
         context['emissions'] = Emission.objects.all().filter(archived=True).order_by('title')
         return context
 
@@ -426,7 +426,7 @@ class Listen(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(Listen, self).get_context_data(**kwargs)
-        context['sectionName'] = "listen"
+        context['sectionName'] = "Listen"
         context['sounds'] = SoundFile.objects.all()[:15]
         listenable = []
         x=0
index 67137a2f801a655b1fcd4923877d6031bad6aa84..2e499124ca06faa499bc352a3e57925b798b78e9 100644 (file)
@@ -91,8 +91,12 @@ $(function() {
                According to this link the probles is that $(html).filter('body').Attr('id') will not work!
                http://www.devnetwork.net/viewtopic.php?f=13&t=117065
                */
-               var bodyID = html.match(/<body id="(.*?)">/);   
-               if(bodyID){$('body').attr('id',bodyID[1].trim());}      
+               if(sectionName = $(html).find('[data-section]').attr('data-section')){
+                       $('body').attr('id',sectionName);
+               }else{
+                       var bodyID = html.match(/<body id="(.*?)">/);   
+                       if(bodyID){$('body').attr('id',bodyID[1].trim());}      
+               }
                $("#Changing").css({'min-height':$(window).height()});
                $.scrollTo('#Changing',1000,{offset:-$('#metaNav').height()+2});
                init();
index 9185eced479cb9c264c3167df6b6377d03b57165..1438658b017e58179fe7385aaa3120ee39d152b4 100644 (file)
@@ -29,7 +29,7 @@
     {% block extrascripts %}{% endblock %}
 </head>
 
-<body id="{% block bodyID %}{% endblock %}" class="section-{{sectionName}}">
+<body id="{{sectionName}}" class="section-{{sectionName}}">
        <div id="All">
                {% block meta %}<div id="metaNav">{% metanav %}</div>{% endblock %}
                <div id="Commons">
@@ -41,7 +41,7 @@
                                {% block listen %}{% player %}{% endblock %}
                        </div>
                </div>
-               <div id="Changing" class="cf">
+               <div id="Changing" class="cf" data-section="{{ sectionName }}">
                        <div id="Nav">
                                <div class="wrapper">
                                {% block nav %}{% endblock %}
index 00969e2788b1287568a24289d8e9a967479228c3..fb24160044775c4025307e207afb77aedbcf8f7a 100644 (file)
@@ -33,7 +33,7 @@
 
        {% if emission.text %}
        <article class="text userContent">
-               {{ emission.text|safe }}
+               {{ emission.text|safe}}
        </article>
        {% endif %}
 </div>
index fabf45142b2b1064fa734031c31c19853c6681d4..04ebe5b7765c5e86f112ce83cd92591da308bc45 100644 (file)
@@ -54,8 +54,7 @@
                        "id":"{{ sound.file.url|slugify }}"
                }
                </code>
-       </audio>
-       
+       </audio>        
 {% else %}
-       <div class="error">No sound available!</div>
+       <div class="hidden error">No sound available!</div>
 {% endif%}
index 3880f0297dcb2b43d51b2597f0255878a77369bf..10daea0a37458dba794bff0bd50f5f2bfa7704b9 100644 (file)
                                {% if cell.episode %}
                                <strong>{{ cell.datetime|date:"H:i" }}</strong>&nbsp;-&nbsp;
                                        <a href="{% url 'episode-view' emission_slug=cell.episode.emission.slug slug=cell.episode.slug %}">
-                                               <span>{{ cell.episode.emission.title }}&nbsp;-&nbsp;{{ cell.episode.title }}</span>
+                                               <span><em>{{ cell.episode.emission.title }}</em>&nbsp;-&nbsp;{{ cell.episode.title }}</span>
                                                {% if cell.episode.description %}
-                                                       |<span class="smooth">&nbsp;-&nbsp;{{ cell.episode.description|safe|striptags|truncatewords:50 }}</span>
+                                                       <span class="smooth">&nbsp;|&nbsp;{{ cell.episode.description|safe|striptags|truncatewords:50 }}</span>
                                                {% elif cell.episode.emission.description %}
-                                                       |<span class="smooth">&nbsp;-&nbsp;{{ cell.episode.emission.description|safe|striptags|truncatewords:50 }}</span>
+                                                       <span class="smooth">&nbsp;|&nbsp;{{ cell.episode.emission.description|safe|striptags|truncatewords:50 }}</span>
                                                {% endif %}
                                        </a>
                                {% elif cell.emission %}
                                <strong>{{ cell.datetime|date:"H:i" }}</strong>&nbsp;-&nbsp;
                                        <a href="{% url 'emission-view' slug=cell.emission.slug %}">
-                                               <span>{{ cell.emission.title }}</span>
+                                               <span><em>{{ cell.emission.title }}</em></span>
                                                {% if  cell.emission.description %}
-                                                       <span class="smooth">&nbsp;-&nbsp;{{ cell.emission.description|safe|striptags|truncatewords:50 }}</span>
+                                                       <span class="smooth">&nbsp;|&nbsp;{{ cell.emission.description|safe|striptags|truncatewords:50 }}</span>
+                                               {% elif cell.emission.text %}
+                                                       <span class="smooth">&nbsp;|&nbsp;{{ cell.emission.text|safe|striptags|truncatewords:50 }}</span>
                                                {% endif %}
                                        </a>
                                {% else %}