From 55073494fc20ea7937bed12d7b3d92b8ffe0a078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20J=C3=A4ckel?= Date: Wed, 5 Sep 2012 21:54:34 +0200 Subject: [PATCH] Insert weight field in custom slides and order custom slides in the widget --- openslides/projector/models.py | 1 + openslides/projector/views.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openslides/projector/models.py b/openslides/projector/models.py index e6e51716a..299b41afb 100644 --- a/openslides/projector/models.py +++ b/openslides/projector/models.py @@ -31,6 +31,7 @@ class ProjectorSlide(models.Model, SlideMixin): title = models.CharField(max_length=256, verbose_name=_("Title")) text = models.TextField(null=True, blank=True, verbose_name=_("Text")) + weight = models.IntegerField(default=0, verbose_name=_("Weight")) def slide(self): return { diff --git a/openslides/projector/views.py b/openslides/projector/views.py index 96af29ed6..59b660e2b 100644 --- a/openslides/projector/views.py +++ b/openslides/projector/views.py @@ -409,11 +409,11 @@ def get_widgets(request): # Custom slide widget context = { - 'slides': ProjectorSlide.objects.all(), + 'slides': ProjectorSlide.objects.all().order_by('weight'), 'welcomepage_is_active': not bool(config["presentation"])} widgets.append(Widget( name='custom_slide', - display_name=_('Custom Slide'), + display_name=_('Custom Slides'), template='projector/custom_slide_widget.html', context=context, permission_required='projector.can_manage_projector',