Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
radiopanik
panikweb
Commits
2a780882
Commit
2a780882
authored
Oct 16, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
home: add recent newsitems
parent
7cd3dec0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
panikweb/views.py
panikweb/views.py
+1
-0
panikweb_templates/templates/home.html
panikweb_templates/templates/home.html
+15
-0
No files found.
panikweb/views.py
View file @
2a780882
...
...
@@ -410,6 +410,7 @@ class Home(TemplateView):
'soundfile'
,
'episode'
,
'newsitem__category'
).
order_by
(
'?'
)[:
12
]
context
[
'emissions'
]
=
Emission
.
objects
.
filter
(
archived
=
False
,
creation_timestamp__gte
=
datetime
(
2013
,
9
,
13
)).
order_by
(
'title'
)
context
[
'newsitems'
]
=
NewsItem
.
objects
.
order_by
(
'-date'
)[:
3
]
context
[
'soundfiles'
]
=
SoundFile
.
objects
.
prefetch_related
(
'episode__emission__categories'
).
filter
(
podcastable
=
True
,
fragment
=
False
)
\
...
...
panikweb_templates/templates/home.html
View file @
2a780882
...
...
@@ -30,6 +30,21 @@
{% with focus as news %}
{% newsroll %}
{% endwith %}
{% if newsitems %}
<div
id=
"recent-news"
>
<h3
class=
"sectionLabel right"
><a
href=
"{% url 'news' %}"
>
Toutes
</a></h3>
<h3
class=
"sectionLabel"
>
Dernières actus
<a
class=
"button icon-rss inBlock"
href=
"{% url 'atom-feed' %}"
></a></h3>
<ul
class=
"custom list"
>
{% for content in newsitems %}
<li
class=
"item"
>
{% news_inline %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if soundfiles %}
<div
id=
"recent-sounds"
>
...
...
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