Merge pull request #11 from normanjaeckel/custom_slides

Insert weight field in custom slides and order custom slides in the
This commit is contained in:
Oskar Hahn 2012-09-11 00:47:07 -07:00
commit d6a0ec5893
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',