]> git.parisson.com Git - teleforma.git/commitdiff
only publish media on desk
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 4 Jul 2013 22:32:12 +0000 (00:32 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 4 Jul 2013 22:32:12 +0000 (00:32 +0200)
teleforma/templates/teleforma/inc/media_list.html
teleforma/views/core.py

index d5a2bbe64f0159f7aceb0e2ee4591a0b422eee31..6c5e13b824201094786da76453adbe4b7a07c230 100644 (file)
@@ -10,7 +10,7 @@
     <table class="listing" width="100%">
     <tbody>
         {% for media in course.media.all|from_course_type:type|from_period:period %}
-         {% if media.is_published or user.is_staff and course_view %}
+         {% if media.is_published or user.is_staff and not list_view %}
           {% if media.type == 'webm' %}
             <tr>
             <td {% if forloop.first %}class="border-top"{% endif %} width="230px" style="vertical-align:middle">
index 0878ee76e267b1e64c627d582f30cb45f8e7cf88..7ad7870a93ff1c14b38fc16b31d02f4d7a107522 100644 (file)
@@ -197,7 +197,6 @@ class CourseView(DetailView):
         context['room'] = get_room(name=course.title, content_type=content_type,
                                    id=course.id)
         context['doc_types'] = DocumentType.objects.all()
-        context['course_view'] = True
         return context
 
     @method_decorator(login_required)
@@ -228,7 +227,6 @@ class CoursesView(ListView):
         context['room'] = get_room(name='site')
         context['doc_types'] = DocumentType.objects.all()
         context['all_courses'] = sorted(self.all_courses, key=lambda k: k['number'])
-        context['period'] = get_periods(self.request.user)[0]
         return context
 
     @method_decorator(login_required)
@@ -246,6 +244,7 @@ class PeriodListView(CoursesView):
     def get_context_data(self, **kwargs):
         context = super(PeriodListView, self).get_context_data(**kwargs)
         context['period'] = self.period
+        context['list_view'] = True
         return context