From bcbed2edc608f17c87a19d0ed82d5eccc03c70af Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Wed, 20 Sep 2017 12:05:58 +0200 Subject: [PATCH 1/3] Correct usage of 'media' field --- Makefile | 2 +- feedler/migrations/0005_auto_20170920_1204.py | 21 ++++++++ .../migrations/0020_auto_20170920_1204.py | 28 +++++++++++ .../home/templates/home/article_content.html | 50 ------------------- .../home/templates/home/page_content.html | 2 +- 5 files changed, 51 insertions(+), 52 deletions(-) create mode 100644 feedler/migrations/0005_auto_20170920_1204.py create mode 100644 publichealth/home/migrations/0020_auto_20170920_1204.py delete mode 100644 publichealth/home/templates/home/article_content.html diff --git a/Makefile b/Makefile index b3a7aa2..3914c67 100644 --- a/Makefile +++ b/Makefile @@ -99,6 +99,6 @@ pg-restore: pg-surefire-drop-restore-db: # drop existing database, recreate it, and then restore its content from backup. - -docker-compose exec postgres bash -c 'dropdb -h localhost -U postgres postgres' + docker-compose exec postgres bash -c 'dropdb -h localhost -U postgres postgres' docker-compose exec postgres bash -c 'createdb -h localhost -U postgres postgres' make pg-restore diff --git a/feedler/migrations/0005_auto_20170920_1204.py b/feedler/migrations/0005_auto_20170920_1204.py new file mode 100644 index 0000000..33159e6 --- /dev/null +++ b/feedler/migrations/0005_auto_20170920_1204.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-09-20 10:04 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('feedler', '0004_auto_20170905_1502'), + ] + + operations = [ + migrations.AlterField( + model_name='entry', + name='stream', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='feedler.Stream', verbose_name='Original stream'), + ), + ] diff --git a/publichealth/home/migrations/0020_auto_20170920_1204.py b/publichealth/home/migrations/0020_auto_20170920_1204.py new file mode 100644 index 0000000..86bf257 --- /dev/null +++ b/publichealth/home/migrations/0020_auto_20170920_1204.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-09-20 10:04 +from __future__ import unicode_literals + +from django.db import migrations +import wagtail.wagtailcore.blocks +import wagtail.wagtailcore.fields +import wagtail.wagtailimages.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0019_auto_20170908_1505'), + ] + + operations = [ + 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))), icon='help')), ('media', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('gallery', 'Image gallery')], icon='media'))), 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))), icon='help')), ('media', wagtail.wagtailcore.blocks.ChoiceBlock(choices=[('gallery', 'Image gallery')], icon='media'))), blank=True, null=True), + ), + ] diff --git a/publichealth/home/templates/home/article_content.html b/publichealth/home/templates/home/article_content.html deleted file mode 100644 index d8b778d..0000000 --- a/publichealth/home/templates/home/article_content.html +++ /dev/null @@ -1,50 +0,0 @@ -{% load wagtailcore_tags wagtailimages_tags %} - -{% if page.feed_image %} -
- {% image page.feed_image fill-940x400 class="img-responsive" %} -
-{% endif %} - -

{{ page.trans_title }}

- -

{{ page.trans_intro|richtext }}

- -{% if page.date %} -

{{ page.date }}

-{% endif %} - - -
-{% for block in page.trans_body %} - {% if block.block_type == 'heading' %} -

{{ block.value }}

- {% elif block.block_type != 'info' %} -

- {% include_block block %} -

- {% endif %} -{% endfor %} -
- - -
-{% for block in page.trans_body %} - {% if block.block_type == 'info' %} -
-
- {% image block.value.photo fill-300x300 %} -
-
-

{{ block.value.title }}

-
- {{ block.value.summary|richtext }} - {% if block.value.action %} - - {% endif %} -
- {% endif %} -{% endfor %} -
diff --git a/publichealth/home/templates/home/page_content.html b/publichealth/home/templates/home/page_content.html index 5c32aeb..a2c4165 100644 --- a/publichealth/home/templates/home/page_content.html +++ b/publichealth/home/templates/home/page_content.html @@ -19,7 +19,7 @@ {% for block in page.trans_body %} {% if block.block_type == 'heading' %}

{{ block.value }}

- {% elif block.block_type == 'placer' %} + {% elif block.block_type == 'media' %} {% if block.value == 'gallery' %} {% include 'home/photo_gallery.html' %} {% endif %} From 77b976dbcf552e259844ac2c6253cc1563b2bd10 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Wed, 20 Sep 2017 12:18:03 +0200 Subject: [PATCH 2/3] Updated to Wagtail 1.12.2 --- requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index dc5b12c..f344d6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -# Updated: 11.9.2017 +# Updated: 20.9.2017 # Core -wagtail==1.12.1 +wagtail==1.12.2 Django==1.11.5 # Database @@ -9,7 +9,7 @@ psycopg2==2.7.3.1 dj-database-url==0.4.2 # Content -puput==0.9 +puput==0.9.1 guess-language-spirit==0.5.3 # Search @@ -30,4 +30,4 @@ stellar==0.4.3 gunicorn==19.7.1 whitenoise==3.3.0 ConcurrentLogHandler==0.9.1 -django-anymail==0.11.1 +django-anymail==1.0 From 8113b6d942fe78a346cdb161b3f28c1d929131a5 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Wed, 20 Sep 2017 12:18:12 +0200 Subject: [PATCH 3/3] Hide unused Feedly page setting --- feedler/models/admin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/feedler/models/admin.py b/feedler/models/admin.py index c6b6587..b259777 100644 --- a/feedler/models/admin.py +++ b/feedler/models/admin.py @@ -29,10 +29,11 @@ class FeedlySettings(BaseSetting): (2, '5'), (3, '10'), (4, '50'), - ), blank=True, null=True, + ), blank=True, null=True, editable=False, help_text='How many pages to fetch?' ) - feedly_stream = models.ManyToManyField(Stream) + feedly_stream = models.ManyToManyField(Stream, + help_text='Which streams to update') class Meta: verbose_name = 'Feedly'