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
ae9f3d66
Commit
ae9f3d66
authored
Sep 14, 2013
by
fred
Browse files
display news category in news roll
parent
285022d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
panikweb/views.py
View file @
ae9f3d66
...
...
@@ -400,7 +400,7 @@ class Home(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Home
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"Home"
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
all
(
).
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
0
:
5
])
context
[
'focus'
]
=
NewsItem
.
objects
.
select_related
(
'category'
).
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
:
9
]
context
[
'emissions'
]
=
list
(
Emission
.
objects
.
filter
(
archived
=
False
).
order_by
(
'title'
))
schedules
=
Schedule
.
objects
.
select_related
().
order_by
(
'datetime'
)
days
=
[]
...
...
@@ -441,7 +441,7 @@ class NewsItemView(DetailView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
NewsItemView
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"News"
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
all
(
).
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
0
:
9
])
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
select_related
(
'category'
).
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
0
:
9
])
context
[
'categories'
]
=
NewsCategory
.
objects
.
all
()
return
context
newsitemview
=
NewsItemView
.
as_view
()
...
...
@@ -451,9 +451,8 @@ class News(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
News
,
self
).
get_context_data
(
**
kwargs
)
context
[
'sectionName'
]
=
"News"
context
[
'focus'
]
=
list
(
NewsItem
.
objects
.
all
().
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
0
:
9
])
context
[
'news'
]
=
list
(
NewsItem
.
objects
.
all
().
exclude
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
3
:
14
])
context
[
'categories'
]
=
NewsCategory
.
objects
.
all
()
context
[
'focus'
]
=
NewsItem
.
objects
.
select_related
(
'category'
).
filter
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[:
9
]
context
[
'news'
]
=
NewsItem
.
objects
.
all
().
exclude
(
focus
=
True
).
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-date'
)[
3
:
14
]
return
context
news
=
News
.
as_view
()
...
...
panikweb_templates/templates/news/roll.html
View file @
ae9f3d66
...
...
@@ -9,13 +9,11 @@
<li
class=
"{% if forloop.counter > 3 %}largeScreens{% endif %}"
>
<a
title=
"{{content.title|striptags|addslashes}}"
class=
"block news relative"
href=
"{% url 'news-view' slug=content.slug %}"
>
{% if content.image %}
<!--
{% if content.category %}
<div
class=
"labels absolute"
>
<span class="item inBlock">Cd-Dvd</span>
<span class="item inBlock">Concours</span>
<span class="item inBlock">Fête</span>
<span
class=
"item inBlock"
>
{{ content.category.title }}
</span>
</div>
-->
{% endif %}
<div
class=
"absolute title "
>
<h5
class=
"ellipsis"
>
{{ content.date|date:"D m/m" }}
</h5>
</div>
...
...
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