Commit 1b0d39aa authored by fred's avatar fred

add a 'all emissions' link in the appbar

parent acf7e459
......@@ -143,6 +143,7 @@ div#appbar span {
padding-right: 15px;
right: 10px;
top: 20px;
z-index: 10;
}
div#appbar button {
......
{% 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>
......
......@@ -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))),
......
......@@ -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())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment