Insert weight field in custom slides and order custom slides in the widget

This commit is contained in:
Norman Jäckel 2012-09-05 21:54:34 +02:00
parent 34a690c713
commit 55073494fc
2 changed files with 3 additions and 2 deletions

View File

@ -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 {

View File

@ -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',