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
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'))
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):
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 = []
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')
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())
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())
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
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')
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
<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>