Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
panikweb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
panikweb
Commits
ac56a061
Commit
ac56a061
authored
Nov 29, 2015
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
publish nonstop playlists
parent
4b9a732f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
121 additions
and
2 deletions
+121
-2
panikweb/urls.py
panikweb/urls.py
+2
-0
panikweb/views.py
panikweb/views.py
+39
-0
panikweb_templates/static/css/specifics.css
panikweb_templates/static/css/specifics.css
+20
-0
panikweb_templates/templates/emissions/emission_detail.html
panikweb_templates/templates/emissions/emission_detail.html
+20
-2
panikweb_templates/templates/nonstop_playlist.html
panikweb_templates/templates/nonstop_playlist.html
+40
-0
No files found.
panikweb/urls.py
View file @
ac56a061
...
...
@@ -20,6 +20,8 @@ urlpatterns = patterns('',
'panikweb.views.soundfile_embed'
,
name
=
'soundfile-embed-view'
),
url
(
r
'^emissions/(?P<emission_slug>[\w,-]+)/(?P<episode_slug>[\w,-]+)/dlg-embed/(?P<pk>\d+)/$'
,
'panikweb.views.soundfile_dlg_embed'
,
name
=
'soundfile-dialog-embed-view'
),
url
(
r
'^emissions/(?P<slug>[\w,-]+)/playlist/(?P<year>[0-9]{4})-(?P<month>[-\w]+)-(?P<day>[0-9]+)/$'
,
'panikweb.views.nonstop_playlist'
,
name
=
'nonstop-playlist'
),
url
(
r
'^emissions/(?P<slug>[\w,-]+)/$'
,
'panikweb.views.emission'
,
name
=
'emission-view'
),
url
(
r
'^ckeditor/'
,
include
(
'ckeditor.urls'
)),
url
(
r
'^emissions/archives$'
,
'panikweb.views.emissionsArchives'
,
name
=
'emissionsArchives'
),
...
...
panikweb/views.py
View file @
ac56a061
...
...
@@ -31,6 +31,7 @@ from emissions.utils import whatsonair, period_program
from
newsletter.forms
import
SubscribeForm
from
nonstop.utils
import
get_current_nonstop_track
from
nonstop.models
import
SomaLogLine
from
panikombo.models
import
ItemTopik
...
...
@@ -102,6 +103,18 @@ class EmissionDetailView(DetailView, EmissionMixin):
context
[
'schedules'
]
=
Schedule
.
objects
.
select_related
().
filter
(
emission
=
self
.
object
).
order_by
(
'rerun'
,
'datetime'
)
context
[
'news'
]
=
NewsItem
.
objects
.
all
().
filter
(
emission
=
self
.
object
.
id
).
order_by
(
'-date'
)[:
3
]
try
:
nonstop_object
=
Nonstop
.
objects
.
get
(
slug
=
self
.
object
.
slug
)
except
Nonstop
.
DoesNotExist
:
pass
else
:
today
=
date
.
today
()
dates
=
[
today
-
timedelta
(
days
=
x
)
for
x
in
range
(
7
)]
if
datetime
.
now
().
time
()
<
nonstop_object
.
start
and
not
(
nonstop_object
.
end
<
nonstop_object
.
start
):
dates
=
dates
[
1
:]
context
[
'nonstop'
]
=
nonstop_object
context
[
'nonstop_dates'
]
=
dates
context
.
update
(
self
.
get_emission_context
(
self
.
object
))
return
context
emission
=
EmissionDetailView
.
as_view
()
...
...
@@ -125,6 +138,32 @@ class EpisodeDetailView(DetailView, EmissionMixin):
episode
=
EpisodeDetailView
.
as_view
()
class
NonstopPlaylistView
(
TemplateView
):
template_name
=
'nonstop_playlist.html'
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
NonstopPlaylistView
,
self
).
get_context_data
(
**
kwargs
)
context
[
'emission'
]
=
Emission
.
objects
.
get
(
slug
=
kwargs
.
get
(
'slug'
))
context
[
'date'
]
=
date
(
int
(
kwargs
.
get
(
'year'
)),
int
(
kwargs
.
get
(
'month'
)),
int
(
kwargs
.
get
(
'day'
)))
nonstop_object
=
Nonstop
.
objects
.
get
(
slug
=
kwargs
.
get
(
'slug'
))
start
=
datetime
(
int
(
kwargs
.
get
(
'year'
)),
int
(
kwargs
.
get
(
'month'
)),
int
(
kwargs
.
get
(
'day'
)),
nonstop_object
.
start
.
hour
,
nonstop_object
.
start
.
minute
)
end
=
datetime
(
int
(
kwargs
.
get
(
'year'
)),
int
(
kwargs
.
get
(
'month'
)),
int
(
kwargs
.
get
(
'day'
)),
nonstop_object
.
end
.
hour
,
nonstop_object
.
end
.
minute
)
if
end
<
start
:
end
=
end
+
timedelta
(
days
=
1
)
context
[
'tracks'
]
=
SomaLogLine
.
objects
.
filter
(
play_timestamp__gte
=
start
,
play_timestamp__lte
=
end
,
on_air
=
True
).
select_related
()
return
context
nonstop_playlist
=
NonstopPlaylistView
.
as_view
()
class
EmissionEpisodesDetailView
(
DetailView
,
EmissionMixin
):
model
=
Emission
template_name
=
'emissions/episodes.html'
...
...
panikweb_templates/static/css/specifics.css
View file @
ac56a061
...
...
@@ -1823,3 +1823,23 @@ body#embed ul.custom .soundfile-info {
body
#embed
span
.fragment-title
{
font-weight
:
normal
;
}
table
.playlist
{
width
:
90%
;
}
table
.playlist
td
{
padding
:
0.5ex
;
text-align
:
left
;
}
table
.playlist
td
.tracktime
{
width
:
6ex
;
text-align
:
center
;
}
p
.playlist-disclaimer
{
margin-top
:
2em
;
max-width
:
60ex
;
font-style
:
italic
;
}
panikweb_templates/templates/emissions/emission_detail.html
View file @
ac56a061
{% extends "emissions.html" %}
{% load paniktags staticfiles i18n %}
{% load paniktags staticfiles i18n
thumbnail
%}
{% block bodyID %}Emissions{% endblock %}
{% block title %}{{ emission.title }}{% endblock %}
...
...
@@ -31,7 +31,7 @@
{% endif %}
</div>
{% if episodes.exists or futurEpisodes.exists or news %}
{% if episodes.exists or futurEpisodes.exists or news
or nonstop
%}
<div
id=
"Emission-tabs-menu"
class=
"rightPart episodes"
>
{% if news %}
...
...
@@ -45,6 +45,24 @@
</div>
{% endif %}
{% if nonstop %}
<div
class=
"sub emissions-newsitems"
>
<h5
class=
"sectionLabel"
>
{% trans 'Recently' %}
</h5>
{% for date in nonstop_dates %}
<div
class=
"episode inline episode-inline"
>
{% if emission.image %}
{% thumbnail emission.image "60x60" crop="50% 25%" as im %}
<img
src=
"{{im.url}}"
/>
{% endthumbnail %}
{% endif %}
<div
class=
"title"
>
<h5
class=
"title"
><a
href=
"{% url 'nonstop-playlist' slug=emission.slug year=date.year month=date.month day=date.day %}"
>
{{date|date:'D d M Y'|lower}}
</a></h5>
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% if episodes.exists or futurEpisodes.exists %}
<h5
class=
"sectionLabel right"
><a
class=
""
href=
"{% url 'emissionEpisodes' slug=emission.slug %}"
>
Tous ({{ episodes.count }})
</a></h5>
...
...
panikweb_templates/templates/nonstop_playlist.html
0 → 100644
View file @
ac56a061
{% extends "emissions.html" %}
{% load paniktags staticfiles i18n thumbnail %}
{% block bodyID %}Emissions{% endblock %}
{% block title %}{{ emission.title }}{% endblock %}
{% block toptitle %}
<h1
class=
"top"
><a
href=
"{% url 'grid' %}"
>
{% trans 'Program' %}
</a></h1>
{% endblock %}
{% block nav %}
{% emission_nav %}
{% endblock %}
{% block main %}
<div
class=
"wrapper navigation cf"
>
<div
id=
"Emission-container"
class=
"emission"
>
<header>
<h3>
{% trans 'Playlist' %} - {{date|date:'l d F Y'|lower}}
</h3>
</header>
<table
class=
"playlist"
>
{% for track in tracks %}
<tr>
<td
class=
"tracktime"
>
{{track.play_timestamp|date:'h:i'}}
</td>
<td
class=
"tracktitle"
>
{{track.filepath.track.title }}
</td>
<td
class=
"trackartist"
>
{{track.filepath.track.artist.name }}
</td>
</tr>
{% endfor %}
</table>
<p
class=
"playlist-disclaimer"
>
N.B. Débordements d'émissions et autres manifestations
radiophoniques spontanées peuvent amener cette liste à ne pas être
totalement correcte.
</p>
</div>
</div>
{% endblock %}
{% block links %}
{% endblock %}
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