]> git.0d.be Git - panikdb.git/commitdiff
give staff members access to all emissions
authorFrédéric Péters <fpeters@0d.be>
Sun, 1 Sep 2013 16:34:36 +0000 (18:34 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sun, 1 Sep 2013 16:34:36 +0000 (18:34 +0200)
panikdb/static/css/style.css
panikdb/templates/home.html
panikdb/views.py

index ef8da172e1e772d861f8944e58dc65912d2c7592..61b588d8e5d736ce2afb12d6602b4740a2ea5ced 100644 (file)
@@ -416,6 +416,7 @@ div.two-columns > div > ul {
        overflow-y: auto;
 }
 
+[class^="icon-"]:after, [class*=" icon-"]:after,
 [class^="icon-"]:before, [class*=" icon-"]:before {
   font-family: FontAwesome;
   font-weight: normal;
@@ -440,3 +441,5 @@ a [class^="icon-"], a [class*=" icon-"] {
 .icon-circle-arrow-right:before   { content: "\f0a9"; }
 .icon-music:before                { content: "\f001"; }
 .icon-th:before                   { content: "\f00a"; }
+
+.icon-circle-arrow-down:after     { content: "  \f0ab"; }
index d4ddf2b6dccb382907075a349259693da7100769..70a9c773f4f7e551bb8e43dc96378892b9e0bdcb 100644 (file)
@@ -44,6 +44,17 @@ 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>
 
@@ -62,3 +73,14 @@ Aucune actu.
 {% endfor %}
 
 {% endblock %}
+
+{% block page-end %}
+
+<script>
+$(document).ready(function() {
+  $('#other-emissions').click(function() {
+     $('#other-emissions-list').toggle('blind');
+  });
+});
+</script>
+{% endblock %}
index 2c8ee07bc8011944f784b333e28e3daab44b1c2f..408da615986128679f07acd3997699f74ad4e421 100644 (file)
@@ -10,6 +10,10 @@ class Home(TemplateView):
         context = super(Home, self).get_context_data(**kwargs)
         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())