Skip to content

Commit

Permalink
Add PhotoSlider backend
Browse files Browse the repository at this point in the history
  • Loading branch information
apardyl committed Apr 14, 2021
1 parent 60e8034 commit d2ed4e5
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 13 deletions.
47 changes: 47 additions & 0 deletions agenda/migrations/0020_auto_20210414_1724.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Generated by Django 3.1.8 on 2021-04-14 15:24

import common.blocks
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks


class Migration(migrations.Migration):

dependencies = [
('agenda', '0019_auto_20210412_0215'),
]

operations = [
migrations.AlterField(
model_name='edition',
name='content',
field=wagtail.core.fields.StreamField([('agenda', wagtail.core.blocks.StructBlock([('index', wagtail.core.blocks.PageChooserBlock(page_type=['agenda.EventIndex', 'agenda.Edition']))])), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('event_index', wagtail.core.blocks.StructBlock([('index', wagtail.core.blocks.PageChooserBlock(page_type=['agenda.EventIndex', 'agenda.Edition'])), ('shown_posts', wagtail.core.blocks.IntegerBlock(min_value=1)), ('show_legend', wagtail.core.blocks.BooleanBlock(default=False, required=False))])), ('event_schedule', wagtail.core.blocks.StructBlock([('index', wagtail.core.blocks.PageChooserBlock(page_type=['agenda.EventIndex', 'agenda.Edition']))])), ('section_title', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_subtitle', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_divider', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('dropdown', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('content', wagtail.core.blocks.RichTextBlock())])), ('photo_gallery', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('photo_slider', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('random_order', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('map', wagtail.core.blocks.StructBlock([('center_longitude', wagtail.core.blocks.FloatBlock()), ('center_latitude', wagtail.core.blocks.FloatBlock()), ('zoom', wagtail.core.blocks.FloatBlock()), ('bearing', wagtail.core.blocks.FloatBlock()), ('pitch', wagtail.core.blocks.FloatBlock()), ('markers', wagtail.core.blocks.ListBlock(common.blocks.MapMarker)), ('placeholder', wagtail.images.blocks.ImageChooserBlock(help_text='Insert a screenshot of the map here'))])), ('raw_html', wagtail.core.blocks.RawHTMLBlock())], blank=True, null=True, verbose_name='content'),
),
migrations.AlterField(
model_name='edition',
name='content_en',
field=wagtail.core.fields.StreamField([('agenda', wagtail.core.blocks.StructBlock([('index', wagtail.core.blocks.PageChooserBlock(page_type=['agenda.EventIndex', 'agenda.Edition']))])), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('event_index', wagtail.core.blocks.StructBlock([('index', wagtail.core.blocks.PageChooserBlock(page_type=['agenda.EventIndex', 'agenda.Edition'])), ('shown_posts', wagtail.core.blocks.IntegerBlock(min_value=1)), ('show_legend', wagtail.core.blocks.BooleanBlock(default=False, required=False))])), ('event_schedule', wagtail.core.blocks.StructBlock([('index', wagtail.core.blocks.PageChooserBlock(page_type=['agenda.EventIndex', 'agenda.Edition']))])), ('section_title', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_subtitle', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_divider', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('dropdown', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('content', wagtail.core.blocks.RichTextBlock())])), ('photo_gallery', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('photo_slider', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('random_order', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('map', wagtail.core.blocks.StructBlock([('center_longitude', wagtail.core.blocks.FloatBlock()), ('center_latitude', wagtail.core.blocks.FloatBlock()), ('zoom', wagtail.core.blocks.FloatBlock()), ('bearing', wagtail.core.blocks.FloatBlock()), ('pitch', wagtail.core.blocks.FloatBlock()), ('markers', wagtail.core.blocks.ListBlock(common.blocks.MapMarker)), ('placeholder', wagtail.images.blocks.ImageChooserBlock(help_text='Insert a screenshot of the map here'))])), ('raw_html', wagtail.core.blocks.RawHTMLBlock())], blank=True, null=True, verbose_name='content'),
),
migrations.AlterField(
model_name='edition',
name='content_pl',
field=wagtail.core.fields.StreamField([('agenda', wagtail.core.blocks.StructBlock([('index', wagtail.core.blocks.PageChooserBlock(page_type=['agenda.EventIndex', 'agenda.Edition']))])), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('event_index', wagtail.core.blocks.StructBlock([('index', wagtail.core.blocks.PageChooserBlock(page_type=['agenda.EventIndex', 'agenda.Edition'])), ('shown_posts', wagtail.core.blocks.IntegerBlock(min_value=1)), ('show_legend', wagtail.core.blocks.BooleanBlock(default=False, required=False))])), ('event_schedule', wagtail.core.blocks.StructBlock([('index', wagtail.core.blocks.PageChooserBlock(page_type=['agenda.EventIndex', 'agenda.Edition']))])), ('section_title', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_subtitle', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_divider', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('dropdown', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('content', wagtail.core.blocks.RichTextBlock())])), ('photo_gallery', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('photo_slider', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('random_order', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('map', wagtail.core.blocks.StructBlock([('center_longitude', wagtail.core.blocks.FloatBlock()), ('center_latitude', wagtail.core.blocks.FloatBlock()), ('zoom', wagtail.core.blocks.FloatBlock()), ('bearing', wagtail.core.blocks.FloatBlock()), ('pitch', wagtail.core.blocks.FloatBlock()), ('markers', wagtail.core.blocks.ListBlock(common.blocks.MapMarker)), ('placeholder', wagtail.images.blocks.ImageChooserBlock(help_text='Insert a screenshot of the map here'))])), ('raw_html', wagtail.core.blocks.RawHTMLBlock())], blank=True, null=True, verbose_name='content'),
),
migrations.AlterField(
model_name='edition',
name='edition_footer',
field=wagtail.core.fields.StreamField([('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('section_title', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_subtitle', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_divider', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('dropdown', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('content', wagtail.core.blocks.RichTextBlock())])), ('photo_gallery', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('photo_slider', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('random_order', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('raw_html', wagtail.core.blocks.RawHTMLBlock())], blank=True, null=True, verbose_name='edition footer'),
),
migrations.AlterField(
model_name='edition',
name='edition_footer_en',
field=wagtail.core.fields.StreamField([('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('section_title', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_subtitle', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_divider', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('dropdown', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('content', wagtail.core.blocks.RichTextBlock())])), ('photo_gallery', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('photo_slider', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('random_order', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('raw_html', wagtail.core.blocks.RawHTMLBlock())], blank=True, null=True, verbose_name='edition footer'),
),
migrations.AlterField(
model_name='edition',
name='edition_footer_pl',
field=wagtail.core.fields.StreamField([('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('section_title', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_subtitle', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('section_divider', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('dropdown', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('content', wagtail.core.blocks.RichTextBlock())])), ('photo_gallery', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('photo_slider', wagtail.core.blocks.StructBlock([('image_height', wagtail.core.blocks.IntegerBlock(default=64, max_value=2000, min_value=0)), ('image_width', wagtail.core.blocks.IntegerBlock(default=260, max_value=2000, min_value=0)), ('crop_to_fit', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('random_order', wagtail.core.blocks.BooleanBlock(default=False, required=False)), ('photos', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock(required=False)), ('photo', wagtail.images.blocks.ImageChooserBlock()), ('link', wagtail.core.blocks.URLBlock(required=False)), ('white_background', wagtail.core.blocks.BooleanBlock(default=False, required=False))])))])), ('raw_html', wagtail.core.blocks.RawHTMLBlock())], blank=True, null=True, verbose_name='edition footer'),
),
]
4 changes: 3 additions & 1 deletion agenda/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from agenda.blocks import AgendaBlock, EventIndexBlock, EventScheduleBlock
from common.blocks import SectionTitleBlock, SectionSubtitleBlock, SectionDividerBlock, DropdownBlock, PhotoGallery, \
MapBlock
MapBlock, PhotoSlider
from common.cache import InvalidateCacheMixin
from common.models import SFIPage, AudioFile, ThemeSettings
from common.utils import paginate, with_context, copy_multi_lang
Expand Down Expand Up @@ -191,6 +191,7 @@ class Edition(RoutablePageMixin, EditionSubpage):
('section_divider', SectionDividerBlock()),
('dropdown', DropdownBlock()),
('photo_gallery', PhotoGallery()),
('photo_slider', PhotoSlider()),
('map', MapBlock()),
('raw_html', RawHTMLBlock()),
], null=True, blank=True, verbose_name=_('content'))
Expand All @@ -211,6 +212,7 @@ class Edition(RoutablePageMixin, EditionSubpage):
('section_divider', SectionDividerBlock()),
('dropdown', DropdownBlock()),
('photo_gallery', PhotoGallery()),
('photo_slider', PhotoSlider()),
('raw_html', blocks.RawHTMLBlock()),
], null=True, blank=True, verbose_name=_('edition footer'))

Expand Down
Loading

0 comments on commit d2ed4e5

Please sign in to comment.