Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
radiopanik
panikweb
Commits
519f9698
Commit
519f9698
authored
Oct 23, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
list future and recent episodes
parent
79347811
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
16 deletions
+41
-16
panikweb/views.py
panikweb/views.py
+15
-1
panikweb_templates/static/css/specifics.css
panikweb_templates/static/css/specifics.css
+10
-0
panikweb_templates/templates/emissions/emission_detail.html
panikweb_templates/templates/emissions/emission_detail.html
+16
-8
panikweb_templates/templates/emissions/nav.html
panikweb_templates/templates/emissions/nav.html
+0
-7
No files found.
panikweb/views.py
View file @
519f9698
...
...
@@ -51,10 +51,24 @@ class EmissionMixin:
select_params
=
(
False
,
True
),
where
=
[
'''datetime = (SELECT MIN(datetime)
FROM emissions_diffusion
WHERE episode_id = emissions_episode.id)'''
],
WHERE episode_id = emissions_episode.id
AND datetime <= CURRENT_TIMESTAMP)'''
],
tables
=
[
'emissions_diffusion'
],
).
order_by
(
'-first_diffusion'
).
distinct
()
context
[
'futurEpisodes'
]
=
\
episodes_queryset
.
extra
(
select
=
{
'first_diffusion'
:
'emissions_diffusion.datetime'
,
},
select_params
=
(
False
,
True
),
where
=
[
'''datetime = (SELECT MIN(datetime)
FROM emissions_diffusion
WHERE episode_id = emissions_episode.id
AND datetime > CURRENT_TIMESTAMP)'''
],
tables
=
[
'emissions_diffusion'
],
).
order_by
(
'first_diffusion'
).
distinct
()
# get all related soundfiles in a single query
soundfiles
=
{}
if
episode_ids
is
not
None
:
...
...
panikweb_templates/static/css/specifics.css
View file @
519f9698
...
...
@@ -889,6 +889,16 @@ h1.top#frequence {
font-size
:
80%
;
}
#Emission-tabs-menu
.futur-episodes
h5
,
#Emission-tabs-menu
.recent-episodes
h5
{
font-size
:
1.2em
;
margin-bottom
:
0.5ex
;
}
#Emission-tabs-menu
#search-form
{
margin-bottom
:
1em
;
}
ul
.extra-soundfiles
li
{
position
:
relative
;
}
...
...
panikweb_templates/templates/emissions/emission_detail.html
View file @
519f9698
...
...
@@ -23,6 +23,7 @@
</div>
<div
id=
"Emission-tabs-menu"
class=
"rightPart episodes"
>
{% if news %}
<div
class=
"sub"
>
<h5
class=
"sectionLabel"
>
Actu
</h5>
...
...
@@ -33,20 +34,27 @@
</ul>
</div>
{% endif %}
<h5
class=
"sectionLabel right"
><a
class=
""
href=
"{% url 'emissionEpisodes' slug=emission.slug %}"
>
Tous ({{ episodes.count }})
</a></h5>
<h5
class=
"sectionLabel"
>
Épisodes
</h5>
<form
method=
"get"
action=
"{% url 'emissionEpisodes' slug=emission.slug %}"
class=
""
id=
"search-form"
>
<input
id=
"id_q"
name=
"q"
type=
"text"
{%
if
search_query
%}
value=
"{{ search_query }}"
{%
endif
%}
>
<button
class=
"icon-search"
></button>
</form>
{% if futurEpisodes %}
<div
class=
"sub"
>
<h5
class=
"sectionLabel"
>
Bientôt
</h5>
{% for episode in futurEpisodes %}
<div
class=
"legend"
>
{{ episode.first_diffusion|date:"F Y" }}
</div>
{% episode_resume date="daytime" %}
<div
class=
"sub futur-episodes"
>
<h5
class=
"sectionLabel"
>
À venir
</h5>
{% for episode in futurEpisodes|slice:":3" %}
{% episode_inline %}
{% endfor %}
</div>
{% endif %}
{% if episodes.exists %}
<div
class=
"sub"
>
<h5
class=
"sectionLabel right"
><a
class=
""
href=
"{% url 'emissionEpisodes' slug=emission.slug %}"
>
Tous ({{ episodes.count }})
</a></h5>
<h5
class=
"sectionLabel"
>
Derniers épisodes
</h5>
<div
class=
"sub recent-episodes"
>
<h5
class=
"sectionLabel"
>
Récemment
</h5>
{% with episodes|slice:"0:5" as episodes %}
{% for episode in episodes %}
...
...
panikweb_templates/templates/emissions/nav.html
View file @
519f9698
...
...
@@ -49,13 +49,6 @@
</div>
{% endif %}
</div>
<div
class=
"rightPart"
>
<form
method=
"get"
action=
"{% url 'emissionEpisodes' slug=emission.slug %}"
class=
""
id=
"search-form"
>
<label
for=
"id_q"
>
Rechercher :
</label>
<input
id=
"id_q"
name=
"q"
type=
"text"
{%
if
search_query
%}
value=
"{{ search_query }}"
{%
endif
%}
>
<button
class=
"icon-search"
></button>
</form>
</div>
</header>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment