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
5db067b4
Commit
5db067b4
authored
Nov 02, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add party mode
parent
d58db7ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
120 additions
and
0 deletions
+120
-0
panikweb/urls.py
panikweb/urls.py
+2
-0
panikweb/views.py
panikweb/views.py
+29
-0
panikweb_templates/templates/party.html
panikweb_templates/templates/party.html
+89
-0
No files found.
panikweb/urls.py
View file @
5db067b4
...
...
@@ -25,6 +25,8 @@ urlpatterns = patterns('',
url
(
r
'^news/archives/$'
,
'panikweb.search.newsArchives'
,
name
=
'newsArchives'
),
url
(
r
'^news/(?P<slug>[\w,-]+)$'
,
'panikweb.views.newsitemview'
,
name
=
'newsitem-view'
),
url
(
r
'^party'
,
'panikweb.views.party'
,
name
=
'party'
),
url
(
r
'^search/'
,
'panikweb.search.view'
,
name
=
'search'
),
url
(
r
'^news.rss'
,
'panikweb.views.rss_news_feed'
,
name
=
'rss-feed'
),
...
...
panikweb/views.py
View file @
5db067b4
from
datetime
import
datetime
,
timedelta
import
math
import
random
import
os
import
stat
import
time
...
...
@@ -603,3 +604,31 @@ class AtomNewsFeed(RssNewsFeed):
feed_type
=
Atom1Feed
atom_news_feed
=
AtomNewsFeed
()
class
Party
(
TemplateView
):
template_name
=
'party.html'
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Party
,
self
).
get_context_data
(
**
kwargs
)
t
=
random
.
choice
([
'newsitem'
]
*
2
+
[
'emission'
]
*
3
+
[
'soundfile'
]
*
1
+
[
'episode'
]
*
2
)
focus
=
Focus
()
if
t
==
'newsitem'
:
focus
.
newsitem
=
NewsItem
.
objects
.
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'?'
)[
0
]
elif
t
==
'emission'
:
focus
.
emission
=
Emission
.
objects
.
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'?'
)[
0
]
elif
t
==
'episode'
:
focus
.
episode
=
Episode
.
objects
.
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'?'
)[
0
]
elif
t
==
'soundfile'
:
focus
.
soundfile
=
SoundFile
.
objects
.
exclude
(
episode__image__isnull
=
True
).
exclude
(
episode__image__exact
=
''
).
order_by
(
'?'
)[
0
]
context
[
'focus'
]
=
focus
return
context
party
=
Party
.
as_view
()
panikweb_templates/templates/party.html
0 → 100644
View file @
5db067b4
{% extends "base.html" %}
{% load thumbnails %}
{% load paniktags %}
{% load staticfiles %}
{% load i18n %}
{% block bodyID %}Party{% endblock %}
{% block title %}Party{% endblock %}
{% block extrascripts %}
<script>
function
reload
()
{
if
(
location
.
href
.
indexOf
(
'
?
'
)
==
-
1
)
{
href
=
location
.
href
;
}
else
{
href
=
location
.
href
.
substring
(
0
,
location
.
href
.
indexOf
(
'
?
'
));
}
href
=
href
+
'
?
'
+
new
Date
().
getTime
()
$
(
'
#Changing
'
).
fadeOut
();
$
(
'
#Changing
'
).
load
(
href
+
"
#Changing>*
"
,
null
,
function
()
{
$
(
'
#Changing
'
).
fadeIn
();});
}
$
(
function
()
{
timer
=
setInterval
(
reload
,
10000
);
});
</script>
{% endblock %}
{% block main %}
<div
id=
"party"
class=
"news"
>
<div
class=
"content content-inline cf special"
>
<a
class=
"block cf"
href=
"{{ focus|get_focus_url}}"
>
{% if focus.content_category_title %}
<div
class=
"label labels absolute"
>
<span
class=
"item inBlock"
>
{{ focus.content_category_title }}
</span>
</div>
{% endif %}
<div
class=
"logo"
>
<img
class=
"normal"
src=
"{{ focus.content_image|thumbnail:'500x375' }}"
/>
</div>
<div
class=
"title"
><div>
{{ focus.focus_title }}
</div></div>
</a>
</div>
<style>
#metaNav
,
#Footer
,
.metas
{
display
:
none
;
}
.special
.title
{
opacity
:
0.9
;
width
:
482px
;
background
:
black
;
color
:
white
;
position
:
absolute
;
bottom
:
0
;
font-family
:
"RegloBold"
;
padding
:
10px
;
}
body
{
height
:
90%
;
overflow
:
hidden
;
}
#Changing
,
#Commons
{
float
:
none
;
height
:
200px
;
width
:
500px
;
margin
:
0
auto
0
auto
;
}
#backgroundBox
{
margin
:
auto
0
;
}
#Commons
>
.wrapper
{
position
:
relative
;
}
#Player
{
width
:
200px
;
position
:
absolute
;
top
:
50px
;
left
:
200px
;
}
</style>
{% 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