From 43b13bfe8122861385a4d7427d7e4abe5c8b2bc3 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Wed, 22 Feb 2017 08:47:00 +0100 Subject: [PATCH 01/28] Requirements update --- publichealth/home/templates/home/home_page.html | 12 +----------- requirements.txt | 6 +++--- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/publichealth/home/templates/home/home_page.html b/publichealth/home/templates/home/home_page.html index 2697e86..fd69fb2 100644 --- a/publichealth/home/templates/home/home_page.html +++ b/publichealth/home/templates/home/home_page.html @@ -34,19 +34,9 @@ {{ block.action }} - {% endif %} + {% endfor %} - {% if block.block_type == 'heading' %} -

{{ block.value }}

- {% else %} -
- {% include_block block %} -
- {% endfor %} - - - {% endblock %} diff --git a/requirements.txt b/requirements.txt index 8884b2f..29f3949 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ Django==1.10.5 psycopg2==2.6.2 -elasticsearch==5.0.1 +elasticsearch==5.2.0 django-redis==4.7.0 -wagtail==1.8 +wagtail==1.9 django-libsass==0.7 libsass==0.12.3 Pillow==4.0.0 @@ -12,6 +12,6 @@ stellar==0.4.3 # Production dependencies dj-database-url==0.4.2 -whitenoise==3.2.3 +whitenoise==3.3.0 uwsgi==2.0.14 ConcurrentLogHandler==0.9.1 From 9d4196657dbc05425bbe976b17059284f2d01d92 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Wed, 22 Feb 2017 09:50:17 +0100 Subject: [PATCH 02/28] Home page model --- publichealth/home/models.py | 1 + publichealth/home/templates/home/home_page.html | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/publichealth/home/models.py b/publichealth/home/models.py index ab52890..2fe63b2 100644 --- a/publichealth/home/models.py +++ b/publichealth/home/models.py @@ -80,6 +80,7 @@ class ArticlePage(Page): ] parent_page_types = ['home.ArticleIndexPage'] subpage_types = [] + template = 'article/article_page.html' class ArticleRelatedLink(Orderable): page = ParentalKey(ArticlePage, related_name='related_links') diff --git a/publichealth/home/templates/home/home_page.html b/publichealth/home/templates/home/home_page.html index fd69fb2..d36efed 100644 --- a/publichealth/home/templates/home/home_page.html +++ b/publichealth/home/templates/home/home_page.html @@ -1,5 +1,6 @@ {% extends "base.html" %} {% load wagtailcore_tags %} +{% load wagtailimages_tags %} {% block body_class %}template-{{ self.get_verbose_name|slugify }}{% endblock %} @@ -23,15 +24,15 @@
{% for block in page.infos %}
-
- +
+ {% image block.value.photo fill-300x300 %}
-

{{ block.title }}

+

{{ block.value.title }}

- {{ block.summary|richtext }} + {{ block.value.summary|richtext }}
{% endfor %} From d04691c1ec0318b1cb49c83327cb99b11024ef83 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Thu, 23 Feb 2017 09:23:18 +0100 Subject: [PATCH 03/28] Reverted migrations --- .../migrations/0003_auto_20161209_0655.py | 33 ---------------- ...221_1728.py => 0003_auto_20170223_0922.py} | 30 ++++++++++----- .../migrations/0005_auto_20170221_1748.py | 38 ------------------- .../migrations/0006_auto_20170221_1811.py | 28 -------------- publichealth/home/models.py | 8 +++- .../{article => home}/article_page.html | 0 6 files changed, 27 insertions(+), 110 deletions(-) delete mode 100644 publichealth/home/migrations/0003_auto_20161209_0655.py rename publichealth/home/migrations/{0004_auto_20170221_1728.py => 0003_auto_20170223_0922.py} (66%) delete mode 100644 publichealth/home/migrations/0005_auto_20170221_1748.py delete mode 100644 publichealth/home/migrations/0006_auto_20170221_1811.py rename publichealth/home/templates/{article => home}/article_page.html (100%) diff --git a/publichealth/home/migrations/0003_auto_20161209_0655.py b/publichealth/home/migrations/0003_auto_20161209_0655.py deleted file mode 100644 index 0a1d370..0000000 --- a/publichealth/home/migrations/0003_auto_20161209_0655.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.4 on 2016-12-09 05:55 -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', '0002_create_homepage'), - ] - - operations = [ - migrations.AddField( - model_name='homepage', - name='body_de', - field=wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())), blank=True, null=True), - ), - migrations.AddField( - model_name='homepage', - name='body_fr', - field=wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())), blank=True, null=True), - ), - migrations.AddField( - model_name='homepage', - name='title_fr', - field=models.CharField(default='', max_length=255), - ), - ] diff --git a/publichealth/home/migrations/0004_auto_20170221_1728.py b/publichealth/home/migrations/0003_auto_20170223_0922.py similarity index 66% rename from publichealth/home/migrations/0004_auto_20170221_1728.py rename to publichealth/home/migrations/0003_auto_20170223_0922.py index 7217474..f1c749e 100644 --- a/publichealth/home/migrations/0004_auto_20170221_1728.py +++ b/publichealth/home/migrations/0003_auto_20170223_0922.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-21 16:28 +# Generated by Django 1.10.5 on 2017-02-23 08:22 from __future__ import unicode_literals from django.db import migrations, models @@ -13,9 +13,9 @@ import wagtail.wagtailimages.blocks class Migration(migrations.Migration): dependencies = [ - ('wagtailimages', '0016_deprecate_rendition_filter_relation'), ('wagtailcore', '0032_add_bulk_delete_page_permission'), - ('home', '0003_auto_20161209_0655'), + ('wagtailimages', '0018_remove_rendition_filter'), + ('home', '0002_create_homepage'), ] operations = [ @@ -36,8 +36,10 @@ class Migration(migrations.Migration): ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), ('title_fr', models.CharField(default='', max_length=255)), ('date', models.DateField(verbose_name='Date')), - ('body_de', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())), blank=True, null=True)), - ('body_fr', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())), blank=True, null=True)), + ('intro_de', wagtail.wagtailcore.fields.RichTextField(default='')), + ('intro_fr', wagtail.wagtailcore.fields.RichTextField(default='')), + ('body_de', wagtail.wagtailcore.fields.StreamField([('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())], blank=True, null=True)), + ('body_fr', wagtail.wagtailcore.fields.StreamField([('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())], blank=True, null=True)), ('feed_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')), ], options={ @@ -55,21 +57,29 @@ class Migration(migrations.Migration): ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_links', to='home.ArticlePage')), ], options={ - 'abstract': False, 'ordering': ['sort_order'], + 'abstract': False, }, ), - migrations.RemoveField( + migrations.AddField( model_name='homepage', name='body_de', + field=wagtail.wagtailcore.fields.RichTextField(default=''), ), - migrations.RemoveField( + migrations.AddField( model_name='homepage', name='body_fr', + field=wagtail.wagtailcore.fields.RichTextField(default=''), ), - migrations.RemoveField( + migrations.AddField( model_name='homepage', - name='title_fr', + name='infos_de', + field=wagtail.wagtailcore.fields.StreamField([('info', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'summary', wagtail.wagtailcore.blocks.RichTextBlock()), (b'action', wagtail.wagtailcore.blocks.CharBlock(required=True))]))], blank=True, null=True), + ), + migrations.AddField( + model_name='homepage', + name='infos_fr', + field=wagtail.wagtailcore.fields.StreamField([('info', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'summary', wagtail.wagtailcore.blocks.RichTextBlock()), (b'action', wagtail.wagtailcore.blocks.CharBlock(required=True))]))], blank=True, null=True), ), migrations.AddField( model_name='homepage', diff --git a/publichealth/home/migrations/0005_auto_20170221_1748.py b/publichealth/home/migrations/0005_auto_20170221_1748.py deleted file mode 100644 index 7ea7e18..0000000 --- a/publichealth/home/migrations/0005_auto_20170221_1748.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-21 16:48 -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', '0004_auto_20170221_1728'), - ] - - operations = [ - migrations.AddField( - model_name='homepage', - name='body_de', - field=wagtail.wagtailcore.fields.RichTextField(default=''), - ), - migrations.AddField( - model_name='homepage', - name='body_fr', - field=wagtail.wagtailcore.fields.RichTextField(default=''), - ), - migrations.AddField( - model_name='homepage', - name='infos_de', - field=wagtail.wagtailcore.fields.StreamField((('info', wagtail.wagtailcore.blocks.StructBlock((('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('summary', wagtail.wagtailcore.blocks.RichTextBlock())))),), blank=True, null=True), - ), - migrations.AddField( - model_name='homepage', - name='infos_fr', - field=wagtail.wagtailcore.fields.StreamField((('info', wagtail.wagtailcore.blocks.StructBlock((('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('summary', wagtail.wagtailcore.blocks.RichTextBlock())))),), blank=True, null=True), - ), - ] diff --git a/publichealth/home/migrations/0006_auto_20170221_1811.py b/publichealth/home/migrations/0006_auto_20170221_1811.py deleted file mode 100644 index a99f1a3..0000000 --- a/publichealth/home/migrations/0006_auto_20170221_1811.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-21 17:11 -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', '0005_auto_20170221_1748'), - ] - - operations = [ - migrations.AlterField( - model_name='homepage', - name='infos_de', - field=wagtail.wagtailcore.fields.StreamField((('info', wagtail.wagtailcore.blocks.StructBlock((('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('summary', wagtail.wagtailcore.blocks.RichTextBlock()), ('action', wagtail.wagtailcore.blocks.CharBlock(required=True))))),), blank=True, null=True), - ), - migrations.AlterField( - model_name='homepage', - name='infos_fr', - field=wagtail.wagtailcore.fields.StreamField((('info', wagtail.wagtailcore.blocks.StructBlock((('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('summary', wagtail.wagtailcore.blocks.RichTextBlock()), ('action', wagtail.wagtailcore.blocks.CharBlock(required=True))))),), blank=True, null=True), - ), - ] diff --git a/publichealth/home/models.py b/publichealth/home/models.py index 2fe63b2..8370518 100644 --- a/publichealth/home/models.py +++ b/publichealth/home/models.py @@ -36,6 +36,13 @@ class ArticlePage(Page): ) date = models.DateField("Date") + + intro_de = RichTextField(default='') + intro_fr = RichTextField(default='') + intro = TranslatedField( + 'intro_de', + 'intro_fr', + ) body_de = StreamField([ ('heading', blocks.CharBlock(classname="full title")), @@ -80,7 +87,6 @@ class ArticlePage(Page): ] parent_page_types = ['home.ArticleIndexPage'] subpage_types = [] - template = 'article/article_page.html' class ArticleRelatedLink(Orderable): page = ParentalKey(ArticlePage, related_name='related_links') diff --git a/publichealth/home/templates/article/article_page.html b/publichealth/home/templates/home/article_page.html similarity index 100% rename from publichealth/home/templates/article/article_page.html rename to publichealth/home/templates/home/article_page.html From 668c578c32aa39a44e2d4c7a249fc4789732a8bb Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Thu, 23 Feb 2017 10:13:44 +0100 Subject: [PATCH 04/28] Navigation --- ...223_0922.py => 0003_auto_20170223_0959.py} | 14 ++--- publichealth/home/models.py | 32 +++++++----- publichealth/home/templates/banner.html | 2 +- .../home/templates/home/article_page.html | 27 ++++++---- .../home/templates/home/home_page.html | 52 +++++++++---------- publichealth/home/templates/news_dynamic.html | 18 +++++++ publichealth/templates/footer.html | 5 +- publichealth/templates/header.html | 17 +++--- 8 files changed, 103 insertions(+), 64 deletions(-) rename publichealth/home/migrations/{0003_auto_20170223_0922.py => 0003_auto_20170223_0959.py} (81%) create mode 100644 publichealth/home/templates/news_dynamic.html diff --git a/publichealth/home/migrations/0003_auto_20170223_0922.py b/publichealth/home/migrations/0003_auto_20170223_0959.py similarity index 81% rename from publichealth/home/migrations/0003_auto_20170223_0922.py rename to publichealth/home/migrations/0003_auto_20170223_0959.py index f1c749e..0dc65ed 100644 --- a/publichealth/home/migrations/0003_auto_20170223_0922.py +++ b/publichealth/home/migrations/0003_auto_20170223_0959.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-23 08:22 +# Generated by Django 1.10.5 on 2017-02-23 08:59 from __future__ import unicode_literals from django.db import migrations, models @@ -26,7 +26,7 @@ class Migration(migrations.Migration): ('title_fr', models.CharField(default='', max_length=255)), ], options={ - 'abstract': False, + 'verbose_name': 'Rubrik', }, bases=('wagtailcore.page',), ), @@ -38,12 +38,12 @@ class Migration(migrations.Migration): ('date', models.DateField(verbose_name='Date')), ('intro_de', wagtail.wagtailcore.fields.RichTextField(default='')), ('intro_fr', wagtail.wagtailcore.fields.RichTextField(default='')), - ('body_de', wagtail.wagtailcore.fields.StreamField([('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())], blank=True, null=True)), - ('body_fr', wagtail.wagtailcore.fields.StreamField([('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())], blank=True, null=True)), + ('body_de', wagtail.wagtailcore.fields.StreamField([('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('section', wagtail.wagtailcore.blocks.CharBlock(classname='full title'))], blank=True, null=True)), + ('body_fr', wagtail.wagtailcore.fields.StreamField([('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('section', wagtail.wagtailcore.blocks.CharBlock(classname='full title'))], blank=True, null=True)), ('feed_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')), ], options={ - 'abstract': False, + 'verbose_name': 'Artikel', }, bases=('wagtailcore.page',), ), @@ -74,12 +74,12 @@ class Migration(migrations.Migration): migrations.AddField( model_name='homepage', name='infos_de', - field=wagtail.wagtailcore.fields.StreamField([('info', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'summary', wagtail.wagtailcore.blocks.RichTextBlock()), (b'action', wagtail.wagtailcore.blocks.CharBlock(required=True))]))], blank=True, null=True), + field=wagtail.wagtailcore.fields.StreamField([('info', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'summary', wagtail.wagtailcore.blocks.RichTextBlock(required=True)), (b'action', wagtail.wagtailcore.blocks.CharBlock()), (b'url', wagtail.wagtailcore.blocks.URLBlock())]))], blank=True, null=True), ), migrations.AddField( model_name='homepage', name='infos_fr', - field=wagtail.wagtailcore.fields.StreamField([('info', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'summary', wagtail.wagtailcore.blocks.RichTextBlock()), (b'action', wagtail.wagtailcore.blocks.CharBlock(required=True))]))], blank=True, null=True), + field=wagtail.wagtailcore.fields.StreamField([('info', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'summary', wagtail.wagtailcore.blocks.RichTextBlock(required=True)), (b'action', wagtail.wagtailcore.blocks.CharBlock()), (b'url', wagtail.wagtailcore.blocks.URLBlock())]))], blank=True, null=True), ), migrations.AddField( model_name='homepage', diff --git a/publichealth/home/models.py b/publichealth/home/models.py index 8370518..debbbf2 100644 --- a/publichealth/home/models.py +++ b/publichealth/home/models.py @@ -15,7 +15,7 @@ from .util import TranslatedField class ArticleIndexPage(Page): title_fr = models.CharField(max_length=255, default="") - translated_title = TranslatedField( + trans_title = TranslatedField( 'title', 'title_fr', ) @@ -27,10 +27,12 @@ class ArticleIndexPage(Page): # Add extra variables and return the updated context context['article_entries'] = ArticlePage.objects.child_of(self).live() return context + class Meta: + verbose_name = "Rubrik" class ArticlePage(Page): title_fr = models.CharField(max_length=255, default="") - translated_title = TranslatedField( + trans_title = TranslatedField( 'title', 'title_fr', ) @@ -39,22 +41,22 @@ class ArticlePage(Page): intro_de = RichTextField(default='') intro_fr = RichTextField(default='') - intro = TranslatedField( + trans_intro = TranslatedField( 'intro_de', 'intro_fr', ) body_de = StreamField([ - ('heading', blocks.CharBlock(classname="full title")), ('paragraph', blocks.RichTextBlock()), ('image', ImageChooserBlock()), + ('section', blocks.CharBlock(classname="full title")), ], null=True, blank=True) body_fr = StreamField([ - ('heading', blocks.CharBlock(classname="full title")), ('paragraph', blocks.RichTextBlock()), ('image', ImageChooserBlock()), + ('section', blocks.CharBlock(classname="full title")), ], null=True, blank=True) - body = TranslatedField( + trans_body = TranslatedField( 'body_de', 'body_fr', ) @@ -72,11 +74,15 @@ class ArticlePage(Page): index.SearchField('body_fr'), index.SearchField('title'), index.SearchField('title_fr'), + index.SearchField('intro_de'), + index.SearchField('intro_fr'), index.FilterField('date'), ] content_panels = Page.content_panels + [ FieldPanel('title_fr'), FieldPanel('date'), + FieldPanel('intro_de'), + FieldPanel('intro_fr'), StreamFieldPanel('body_de'), StreamFieldPanel('body_fr'), InlinePanel('related_links', label="Related links"), @@ -87,6 +93,8 @@ class ArticlePage(Page): ] parent_page_types = ['home.ArticleIndexPage'] subpage_types = [] + class Meta: + verbose_name = "Artikel" class ArticleRelatedLink(Orderable): page = ParentalKey(ArticlePage, related_name='related_links') @@ -100,21 +108,21 @@ class ArticleRelatedLink(Orderable): class InfoBlock(blocks.StructBlock): title = blocks.CharBlock(required=True) photo = ImageChooserBlock() - summary = blocks.RichTextBlock() - action = blocks.CharBlock(required=True) - url = models.URLField() + summary = blocks.RichTextBlock(required=True) + action = blocks.CharBlock() + url = blocks.URLBlock() class HomePage(Page): intro_de = RichTextField(default='') intro_fr = RichTextField(default='') - intro = TranslatedField( + trans_intro = TranslatedField( 'intro_de', 'intro_fr', ) body_de = RichTextField(default='') body_fr = RichTextField(default='') - body = TranslatedField( + trans_body = TranslatedField( 'body_de', 'body_fr', ) @@ -125,7 +133,7 @@ class HomePage(Page): infos_fr = StreamField([ ('info', InfoBlock()) ], null=True, blank=True) - infos = TranslatedField( + trans_infos = TranslatedField( 'infos_de', 'infos_fr', ) diff --git a/publichealth/home/templates/banner.html b/publichealth/home/templates/banner.html index ed82111..adc9569 100644 --- a/publichealth/home/templates/banner.html +++ b/publichealth/home/templates/banner.html @@ -47,7 +47,7 @@

- {{ page.intro|richtext }} + {{ page.trans_intro|richtext }}

diff --git a/publichealth/home/templates/home/article_page.html b/publichealth/home/templates/home/article_page.html index 3285133..63fc005 100644 --- a/publichealth/home/templates/home/article_page.html +++ b/publichealth/home/templates/home/article_page.html @@ -4,25 +4,34 @@ {% block body_class %}template-{{ self.get_verbose_name|slugify }}{% endblock %} {% block content %} +
+
-

{{ page.translated_title }}

- {{ page.date }} +
+ {% include_block feed_image %} +
+ +

{{ page.trans_title }}

+ +

{{ page.trans_intro }}

- {% include_block feed_image %} +

{{ page.date }}

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

{{ block.value }}

+

{{ block.value }}

{% else %} -
+

{% include_block block %} -

+

{% endif %} {% endfor %} +
+
{% endblock %} diff --git a/publichealth/home/templates/home/home_page.html b/publichealth/home/templates/home/home_page.html index d36efed..cb37335 100644 --- a/publichealth/home/templates/home/home_page.html +++ b/publichealth/home/templates/home/home_page.html @@ -10,34 +10,34 @@ {% include 'news.html' %} -
-
-
- {{ page.body|richtext }} -
+
+
+
+ {{ page.trans_body|richtext }}
-
+
+
- -
-
-
- {% for block in page.infos %} -
-
- {% image block.value.photo fill-300x300 %} -
-
-

{{ block.value.title }}

-
- {{ block.value.summary|richtext }} - -
- {% endfor %} -
+ +
+
+
+ {% for block in page.trans_infos %} +
+
+ {% image block.value.photo fill-300x300 %} +
+
+

{{ block.value.title }}

+
+ {{ block.value.summary|richtext }} + +
+ {% endfor %}
-
+
+
{% endblock %} diff --git a/publichealth/home/templates/news_dynamic.html b/publichealth/home/templates/news_dynamic.html new file mode 100644 index 0000000..809334f --- /dev/null +++ b/publichealth/home/templates/news_dynamic.html @@ -0,0 +1,18 @@ +
+
+
+ {% for entry in articles %} +
+
+ {% image entry.feed_image fill-345x260 %} +
+

{{ entry.trans_title }}

+

{{ entry.trans_intro|richtext }}

+ Mehr erfahren +
+
+
+ {% endfor %} +
+
+
diff --git a/publichealth/templates/footer.html b/publichealth/templates/footer.html index faec512..a0e8716 100644 --- a/publichealth/templates/footer.html +++ b/publichealth/templates/footer.html @@ -11,11 +11,10 @@
  • Projekte und Aktivitäten
  • Information zu Public Health
  • Agenda
  • -
  • ...
  • -
    +

    Public Health Schweiz
    Effingerstrasse 54
    @@ -48,5 +47,5 @@

    diff --git a/publichealth/templates/header.html b/publichealth/templates/header.html index 4530de4..1a3d204 100644 --- a/publichealth/templates/header.html +++ b/publichealth/templates/header.html @@ -2,13 +2,17 @@ @@ -23,7 +27,8 @@ - + [logo] +
    From a51053aacd03c9f4125cf65135d0f3d769439671 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Thu, 23 Feb 2017 10:23:22 +0100 Subject: [PATCH 05/28] Moved article page --- .../templates/home/{article_page.html => article_index_page.html} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename publichealth/home/templates/home/{article_page.html => article_index_page.html} (100%) diff --git a/publichealth/home/templates/home/article_page.html b/publichealth/home/templates/home/article_index_page.html similarity index 100% rename from publichealth/home/templates/home/article_page.html rename to publichealth/home/templates/home/article_index_page.html From 3f51ab2de7ded04020823cf03f34423b093033f3 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Thu, 23 Feb 2017 10:25:35 +0100 Subject: [PATCH 06/28] Article page --- publichealth/home/templates/home/article_index_page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publichealth/home/templates/home/article_index_page.html b/publichealth/home/templates/home/article_index_page.html index 63fc005..c8be73d 100644 --- a/publichealth/home/templates/home/article_index_page.html +++ b/publichealth/home/templates/home/article_index_page.html @@ -13,7 +13,7 @@

    {{ page.trans_title }}

    -

    {{ page.trans_intro }}

    +

    {{ page.trans_intro|richtext }}

    {{ page.date }}

    From bde512904fa7b779c19293ded9029afc0d35bee1 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Thu, 23 Feb 2017 10:27:53 +0100 Subject: [PATCH 07/28] Article page --- .../home/templates/home/article_page.html | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 publichealth/home/templates/home/article_page.html diff --git a/publichealth/home/templates/home/article_page.html b/publichealth/home/templates/home/article_page.html new file mode 100644 index 0000000..c8be73d --- /dev/null +++ b/publichealth/home/templates/home/article_page.html @@ -0,0 +1,37 @@ +{% extends "base.html" %} +{% load wagtailcore_tags %} + +{% block body_class %}template-{{ self.get_verbose_name|slugify }}{% endblock %} + +{% block content %} +
    +
    + +
    + {% include_block feed_image %} +
    + +

    {{ page.trans_title }}

    + +

    {{ page.trans_intro|richtext }}

    + +

    {{ page.date }}

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

    {{ block.value }}

    + {% else %} +

    + {% include_block block %} +

    + {% endif %} + {% endfor %} + +
    +
    +
    + +{% endblock %} From 793a052b4fec28ca0b7b113d524a4f48d02061bc Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Fri, 24 Feb 2017 08:55:30 +0100 Subject: [PATCH 08/28] Feed image in article --- publichealth/home/templates/home/article_index_page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publichealth/home/templates/home/article_index_page.html b/publichealth/home/templates/home/article_index_page.html index c8be73d..152b9ff 100644 --- a/publichealth/home/templates/home/article_index_page.html +++ b/publichealth/home/templates/home/article_index_page.html @@ -8,7 +8,7 @@
    - {% include_block feed_image %} + {% include_block page.feed_image %}

    {{ page.trans_title }}

    From 3a8ddd7afd823892a6a0fae2dc1b8931abe496ba Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Fri, 3 Mar 2017 18:13:31 +0100 Subject: [PATCH 09/28] Language switcher tag --- publichealth/home/templates/tags/language.html | 3 +++ publichealth/home/templatetags/navigation.py | 14 ++++++++++++++ publichealth/templates/header.html | 11 ++++++----- readme.md | 4 ++++ 4 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 publichealth/home/templates/tags/language.html create mode 100644 publichealth/home/templatetags/navigation.py diff --git a/publichealth/home/templates/tags/language.html b/publichealth/home/templates/tags/language.html new file mode 100644 index 0000000..dc5963f --- /dev/null +++ b/publichealth/home/templates/tags/language.html @@ -0,0 +1,3 @@ +{% for lang in languages %} + {{ lang.title }} +{% endfor %} diff --git a/publichealth/home/templatetags/navigation.py b/publichealth/home/templatetags/navigation.py new file mode 100644 index 0000000..1072742 --- /dev/null +++ b/publichealth/home/templatetags/navigation.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +from django import template +from django.utils import translation + +register = template.Library() + +# Language switcher +@register.inclusion_tag('home/templates/tags/language.html', takes_context=True) +def language_switcher(context): + return { + 'languages': [ { 'code': 'de', 'title': 'De' }, { 'code': 'fr', 'title': 'Fr' } ], + 'currentlangcode': translation.get_language(), + 'request': context['request'], + } diff --git a/publichealth/templates/header.html b/publichealth/templates/header.html index 1a3d204..ef56726 100644 --- a/publichealth/templates/header.html +++ b/publichealth/templates/header.html @@ -1,18 +1,19 @@ +{% load wagtailcore_tags navigation %} +
    diff --git a/readme.md b/readme.md index 00409a0..b9c8009 100644 --- a/readme.md +++ b/readme.md @@ -53,3 +53,7 @@ grunt browser-sync A default browser should open pointing to the default home page. Now access the admin panel with the user account you created earlier: http://localhost:3000/admin/ + +## Troubleshooting + +- Issues with migrating database tables in SQLite during development? Try `./manage.py migrate --fake` From df7be31ee7adfc98798d62369bedb25d80079168 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Tue, 7 Mar 2017 22:36:33 +0100 Subject: [PATCH 10/28] Language navigation --- publichealth/home/templatetags/__init__.py | 0 publichealth/home/templatetags/navigation.py | 2 +- publichealth/settings/base.py | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 publichealth/home/templatetags/__init__.py diff --git a/publichealth/home/templatetags/__init__.py b/publichealth/home/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/publichealth/home/templatetags/navigation.py b/publichealth/home/templatetags/navigation.py index 1072742..40ce300 100644 --- a/publichealth/home/templatetags/navigation.py +++ b/publichealth/home/templatetags/navigation.py @@ -5,7 +5,7 @@ from django.utils import translation register = template.Library() # Language switcher -@register.inclusion_tag('home/templates/tags/language.html', takes_context=True) +@register.inclusion_tag('tags/language.html', takes_context=True) def language_switcher(context): return { 'languages': [ { 'code': 'de', 'title': 'De' }, { 'code': 'fr', 'title': 'Fr' } ], diff --git a/publichealth/settings/base.py b/publichealth/settings/base.py index ae871dd..cb68d62 100644 --- a/publichealth/settings/base.py +++ b/publichealth/settings/base.py @@ -25,6 +25,7 @@ BASE_DIR = os.path.dirname(PROJECT_DIR) INSTALLED_APPS = [ 'publichealth.home', + 'publichealth.home.templatetags', 'publichealth.search', 'wagtail.contrib.wagtailsearchpromotions', From 80c0951a5e9eab0a7a55634f43bf7929b2fb4893 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Tue, 7 Mar 2017 23:37:55 +0100 Subject: [PATCH 11/28] Navigation and routes --- publichealth/home/models.py | 32 +++++++++------ publichealth/home/routes.py | 19 +++++++++ publichealth/home/templates/banner.html | 39 +++---------------- .../templates/home/article_index_page.html | 31 +-------------- .../home/templates/home/article_page.html | 3 +- .../home/templates/home/home_page.html | 9 +++-- publichealth/home/templates/news_dynamic.html | 18 --------- publichealth/settings/base.py | 1 + publichealth/static/css/main.scss | 3 +- publichealth/static/css/modules/_news.scss | 2 + 10 files changed, 57 insertions(+), 100 deletions(-) create mode 100644 publichealth/home/routes.py delete mode 100644 publichealth/home/templates/news_dynamic.html diff --git a/publichealth/home/models.py b/publichealth/home/models.py index debbbf2..b90d01b 100644 --- a/publichealth/home/models.py +++ b/publichealth/home/models.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + from __future__ import unicode_literals from django.db import models @@ -37,8 +39,6 @@ class ArticlePage(Page): 'title_fr', ) - date = models.DateField("Date") - intro_de = RichTextField(default='') intro_fr = RichTextField(default='') trans_intro = TranslatedField( @@ -61,6 +61,7 @@ class ArticlePage(Page): 'body_fr', ) + date = models.DateField("Date") feed_image = models.ForeignKey( 'wagtailimages.Image', null=True, @@ -76,20 +77,24 @@ class ArticlePage(Page): index.SearchField('title_fr'), index.SearchField('intro_de'), index.SearchField('intro_fr'), - index.FilterField('date'), ] - content_panels = Page.content_panels + [ - FieldPanel('title_fr'), - FieldPanel('date'), - FieldPanel('intro_de'), - FieldPanel('intro_fr'), - StreamFieldPanel('body_de'), - StreamFieldPanel('body_fr'), - InlinePanel('related_links', label="Related links"), + content_panels = [ + MultiFieldPanel([ + FieldPanel('title'), + FieldPanel('intro_de'), + StreamFieldPanel('body_de'), + ], heading="Deutsch"), + MultiFieldPanel([ + FieldPanel('title_fr'), + FieldPanel('intro_fr'), + StreamFieldPanel('body_fr'), + ], heading="Français"), ] promote_panels = [ - MultiFieldPanel(Page.promote_panels, "Common page configuration"), + FieldPanel('date'), ImageChooserPanel('feed_image'), + InlinePanel('related_links', label="Links"), + MultiFieldPanel(Page.promote_panels, "Common page configuration"), ] parent_page_types = ['home.ArticleIndexPage'] subpage_types = [] @@ -138,6 +143,9 @@ class HomePage(Page): 'infos_fr', ) + def get_articles(self): + return ArticleIndexPage.objects.descendant_of(self).live().order_by('-date').select_related('owner') + content_panels = Page.content_panels + [ FieldPanel('intro_de', classname="full"), FieldPanel('intro_fr', classname="full"), diff --git a/publichealth/home/routes.py b/publichealth/home/routes.py new file mode 100644 index 0000000..e04e0f6 --- /dev/null +++ b/publichealth/home/routes.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +from datetime import date + +from django.utils.dateformat import DateFormat +from django.utils.formats import date_format +from django.utils.translation import ugettext_lazy as _ +from django.conf import settings + +from wagtail.wagtailcore.models import Page +from wagtail.wagtailsearch.models import Query +from wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin, route + +class HomePage(RoutablePageMixin, Page): + + @route(r'^$') + def home_page(self, request, *args, **kwargs): + self.articles = self.get_articles() + return Page.serve(self, request, *args, **kwargs) diff --git a/publichealth/home/templates/banner.html b/publichealth/home/templates/banner.html index adc9569..7899f93 100644 --- a/publichealth/home/templates/banner.html +++ b/publichealth/home/templates/banner.html @@ -1,46 +1,17 @@ {% load wagtailcore_tags %} -
    From bec55a8660c511d5b9607d9dad82a63c7018035d Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Thu, 9 Mar 2017 10:58:39 +0100 Subject: [PATCH 19/28] Translation fix --- publichealth/home/templates/tags/language.html | 2 +- publichealth/home/templates/tags/top_menu.html | 4 ++-- publichealth/home/templates/tags/top_menu_children.html | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/publichealth/home/templates/tags/language.html b/publichealth/home/templates/tags/language.html index dc5963f..6e7dfd3 100644 --- a/publichealth/home/templates/tags/language.html +++ b/publichealth/home/templates/tags/language.html @@ -1,3 +1,3 @@ {% for lang in languages %} - {{ lang.title }} + {{ lang.title }} {% endfor %} diff --git a/publichealth/home/templates/tags/top_menu.html b/publichealth/home/templates/tags/top_menu.html index 775d2b8..3fd485b 100644 --- a/publichealth/home/templates/tags/top_menu.html +++ b/publichealth/home/templates/tags/top_menu.html @@ -5,10 +5,10 @@ {% for menuitem in menuitems %} {% endfor %} diff --git a/publichealth/home/templates/tags/top_menu_children.html b/publichealth/home/templates/tags/top_menu_children.html index 5ae4613..556a471 100644 --- a/publichealth/home/templates/tags/top_menu_children.html +++ b/publichealth/home/templates/tags/top_menu_children.html @@ -1,8 +1,8 @@ {% load navigation wagtailcore_tags %} From e6cd7c50c48f594d435a6e0f7dad27441acbd71f Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Thu, 9 Mar 2017 11:07:06 +0100 Subject: [PATCH 20/28] Translated menus --- publichealth/home/templates/tags/top_menu.html | 4 ++-- publichealth/home/templates/tags/top_menu_children.html | 4 ++-- publichealth/home/templatetags/navigation.py | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/publichealth/home/templates/tags/top_menu.html b/publichealth/home/templates/tags/top_menu.html index 3fd485b..775d2b8 100644 --- a/publichealth/home/templates/tags/top_menu.html +++ b/publichealth/home/templates/tags/top_menu.html @@ -5,10 +5,10 @@ {% for menuitem in menuitems %} {% endfor %} diff --git a/publichealth/home/templates/tags/top_menu_children.html b/publichealth/home/templates/tags/top_menu_children.html index 556a471..ba5f63f 100644 --- a/publichealth/home/templates/tags/top_menu_children.html +++ b/publichealth/home/templates/tags/top_menu_children.html @@ -1,8 +1,8 @@ {% load navigation wagtailcore_tags %} diff --git a/publichealth/home/templatetags/navigation.py b/publichealth/home/templatetags/navigation.py index d6c530f..f571dcf 100644 --- a/publichealth/home/templatetags/navigation.py +++ b/publichealth/home/templatetags/navigation.py @@ -25,11 +25,12 @@ def has_menu_children(page): # Retrieves the top menu items @register.inclusion_tag('tags/top_menu.html', takes_context=True) def top_menu(context, parent, calling_page=None): - menuitems = parent.get_children().live().in_menu() + menuitems = parent.get_children().live().in_menu().specific() for menuitem in menuitems: menuitem.show_dropdown = has_menu_children(menuitem) menuitem.active = (calling_page.url.startswith(menuitem.url) if calling_page else False) + menuitem.title = menuitem.trans_title return { 'calling_page': calling_page, 'menuitems': menuitems, @@ -39,7 +40,9 @@ def top_menu(context, parent, calling_page=None): # Retrieves the children of the top menu items for the drop downs @register.inclusion_tag('tags/top_menu_children.html', takes_context=True) def top_menu_children(context, parent): - menuitems_children = parent.get_children().live().in_menu() + menuitems_children = parent.get_children().live().in_menu().specific() + for menuitem in menuitems_children: + menuitem.title = menuitem.trans_title return { 'parent': parent, 'menuitems_children': menuitems_children, From ea40b925f3ada93d1d50a7cd45fb5d0814c31d9a Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Mon, 13 Mar 2017 16:59:47 +0100 Subject: [PATCH 21/28] Added basic test suite --- requirements-test.txt | 3 ++ tests/__init__.py | 0 tests/conftest.py | 10 +++++ tests/testapp/__init__.py | 0 tests/testapp/docker-compose.yaml | 11 +++++ tests/testapp/puput.db | Bin 0 -> 164864 bytes tests/testapp/settings.py | 71 ++++++++++++++++++++++++++++++ tests/testapp/urls.py | 11 +++++ tests/testapp/wsgi.py | 16 +++++++ 9 files changed, 122 insertions(+) create mode 100644 requirements-test.txt create mode 100644 tests/__init__.py create mode 100644 tests/conftest.py create mode 100644 tests/testapp/__init__.py create mode 100644 tests/testapp/docker-compose.yaml create mode 100644 tests/testapp/puput.db create mode 100644 tests/testapp/settings.py create mode 100644 tests/testapp/urls.py create mode 100644 tests/testapp/wsgi.py diff --git a/requirements-test.txt b/requirements-test.txt new file mode 100644 index 0000000..be7e033 --- /dev/null +++ b/requirements-test.txt @@ -0,0 +1,3 @@ +pytest==3.0.3 +pytest-splinter==1.7.6 +tox==2.3.1 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..f841804 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,10 @@ +import pytest + + +@pytest.fixture +def site_url(request): + return request.config.getoption("--site-url") + + +def pytest_addoption(parser): + parser.addoption("--site-url", action="store", default="type1", help="url to test") diff --git a/tests/testapp/__init__.py b/tests/testapp/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/testapp/docker-compose.yaml b/tests/testapp/docker-compose.yaml new file mode 100644 index 0000000..9bec946 --- /dev/null +++ b/tests/testapp/docker-compose.yaml @@ -0,0 +1,11 @@ +hub: + image: selenium/hub + ports: + - "4444:4444" +firefox: + image: selenium/node-firefox + links: + - hub + expose: + - "5555" + diff --git a/tests/testapp/puput.db b/tests/testapp/puput.db new file mode 100644 index 0000000000000000000000000000000000000000..930d7b531ca972068de9dc3cecd546ed1674cd59 GIT binary patch literal 164864 zcmeHw34Bz^dFQKF-D));E+H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4q`glQt$@~GaO?z^nTbxNTJGs3vz z#=*KXN{o1R(}sZVSTQi!jO2q}JvbvNbl=R#HwHGENgQ2Dwr^)7w8tUsABm3&@W($K zftP^5yo`cE`^X#i2uPqtv!m$&Neahe`{d}pggh9R;nYL)RlUV>?y8#a-4~wB7ON^O zW7Z0_q6*KwWRB4b9y9e)Zn{t;G*Pn5IbFW46lN6Ip;NCi@rs3OBwDRfCtRv3*g`ir z5ia_H2G%eNq(MUR>TGQqV#eS%8D>>$pvlzs8YsDnN(Np^wgv<<^E$acCCG}qUdWI3fX){7^ff>y$T$AzaRroD~|74*8LRcxV zsT;=LfwXssjAw=jC-uf`0p9E2X~0-5)~5&!A+acI8JQ}>eTiV-++_bOrtKdc6X1`3 zUJ3%QkBg-Gzhyu`K}YpZ?2E<+GpRVO{`xD!ngM_je<-#mo}`7E0|hv#d9a0;luR&|ooo&E+?f9{@;aBwStr2n9GUzdoeGQnHxLEOc0f46jx P3PUb@(Ym3fw*UVRb4xCK literal 0 HcmV?d00001 diff --git a/tests/testapp/settings.py b/tests/testapp/settings.py new file mode 100644 index 0000000..91bc60b --- /dev/null +++ b/tests/testapp/settings.py @@ -0,0 +1,71 @@ +import os +from puput import PUPUT_APPS + +WAGTAIL_SITE_NAME = 'Public Health' +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +SECRET_KEY = 'changemepliz' +DEBUG = True +ALLOWED_HOSTS = "*" + +INSTALLED_APPS = ( + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +) +INSTALLED_APPS += PUPUT_APPS + +MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.security.SecurityMiddleware', + 'wagtail.wagtailcore.middleware.SiteMiddleware', + 'wagtail.wagtailredirects.middleware.RedirectMiddleware', +) + +ROOT_URLCONF = 'tests.testapp.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'tests.testapp.wsgi.application' + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': 'tests/testapp/publichealth.db', + 'USER': '', + 'PASSWORD': '', + } +} + +LANGUAGE_CODE = 'de-ch' +TIME_ZONE = 'UTC' +USE_I18N = True +USE_L10N = True +USE_TZ = True + +STATIC_ROOT = '/tmp/static' +STATIC_URL = '/static/' +MEDIA_ROOT = '/tmp/media' +MEDIA_URL = '/media/' diff --git a/tests/testapp/urls.py b/tests/testapp/urls.py new file mode 100644 index 0000000..316928a --- /dev/null +++ b/tests/testapp/urls.py @@ -0,0 +1,11 @@ +from django.conf import settings +from django.conf.urls import include, url +from django.contrib import admin +from django.conf.urls.static import static + +urlpatterns = [ + url(r'^admin/', include(admin.site.urls)), + url(r'', include('publichealth.urls')), +] +urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) +urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/tests/testapp/wsgi.py b/tests/testapp/wsgi.py new file mode 100644 index 0000000..367af5e --- /dev/null +++ b/tests/testapp/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for blog project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.testapp.settings") + +application = get_wsgi_application() From b6235534ae82dc94fb585aee6a6afc50ee50564f Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Mon, 13 Mar 2017 17:33:02 +0100 Subject: [PATCH 22/28] Added Puput, updated Django --- publichealth/home/models.py | 6 +++++- publichealth/settings/base.py | 13 ++++++++----- publichealth/urls.py | 3 ++- requirements.txt | 7 ++++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/publichealth/home/models.py b/publichealth/home/models.py index 1d6afb3..e418c0c 100644 --- a/publichealth/home/models.py +++ b/publichealth/home/models.py @@ -41,6 +41,7 @@ class ArticleIndexPage(Page): context['articles'] = articles return context + subpage_types = ['home.ArticlePage'] class Meta: verbose_name = "Rubrik" @@ -181,4 +182,7 @@ class HomePage(Page): # Update template context context = super(HomePage, self).get_context(request) context['featured'] = featured - return context \ No newline at end of file + return context + + class Meta: + verbose_name = "Frontpage" \ No newline at end of file diff --git a/publichealth/settings/base.py b/publichealth/settings/base.py index cbebaac..f603424 100644 --- a/publichealth/settings/base.py +++ b/publichealth/settings/base.py @@ -10,17 +10,14 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ +# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(PROJECT_DIR) - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ - - # Application definition INSTALLED_APPS = [ @@ -30,6 +27,7 @@ INSTALLED_APPS = [ 'wagtail.contrib.wagtailsearchpromotions', 'wagtail.contrib.wagtailroutablepage', + 'wagtail.contrib.wagtailsitemaps', 'wagtail.wagtailforms', 'wagtail.wagtailredirects', 'wagtail.wagtailembeds', @@ -45,6 +43,7 @@ INSTALLED_APPS = [ 'modelcluster', 'compressor', 'taggit', + 'puput', 'django.contrib.admin', 'django.contrib.auth', @@ -192,3 +191,7 @@ WAGTAILSEARCH_BACKENDS = { # Wagtail settings WAGTAIL_SITE_NAME = "Public Health Schweiz" + +# Puput settings + +PUPUT_AS_PLUGIN = True \ No newline at end of file diff --git a/publichealth/urls.py b/publichealth/urls.py index 7289230..1b7d87a 100644 --- a/publichealth/urls.py +++ b/publichealth/urls.py @@ -6,18 +6,19 @@ from django.conf.urls.i18n import i18n_patterns from wagtail.wagtailadmin import urls as wagtailadmin_urls from wagtail.wagtaildocs import urls as wagtaildocs_urls from wagtail.wagtailcore import urls as wagtail_urls +from puput import urls as puput_urls from publichealth.search import views as search_views urlpatterns = [ + url(r'', include(puput_urls)), url(r'^django-admin/', include(admin.site.urls)), url(r'^admin/', include(wagtailadmin_urls)), url(r'^documents/', include(wagtaildocs_urls)), url(r'^search/$', search_views.search, name='search'), - ] diff --git a/requirements.txt b/requirements.txt index 29f3949..400f022 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,9 @@ -Django==1.10.5 -psycopg2==2.6.2 +wagtail==1.9 +puput==0.8 +Django==1.10.6 +psycopg2==2.7.1 elasticsearch==5.2.0 django-redis==4.7.0 -wagtail==1.9 django-libsass==0.7 libsass==0.12.3 Pillow==4.0.0 From b536af96abe799ff4757a964616a82ab3bf6caca Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Mon, 13 Mar 2017 17:56:33 +0100 Subject: [PATCH 23/28] Frontpage root level only --- .../migrations/0008_auto_20170313_1755.py | 19 +++++++++++++++++++ publichealth/home/models.py | 1 + 2 files changed, 20 insertions(+) create mode 100644 publichealth/home/migrations/0008_auto_20170313_1755.py diff --git a/publichealth/home/migrations/0008_auto_20170313_1755.py b/publichealth/home/migrations/0008_auto_20170313_1755.py new file mode 100644 index 0000000..25d0f23 --- /dev/null +++ b/publichealth/home/migrations/0008_auto_20170313_1755.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.6 on 2017-03-13 16:55 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0007_articlepage_date'), + ] + + operations = [ + migrations.AlterModelOptions( + name='homepage', + options={'verbose_name': 'Frontpage'}, + ), + ] diff --git a/publichealth/home/models.py b/publichealth/home/models.py index e418c0c..c37654e 100644 --- a/publichealth/home/models.py +++ b/publichealth/home/models.py @@ -184,5 +184,6 @@ class HomePage(Page): context['featured'] = featured return context + parent_page_types = [] class Meta: verbose_name = "Frontpage" \ No newline at end of file From 118603a7606b2800c26fc961b0f8bb0fded135b3 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Mon, 13 Mar 2017 17:56:47 +0100 Subject: [PATCH 24/28] Custom news page --- publichealth/home/models.py | 11 ++++ .../home/templates/home/news_page.html | 51 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 publichealth/home/templates/home/news_page.html diff --git a/publichealth/home/models.py b/publichealth/home/models.py index c37654e..ccc1006 100644 --- a/publichealth/home/models.py +++ b/publichealth/home/models.py @@ -13,6 +13,8 @@ from wagtail.wagtailimages.blocks import ImageChooserBlock from wagtail.wagtailimages.edit_handlers import ImageChooserPanel from wagtail.wagtailsearch import index +from puput.models import EntryPage, BlogPage + from .util import TranslatedField class ArticleIndexPage(Page): @@ -123,6 +125,15 @@ class ArticleRelatedLink(Orderable): FieldPanel('url'), ] +class NewsEntryPage(EntryPage): + video_url = models.URLField() + content_panels = EntryPage.content_panels + [ + FieldPanel('video_url') + ] + class Meta: + verbose_name = "News" +BlogPage.subpage_types = NewsEntryPage + class InfoBlock(blocks.StructBlock): title = blocks.CharBlock(required=True) photo = ImageChooserBlock() diff --git a/publichealth/home/templates/home/news_page.html b/publichealth/home/templates/home/news_page.html new file mode 100644 index 0000000..aacc39e --- /dev/null +++ b/publichealth/home/templates/home/news_page.html @@ -0,0 +1,51 @@ +{% extends "base.html" %} +{% load wagtailcore_tags wagtailimages_tags puput_tags %} + +{% block body_class %}template-{{ self.get_verbose_name|slugify }}{% endblock %} + +{% block title %}{{ self.title }} | {{ blog_page.title }}{% endblock title %} +{% block meta_title %}{% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}{% endblock meta_title %} +{% block meta_description %}{% if self.search_description %}{{ self.search_description }}{% else %}{{ self.body|striptags|truncatewords:20 }}{% endif %}{% endblock meta_description %} +{% block canonical %}{% canonical_url entry=self %}{% endblock canonical %} +{% block social_share %} + {% image self.header_image fill-800x450 as share_image %} + + + + {% if self.header_image %} + + + + + {% endif %} + + + +{% endblock social_share %} + +{% block content %} +
    +
    + {% include 'puput/entry_page_header.html' with entry=self %} + {% if self.header_image %} +
    + + {% image self.header_image fill-800x450 as header_image %} + {{ self.header_image.title }} + +
    + {% endif %} +
    + {{ self.body|richtext}} +
    + {% show_comments %} +
    +
    +{% endblock content %} + +{% block extra_content %} + {% if self.has_related %} + {% include 'puput/related_entries.html' with entry=self %} + {% endif %} +{% endblock extra_content %} From 51e3a70922be5924090aaec56605e3ba1c6ad98a Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Mon, 13 Mar 2017 23:13:45 +0100 Subject: [PATCH 25/28] News page template --- publichealth/home/models.py | 13 +------ .../home/templates/home/article_page.html | 4 +-- .../news_page.html => puput/entry_page.html} | 34 ++++++++++--------- publichealth/static/css/modules/_news.scss | 14 ++++++++ 4 files changed, 35 insertions(+), 30 deletions(-) rename publichealth/home/templates/{home/news_page.html => puput/entry_page.html} (78%) diff --git a/publichealth/home/models.py b/publichealth/home/models.py index ccc1006..6fea49b 100644 --- a/publichealth/home/models.py +++ b/publichealth/home/models.py @@ -13,8 +13,6 @@ from wagtail.wagtailimages.blocks import ImageChooserBlock from wagtail.wagtailimages.edit_handlers import ImageChooserPanel from wagtail.wagtailsearch import index -from puput.models import EntryPage, BlogPage - from .util import TranslatedField class ArticleIndexPage(Page): @@ -104,9 +102,9 @@ class ArticlePage(Page): FieldPanel('intro_fr'), StreamFieldPanel('body_fr'), ], heading="Français"), + ImageChooserPanel('feed_image'), ] promote_panels = [ - ImageChooserPanel('feed_image'), FieldPanel('date'), InlinePanel('related_links', label="Links"), MultiFieldPanel(Page.promote_panels, "Common page configuration"), @@ -125,15 +123,6 @@ class ArticleRelatedLink(Orderable): FieldPanel('url'), ] -class NewsEntryPage(EntryPage): - video_url = models.URLField() - content_panels = EntryPage.content_panels + [ - FieldPanel('video_url') - ] - class Meta: - verbose_name = "News" -BlogPage.subpage_types = NewsEntryPage - class InfoBlock(blocks.StructBlock): title = blocks.CharBlock(required=True) photo = ImageChooserBlock() diff --git a/publichealth/home/templates/home/article_page.html b/publichealth/home/templates/home/article_page.html index 51835cf..58bfe09 100644 --- a/publichealth/home/templates/home/article_page.html +++ b/publichealth/home/templates/home/article_page.html @@ -7,9 +7,11 @@
    + {% if page.feed_image %}
    {% image page.feed_image fill-940x400 class="img-responsive" %}
    + {% endif %}

    {{ page.trans_title }}

    @@ -21,7 +23,6 @@
    - {% for block in page.trans_body %} {% if block.block_type == 'heading' %}

    {{ block.value }}

    @@ -31,7 +32,6 @@

    {% endif %} {% endfor %} -
    diff --git a/publichealth/home/templates/home/news_page.html b/publichealth/home/templates/puput/entry_page.html similarity index 78% rename from publichealth/home/templates/home/news_page.html rename to publichealth/home/templates/puput/entry_page.html index aacc39e..01bfbaf 100644 --- a/publichealth/home/templates/home/news_page.html +++ b/publichealth/home/templates/puput/entry_page.html @@ -24,24 +24,26 @@ {% endblock social_share %} {% block content %} -
    -
    +
    - {% include 'puput/entry_page_header.html' with entry=self %} - {% if self.header_image %} -
    - - {% image self.header_image fill-800x450 as header_image %} - {{ self.header_image.title }} - -
    - {% endif %} -
    - {{ self.body|richtext}} -
    - {% show_comments %} + + {% if self.header_image %} +
    + {% image self.header_image fill-940x300 as header_image %} + {{ self.header_image.title }} +
    + {% endif %} + + {% include 'puput/entry_page_header.html' with entry=self %} + +
    + {{ self.body|richtext}} +
    + + {% show_comments %}
    -
    + {% endblock content %} {% block extra_content %} diff --git a/publichealth/static/css/modules/_news.scss b/publichealth/static/css/modules/_news.scss index 22c0ece..ea71ef4 100644 --- a/publichealth/static/css/modules/_news.scss +++ b/publichealth/static/css/modules/_news.scss @@ -108,4 +108,18 @@ .backlink { margin-top: 3em; } + + .img-responsive { + width: 100%; + } + + .links { + display: inline-block; + border-bottom: 1px solid #999; + padding: 1em; + margin: 0em; + list-style-type: none; + + li:first-child { display: none; } + } } From abb3935cd7edf21d4884e98ab5728d30465b6300 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Tue, 14 Mar 2017 10:54:47 +0100 Subject: [PATCH 26/28] Fix footer menu lang --- publichealth/home/templatetags/navigation.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/publichealth/home/templatetags/navigation.py b/publichealth/home/templatetags/navigation.py index f571dcf..be7a954 100644 --- a/publichealth/home/templatetags/navigation.py +++ b/publichealth/home/templatetags/navigation.py @@ -37,24 +37,26 @@ def top_menu(context, parent, calling_page=None): 'request': context['request'], } -# Retrieves the children of the top menu items for the drop downs -@register.inclusion_tag('tags/top_menu_children.html', takes_context=True) -def top_menu_children(context, parent): +def menuitems_children(parent): menuitems_children = parent.get_children().live().in_menu().specific() for menuitem in menuitems_children: menuitem.title = menuitem.trans_title + return menuitems_children + +# Retrieves the children of the top menu items for the drop downs +@register.inclusion_tag('tags/top_menu_children.html', takes_context=True) +def top_menu_children(context, parent): return { 'parent': parent, - 'menuitems_children': menuitems_children, + 'menuitems_children': menuitems_children(parent), 'request': context['request'], } # Retrieves the footer menu items @register.inclusion_tag('tags/footer_menu.html', takes_context=True) def footer_menu(context, parent, calling_page=None): - menuitems = parent.get_children().live().in_menu() return { 'calling_page': calling_page, - 'menuitems': menuitems, + 'menuitems': menuitems_children(parent), 'request': context['request'], } \ No newline at end of file From f8aafda1f453b82683894a545c05fdcdf72d3eca Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Tue, 14 Mar 2017 11:10:32 +0100 Subject: [PATCH 27/28] Added news to frontpage --- publichealth/home/models.py | 19 ++++++++--- publichealth/home/templates/news.html | 48 +++++++++++---------------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/publichealth/home/models.py b/publichealth/home/models.py index 6fea49b..1d0042a 100644 --- a/publichealth/home/models.py +++ b/publichealth/home/models.py @@ -13,6 +13,8 @@ from wagtail.wagtailimages.blocks import ImageChooserBlock from wagtail.wagtailimages.edit_handlers import ImageChooserPanel from wagtail.wagtailsearch import index +from puput.models import EntryPage + from .util import TranslatedField class ArticleIndexPage(Page): @@ -172,16 +174,25 @@ class HomePage(Page): @property def featured(self): # Get list of live pages that are descendants of this page - articles = ArticlePage.objects.live()[:4] #.descendant_of(self) + articles = ArticlePage.objects.live() #.descendant_of(self) # Order by most recent date first #articles = articles.order_by('-date') - return articles + return articles[:4] + + @property + def newsfeed(self): + # Get list of latest news + # TODO: fetch children of 'News (DE)' + entries = EntryPage.objects.live().descendant_of(self) + # Order by most recent date first + entries = entries.order_by('-date') + return entries[:4] def get_context(self, request): - featured = self.featured[:4] # Update template context context = super(HomePage, self).get_context(request) - context['featured'] = featured + context['featured'] = self.featured + context['newsfeed'] = self.newsfeed return context parent_page_types = [] diff --git a/publichealth/home/templates/news.html b/publichealth/home/templates/news.html index 440db3c..c6b1fa7 100644 --- a/publichealth/home/templates/news.html +++ b/publichealth/home/templates/news.html @@ -1,39 +1,31 @@ +{% load wagtailcore_tags wagtailimages_tags puput_tags %} +
    + {% for entry in newsfeed %}
    - + {% if entry.header_image %} + {% image entry.header_image fill-360x270 %} + {% endif %}
    -

    Ehrenmitgliedschaften

    -

    Nicole Probst-Hensch, Professorin für Pharmakologie und Epidemiologie am Schweizerischen Tropen- und Public Health Institut der Universität Basel, wurde die Ehrenmitgliedschaft von Public Health Schweiz verliehen.

    - Mehr erfahren +

    {{ entry.title }}

    +

    + {% if entry.excerpt %} + {{ entry.excerpt|richtext }} + {% else %} + {{ entry.body|richtext|truncatewords_html:70 }} + {% endif %} +

    + Mehr erfahren
    - -
    -
    -
    -
    - -
    - -

    Parlamentarische Gruppe nichtübertragbare Krankheiten NCD gegründet

    - - Mehr erfahren -
    - -
    -
    -
    -
    -
    -
    -

    Wirksamer Schutz der Kinder und Jugendlichen vor Tabakkonsum rückt in weite Ferne

    - Mehr erfahren -
    - +
    + {% empty %} + No news today + {% endfor %}
    -
    + From 120e098fda52a3a2326e68f2ccb7d064e845bad9 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Tue, 14 Mar 2017 11:12:29 +0100 Subject: [PATCH 28/28] Formspree'd contact form --- publichealth/templates/footer.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/publichealth/templates/footer.html b/publichealth/templates/footer.html index 0833d24..f35e1a8 100644 --- a/publichealth/templates/footer.html +++ b/publichealth/templates/footer.html @@ -22,13 +22,12 @@
    -
    - +
    - +