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
panikdb
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
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
panikdb
Commits
ddcad4b4
Commit
ddcad4b4
authored
Apr 18, 2014
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
also list recent changes in newsitems and soundfiles on homepage
parent
b096b066
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
panikdb/templates/home.html
panikdb/templates/home.html
+24
-0
panikdb/views.py
panikdb/views.py
+4
-0
No files found.
panikdb/templates/home.html
View file @
ddcad4b4
...
...
@@ -116,6 +116,30 @@ Aucune actu.
{% endfor %}
</ul>
<h3>
Actus récemment édités
</h3>
<ul
class=
"episode-list"
>
{% for newsitem in recent_newsitems|slice:":20" %}
<li>
{{ newsitem.last_update_timestamp|date:"d E o H:i"|lower }}
<a
href=
"{% url 'newsitem-view' slug=newsitem.slug %}"
>
{{ newsitem.title }}
</a>
</li>
{% endfor %}
</ul>
<h3>
Sons récemment édités
</h3>
<ul
class=
"episode-list"
>
{% for soundfile in recent_soundfiles|slice:":20" %}
<li>
{{ soundfile.last_update_timestamp|date:"d E o H:i"|lower }}
<a
href=
"{% url 'emission-view' slug=soundfile.episode.emission.slug %}"
>
{{ soundfile.episode.emission.title }}
</a>
/
<a
href=
"{% url 'episode-view' slug=soundfile.episode.slug emission_slug=soundfile.episode.emission.slug %}"
>
{{ soundfile.episode.title }}
</a>
{% if soundfile.fragment %} ({{soundfile.title}}){% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
...
...
panikdb/views.py
View file @
ddcad4b4
...
...
@@ -25,6 +25,10 @@ class Home(TemplateView):
context
[
'focused_items'
]
=
Focus
.
objects
.
select_related
().
filter
(
current
=
True
)
context
[
'recent_episodes'
]
=
Episode
.
objects
.
select_related
(
).
order_by
(
'-last_update_timestamp'
)
context
[
'recent_newsitems'
]
=
NewsItem
.
objects
.
select_related
(
).
order_by
(
'-last_update_timestamp'
)
context
[
'recent_soundfiles'
]
=
SoundFile
.
objects
.
select_related
(
).
order_by
(
'-last_update_timestamp'
)
return
context
...
...
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