diff --git a/bower.json b/bower.json
index 338479c..6e003a9 100644
--- a/bower.json
+++ b/bower.json
@@ -15,6 +15,7 @@
],
"dependencies": {
"bootstrap-sass": "bootstrap-sass-official#^3.3.7",
- "slick-carousel": "^1.6.0"
+ "slick-carousel": "^1.4.1",
+ "slick-lightbox": "^0.2.10"
}
}
diff --git a/feedler/migrations/0004_auto_20170905_1502.py b/feedler/migrations/0004_auto_20170905_1502.py
new file mode 100644
index 0000000..3e36893
--- /dev/null
+++ b/feedler/migrations/0004_auto_20170905_1502.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.4 on 2017-09-05 13:02
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('feedler', '0003_entry_lang'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='entry',
+ name='lang',
+ field=models.CharField(blank=True, choices=[('de', 'Deutsch'), ('fr', 'Français'), ('it', 'Italiano'), ('en', 'English'), ('', ' * * * ')], default='', max_length=2),
+ ),
+ ]
diff --git a/publichealth/home/migrations/0019_auto_20170703_1244.py b/publichealth/home/migrations/0019_auto_20170703_1244.py
deleted file mode 100644
index 6565d9d..0000000
--- a/publichealth/home/migrations/0019_auto_20170703_1244.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.11.3 on 2017-07-03 10:44
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('home', '0018_contact_contact_form'),
- ]
-
- operations = [
- migrations.AlterModelOptions(
- name='dataletssettings',
- options={'verbose_name': 'Get support'},
- ),
- ]
diff --git a/publichealth/home/migrations/0019_auto_20170908_1505.py b/publichealth/home/migrations/0019_auto_20170908_1505.py
new file mode 100644
index 0000000..58ef971
--- /dev/null
+++ b/publichealth/home/migrations/0019_auto_20170908_1505.py
@@ -0,0 +1,42 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.4 on 2017-09-08 13:05
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import wagtail.wagtailcore.blocks
+import wagtail.wagtailcore.fields
+import wagtail.wagtailimages.blocks
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('home', '0018_contact_contact_form'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='dataletssettings',
+ options={'verbose_name': 'Get support'},
+ ),
+ migrations.AddField(
+ model_name='articlepage',
+ name='gallery',
+ field=wagtail.wagtailcore.fields.StreamField((('image', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('caption', wagtail.wagtailcore.blocks.TextBlock(required=False)))), icon='image')),), blank=True),
+ ),
+ migrations.AlterField(
+ model_name='articlepage',
+ name='body_de',
+ field=wagtail.wagtailcore.fields.StreamField((('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('section', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('info', wagtail.wagtailcore.blocks.StructBlock((('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('photo', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('summary', wagtail.wagtailcore.blocks.RichTextBlock(required=True)), ('action', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('url', wagtail.wagtailcore.blocks.URLBlock(required=False))))), ('placer', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('gallery', 'Image gallery')], icon='user'))), blank=True, null=True),
+ ),
+ migrations.AlterField(
+ model_name='articlepage',
+ name='body_fr',
+ field=wagtail.wagtailcore.fields.StreamField((('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('section', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('info', wagtail.wagtailcore.blocks.StructBlock((('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('photo', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('summary', wagtail.wagtailcore.blocks.RichTextBlock(required=True)), ('action', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('url', wagtail.wagtailcore.blocks.URLBlock(required=False))))), ('placer', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('gallery', 'Image gallery')], icon='user'))), blank=True, null=True),
+ ),
+ migrations.AlterField(
+ model_name='contactformfield',
+ name='field_type',
+ field=models.CharField(choices=[('singleline', 'Single line text'), ('multiline', 'Multi-line text'), ('email', 'Email'), ('number', 'Number'), ('url', 'URL'), ('checkbox', 'Checkbox'), ('checkboxes', 'Checkboxes'), ('dropdown', 'Drop down'), ('multiselect', 'Multiple select'), ('radio', 'Radio buttons'), ('date', 'Date'), ('datetime', 'Date/time')], max_length=16, verbose_name='field type'),
+ ),
+ ]
diff --git a/publichealth/home/migrations/0020_auto_20170904_2233.py b/publichealth/home/migrations/0020_auto_20170904_2233.py
deleted file mode 100644
index a96fbe9..0000000
--- a/publichealth/home/migrations/0020_auto_20170904_2233.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.11.4 on 2017-09-04 20:33
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ('home', '0019_auto_20170703_1244'),
- ]
-
- operations = [
- migrations.AlterField(
- model_name='contactformfield',
- name='field_type',
- field=models.CharField(choices=[('singleline', 'Single line text'), ('multiline', 'Multi-line text'), ('email', 'Email'), ('number', 'Number'), ('url', 'URL'), ('checkbox', 'Checkbox'), ('checkboxes', 'Checkboxes'), ('dropdown', 'Drop down'), ('multiselect', 'Multiple select'), ('radio', 'Radio buttons'), ('date', 'Date'), ('datetime', 'Date/time')], max_length=16, verbose_name='field type'),
- ),
- ]
diff --git a/publichealth/home/models/models.py b/publichealth/home/models/models.py
index 6fd1eb1..45be7cb 100644
--- a/publichealth/home/models/models.py
+++ b/publichealth/home/models/models.py
@@ -7,7 +7,7 @@ from django.utils import translation
from modelcluster.fields import ParentalKey
-from wagtail.wagtailcore.blocks import StructBlock, CharBlock, URLBlock, RichTextBlock
+from wagtail.wagtailcore.blocks import StructBlock, CharBlock, URLBlock, RichTextBlock, ListBlock, TextBlock, ChoiceBlock
from wagtail.wagtailcore.models import Page, Orderable
from wagtail.wagtailcore.fields import StreamField, RichTextField
from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel, InlinePanel, MultiFieldPanel
@@ -77,6 +77,13 @@ class ArticleIndexPage(Page):
class Meta:
verbose_name = "Rubrik"
+class ImageCarouselBlock(StructBlock):
+ image = ImageChooserBlock()
+ caption = TextBlock(required=False)
+
+ class Meta:
+ icon = 'image'
+
class ArticlePage(Page):
title_fr = models.CharField(max_length=255, default="")
trans_title = TranslatedField(
@@ -91,17 +98,28 @@ class ArticlePage(Page):
'intro_fr',
)
+ gallery = StreamField([
+ ('image', ListBlock(ImageCarouselBlock(), icon="image")),
+ ], blank=True)
+ # documents = StreamField([
+ # ('documents', ListBlock(DocumentChooserBlock(), icon="document")),
+ # ])
+
body_de = StreamField([
('paragraph', RichTextBlock()),
- ('image', ImageChooserBlock()),
('section', CharBlock(classname="full title")),
('info', InfoBlock()),
+ ('placer', ChoiceBlock(choices=[
+ ('gallery', 'Image gallery'),
+ ], icon='user'))
], null=True, blank=True)
body_fr = StreamField([
('paragraph', RichTextBlock()),
- ('image', ImageChooserBlock()),
('section', CharBlock(classname="full title")),
('info', InfoBlock()),
+ ('placer', ChoiceBlock(choices=[
+ ('gallery', 'Image gallery'),
+ ], icon='user'))
], null=True, blank=True)
trans_body = TranslatedField(
'body_de',
@@ -142,6 +160,7 @@ class ArticlePage(Page):
MultiFieldPanel([
ImageChooserPanel('feed_image'),
], heading="Images"),
+ StreamFieldPanel('gallery'),
]
promote_panels = [
InlinePanel('related_links', label="Links"),
diff --git a/publichealth/home/templates/home/article_page.html b/publichealth/home/templates/home/article_page.html
index 71336e8..f5137ff 100644
--- a/publichealth/home/templates/home/article_page.html
+++ b/publichealth/home/templates/home/article_page.html
@@ -1,14 +1,18 @@
{% extends "base.html" %}
-{% load wagtailcore_tags wagtailimages_tags %}
+{% load static wagtailcore_tags %}
{% block body_class %}template-{{ self.get_verbose_name|slugify }}{% endblock %}
+{% block extra_css %}
+
+
+
+{% endblock %}
+
{% block content %}
{% include_block block %} diff --git a/publichealth/home/templates/home/photo_gallery.html b/publichealth/home/templates/home/photo_gallery.html new file mode 100644 index 0000000..823bc4f --- /dev/null +++ b/publichealth/home/templates/home/photo_gallery.html @@ -0,0 +1,26 @@ +{% load compress static wagtailcore_tags wagtailimages_tags %} + + + +