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
radiopanik
panikweb
Commits
f5e01b7d
Commit
f5e01b7d
authored
Aug 31, 2013
by
Simon Daron
Browse files
program description
parent
aa60c70c
Changes
6
Hide whitespace changes
Inline
Side-by-side
panikweb/views.py
View file @
f5e01b7d
...
...
@@ -23,7 +23,7 @@ class EmissionDetailView(DetailView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
EmissionDetailView
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"
e
missions"
context
[
'sectionName'
]
=
"
E
missions"
context
[
'schedules'
]
=
Schedule
.
objects
.
filter
(
emission
=
self
.
object
).
order_by
(
'datetime'
)
# get all episodes, with an additional attribute to get the date of
...
...
@@ -59,7 +59,7 @@ class EpisodeDetailView(DetailView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
EpisodeDetailView
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"
e
missions"
context
[
'sectionName'
]
=
"
E
missions"
context
[
'diffusions'
]
=
Diffusion
.
objects
.
filter
(
episode
=
self
.
object
.
id
)
context
[
'soundfiles'
]
=
SoundFile
.
objects
.
filter
(
episode
=
self
.
object
.
id
)
context
[
'emission'
]
=
Emission
.
objects
.
get
(
slug
=
self
.
kwargs
.
get
(
'emission_slug'
))
...
...
@@ -96,7 +96,7 @@ class ProgramView(TemplateView):
def
get_context_data
(
self
,
year
=
None
,
week
=
None
,
**
kwargs
):
context
=
super
(
ProgramView
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"
e
missions"
context
[
'sectionName'
]
=
"
E
missions"
schedules
=
Schedule
.
objects
.
select_related
().
order_by
(
'datetime'
)
days
=
[]
for
day
in
range
(
7
):
...
...
@@ -150,7 +150,7 @@ class Grid(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Grid
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"
e
missions"
context
[
'sectionName'
]
=
"
E
missions"
nb_lines
=
2
*
24
# the cells are half hours
grid
=
[]
...
...
@@ -354,7 +354,7 @@ class Home(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Home
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"
h
ome"
context
[
'sectionName'
]
=
"
H
ome"
context
[
'news'
]
=
list
(
NewsItem
.
objects
.
all
().
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-datetime'
)[:
10
])
context
[
'emissions'
]
=
list
(
Emission
.
objects
.
filter
(
archived
=
False
).
order_by
(
'title'
))
schedules
=
Schedule
.
objects
.
select_related
().
order_by
(
'datetime'
)
...
...
@@ -370,7 +370,7 @@ home = Home.as_view()
class
NewsItemDetailView
(
DetailView
):
model
=
NewsItem
def
get_context_data
(
self
,
**
kwargs
):
context
[
'sectionName'
]
=
"
n
ews"
context
[
'sectionName'
]
=
"
N
ews"
context
=
super
(
NewsItemDetailView
,
self
).
get_context_data
(
**
kwargs
)
context
[
'news'
]
=
list
(
NewsItem
.
objects
.
all
().
order_by
(
'-datetime'
)[:
60
])
context
[
'categories'
]
=
list
(
NewsCategory
.
objects
.
all
())
...
...
@@ -382,7 +382,7 @@ class News(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
News
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"
n
ews"
context
[
'sectionName'
]
=
"
N
ews"
context
[
'newsImaged'
]
=
list
(
NewsItem
.
objects
.
all
().
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-datetime'
)[:
3
])
context
[
'news'
]
=
list
(
NewsItem
.
objects
.
all
().
order_by
(
'-datetime'
)[:
60
])
context
[
'categories'
]
=
list
(
NewsCategory
.
objects
.
all
())
...
...
@@ -395,7 +395,7 @@ class Emissions(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Emissions
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"
e
missions"
context
[
'sectionName'
]
=
"
E
missions"
context
[
'emissions'
]
=
Emission
.
objects
.
all
().
filter
(
archived
=
False
).
order_by
(
'title'
)
context
[
'categories'
]
=
Category
.
objects
.
all
()
return
context
...
...
@@ -406,7 +406,7 @@ class Archives(TemplateView):
template_name
=
'archives.html'
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Archives
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"
e
missions"
context
[
'sectionName'
]
=
"
E
missions"
context
[
'emissions'
]
=
Emission
.
objects
.
all
().
filter
(
archived
=
True
).
order_by
(
'title'
)
return
context
...
...
@@ -426,7 +426,7 @@ class Listen(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Listen
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"
l
isten"
context
[
'sectionName'
]
=
"
L
isten"
context
[
'sounds'
]
=
SoundFile
.
objects
.
all
()[:
15
]
listenable
=
[]
x
=
0
...
...
panikweb_templates/static/js/specifics.js
View file @
f5e01b7d
...
...
@@ -91,8 +91,12 @@ $(function() {
According to this link the probles is that $(html).filter('body').Attr('id') will not work!
http://www.devnetwork.net/viewtopic.php?f=13&t=117065
*/
var
bodyID
=
html
.
match
(
/<body id="
(
.*
?)
">/
);
if
(
bodyID
){
$
(
'
body
'
).
attr
(
'
id
'
,
bodyID
[
1
].
trim
());}
if
(
sectionName
=
$
(
html
).
find
(
'
[data-section]
'
).
attr
(
'
data-section
'
)){
$
(
'
body
'
).
attr
(
'
id
'
,
sectionName
);
}
else
{
var
bodyID
=
html
.
match
(
/<body id="
(
.*
?)
">/
);
if
(
bodyID
){
$
(
'
body
'
).
attr
(
'
id
'
,
bodyID
[
1
].
trim
());}
}
$
(
"
#Changing
"
).
css
({
'
min-height
'
:
$
(
window
).
height
()});
$
.
scrollTo
(
'
#Changing
'
,
1000
,{
offset
:
-
$
(
'
#metaNav
'
).
height
()
+
2
});
init
();
...
...
panikweb_templates/templates/base.html
View file @
f5e01b7d
...
...
@@ -29,7 +29,7 @@
{% block extrascripts %}{% endblock %}
</head>
<body
id=
"{
% block bodyID %}{% endblock %
}"
class=
"section-{{sectionName}}"
>
<body
id=
"{
{sectionName}
}"
class=
"section-{{sectionName}}"
>
<div
id=
"All"
>
{% block meta %}
<div
id=
"metaNav"
>
{% metanav %}
</div>
{% endblock %}
<div
id=
"Commons"
>
...
...
@@ -41,7 +41,7 @@
{% block listen %}{% player %}{% endblock %}
</div>
</div>
<div
id=
"Changing"
class=
"cf"
>
<div
id=
"Changing"
class=
"cf"
data-section=
"{{ sectionName }}"
>
<div
id=
"Nav"
>
<div
class=
"wrapper"
>
{% block nav %}{% endblock %}
...
...
panikweb_templates/templates/emissions/detail.html
View file @
f5e01b7d
...
...
@@ -33,7 +33,7 @@
{% if emission.text %}
<article
class=
"text userContent"
>
{{ emission.text|safe
}}
{{ emission.text|safe}}
</article>
{% endif %}
</div>
...
...
panikweb_templates/templates/includes/audio.html
View file @
f5e01b7d
...
...
@@ -54,8 +54,7 @@
"id":"{{ sound.file.url|slugify }}"
}
</code>
</audio>
</audio>
{% else %}
<div
class=
"error"
>
No sound available!
</div>
<div
class=
"
hidden
error"
>
No sound available!
</div>
{% endif%}
panikweb_templates/templates/includes/week.html
View file @
f5e01b7d
...
...
@@ -20,19 +20,21 @@
{% if cell.episode %}
<strong>
{{ cell.datetime|date:"H:i" }}
</strong>
-
<a
href=
"{% url 'episode-view' emission_slug=cell.episode.emission.slug slug=cell.episode.slug %}"
>
<span>
{{ cell.episode.emission.title }}
-
{{ cell.episode.title }}
</span>
<span>
<em>
{{ cell.episode.emission.title }}
</em>
-
{{ cell.episode.title }}
</span>
{% if cell.episode.description %}
|
<span
class=
"smooth"
>
-
{{ cell.episode.description|safe|striptags|truncatewords:50 }}
</span>
<span
class=
"smooth"
>
|
{{ cell.episode.description|safe|striptags|truncatewords:50 }}
</span>
{% elif cell.episode.emission.description %}
|
<span
class=
"smooth"
>
-
{{ cell.episode.emission.description|safe|striptags|truncatewords:50 }}
</span>
<span
class=
"smooth"
>
|
{{ cell.episode.emission.description|safe|striptags|truncatewords:50 }}
</span>
{% endif %}
</a>
{% elif cell.emission %}
<strong>
{{ cell.datetime|date:"H:i" }}
</strong>
-
<a
href=
"{% url 'emission-view' slug=cell.emission.slug %}"
>
<span>
{{ cell.emission.title }}
</span>
<span>
<em>
{{ cell.emission.title }}
</
em></
span>
{% if cell.emission.description %}
<span
class=
"smooth"
>
-
{{ cell.emission.description|safe|striptags|truncatewords:50 }}
</span>
<span
class=
"smooth"
>
|
{{ cell.emission.description|safe|striptags|truncatewords:50 }}
</span>
{% elif cell.emission.text %}
<span
class=
"smooth"
>
|
{{ cell.emission.text|safe|striptags|truncatewords:50 }}
</span>
{% endif %}
</a>
{% else %}
...
...
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