Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon Daron
panikweb
Commits
f4479341
Commit
f4479341
authored
Jun 28, 2018
by
fred
Browse files
add support for nonstop redirect path
parent
4af9d12b
Changes
3
Show whitespace changes
Inline
Side-by-side
panikweb/views.py
View file @
f4479341
...
...
@@ -290,15 +290,15 @@ class Grid(TemplateView):
if
nonstop
.
start
<
nonstop
.
end
:
nonstops
.
append
([
nonstop
.
start
.
hour
+
nonstop
.
start
.
minute
/
60.
,
nonstop
.
end
.
hour
+
nonstop
.
end
.
minute
/
60.
,
nonstop
.
title
,
nonstop
.
slug
])
nonstop
.
title
,
nonstop
.
slug
,
nonstop
])
else
:
# crossing midnight
nonstops
.
append
([
nonstop
.
start
.
hour
+
nonstop
.
start
.
minute
/
60.
,
24
,
nonstop
.
title
,
nonstop
.
slug
])
nonstop
.
title
,
nonstop
.
slug
,
nonstop
])
nonstops
.
append
([
0
,
nonstop
.
end
.
hour
+
nonstop
.
end
.
minute
/
60.
,
nonstop
.
title
,
nonstop
.
slug
])
nonstop
.
title
,
nonstop
.
slug
,
nonstop
])
nonstops
.
sort
()
for
i
in
range
(
nb_lines
):
...
...
@@ -310,6 +310,7 @@ class Grid(TemplateView):
for
time_cell
in
grid
[
-
1
]:
time_cell
.
nonstop
=
nonstop
[
2
]
time_cell
.
nonstop_slug
=
nonstop
[
3
]
time_cell
.
redirect_path
=
nonstop
[
4
].
redirect_path
if
nonstop
[
1
]
==
5
:
# the one ending at 5am will be cut down, so we inscribe
# its duration manually
...
...
@@ -642,9 +643,12 @@ def onair(request):
'chat'
:
chat_url
,
}
if
d
.
get
(
'nonstop'
):
redirect_path
=
d
[
'nonstop'
].
redirect_path
d
[
'nonstop'
]
=
{
'title'
:
d
[
'nonstop'
].
title
,
}
if
redirect_path
:
d
[
'nonstop'
][
'url'
]
=
redirect_path
d
.
update
(
get_current_nonstop_track
())
if
d
.
get
(
'current_slot'
):
del
d
[
'current_slot'
]
...
...
panikweb_templates/static/js/specifics.js
View file @
f4479341
...
...
@@ -190,7 +190,11 @@ $(function() {
$
(
'
<a>
'
,{
href
:
onair
.
data
.
episode
.
url
,
html
:
onair
.
data
.
episode
.
title
}).
appendTo
(
onairContainer
).
ajaxifyClick
();
}
}
else
if
(
onair
.
data
.
nonstop
)
{
if
(
onair
.
data
.
nonstop
.
url
)
{
onairContainer
=
$
(
'
<a href="
'
+
onair
.
data
.
nonstop
.
url
+
'
">
'
+
onair
.
data
.
nonstop
.
title
+
'
</a>
'
);
}
else
{
onairContainer
=
$
(
'
<span>
'
+
onair
.
data
.
nonstop
.
title
+
'
</span>
'
);
}
if
(
onair
.
data
.
track_title
)
{
$
(
'
<span> - </span>
'
).
appendTo
(
onairContainer
);
$
(
'
<span class="nonstop-track-title">
'
+
onair
.
data
.
track_title
+
'
</span>
'
).
appendTo
(
onairContainer
);
...
...
panikweb_templates/templates/grid.html
View file @
f4479341
...
...
@@ -60,7 +60,8 @@
</div>
{% endfor %}
{% else %}
<div
class=
"continu"
><strong><a
href=
"{% url 'emission-view' slug=cell.nonstop_slug %}"
>
{{ cell }}
</a></strong></div>
<div
class=
"continu"
><strong><a
href=
"{% if cell.redirect_path %}{{ cell.redirect_path }}{% else %}{% url 'emission-view' slug=cell.nonstop_slug %}{% endif %}"
>
{{ cell }}
</a></strong></div>
{% if cell.w > 1 and cell.h > 1%}
<p>
la musique en continu
</p>
{% endif %}
{% endif %}
</td>
...
...
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