resume.html 3.07 KB
Newer Older
1
{% load thumbnail paniktags staticfiles %}
2
3
<div class="episode {% if model %}{{ model }}{% else %}resume{% endif %} cf {{ class }}">
	{% if date != False %}
Simon Daron's avatar
Simon Daron committed
4
	<div class="dateBloc">
5
6
7
8
9
10
11
12
13
		<div class="date">
			<div class="day">
			    {{ episode.first_diffusion|date:"D"|slice:":2"}}
			</div>
			<div class="number">
			    {{ episode.first_diffusion|date:"d" }}
			</div>
			{% if date != "daytime" %}
			<div class="month">
14
			    {{ episode.first_diffusion|date:"M y" }}
15
16
17
18
19
			</div>
			{% endif %}
			<div class="time">
			    {{ episode.first_diffusion|date:"H:i" }}
			</div>
Simon Daron's avatar
Simon Daron committed
20
21
		</div>
	</div>
22
	{% endif %}
Simon Daron's avatar
Simon Daron committed
23
	<div class="logo">
24
		<a href="{% url 'episode-view' emission_slug=episode.emission.slug slug=episode.slug %}">
25
		{% if model = "inline" and episode.image %}
26
27
28
			{% thumbnail episode.image "60x60" crop="50% 25%" as im %}
			<img width="60" height="60" src="{{im.url}}"/>
			{% endthumbnail %}
Simon Daron's avatar
Simon Daron committed
29
		{% elif model = "inline" and episode.emission.image %}
30
31
32
			{% thumbnail emission.episode.image "60x60" crop="50% 25%" as im %}
			<img width="60" height="60" src="{{im.url}}"/>
			{% endthumbnail %}
33
		{% elif model = "inline" %}
34
			<img class="smooth"  style="width:60px;" src="{% static "img/emission.png" %}"/>
35
		{% elif episode.image %}
36
37
38
			{% thumbnail episode.image "150x150" crop="50% 25%" as im %}
			<img width="150" height="150" src="{{im.url}}"/>
			{% endthumbnail %}
Simon Daron's avatar
Simon Daron committed
39
		{% elif episode.emission.image %}
40
41
42
			{% thumbnail episode.emission.image "150x150" crop="50% 25%" as im %}
			<img width="150" height="150" src="{{im.url}}"/>
			{% endthumbnail %}
43
		{% else %}
44
			<img class="smooth" style="width:150px;" src="{% static "img/emission.png" %}"/>
45
		{% endif %}
46
		</a>
Simon Daron's avatar
Simon Daron committed
47
48
	</div>
	<div class="content">
Simon Daron's avatar
Simon Daron committed
49

50
		{% if episode.main_sound %}
Simon Daron's avatar
Simon Daron committed
51
52
			<div class="sound right">{% audio sound=episode.main_sound %}</div>
		{% endif %}
53
		<div class="title">
54
			<h5 class=" title">
55
56
57
58
				<a href="{% url 'episode-view' emission_slug=episode.emission.slug slug=episode.slug %}">{{ episode.title }}</a>
			</h5>
			<div class="smooth metas">
			{% if class = "standalone" %}
59
60
61
62
63
64
				<h5 class="title inBlock">
					<a href="{% url 'emission-view' slug=episode.emission.slug %}">{{ episode.emission.title }}</a>
				</h5>
				{% if episode.emission.categories %}
					<span class="categories">
					{% for category in episode.emission.categories.all %}
fred's avatar
fred committed
65
						{% if forloop.counter > 1 %} - {% endif %}<span class="category">{{category}}</span>
66
67
68
					{% endfor%}
					</span>
				{% endif %}
69
			{% endif %}
70
			</div>
71
72
		</div>

73
		{% if model = "inline" %}
74
75
			<div class="description">
			<a href="{% url 'episode-view' emission_slug=episode.emission.slug slug=episode.slug %}">
fred's avatar
fred committed
76
			{% if episode.subtitle %}
77
				{{ episode.subtitle|truncatewords:20}}
78
			{% elif episode.text %}
79
				{{ episode.text|safe|striptags|truncatewords:20}}
80
			{% endif %}
81
82
			</a>
			</div>
83
		{% else %}
fred's avatar
fred committed
84
			{% if episode.subtitle %}
Simon Daron's avatar
Simon Daron committed
85
			<article class="text userContent">
fred's avatar
fred committed
86
				{{ episode.subtitle|truncatewords:50 }}
87
88
			</article>
			{% elif episode.text %}
Simon Daron's avatar
Simon Daron committed
89
			<article class="text userContent">
90
				{{ episode.text|safe|truncatewords:50}}
91
92
			</article>
			{% endif %}
Simon Daron's avatar
Simon Daron committed
93
94
95
		{% endif %}
	</div>
</div>