Skip to content
GitLab
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
9d9c534c
Commit
9d9c534c
authored
Aug 21, 2013
by
Simon Daron
Browse files
Remove HTML view for onair
parent
9296e2c6
Changes
2
Hide whitespace changes
Inline
Side-by-side
panikweb/urls.py
View file @
9d9c534c
...
...
@@ -16,7 +16,6 @@ urlpatterns = patterns('',
url
(
r
'^ckeditor/'
,
include
(
'ckeditor.urls'
)),
url
(
r
'^get$'
,
'panikweb.views.get'
,
name
=
'get'
),
url
(
r
'^player$'
,
'panikweb.views.player'
,
name
=
'player'
),
url
(
r
'^what$'
,
'panikweb.views.what'
,
name
=
'what'
),
(
r
'^api/v2/'
,
include
(
'fiber.rest_api.urls'
)),
(
r
'^admin/fiber/'
,
include
(
'fiber.admin_urls'
)),
...
...
panikweb/views.py
View file @
9d9c534c
...
...
@@ -173,44 +173,12 @@ class Get(TemplateView):
get
=
Get
.
as_view
()
class
WhatsOnAir
(
TemplateView
):
template_name
=
'whatsonair.html'
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
WhatsOnAir
,
self
).
get_context_data
(
**
kwargs
)
now
=
datetime
.
now
()
date_start
=
now
-
timedelta
(
days
=
1
)
date_end
=
now
+
timedelta
(
days
=
1
)
diffusions
=
Diffusion
.
objects
.
filter
(
datetime__range
=
(
date_start
,
date_end
)).
order_by
(
'datetime'
)
diffusions
=
[
x
for
x
in
diffusions
if
x
.
datetime
<=
now
and
now
<=
x
.
datetime
+
timedelta
(
minutes
=
x
.
episode
.
emission
.
duration
)]
episode
=
None
emission
=
None
if
diffusions
:
# there should be only one
diffusion
=
diffusions
[
0
]
episode
=
diffusion
.
episode
emission
=
episode
.
emission
else
:
for
schedule
in
Schedule
.
objects
.
all
():
if
not
schedule
.
matches
(
now
):
continue
emission
=
schedule
.
emission
break
context
[
'episode'
]
=
episode
context
[
'emission'
]
=
emission
return
context
what
=
WhatsOnAir
.
as_view
()
class
Player
(
TemplateView
):
template_name
=
'player.html'
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Player
,
self
).
get_context_data
(
**
kwargs
)
#context['whatsonair'] = WhatsOnAir.as_view() #HOW TO PRELOAD WHATSONAIR ON PLAYER?
return
context
return
context
player
=
Player
.
as_view
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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