Insert weight field in custom slides and order custom slides in the widget
This commit is contained in:
parent
34a690c713
commit
55073494fc
@ -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 {
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user