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
panikdb
Commits
1b0d39aa
Commit
1b0d39aa
authored
Sep 08, 2013
by
fred
Browse files
add a 'all emissions' link in the appbar
parent
acf7e459
Changes
4
Hide whitespace changes
Inline
Side-by-side
panikdb/static/css/style.css
View file @
1b0d39aa
...
...
@@ -143,6 +143,7 @@ div#appbar span {
padding-right
:
15px
;
right
:
10px
;
top
:
20px
;
z-index
:
10
;
}
div
#appbar
button
{
...
...
panikdb/templates/home.html
View file @
1b0d39aa
{% extends "base.html" %}
{% block content %}
{% block appbar %}
{% if user.is_staff %}
<span><a
href=
"{% url 'emission-list' %}"
>
Toutes les émissions
</a></span>
{% endif %}
{% endblock %}
{% block content %}
{% for emission in emissions %}
<h2><a
href=
"{% url 'emission-view' slug=emission.slug %}"
>
{{ emission.title }}
</a></h2>
...
...
@@ -44,16 +49,6 @@ Aucune actu.
{% endfor %}
{% if all_emissions %}
<h2
class=
"icon-circle-arrow-down"
id=
"other-emissions"
>
Autres émissions
</h2>
<ul
class=
"emission-list"
id=
"other-emissions-list"
style=
"display: none;"
>
{% for emission in all_emissions %}
<li><a
href=
"{% url 'emission-view' slug=emission.slug %}"
>
{{emission.title}}
</a></li>
{% endfor %}
</ul>
{% endif %}
{% for news_category in news_categories %}
<h2>
{{ news_category.title }}
</h2>
...
...
panikdb/urls.py
View file @
1b0d39aa
...
...
@@ -24,7 +24,8 @@ urlpatterns = patterns('',
(
r
'^ckeditor/'
,
include
(
'ckeditor.urls'
)),
url
(
r
'^search/'
,
search_view_factory
(
view_class
=
FacetedSearchView
,
form_class
=
FacetedSearchForm
,
searchqueryset
=
sqs
),
name
=
'haystack_search'
),
url
(
r
'^emissions/$'
,
RedirectView
.
as_view
(
url
=
reverse_lazy
(
'home'
))),
url
(
r
'^$'
,
'panikdb.views.emissions'
,
name
=
'emission-list'
),
url
(
r
'^emissions/'
,
decorated_includes
(
login_required
,
include
(
emissions_urlpatterns
))),
...
...
panikdb/views.py
View file @
1b0d39aa
...
...
@@ -3,6 +3,8 @@ from django.views.generic.base import TemplateView
from
emissions.models
import
Emission
import
emissions.views
class
Home
(
TemplateView
):
template_name
=
'home.html'
...
...
@@ -11,9 +13,12 @@ class Home(TemplateView):
context
[
'emissions'
]
=
self
.
request
.
user
.
emissions
.
all
().
order_by
(
'title'
)
context
[
'news_categories'
]
=
self
.
request
.
user
.
news_categories
.
all
().
order_by
(
'title'
)
if
self
.
request
.
user
.
is_staff
:
context
[
'all_emissions'
]
=
Emission
.
objects
.
all
().
order_by
(
'title'
)
return
context
home
=
login_required
(
Home
.
as_view
())
class
EmissionListView
(
emissions
.
views
.
EmissionListView
):
pass
emissions
=
login_required
(
EmissionListView
.
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