Commit f5e01b7d authored by Simon Daron's avatar Simon Daron
Browse files

program description

parent aa60c70c
......@@ -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
......
......@@ -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();
......
......@@ -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 %}
......
......@@ -33,7 +33,7 @@
{% if emission.text %}
<article class="text userContent">
{{ emission.text|safe }}
{{ emission.text|safe}}
</article>
{% endif %}
</div>
......
......@@ -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%}
......@@ -20,19 +20,21 @@
{% 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 %}
......
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