]> git.parisson.com Git - teleforma.git/commitdiff
fix prof unicode, prepare media pending view
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 6 Aug 2013 13:19:36 +0000 (15:19 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 6 Aug 2013 13:19:36 +0000 (15:19 +0200)
teleforma/models/core.py
teleforma/static/teleforma/video-js/video-js.css
teleforma/views/core.py

index 986711562efd46376a857df2c5569273da151dc0..fc6dcd2252137a9d8aea647c01c33e70386d939f 100644 (file)
@@ -202,7 +202,10 @@ class Professor(Model):
                                         blank=True, null=True)
 
     def __unicode__(self):
-        return self.user.last_name + ' ' + self.user.first_name[0] + '.'
+        if self.user.first_name and self.user.last_name:
+            return self.user.last_name + ' ' + self.user.first_name[0] + '.'
+        else:
+            return self.user.username
 
     def to_json_dict(self):
         data = {'username': self.user.username,
index cd468eb0310bd767655192ee38268b9d3d000ee7..0604f3cf1b7c08f626b9540ff029e6dcc060461f 100644 (file)
@@ -141,6 +141,10 @@ so you can upgrade to newer versions easier. You can remove all these styles by
 .vjs-default-skin.vjs-paused .vjs-play-control div { width: 15px; height: 17px; background: url('video-js.png'); margin: 0.5em auto 0; }
 .vjs-default-skin.vjs-playing .vjs-play-control div { width: 15px; height: 17px; background: url('video-js.png') -25px 0; margin: 0.5em auto 0; }
 
+/* x2 playback */
+.vjs-default-skin.vjs-playing .vjs-playback-speed-x1 div { width: 15px; height: 17px; background: url('video-js.png') -25px 0; margin: 0.5em auto 0; }
+.vjs-default-skin.vjs-playing .vjs-playback-speed-x2 div { width: 15px; height: 17px; background: url('video-js.png') -25px 0; margin: 0.5em auto 0; }
+
 /* Rewind
 -------------------------------------------------------------------------------- */
 .vjs-default-skin .vjs-rewind-control { width: 5em; cursor: pointer !important; }
index a9f92da1a9266c3da79f1a1486efe8912247b4fb..218fef486e256655f09458cda2396e369c240045 100644 (file)
@@ -359,6 +359,24 @@ class MediaView(CourseAccessMixin, DetailView):
         media.save()
 
 
+class MediaPendingView(ListView):
+
+    model = Media
+    template_name='teleforma/media_pending.html'
+
+    def get_queryset(self):
+        return Media.objects.filter(is_published=False)
+
+    def get_context_data(self, **kwargs):
+        context = super(MediaPendingView, self).get_context_data(**kwargs)
+        return context
+
+    @method_decorator(permission_required('is_superuser'))
+    @method_decorator(login_required)
+    def dispatch(self, *args, **kwargs):
+        return super(MediaPendingView, self).dispatch(*args, **kwargs)
+
+
 class DocumentView(CourseAccessMixin, DetailView):
 
     model = Document