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
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
panikdb
Commits
6748a09d
Commit
6748a09d
authored
Sep 08, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add browsing to newsitems
parent
1b0d39aa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
3 deletions
+64
-3
panikdb/static/css/style.css
panikdb/static/css/style.css
+8
-0
panikdb/templates/emissions/newscategory_list.html
panikdb/templates/emissions/newscategory_list.html
+33
-0
panikdb/templates/home.html
panikdb/templates/home.html
+3
-1
panikdb/urls.py
panikdb/urls.py
+3
-1
panikdb/views.py
panikdb/views.py
+17
-1
No files found.
panikdb/static/css/style.css
View file @
6748a09d
...
...
@@ -371,6 +371,14 @@ ul.episode-list {
-webkit-column-count
:
2
;
}
ul
.newsitem-list
{
column-count
:
2
;
-moz-column-count
:
2
;
-webkit-column-count
:
2
;
}
.fileprogress
{
border
:
1px
solid
#888
;
}
...
...
panikdb/templates/emissions/newscategory_list.html
0 → 100644
View file @
6748a09d
{% extends "base.html" %}
{% block appbar %}
{% if user.is_staff %}
<span><a
href=
"{% url 'emission-list' %}"
>
Toutes les émissions
</a>
-
<a
href=
"{% url 'news-list' %}"
>
Toutes les actus
</a></span>
{% endif %}
{% endblock %}
{% block content %}
<h2>
Actus
</h2>
{% for category in object_list %}
<h3>
{{ category.title }}
</h3>
<ul
class=
"newsitem-list"
>
{% for newsitem in category.sorted_news %}
<li><a
href=
"{% url 'newsitem-view' slug=newsitem.slug %}"
>
{{ newsitem.title }}
</a></li>
{% endfor %}
</ul>
{% endfor %}
<h3>
Actus non rangées
</h3>
<ul
class=
"newsitem-list"
>
{% for newsitem in unsorted_newsitems %}
<li><a
href=
"{% url 'newsitem-view' slug=newsitem.slug %}"
>
{{ newsitem.title }}
</a></li>
{% endfor %}
</ul>
{% endblock %}
panikdb/templates/home.html
View file @
6748a09d
...
...
@@ -2,7 +2,9 @@
{% block appbar %}
{% if user.is_staff %}
<span><a
href=
"{% url 'emission-list' %}"
>
Toutes les émissions
</a></span>
<span><a
href=
"{% url 'emission-list' %}"
>
Toutes les émissions
</a>
-
<a
href=
"{% url 'news-list' %}"
>
Toutes les actus
</a></span>
{% endif %}
{% endblock %}
...
...
panikdb/urls.py
View file @
6748a09d
...
...
@@ -25,11 +25,13 @@ urlpatterns = patterns('',
url
(
r
'^search/'
,
search_view_factory
(
view_class
=
FacetedSearchView
,
form_class
=
FacetedSearchForm
,
searchqueryset
=
sqs
),
name
=
'haystack_search'
),
url
(
r
'^$'
,
'panikdb.views.emissions'
,
name
=
'emission-list'
),
url
(
r
'^
emissions/
$'
,
'panikdb.views.emissions'
,
name
=
'emission-list'
),
url
(
r
'^emissions/'
,
decorated_includes
(
login_required
,
include
(
emissions_urlpatterns
))),
url
(
r
'^news/$'
,
'panikdb.views.news'
,
name
=
'news-list'
),
url
(
r
'^accounts/logout/'
,
'django.contrib.auth.views.logout_then_login'
,
name
=
'logout'
),
url
(
r
'^accounts/'
,
include
(
'registration.backends.default.urls'
)),
...
...
panikdb/views.py
View file @
6748a09d
from
django.contrib.auth.decorators
import
login_required
from
django.views.generic.base
import
TemplateView
from
django.views.generic.list
import
ListView
from
emissions.models
import
Emission
from
emissions.models
import
Emission
,
NewsCategory
,
NewsItem
import
emissions.views
...
...
@@ -22,3 +23,18 @@ class EmissionListView(emissions.views.EmissionListView):
pass
emissions
=
login_required
(
EmissionListView
.
as_view
())
class
NewsListView
(
ListView
):
model
=
NewsCategory
def
get_queryset
(
self
):
return
NewsCategory
.
objects
.
order_by
(
'title'
)
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
NewsListView
,
self
).
get_context_data
(
**
kwargs
)
context
[
'unsorted_newsitems'
]
=
NewsItem
.
objects
.
filter
(
category__isnull
=
True
).
order_by
(
'title'
)
return
context
news
=
login_required
(
NewsListView
.
as_view
())
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