Commit 140b7a73 authored by Simon Daron's avatar Simon Daron
Browse files

Prepare future episodes

parent 3f7373c5
......@@ -115,10 +115,10 @@ def weekview(context, year=None, week=None, weekday=None, fragment=None):
'year': year,
}
@register.inclusion_tag('news/inline.html', takes_context=False)
def news_inline(content=None, klass=None, logo=None):
@register.inclusion_tag('news/inline.html', takes_context=True)
def news_inline(context, klass=None, logo=None):
return {
'content': content,
'content': context.get('content'),
'class': klass,
'logo': logo
}
......
......@@ -56,6 +56,8 @@ class EmissionMixin:
for episode in context['episodes']:
episode.main_sound = soundfiles.get(episode.id)
#context['futurEpisodes'] = context['episodes'].filter(first_diffusion='2013')[0:3]
return context
......@@ -66,6 +68,7 @@ class EmissionDetailView(DetailView, EmissionMixin):
context = super(EmissionDetailView, self).get_context_data(**kwargs)
context['sectionName'] = "Emissions"
context['schedules'] = Schedule.objects.select_related().filter(emission=self.object).order_by('datetime')
context['news'] = NewsItem.objects.all().filter(emission=self.object.id)
context.update(self.get_emission_context(self.object))
return context
emission = EmissionDetailView.as_view()
......
......@@ -174,9 +174,9 @@ nav ul li, ul.inline li{
ul.list{
list-style-type:square; /*Not working but why?*/
list-style-position:inside;
column-rule:1px solid #ccc;
-moz-column-rule:1px solid #ccc;
-webkit-column-rule:1px solid #ccc;
column-rule:3px solid #999;
-moz-column-rule:3px solid #999;
-webkit-column-rule:3px solid #999;
}
ul.list > li{
padding:0.5em 0 0.5em 0;
......@@ -249,13 +249,16 @@ a.active, button.active{
}
.block {display:block;}
.inBlock{display:inline-block;}
.right{float:right;margin-left:1em;margin-bottom:1em;}
.left{float:left;margin-right:1em;margin-bottom:1em;}
.right{float:right;margin-left:1em;}
.left{float:left;margin-right:1em;}
.userContent .right, .userContent .left{
margin-bottom:1.5em;
}
img.right, img.left{max-width:50%;}
.smooth{opacity:0.5;}
.hidden{display:none;}
.padded{padding:1.5em;}
.marged{margin:1.5em;}
.marged{margin:1.5em 0 1.5em 0;}
.small{ font-size: 80%;}
.big{ font-size: 150%;}
......@@ -272,7 +275,8 @@ img.right, img.left{max-width:50%;}
}
.center{
text-align:center;
margin:auto;
margin-left:auto;
margin-right:auto;
}
.loading{
......
......@@ -20,8 +20,8 @@
text-align: center;}
.dateBloc{display:inline-block;}
.dateBloc *{line-height: 100%;}
.dateBloc .day {font-size: 2.2em;}
.dateBloc .number {font-size: 2.2em;}
.dateBloc .day {font-size: 1.8em;}
.dateBloc .number {font-size: 1.8em;}
.dateBloc .month {font-size: 0.8em;}
.dateBloc .time {font-size: 1.2em;margin: 0.2em 0;}
......@@ -527,9 +527,6 @@ background-color:#ff6633; border-color:#fff;}
*/
}
/**** Detail ****/
.emission-detail .metas {
margin:0em 0 1em 0;
}
.emission-detail .metas{
line-height:1.5em;
}
......@@ -542,7 +539,6 @@ background-color:#ff6633; border-color:#fff;}
.emission-detail .logo{
float:right;
max-width:50%;
margin:0em 0 0 1em;
}
@media screen and (max-width: 300px) {
.emission-detail .metas {
......@@ -584,7 +580,10 @@ background-color:#ff6633; border-color:#fff;}
.episode .tag{
}
.episode.resume, .episode.inline{
padding:0.5em 0.5em 0;
padding:1em 0.5em 1em;
}
.episode.inline .dateBloc, .episode.resume .dateBloc{
float:left;
}
.episode.resume img {
border: 2px solid black;
......@@ -593,7 +592,7 @@ background-color:#ff6633; border-color:#fff;}
.episode.resume .title{
margin-bottom:0.5em;
}
.episode.resume .logo{
.episode.inline .logo, .episode.resume .logo{
float: right;
}
.episode.resume .sound{
......
{% load i18n %}
{% load paniktags %}
<div class="emission emission-detail cf">
<div class="metas">
{% if emission.image %}
<img class="logo" src="{{ emission.image.url }}"/>
{% endif %}
{% if emission.subtitle %}
<strong class="subtitle">
{{ emission.subtitle }}
</strong>
{% endif %}
<div class="metas marged">
{% if schedules %}
<ul class="schedule custom">
{% for schedule in schedules %}
<li>
<div>
<span class="label">{{ schedule.datetime|date:"l G:i" }}</span>
{% if schedule.rerun %} <span class="smooth">(rediff)</span> {% endif %}
</div>
<span class="label">{{ schedule.datetime|date:"l G:i" }}</span>
{% if schedule.rerun %} <span class="smooth">(rediff)</span> {% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% if emission.subtitle %}
<div class="description">
{{ emission.subtitle }}
{% if emission.image %}
<img class="logo right" src="{{ emission.image.url }}"/>
{% endif %}
{% if emission.description %}
<div class="description bold">
{{ emission.description }}
</div>
{% endif %}
......
......@@ -17,21 +17,42 @@
</div>
<div id="Emission-tabs-last" class="episodes">
{% if episodes %}
<h5 class="sectionLabel">Derniers épisodes</h5>
{% with episodes|slice:"0:1" as episodes %}
{% for episode in episodes %}
<div class="legend">{{ episode.first_diffusion|date:"F Y" }}</div>
{% episode_resume date="daytime" %}
{% if news %}
<div>
<h5 class="sectionLabel">Actu</h5>
<ul class="custom list">
{% for content in news %}
<li>{% news_inline %}</li>
{% endfor %}
{% endwith %}
{% with episodes|slice:"1:3" as episodes %}
{% for episode in episodes %}
</ul>
</div>
{% endif %}
{% if futurEpisodes %}
<div>
<h5 class="sectionLabel marged">Prochains épisodes</h5>
{% for episode in futurEpisodes %}
<div class="legend">{{ episode.first_diffusion|date:"F Y" }}</div>
{% episode_resume model="inline" date="daytime" %}
{% episode_resume date="daytime" %}
{% endfor %}
{% endwith %}
{% endif %}
</div>
{% endif %}
{% if episodes %}
<div>
<h5 class="sectionLabel marged">Derniers épisodes</h5>
{% with episodes|slice:"0:1" as episodes %}
{% for episode in episodes %}
<div class="legend">{{ episode.first_diffusion|date:"F Y" }}</div>
{% episode_resume date="daytime" %}
{% endfor %}
{% endwith %}
{% with episodes|slice:"1:1" as episodes %}
{% for episode in episodes %}
<div class="legend">{{ episode.first_diffusion|date:"F Y" }}</div>
{% episode_resume model="inline" date="daytime" %}
{% endfor %}
{% endwith %}
</div>
{% endif %}
</div>
</div>
</div>
......
......@@ -17,12 +17,12 @@
{% audio sound=episode.main_sound %}
</div>
{% endif %}
{% if episode.image %}
<div class="logo right">
<img src="{{ episode.image|thumbnail:'640x480' }}"/>
</div>
{% endif %}
<div class="content userContent">
<div class="content userContent marged">
{% if episode.image %}
<div class="logo right">
<img src="{{ episode.image|thumbnail:'640x480' }}"/>
</div>
{% endif %}
{% if episode.subtitle %}
<div class="description">
{{ episode.subtitle }}
......
{% load thumbnails %}
{% load paniktags %}
<div class="episode {% if model = "inline" %}inline{% else %}resume{% endif %} cf">
<div class="dateBloc left">
<div class="dateBloc">
<div class="date">
<div class="day">
{{ episode.first_diffusion|date:"D"|slice:":2"}}
......@@ -20,7 +20,7 @@
</div>
</div>
{% if episode.image %}
<div class="logo right">
<div class="logo">
{% if model = "inline" %}
<img src="{{ episode.image|thumbnail:'75x75' }}"/>
{% else %}
......
......@@ -8,9 +8,9 @@
<div class="news">
<div class="wrapper">
<ul class="custom columns list news cf">
{% for NewsItem in news %}
{% for content in news %}
<li class="item">
{% news_inline content=NewsItem klass="special inBlock padded" logo="medium"%}
{% news_inline klass="special inBlock padded" logo="medium"%}
</li>
{% endfor %}
</ul>
......
{% load thumbnails %}
<div class="content content-inline inline cf {{ class }}">
<div>
<a class="block" href="{% url 'news-view' slug=content.slug %}">
{% if content.datetime %}
<div class="date cf">{{ content.datetime|date:"D m/M" }}</div>
{% endif %}
{% if content.image %}
{% if logo == "large" %}
<img class="logo" src="{{ content.image|thumbnail:'800x600' }}"/>
{% elif logo == "medium" %}
<img class="logo" src="{{ content.image|thumbnail:'320x240' }}"/>
{% else %}
<img class="logo" src="{{ content.image|thumbnail:'60x60' }}"/>
{% endif %}
{% endif %}
<div class="content">
<h5 class="title {% if not class %}ellipsis{% endif %}">{{ content.title }}</h5>
<div class="description {% if not class %}ellipsis{% endif %}">
{% if logo == "large" %}
{{ content.text|safe|striptags|truncatewords:100}}
{% elif logo == "medium" %}
{{ content.text|safe|striptags|truncatewords:50}}
{% else %}
{{ content.text|safe|striptags|truncatewords:20}}
{% endif %}
</div>
<a class="block cf" href="{% url 'news-view' slug=content.slug %}">
{% if content.image %}
<img class="logo left" src="{{ content.image|thumbnail:'60x60' }}"/>
{% endif %}
{% if content.datetime %}
<strong>{{ content.datetime|date:"D m/M" }}</strong>
{% endif %}
<div class="content">
<h5 class="title {% if not class %}ellipsis{% endif %}">{{ content.title }}</h5>
<div class="description {% if not class %}ellipsis{% endif %}">
{% if logo == "large" %}
{{ content.text|safe|striptags|truncatewords:100}}
{% elif logo == "medium" %}
{{ content.text|safe|striptags|truncatewords:50}}
{% else %}
{{ content.text|safe|striptags|truncatewords:20}}
{% endif %}
</div>
</a>
</div>
</div>
</a>
</div>
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