From 20d42ce9c2c7a345797c90b31508cbc46e2ce5ba Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Mon, 6 Aug 2018 11:35:43 -0700 Subject: [PATCH 01/21] hero stuff --- .../0035_participatepage_primaryhero.py | 22 ++++++ .../migrations/0036_auto_20180806_1718.py | 36 +++++++++ network-api/networkapi/wagtailpages/models.py | 39 ++++++++++ .../wagtailpages/static/participate_page.html | 38 ++++----- source/images/hand.svg | 78 +++++++++++++++++++ source/sass/components/commitment.scss | 19 +++++ source/sass/main.scss | 1 + 7 files changed, 210 insertions(+), 23 deletions(-) create mode 100644 network-api/networkapi/wagtailpages/migrations/0035_participatepage_primaryhero.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0036_auto_20180806_1718.py create mode 100644 source/images/hand.svg create mode 100644 source/sass/components/commitment.scss diff --git a/network-api/networkapi/wagtailpages/migrations/0035_participatepage_primaryhero.py b/network-api/networkapi/wagtailpages/migrations/0035_participatepage_primaryhero.py new file mode 100644 index 00000000000..249165aa2e6 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0035_participatepage_primaryhero.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-06 17:06 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailimages', '0020_add-verbose-name'), + ('wagtailpages', '0034_auto_20180727_1851'), + ] + + operations = [ + migrations.AddField( + model_name='participatepage', + name='primaryHero', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='primary_hero_participate', to='wagtailimages.Image', verbose_name='Primary Hero Image'), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0036_auto_20180806_1718.py b/network-api/networkapi/wagtailpages/migrations/0036_auto_20180806_1718.py new file mode 100644 index 00000000000..4a9f2176986 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0036_auto_20180806_1718.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-06 17:18 +from __future__ import unicode_literals + +from django.db import migrations, models +import wagtail.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0035_participatepage_primaryhero'), + ] + + operations = [ + migrations.AddField( + model_name='participatepage', + name='ctaButtonTitle', + field=models.CharField(blank=True, max_length=250, verbose_name='Button Text'), + ), + migrations.AddField( + model_name='participatepage', + name='ctaButtonURL', + field=models.TextField(blank=True, verbose_name='Button URL'), + ), + migrations.AddField( + model_name='participatepage', + name='heroHeader', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='participatepage', + name='heroSubhead', + field=wagtail.core.fields.RichTextField(blank=True), + ), + ] diff --git a/network-api/networkapi/wagtailpages/models.py b/network-api/networkapi/wagtailpages/models.py index 42511e8a80e..613ca8b889d 100644 --- a/network-api/networkapi/wagtailpages/models.py +++ b/network-api/networkapi/wagtailpages/models.py @@ -498,6 +498,45 @@ class ParticipatePage(PrimaryPage): parent_page_types = ['Homepage'] template = 'wagtailpages/static/participate_page.html' + primaryHero = models.ForeignKey( + 'wagtailimages.Image', + null=True, + blank=True, + on_delete=models.SET_NULL, + related_name='primary_hero_participate', + verbose_name='Primary Hero Image', + ) + + heroHeader = models.TextField( + blank=True, + ) + + heroSubhead = RichTextField( + features=[ + 'bold', 'italic', 'link', + ], + blank=True, + ) + + ctaButtonTitle = models.CharField( + verbose_name='Button Text', + max_length=250, + blank=True, + ) + + ctaButtonURL = models.TextField( + verbose_name='Button URL', + blank=True, + ) + + content_panels = Page.content_panels + [ + ImageChooserPanel('primaryHero'), + FieldPanel('heroHeader'), + FieldPanel('heroSubhead'), + FieldPanel('ctaButtonTitle'), + FieldPanel('ctaButtonURL'), + ] + class PeoplePage(PrimaryPage): parent_page_types = ['Homepage'] diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html index 969e63048e7..2f4bb1cc042 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html @@ -1,29 +1,21 @@ -{% extends "../primary_page.html" %} -{% load wagtailcore_tags wagtailimages_tags %} +{% extends "pages/base.html" %} +{% load wagtailcore_tags wagtailimages_tags homepage_tags card_tags %} + +{% block bodyID %}participate{% endblock %} {% block content %} -
-
-
-
-
-

Mozfest 2018 is open for proposals!

-

This years theme "Data and You" takes the large concepts of data: collection, surveillance, policy, it’s currency and its future and center it around the most important of all its parts: people. How does and will data affect people’s lives? How can we share best practices, innovative tools and grow connections that allow data to serve people instead of people serving data. The deadline for proposals is August 31st.

Apply now -
-
-
-
-
-

Fellowships that Empower Leaders

-

Mozilla Fellowships provide resources, tools, community and amplification to those building a more ​humane​ ​digital​ ​world. Mozilla Fellowships are a transformative experience for emerging leaders concerned with making the internet a safer, more accessible resource for everyone.

Learn more and apply -
-
-
-
-
-

Internet Health Report

-

Is the Internet getting healthier? Is it under threat? Do we all have a voice on the web? Mozilla’s Internet Health Report is an open source initiative that combines research from multiple sources to document what’s healthy and unhealthy.

Read the report + +{% image page.primaryHero format-jpeg as big_hero %} +
+
+
+
+

{{ page.heroHeader }}

+

{{ page.heroSubhead | richtext }}

+

30 min commitment

+ {{ page.ctaButtonTitle }}
+
{% endblock %} diff --git a/source/images/hand.svg b/source/images/hand.svg new file mode 100644 index 00000000000..3f69afe6d2e --- /dev/null +++ b/source/images/hand.svg @@ -0,0 +1,78 @@ + + + + Page 1 + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/source/sass/components/commitment.scss b/source/sass/components/commitment.scss new file mode 100644 index 00000000000..aa66a8df506 --- /dev/null +++ b/source/sass/components/commitment.scss @@ -0,0 +1,19 @@ +.commitment { + font-family: NunitoSans-Regular; + font-size: 12px; + color: #909090; + letter-spacing: 0.5px; + line-height: 16px; + text-transform: uppercase; + display: flex; + align-items: center; + + &::before { + content: ""; + background: url(/_images/hand.svg) no-repeat; + width: 14px; + height: 20px; + display: block; + margin-right: 6px; + } +} diff --git a/source/sass/main.scss b/source/sass/main.scss index 95789b35469..c674b6eecce 100755 --- a/source/sass/main.scss +++ b/source/sass/main.scss @@ -37,6 +37,7 @@ $bp-xl: #{map-get($grid-breakpoints, xl)}; // >= 1200px @import './components/hr-gradient'; @import './components/feature-quote'; @import './components/nav'; +@import './components/commitment'; // Misc From a9a85edcf98516ceebe2c4e83f081c6531f609c1 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Mon, 6 Aug 2018 13:55:23 -0700 Subject: [PATCH 02/21] more scaffolding --- .../migrations/0002_highlight_commitment.py | 20 +++++++++++ .../migrations/0003_auto_20180806_2045.py | 20 +++++++++++ network-api/networkapi/highlights/models.py | 5 +++ .../0037_participatepage_commitment.py | 20 +++++++++++ .../migrations/0038_auto_20180806_2021.py | 25 ++++++++++++++ .../migrations/0039_participatehighlights.py | 32 +++++++++++++++++ network-api/networkapi/wagtailpages/models.py | 34 +++++++++++++++++++ .../wagtailpages/static/participate_page.html | 24 ++++++++++++- 8 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 network-api/networkapi/highlights/migrations/0002_highlight_commitment.py create mode 100644 network-api/networkapi/highlights/migrations/0003_auto_20180806_2045.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0037_participatepage_commitment.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0038_auto_20180806_2021.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0039_participatehighlights.py diff --git a/network-api/networkapi/highlights/migrations/0002_highlight_commitment.py b/network-api/networkapi/highlights/migrations/0002_highlight_commitment.py new file mode 100644 index 00000000000..94fdb398f74 --- /dev/null +++ b/network-api/networkapi/highlights/migrations/0002_highlight_commitment.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-06 20:36 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('highlights', '0001_squashed_0007_nullify_homepage'), + ] + + operations = [ + migrations.AddField( + model_name='highlight', + name='commitment', + field=models.CharField(blank=True, help_text='Amount of time required', max_length=256), + ), + ] diff --git a/network-api/networkapi/highlights/migrations/0003_auto_20180806_2045.py b/network-api/networkapi/highlights/migrations/0003_auto_20180806_2045.py new file mode 100644 index 00000000000..392da64635b --- /dev/null +++ b/network-api/networkapi/highlights/migrations/0003_auto_20180806_2045.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-06 20:45 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('highlights', '0002_highlight_commitment'), + ] + + operations = [ + migrations.AlterField( + model_name='highlight', + name='commitment', + field=models.CharField(blank=True, help_text='Amount of time required (eg: "30 min commitment")', max_length=256), + ), + ] diff --git a/network-api/networkapi/highlights/models.py b/network-api/networkapi/highlights/models.py index e4ced5155ea..fa6bdfee7fa 100644 --- a/network-api/networkapi/highlights/models.py +++ b/network-api/networkapi/highlights/models.py @@ -58,6 +58,11 @@ class Highlight(SortableMixin): upload_to=get_highlights_image_upload_path, blank=True, ) + commitment = models.CharField( + blank=True, + max_length=256, + help_text='Amount of time required (eg: "30 min commitment")', + ) footer = RichTextField( "footer", help_text="Content to appear after description (view more projects " diff --git a/network-api/networkapi/wagtailpages/migrations/0037_participatepage_commitment.py b/network-api/networkapi/wagtailpages/migrations/0037_participatepage_commitment.py new file mode 100644 index 00000000000..f5651301929 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0037_participatepage_commitment.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-06 18:37 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0036_auto_20180806_1718'), + ] + + operations = [ + migrations.AddField( + model_name='participatepage', + name='commitment', + field=models.TextField(blank=True), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0038_auto_20180806_2021.py b/network-api/networkapi/wagtailpages/migrations/0038_auto_20180806_2021.py new file mode 100644 index 00000000000..ecfede17b6d --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0038_auto_20180806_2021.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-06 20:21 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0037_participatepage_commitment'), + ] + + operations = [ + migrations.AddField( + model_name='participatepage', + name='h2', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='participatepage', + name='h2Subheader', + field=models.TextField(blank=True), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0039_participatehighlights.py b/network-api/networkapi/wagtailpages/migrations/0039_participatehighlights.py new file mode 100644 index 00000000000..6b1f422325a --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0039_participatehighlights.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-06 20:45 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import modelcluster.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('highlights', '0003_auto_20180806_2045'), + ('wagtailpages', '0038_auto_20180806_2021'), + ] + + operations = [ + migrations.CreateModel( + name='ParticipateHighlights', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sort_order', models.IntegerField(blank=True, editable=False, null=True)), + ('highlight', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='highlights.Highlight')), + ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='featured_highlights', to='wagtailpages.ParticipatePage')), + ], + options={ + 'verbose_name': 'highlight', + 'verbose_name_plural': 'highlights', + 'ordering': ['sort_order'], + }, + ), + ] diff --git a/network-api/networkapi/wagtailpages/models.py b/network-api/networkapi/wagtailpages/models.py index 613ca8b889d..eacf4e9f27a 100644 --- a/network-api/networkapi/wagtailpages/models.py +++ b/network-api/networkapi/wagtailpages/models.py @@ -518,6 +518,10 @@ class ParticipatePage(PrimaryPage): blank=True, ) + commitment = models.TextField( + blank=True, + ) + ctaButtonTitle = models.CharField( verbose_name='Button Text', max_length=250, @@ -529,12 +533,24 @@ class ParticipatePage(PrimaryPage): blank=True, ) + h2 = models.TextField( + blank=True, + ) + + h2Subheader = models.TextField( + blank=True, + ) + content_panels = Page.content_panels + [ ImageChooserPanel('primaryHero'), FieldPanel('heroHeader'), FieldPanel('heroSubhead'), + FieldPanel('commitment'), FieldPanel('ctaButtonTitle'), FieldPanel('ctaButtonURL'), + FieldPanel('h2'), + FieldPanel('h2Subheader'), + InlinePanel('featured_highlights', label='Highlights', max_num=3), ] @@ -607,6 +623,24 @@ class Meta: def __str__(self): return self.page.title + '->' + self.highlight.title +class ParticipateHighlights(WagtailOrderable, models.Model): + page = ParentalKey( + 'wagtailpages.ParticipatePage', + related_name='featured_highlights', + ) + highlight = models.ForeignKey('highlights.Highlight', related_name='+') + panels = [ + SnippetChooserPanel('highlight'), + ] + + class Meta: + verbose_name = 'highlight' + verbose_name_plural = 'highlights' + ordering = ['sort_order'] # not automatically inherited! + + def __str__(self): + return self.page.title + '->' + self.highlight.title + class Homepage(MetadataPageMixin, Page): hero_headline = models.CharField( diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html index 2f4bb1cc042..d83a68fab7c 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html @@ -12,10 +12,32 @@

{{ page.heroHeader }}

{{ page.heroSubhead | richtext }}

-

30 min commitment

+

{{ page.commitment }}

{{ page.ctaButtonTitle }}
+ +
+
+
+

{{ page.h2 }}

+

{{ page.h2Subheader }}

+
+
+ +
+
+ {% for highlight in page.featured_highlights.all %} + {% if forloop.counter <= 3 %} +
+ {% card "md_width" highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label %} +
+ {% endif %} + {% endfor %} +
+
+ +
{% endblock %} From 9ab2463718dc12a5adc31c88be849be49b685580 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Mon, 6 Aug 2018 16:11:26 -0700 Subject: [PATCH 03/21] augmented cards --- .../0004_remove_highlight_commitment.py | 19 ++++++++++++++++++ network-api/networkapi/highlights/models.py | 5 ----- .../0040_participatehighlights_commitment.py | 20 +++++++++++++++++++ network-api/networkapi/wagtailpages/models.py | 6 ++++++ .../wagtailpages/static/participate_page.html | 2 +- .../templates/wagtailpages/tags/card.html | 11 ++++++++-- .../wagtailpages/templatetags/card_tags.py | 5 +++-- source/sass/components/card.scss | 12 +++++++++++ source/sass/main.scss | 1 + 9 files changed, 71 insertions(+), 10 deletions(-) create mode 100644 network-api/networkapi/highlights/migrations/0004_remove_highlight_commitment.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0040_participatehighlights_commitment.py create mode 100644 source/sass/components/card.scss diff --git a/network-api/networkapi/highlights/migrations/0004_remove_highlight_commitment.py b/network-api/networkapi/highlights/migrations/0004_remove_highlight_commitment.py new file mode 100644 index 00000000000..efbacfcca9e --- /dev/null +++ b/network-api/networkapi/highlights/migrations/0004_remove_highlight_commitment.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-06 22:45 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('highlights', '0003_auto_20180806_2045'), + ] + + operations = [ + migrations.RemoveField( + model_name='highlight', + name='commitment', + ), + ] diff --git a/network-api/networkapi/highlights/models.py b/network-api/networkapi/highlights/models.py index fa6bdfee7fa..e4ced5155ea 100644 --- a/network-api/networkapi/highlights/models.py +++ b/network-api/networkapi/highlights/models.py @@ -58,11 +58,6 @@ class Highlight(SortableMixin): upload_to=get_highlights_image_upload_path, blank=True, ) - commitment = models.CharField( - blank=True, - max_length=256, - help_text='Amount of time required (eg: "30 min commitment")', - ) footer = RichTextField( "footer", help_text="Content to appear after description (view more projects " diff --git a/network-api/networkapi/wagtailpages/migrations/0040_participatehighlights_commitment.py b/network-api/networkapi/wagtailpages/migrations/0040_participatehighlights_commitment.py new file mode 100644 index 00000000000..0eee1001827 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0040_participatehighlights_commitment.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-06 22:45 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0039_participatehighlights'), + ] + + operations = [ + migrations.AddField( + model_name='participatehighlights', + name='commitment', + field=models.CharField(blank=True, help_text='Amount of time required (eg: "30 min commitment")', max_length=256), + ), + ] diff --git a/network-api/networkapi/wagtailpages/models.py b/network-api/networkapi/wagtailpages/models.py index eacf4e9f27a..6067d8cbe69 100644 --- a/network-api/networkapi/wagtailpages/models.py +++ b/network-api/networkapi/wagtailpages/models.py @@ -629,8 +629,14 @@ class ParticipateHighlights(WagtailOrderable, models.Model): related_name='featured_highlights', ) highlight = models.ForeignKey('highlights.Highlight', related_name='+') + commitment = models.CharField( + blank=True, + max_length=256, + help_text='Amount of time required (eg: "30 min commitment")', + ) panels = [ SnippetChooserPanel('highlight'), + FieldPanel('commitment'), ] class Meta: diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html index d83a68fab7c..7df27ce0f95 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html @@ -32,7 +32,7 @@

{{ page.h2 }}

{% for highlight in page.featured_highlights.all %} {% if forloop.counter <= 3 %}
- {% card "md_width" highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label %} + {% card "md_width" highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label highlight.commitment %}
{% endif %} {% endfor %} diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card.html index 856fe25ac31..8d019ab1fb4 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card.html @@ -1,10 +1,17 @@ -
+
+ + {% if commitment %} +
{{ commitment }}
+ {% endif %} + +
-
+
{{ title }}

{{ description }}

{{ link_label }}
+
diff --git a/network-api/networkapi/wagtailpages/templatetags/card_tags.py b/network-api/networkapi/wagtailpages/templatetags/card_tags.py index ac7d036e4a8..5fb462aa6b3 100644 --- a/network-api/networkapi/wagtailpages/templatetags/card_tags.py +++ b/network-api/networkapi/wagtailpages/templatetags/card_tags.py @@ -4,12 +4,13 @@ @register.inclusion_tag('wagtailpages/tags/card.html') -def card(md_width, image, title, description, link_url, link_label): +def card(md_width, image, title, description, link_url, link_label, commitment): return { 'md_width': md_width, 'image': image, 'title': title, 'description': description, 'link_url': link_url, - 'link_label': link_label + 'link_label': link_label, + 'commitment': commitment, } diff --git a/source/sass/components/card.scss b/source/sass/components/card.scss new file mode 100644 index 00000000000..dab75fbbdd2 --- /dev/null +++ b/source/sass/components/card.scss @@ -0,0 +1,12 @@ +.card-regular { + position: relative; + + .commitment { + position: absolute; + top: 16px; + left: 16px; + background: $white; + border: 1px solid #cecece; + padding: 4px 8px; + } +} diff --git a/source/sass/main.scss b/source/sass/main.scss index c674b6eecce..4c785680cf7 100755 --- a/source/sass/main.scss +++ b/source/sass/main.scss @@ -38,6 +38,7 @@ $bp-xl: #{map-get($grid-breakpoints, xl)}; // >= 1200px @import './components/feature-quote'; @import './components/nav'; @import './components/commitment'; +@import './components/card'; // Misc From 62aaa2ff250426cbd58623d8564a7be935ed256e Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Mon, 6 Aug 2018 16:33:51 -0700 Subject: [PATCH 04/21] adding commitment to style guide --- .../wagtailpages/templates/wagtailpages/static/styleguide.html | 2 ++ network-api/networkapi/wagtailpages/templatetags/card_tags.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/styleguide.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/styleguide.html index 2b4852b4ceb..5dc8b3091b0 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/styleguide.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/styleguide.html @@ -207,6 +207,8 @@

.hr-gradient


card (Django template custom tag: `card_tags`)

{% card "md_width" "https://placekitten.com/g/600/400" "title" "description" "http://example.org" "Link" %} +

.commitment

+
10 hour commitment

.join-us

.pulse-project-list(for="SEARCH_QUERY", size="MAX_TO_DISPLAY", rev="BOOLEAN_TO_INDICATE_ORDERING")

diff --git a/network-api/networkapi/wagtailpages/templatetags/card_tags.py b/network-api/networkapi/wagtailpages/templatetags/card_tags.py index 5fb462aa6b3..205e48b1274 100644 --- a/network-api/networkapi/wagtailpages/templatetags/card_tags.py +++ b/network-api/networkapi/wagtailpages/templatetags/card_tags.py @@ -4,7 +4,7 @@ @register.inclusion_tag('wagtailpages/tags/card.html') -def card(md_width, image, title, description, link_url, link_label, commitment): +def card(md_width, image, title, description, link_url, link_label, commitment=None): return { 'md_width': md_width, 'image': image, From 036d39ffec467622182d4b56b6c02f7ddf95a353 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Tue, 7 Aug 2018 11:42:01 -0700 Subject: [PATCH 05/21] cta scaffold --- .../templates/wagtailpages/homepage.html | 2 +- .../wagtailpages/static/initiatives_page.html | 2 +- .../wagtailpages/static/participate_page.html | 6 ++++-- .../templates/wagtailpages/static/styleguide.html | 2 +- .../templates/wagtailpages/tags/card-cta.html | 10 ++++++++++ .../wagtailpages/templatetags/card_tags.py | 14 ++++++++++++-- 6 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/homepage.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/homepage.html index a85957220bd..eea7aeddaa6 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/homepage.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/homepage.html @@ -103,7 +103,7 @@

Happening now

{% for highlight in page.featured_highlights.all %} {% if forloop.counter <= 2 %}
- {% card "md_width" highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label %} + {% card highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label %}
{% endif %} {% endfor %}
diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/initiatives_page.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/initiatives_page.html index 453142c150d..e9355e4ea71 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/initiatives_page.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/initiatives_page.html @@ -72,7 +72,7 @@

{{ page.h3 }}

{% for highlight in page.featured_highlights.all %} {% if forloop.counter <= 3 %}
- {% card "md_width" highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label %} + {% card highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label %}
{% endif %} {% endfor %} diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html index 7df27ce0f95..885cf605081 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html @@ -27,17 +27,19 @@

{{ page.h2 }}

-
+
{% for highlight in page.featured_highlights.all %} {% if forloop.counter <= 3 %}
- {% card "md_width" highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label highlight.commitment %} + {% card highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label highlight.commitment %}
{% endif %} {% endfor %}
+ {% cardCTA None "Give" "lorem" "http://x.com" "Donate Now" "5 min" %} +
{% endblock %} diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/styleguide.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/styleguide.html index 5dc8b3091b0..d736d0582b0 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/styleguide.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/styleguide.html @@ -206,7 +206,7 @@

.jump-bar

.hr-gradient


card (Django template custom tag: `card_tags`)

- {% card "md_width" "https://placekitten.com/g/600/400" "title" "description" "http://example.org" "Link" %} + {% card "https://placekitten.com/g/600/400" "title" "description" "http://example.org" "Link" %}

.commitment

10 hour commitment

.join-us

diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html new file mode 100644 index 00000000000..1b175298d38 --- /dev/null +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html @@ -0,0 +1,10 @@ +
+

{{ title }}

+

{{ description }}

+ + {% if commitment %} +
{{ commitment }}
+ {% endif %} + + {{ link_label }} +
diff --git a/network-api/networkapi/wagtailpages/templatetags/card_tags.py b/network-api/networkapi/wagtailpages/templatetags/card_tags.py index 205e48b1274..3de6c45af9a 100644 --- a/network-api/networkapi/wagtailpages/templatetags/card_tags.py +++ b/network-api/networkapi/wagtailpages/templatetags/card_tags.py @@ -4,9 +4,19 @@ @register.inclusion_tag('wagtailpages/tags/card.html') -def card(md_width, image, title, description, link_url, link_label, commitment=None): +def card(image, title, description, link_url, link_label, commitment=None): + return { + 'image': image, + 'title': title, + 'description': description, + 'link_url': link_url, + 'link_label': link_label, + 'commitment': commitment, + } + +@register.inclusion_tag('wagtailpages/tags/card-cta.html') +def cardCTA(image, title, description, link_url, link_label, commitment=None): return { - 'md_width': md_width, 'image': image, 'title': title, 'description': description, From e57e647f338d84f65b0e7ef6cd60be6e839f25cd Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Tue, 7 Aug 2018 14:04:20 -0700 Subject: [PATCH 06/21] adding a 2nd participate template --- .../migrations/0041_auto_20180807_2048.py | 74 +++++++++++++++++++ network-api/networkapi/wagtailpages/models.py | 8 +- .../wagtailpages/static/participate_page.html | 56 +++++--------- .../static/participate_page2.html | 45 +++++++++++ 4 files changed, 146 insertions(+), 37 deletions(-) create mode 100644 network-api/networkapi/wagtailpages/migrations/0041_auto_20180807_2048.py create mode 100644 network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html diff --git a/network-api/networkapi/wagtailpages/migrations/0041_auto_20180807_2048.py b/network-api/networkapi/wagtailpages/migrations/0041_auto_20180807_2048.py new file mode 100644 index 00000000000..2bf09d12edd --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0041_auto_20180807_2048.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-07 20:48 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import modelcluster.fields +import wagtail.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailimages', '0020_add-verbose-name'), + ('wagtailpages', '0040_participatehighlights_commitment'), + ] + + operations = [ + migrations.CreateModel( + name='ParticipatePage2', + fields=[ + ('primarypage_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailpages.PrimaryPage')), + ('heroHeader', models.TextField(blank=True)), + ('heroSubhead', wagtail.core.fields.RichTextField(blank=True)), + ('commitment', models.TextField(blank=True)), + ('ctaButtonTitle', models.CharField(blank=True, max_length=250, verbose_name='Button Text')), + ('ctaButtonURL', models.TextField(blank=True, verbose_name='Button URL')), + ('h2', models.TextField(blank=True)), + ('h2Subheader', models.TextField(blank=True)), + ('primaryHero', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='primary_hero_participate', to='wagtailimages.Image', verbose_name='Primary Hero Image')), + ], + options={ + 'abstract': False, + }, + bases=('wagtailpages.primarypage',), + ), + migrations.RemoveField( + model_name='participatepage', + name='commitment', + ), + migrations.RemoveField( + model_name='participatepage', + name='ctaButtonTitle', + ), + migrations.RemoveField( + model_name='participatepage', + name='ctaButtonURL', + ), + migrations.RemoveField( + model_name='participatepage', + name='h2', + ), + migrations.RemoveField( + model_name='participatepage', + name='h2Subheader', + ), + migrations.RemoveField( + model_name='participatepage', + name='heroHeader', + ), + migrations.RemoveField( + model_name='participatepage', + name='heroSubhead', + ), + migrations.RemoveField( + model_name='participatepage', + name='primaryHero', + ), + migrations.AlterField( + model_name='participatehighlights', + name='page', + field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='featured_highlights', to='wagtailpages.ParticipatePage2'), + ), + ] diff --git a/network-api/networkapi/wagtailpages/models.py b/network-api/networkapi/wagtailpages/models.py index 6067d8cbe69..a7e23a07357 100644 --- a/network-api/networkapi/wagtailpages/models.py +++ b/network-api/networkapi/wagtailpages/models.py @@ -498,6 +498,11 @@ class ParticipatePage(PrimaryPage): parent_page_types = ['Homepage'] template = 'wagtailpages/static/participate_page.html' + +class ParticipatePage2(PrimaryPage): + parent_page_types = ['Homepage'] + template = 'wagtailpages/static/participate_page2.html' + primaryHero = models.ForeignKey( 'wagtailimages.Image', null=True, @@ -625,7 +630,7 @@ def __str__(self): class ParticipateHighlights(WagtailOrderable, models.Model): page = ParentalKey( - 'wagtailpages.ParticipatePage', + 'wagtailpages.ParticipatePage2', related_name='featured_highlights', ) highlight = models.ForeignKey('highlights.Highlight', related_name='+') @@ -702,6 +707,7 @@ class Homepage(MetadataPageMixin, Page): 'Styleguide', 'NewsPage', 'ParticipatePage', + 'ParticipatePage2', 'MiniSiteNameSpace', 'RedirectingPage', 'OpportunityPage', diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html index 885cf605081..969e63048e7 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page.html @@ -1,45 +1,29 @@ -{% extends "pages/base.html" %} -{% load wagtailcore_tags wagtailimages_tags homepage_tags card_tags %} - -{% block bodyID %}participate{% endblock %} +{% extends "../primary_page.html" %} +{% load wagtailcore_tags wagtailimages_tags %} {% block content %} - -{% image page.primaryHero format-jpeg as big_hero %} -
-
-
-
-

{{ page.heroHeader }}

-

{{ page.heroSubhead | richtext }}

-

{{ page.commitment }}

- {{ page.ctaButtonTitle }} +
+
+
+
+
+

Mozfest 2018 is open for proposals!

+

This years theme "Data and You" takes the large concepts of data: collection, surveillance, policy, it’s currency and its future and center it around the most important of all its parts: people. How does and will data affect people’s lives? How can we share best practices, innovative tools and grow connections that allow data to serve people instead of people serving data. The deadline for proposals is August 31st.

Apply now
-
-
- -
-
-
-

{{ page.h2 }}

-

{{ page.h2Subheader }}

+
+
+
+

Fellowships that Empower Leaders

+

Mozilla Fellowships provide resources, tools, community and amplification to those building a more ​humane​ ​digital​ ​world. Mozilla Fellowships are a transformative experience for emerging leaders concerned with making the internet a safer, more accessible resource for everyone.

Learn more and apply +
-
- -
-
- {% for highlight in page.featured_highlights.all %} - {% if forloop.counter <= 3 %} -
- {% card highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label highlight.commitment %} +
+
+
+

Internet Health Report

+

Is the Internet getting healthier? Is it under threat? Do we all have a voice on the web? Mozilla’s Internet Health Report is an open source initiative that combines research from multiple sources to document what’s healthy and unhealthy.

Read the report
- {% endif %} - {% endfor %}
- - {% cardCTA None "Give" "lorem" "http://x.com" "Donate Now" "5 min" %} - -
{% endblock %} diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html new file mode 100644 index 00000000000..885cf605081 --- /dev/null +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html @@ -0,0 +1,45 @@ +{% extends "pages/base.html" %} +{% load wagtailcore_tags wagtailimages_tags homepage_tags card_tags %} + +{% block bodyID %}participate{% endblock %} + +{% block content %} + +{% image page.primaryHero format-jpeg as big_hero %} +
+
+
+
+

{{ page.heroHeader }}

+

{{ page.heroSubhead | richtext }}

+

{{ page.commitment }}

+ {{ page.ctaButtonTitle }} +
+
+
+
+ +
+
+
+

{{ page.h2 }}

+

{{ page.h2Subheader }}

+
+
+ +
+
+ {% for highlight in page.featured_highlights.all %} + {% if forloop.counter <= 3 %} +
+ {% card highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label highlight.commitment %} +
+ {% endif %} + {% endfor %} +
+
+ + {% cardCTA None "Give" "lorem" "http://x.com" "Donate Now" "5 min" %} + +
+{% endblock %} From 55fdc8e46e0f3090c8b8993d140f8317b40e4b9e Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Thu, 9 Aug 2018 14:42:17 -0700 Subject: [PATCH 07/21] WET approach --- .../migrations/0042_auto_20180808_1754.py | 64 ++++++++++++++++++ .../migrations/0043_auto_20180808_1833.py | 59 +++++++++++++++++ .../migrations/0044_auto_20180808_2029.py | 32 +++++++++ .../migrations/0045_auto_20180808_2054.py | 42 ++++++++++++ .../migrations/0046_auto_20180808_2133.py | 29 +++++++++ .../migrations/0047_auto_20180809_1909.py | 32 +++++++++ .../migrations/0048_auto_20180809_1944.py | 35 ++++++++++ .../migrations/0049_auto_20180809_1950.py | 31 +++++++++ .../migrations/0050_auto_20180809_2118.py | 26 ++++++++ .../migrations/0051_auto_20180809_2136.py | 35 ++++++++++ .../migrations/0052_auto_20180809_2140.py | 48 ++++++++++++++ network-api/networkapi/wagtailpages/models.py | 65 ++++++++++++++++--- 12 files changed, 488 insertions(+), 10 deletions(-) create mode 100644 network-api/networkapi/wagtailpages/migrations/0042_auto_20180808_1754.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0043_auto_20180808_1833.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0044_auto_20180808_2029.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0045_auto_20180808_2054.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0046_auto_20180808_2133.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0047_auto_20180809_1909.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0048_auto_20180809_1944.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0049_auto_20180809_1950.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0050_auto_20180809_2118.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0051_auto_20180809_2136.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0052_auto_20180809_2140.py diff --git a/network-api/networkapi/wagtailpages/migrations/0042_auto_20180808_1754.py b/network-api/networkapi/wagtailpages/migrations/0042_auto_20180808_1754.py new file mode 100644 index 00000000000..f4d3c900a91 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0042_auto_20180808_1754.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-08 17:54 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import modelcluster.fields +import wagtail.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailimages', '0020_add-verbose-name'), + ('wagtailpages', '0041_auto_20180807_2048'), + ] + + operations = [ + migrations.CreateModel( + name='ParticipateCTA', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('heroHeader', models.TextField(blank=True)), + ('heroSubhead', wagtail.core.fields.RichTextField(blank=True)), + ('commitment', models.TextField(blank=True)), + ('ctaButtonTitle', models.CharField(blank=True, max_length=250, verbose_name='Button Text')), + ('ctaButtonURL', models.TextField(blank=True, verbose_name='Button URL')), + ], + ), + migrations.RemoveField( + model_name='participatepage2', + name='commitment', + ), + migrations.RemoveField( + model_name='participatepage2', + name='ctaButtonTitle', + ), + migrations.RemoveField( + model_name='participatepage2', + name='ctaButtonURL', + ), + migrations.RemoveField( + model_name='participatepage2', + name='heroHeader', + ), + migrations.RemoveField( + model_name='participatepage2', + name='heroSubhead', + ), + migrations.RemoveField( + model_name='participatepage2', + name='primaryHero', + ), + migrations.AddField( + model_name='participatecta', + name='page', + field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='participate_cta', to='wagtailpages.ParticipatePage2'), + ), + migrations.AddField( + model_name='participatecta', + name='primaryHero', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='primary_hero_participate', to='wagtailimages.Image', verbose_name='Primary Hero Image'), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0043_auto_20180808_1833.py b/network-api/networkapi/wagtailpages/migrations/0043_auto_20180808_1833.py new file mode 100644 index 00000000000..585df9fd578 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0043_auto_20180808_1833.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-08 18:33 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import wagtail.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailimages', '0020_add-verbose-name'), + ('wagtailpages', '0042_auto_20180808_1754'), + ] + + operations = [ + migrations.RemoveField( + model_name='participatecta', + name='page', + ), + migrations.RemoveField( + model_name='participatecta', + name='primaryHero', + ), + migrations.AddField( + model_name='participatepage2', + name='ctaButtonTitle', + field=models.CharField(blank=True, max_length=250, verbose_name='Button Text'), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaButtonURL', + field=models.TextField(blank=True, verbose_name='Button URL'), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaCommitment', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaHeader', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaImage', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='primary_hero_participate', to='wagtailimages.Image', verbose_name='Primary Hero Image'), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaSubhead', + field=wagtail.core.fields.RichTextField(blank=True), + ), + migrations.DeleteModel( + name='ParticipateCTA', + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0044_auto_20180808_2029.py b/network-api/networkapi/wagtailpages/migrations/0044_auto_20180808_2029.py new file mode 100644 index 00000000000..ff8fa8b7072 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0044_auto_20180808_2029.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-08 20:29 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0043_auto_20180808_1833'), + ] + + operations = [ + migrations.CreateModel( + name='Example', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('foo', models.CharField(blank=True, max_length=128)), + ('bar', models.CharField(blank=True, max_length=128)), + ], + options={ + 'verbose_name_plural': 'Examples', + }, + ), + migrations.AddField( + model_name='participatepage2', + name='example', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='wagtailpages.Example'), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0045_auto_20180808_2054.py b/network-api/networkapi/wagtailpages/migrations/0045_auto_20180808_2054.py new file mode 100644 index 00000000000..a22b421dab0 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0045_auto_20180808_2054.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-08 20:54 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0044_auto_20180808_2029'), + ] + + operations = [ + migrations.RenameField( + model_name='participatepage2', + old_name='ctaCommitment', + new_name='commitment', + ), + migrations.RenameField( + model_name='participatepage2', + old_name='ctaHeader', + new_name='heroHeader', + ), + migrations.RenameField( + model_name='participatepage2', + old_name='ctaSubhead', + new_name='heroSubhead', + ), + migrations.RenameField( + model_name='participatepage2', + old_name='ctaImage', + new_name='primaryHero', + ), + migrations.RemoveField( + model_name='participatepage2', + name='example', + ), + migrations.DeleteModel( + name='Example', + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0046_auto_20180808_2133.py b/network-api/networkapi/wagtailpages/migrations/0046_auto_20180808_2133.py new file mode 100644 index 00000000000..d3dfe51b23c --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0046_auto_20180808_2133.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-08 21:33 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0045_auto_20180808_2054'), + ] + + operations = [ + migrations.CreateModel( + name='Foo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('question_text', models.CharField(max_length=200)), + ('pub_date', models.DateTimeField(verbose_name='date published')), + ], + ), + migrations.AddField( + model_name='participatepage2', + name='foo', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='wagtailpages.Foo'), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0047_auto_20180809_1909.py b/network-api/networkapi/wagtailpages/migrations/0047_auto_20180809_1909.py new file mode 100644 index 00000000000..86916d2844b --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0047_auto_20180809_1909.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-09 19:09 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import modelcluster.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0046_auto_20180808_2133'), + ] + + operations = [ + migrations.RemoveField( + model_name='participatepage2', + name='foo', + ), + migrations.AddField( + model_name='foo', + name='bar', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='foo', + name='page', + field=modelcluster.fields.ParentalKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='foos', to='wagtailpages.ParticipatePage2'), + preserve_default=False, + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0048_auto_20180809_1944.py b/network-api/networkapi/wagtailpages/migrations/0048_auto_20180809_1944.py new file mode 100644 index 00000000000..f5ee132b203 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0048_auto_20180809_1944.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-09 19:44 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0047_auto_20180809_1909'), + ] + + operations = [ + migrations.RemoveField( + model_name='foo', + name='page', + ), + migrations.AddField( + model_name='participatepage2', + name='bar', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='participate_page', to='wagtailpages.Foo'), + ), + migrations.AddField( + model_name='participatepage2', + name='bar2', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='participate_page2', to='wagtailpages.Foo'), + ), + migrations.AddField( + model_name='participatepage2', + name='bar3', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='participate_page3', to='wagtailpages.Foo'), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0049_auto_20180809_1950.py b/network-api/networkapi/wagtailpages/migrations/0049_auto_20180809_1950.py new file mode 100644 index 00000000000..7319dcdfec1 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0049_auto_20180809_1950.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-09 19:50 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0048_auto_20180809_1944'), + ] + + operations = [ + migrations.RemoveField( + model_name='participatehighlights', + name='highlight', + ), + migrations.RemoveField( + model_name='participatepage2', + name='bar', + ), + migrations.RemoveField( + model_name='participatepage2', + name='bar2', + ), + migrations.RemoveField( + model_name='participatepage2', + name='bar3', + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0050_auto_20180809_2118.py b/network-api/networkapi/wagtailpages/migrations/0050_auto_20180809_2118.py new file mode 100644 index 00000000000..503231be147 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0050_auto_20180809_2118.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-09 21:18 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('highlights', '0004_remove_highlight_commitment'), + ('wagtailpages', '0049_auto_20180809_1950'), + ] + + operations = [ + migrations.DeleteModel( + name='Foo', + ), + migrations.AddField( + model_name='participatehighlights', + name='highlight', + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='highlights.Highlight'), + preserve_default=False, + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0051_auto_20180809_2136.py b/network-api/networkapi/wagtailpages/migrations/0051_auto_20180809_2136.py new file mode 100644 index 00000000000..5667e3a6d65 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0051_auto_20180809_2136.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-09 21:36 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0050_auto_20180809_2118'), + ] + + operations = [ + migrations.RenameField( + model_name='participatepage2', + old_name='commitment', + new_name='ctaCommitment', + ), + migrations.RenameField( + model_name='participatepage2', + old_name='primaryHero', + new_name='ctaHero', + ), + migrations.RenameField( + model_name='participatepage2', + old_name='heroHeader', + new_name='ctaHeroHeader', + ), + migrations.RenameField( + model_name='participatepage2', + old_name='heroSubhead', + new_name='ctaHeroSubhead', + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0052_auto_20180809_2140.py b/network-api/networkapi/wagtailpages/migrations/0052_auto_20180809_2140.py new file mode 100644 index 00000000000..6b569cc6477 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0052_auto_20180809_2140.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-09 21:40 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import wagtail.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailimages', '0020_add-verbose-name'), + ('wagtailpages', '0051_auto_20180809_2136'), + ] + + operations = [ + migrations.AddField( + model_name='participatepage2', + name='ctaButtonTitle2', + field=models.CharField(blank=True, max_length=250, verbose_name='Button Text'), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaButtonURL2', + field=models.TextField(blank=True, verbose_name='Button URL'), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaCommitment2', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaHero2', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='primary_hero_participate2', to='wagtailimages.Image', verbose_name='Primary Hero Image'), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaHeroHeader2', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaHeroSubhead2', + field=wagtail.core.fields.RichTextField(blank=True), + ), + ] diff --git a/network-api/networkapi/wagtailpages/models.py b/network-api/networkapi/wagtailpages/models.py index a7e23a07357..01737512d82 100644 --- a/network-api/networkapi/wagtailpages/models.py +++ b/network-api/networkapi/wagtailpages/models.py @@ -503,7 +503,7 @@ class ParticipatePage2(PrimaryPage): parent_page_types = ['Homepage'] template = 'wagtailpages/static/participate_page2.html' - primaryHero = models.ForeignKey( + ctaHero = models.ForeignKey( 'wagtailimages.Image', null=True, blank=True, @@ -512,18 +512,18 @@ class ParticipatePage2(PrimaryPage): verbose_name='Primary Hero Image', ) - heroHeader = models.TextField( + ctaHeroHeader = models.TextField( blank=True, ) - heroSubhead = RichTextField( + ctaHeroSubhead = RichTextField( features=[ 'bold', 'italic', 'link', ], blank=True, ) - commitment = models.TextField( + ctaCommitment = models.TextField( blank=True, ) @@ -538,6 +538,41 @@ class ParticipatePage2(PrimaryPage): blank=True, ) + ctaHero2 = models.ForeignKey( + 'wagtailimages.Image', + null=True, + blank=True, + on_delete=models.SET_NULL, + related_name='primary_hero_participate2', + verbose_name='Primary Hero Image', + ) + + ctaHeroHeader2 = models.TextField( + blank=True, + ) + + ctaHeroSubhead2 = RichTextField( + features=[ + 'bold', 'italic', 'link', + ], + blank=True, + ) + + ctaCommitment2 = models.TextField( + blank=True, + ) + + ctaButtonTitle2 = models.CharField( + verbose_name='Button Text', + max_length=250, + blank=True, + ) + + ctaButtonURL2 = models.TextField( + verbose_name='Button URL', + blank=True, + ) + h2 = models.TextField( blank=True, ) @@ -547,15 +582,25 @@ class ParticipatePage2(PrimaryPage): ) content_panels = Page.content_panels + [ - ImageChooserPanel('primaryHero'), - FieldPanel('heroHeader'), - FieldPanel('heroSubhead'), - FieldPanel('commitment'), - FieldPanel('ctaButtonTitle'), - FieldPanel('ctaButtonURL'), + MultiFieldPanel([ + ImageChooserPanel('ctaHero'), + FieldPanel('ctaHeroHeader'), + FieldPanel('ctaHeroSubhead'), + FieldPanel('ctaCommitment'), + FieldPanel('ctaButtonTitle'), + FieldPanel('ctaButtonURL'), + ], heading="Primary CTA"), FieldPanel('h2'), FieldPanel('h2Subheader'), InlinePanel('featured_highlights', label='Highlights', max_num=3), + MultiFieldPanel([ + ImageChooserPanel('ctaHero2'), + FieldPanel('ctaHeroHeader2'), + FieldPanel('ctaHeroSubhead2'), + FieldPanel('ctaCommitment2'), + FieldPanel('ctaButtonTitle2'), + FieldPanel('ctaButtonURL2'), + ], heading="CTA 2"), ] From 1dd498b5ecf91954c1ef45d26c4746ea8379fc97 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Thu, 9 Aug 2018 14:51:31 -0700 Subject: [PATCH 08/21] more template scaffolding --- .../wagtailpages/static/participate_page2.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html index 885cf605081..59346fe246c 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html @@ -5,14 +5,14 @@ {% block content %} -{% image page.primaryHero format-jpeg as big_hero %} +{% image page.ctaHero format-jpeg as big_hero %}
-

{{ page.heroHeader }}

-

{{ page.heroSubhead | richtext }}

-

{{ page.commitment }}

+

{{ page.ctaHeroHeader }}

+

{{ page.ctaHeroSubhead | richtext }}

+

{{ page.ctaCommitment }}

{{ page.ctaButtonTitle }}
@@ -39,7 +39,7 @@

{{ page.h2 }}

- {% cardCTA None "Give" "lorem" "http://x.com" "Donate Now" "5 min" %} + {% cardCTA None page.ctaHeroHeader2 page.ctaHeroSubhead2 page.ctaButtonURL2 page.ctaButtonTitle2 page.ctaCommitment2 %}
{% endblock %} From 6059675fcfae048717d6f81d085b8febfe36c986 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Wed, 15 Aug 2018 16:59:25 -0700 Subject: [PATCH 09/21] cta --- .../static/participate_page2.html | 6 ++--- .../templates/wagtailpages/tags/card-cta.html | 22 +++++++++++++------ source/sass/components/card.scss | 12 ++++++++++ 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html index 59346fe246c..eaa7c50184e 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html @@ -21,13 +21,13 @@

{{ page.ctaHeroHeader }}

-
+

{{ page.h2 }}

{{ page.h2Subheader }}

-
+
{% for highlight in page.featured_highlights.all %} {% if forloop.counter <= 3 %} @@ -39,7 +39,7 @@

{{ page.h2 }}

- {% cardCTA None page.ctaHeroHeader2 page.ctaHeroSubhead2 page.ctaButtonURL2 page.ctaButtonTitle2 page.ctaCommitment2 %} + {% cardCTA page.ctaHero2 page.ctaHeroHeader2 page.ctaHeroSubhead2 page.ctaButtonURL2 page.ctaButtonTitle2 page.ctaCommitment2 %}
{% endblock %} diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html index 1b175298d38..30e8a90f2fe 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html @@ -1,10 +1,18 @@ -
-

{{ title }}

-

{{ description }}

+{% load wagtailcore_tags wagtailimages_tags %} - {% if commitment %} -
{{ commitment }}
- {% endif %} +
+
+

{{ title }}

+

{{ description | richtext }}

- {{ link_label }} + {% if commitment %} +
{{ commitment }}
+ {% endif %} + + {{ link_label }} +
+
+ {% image image format-png as hero %} +
+
diff --git a/source/sass/components/card.scss b/source/sass/components/card.scss index dab75fbbdd2..93f48a6e51a 100644 --- a/source/sass/components/card.scss +++ b/source/sass/components/card.scss @@ -10,3 +10,15 @@ padding: 4px 8px; } } + +.card-cta { + .wrapper { + display: flex; + margin: -24px 0; + height: calc(100% + 48px); + background-size: contain; + background-repeat: no-repeat; + background-position: center; + min-height: 300px; + } +} From a8d0176e96bbfd99bf5a1d56dfb824b2c0ce8fd7 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Thu, 16 Aug 2018 10:27:05 -0700 Subject: [PATCH 10/21] tweak --- .../templates/wagtailpages/static/participate_page2.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html index eaa7c50184e..8a32ff382ac 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html @@ -30,11 +30,9 @@

{{ page.h2 }}

{% for highlight in page.featured_highlights.all %} - {% if forloop.counter <= 3 %}
{% card highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label highlight.commitment %}
- {% endif %} {% endfor %}
From 4ab1e993f9d8df983c83d8dfb1e96ed1d15430e7 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Thu, 16 Aug 2018 10:46:57 -0700 Subject: [PATCH 11/21] adding 2nd set of highlights --- .../migrations/0053_participatehighlights2.py | 34 +++++++++++++++++++ network-api/networkapi/wagtailpages/models.py | 16 ++++++++- .../static/participate_page2.html | 10 ++++++ .../templates/wagtailpages/tags/card-cta.html | 2 +- source/sass/components/card.scss | 2 ++ 5 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 network-api/networkapi/wagtailpages/migrations/0053_participatehighlights2.py diff --git a/network-api/networkapi/wagtailpages/migrations/0053_participatehighlights2.py b/network-api/networkapi/wagtailpages/migrations/0053_participatehighlights2.py new file mode 100644 index 00000000000..ae18e78cf94 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0053_participatehighlights2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-16 17:32 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import modelcluster.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('highlights', '0004_remove_highlight_commitment'), + ('wagtailpages', '0052_auto_20180809_2140'), + ] + + operations = [ + migrations.CreateModel( + name='ParticipateHighlights2', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sort_order', models.IntegerField(blank=True, editable=False, null=True)), + ('commitment', models.CharField(blank=True, help_text='Amount of time required (eg: "30 min commitment")', max_length=256)), + ('highlight', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='highlights.Highlight')), + ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='featured_highlights2', to='wagtailpages.ParticipatePage2')), + ], + options={ + 'verbose_name': 'highlight', + 'verbose_name_plural': 'highlights', + 'ordering': ['sort_order'], + 'abstract': False, + }, + ), + ] diff --git a/network-api/networkapi/wagtailpages/models.py b/network-api/networkapi/wagtailpages/models.py index 01737512d82..f7a1cee2ae3 100644 --- a/network-api/networkapi/wagtailpages/models.py +++ b/network-api/networkapi/wagtailpages/models.py @@ -494,6 +494,7 @@ class InitiativesPage(PrimaryPage): ] +# TODO: Remove this model after ParticipatePage2 is in use class ParticipatePage(PrimaryPage): parent_page_types = ['Homepage'] template = 'wagtailpages/static/participate_page.html' @@ -601,6 +602,7 @@ class ParticipatePage2(PrimaryPage): FieldPanel('ctaButtonTitle2'), FieldPanel('ctaButtonURL2'), ], heading="CTA 2"), + InlinePanel('featured_highlights2', label='Highlights2', max_num=6), ] @@ -673,7 +675,7 @@ class Meta: def __str__(self): return self.page.title + '->' + self.highlight.title -class ParticipateHighlights(WagtailOrderable, models.Model): +class ParticipateHighlightsBase(WagtailOrderable, models.Model): page = ParentalKey( 'wagtailpages.ParticipatePage2', related_name='featured_highlights', @@ -690,6 +692,7 @@ class ParticipateHighlights(WagtailOrderable, models.Model): ] class Meta: + abstract = True verbose_name = 'highlight' verbose_name_plural = 'highlights' ordering = ['sort_order'] # not automatically inherited! @@ -697,6 +700,17 @@ class Meta: def __str__(self): return self.page.title + '->' + self.highlight.title +class ParticipateHighlights(ParticipateHighlightsBase): + page = ParentalKey( + 'wagtailpages.ParticipatePage2', + related_name='featured_highlights', + ) + +class ParticipateHighlights2(ParticipateHighlightsBase): + page = ParentalKey( + 'wagtailpages.ParticipatePage2', + related_name='featured_highlights2', + ) class Homepage(MetadataPageMixin, Page): hero_headline = models.CharField( diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html index 8a32ff382ac..01cc8868e40 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html @@ -39,5 +39,15 @@

{{ page.h2 }}

{% cardCTA page.ctaHero2 page.ctaHeroHeader2 page.ctaHeroSubhead2 page.ctaButtonURL2 page.ctaButtonTitle2 page.ctaCommitment2 %} +
+
+ {% for highlight in page.featured_highlights2.all %} +
+ {% card highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label highlight.commitment %} +
+ {% endfor %} +
+
+
{% endblock %} diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html index 30e8a90f2fe..7e0eb4f6deb 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html @@ -1,6 +1,6 @@ {% load wagtailcore_tags wagtailimages_tags %} -
+

{{ title }}

{{ description | richtext }}

diff --git a/source/sass/components/card.scss b/source/sass/components/card.scss index 93f48a6e51a..73413b51264 100644 --- a/source/sass/components/card.scss +++ b/source/sass/components/card.scss @@ -12,6 +12,8 @@ } .card-cta { + margin: 48px 0; + .wrapper { display: flex; margin: -24px 0; From bf6e4fb926f2aa512df61781ff14e53634deb308 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Thu, 16 Aug 2018 15:53:33 -0700 Subject: [PATCH 12/21] adding more ctas --- .../migrations/0054_participatecta3.py | 28 ++++++ .../0055_participatecta3_newctahero.py | 22 +++++ .../migrations/0056_auto_20180816_1811.py | 26 +++++ .../migrations/0057_auto_20180816_2054.py | 48 +++++++++ .../migrations/0058_auto_20180816_2204.py | 44 +++++++++ .../wagtailpages/migrations/0059_cta4_hero.py | 22 +++++ .../migrations/0060_auto_20180816_2219.py | 36 +++++++ network-api/networkapi/wagtailpages/models.py | 98 ++++++++++++++++++- .../static/participate_page2.html | 10 +- .../templates/wagtailpages/tags/card-cta.html | 2 + .../wagtailpages/tags/card-large.html | 14 +++ .../wagtailpages/templatetags/card_tags.py | 11 +++ 12 files changed, 358 insertions(+), 3 deletions(-) create mode 100644 network-api/networkapi/wagtailpages/migrations/0054_participatecta3.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0055_participatecta3_newctahero.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0056_auto_20180816_1811.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0057_auto_20180816_2054.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0058_auto_20180816_2204.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0059_cta4_hero.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0060_auto_20180816_2219.py create mode 100644 network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-large.html diff --git a/network-api/networkapi/wagtailpages/migrations/0054_participatecta3.py b/network-api/networkapi/wagtailpages/migrations/0054_participatecta3.py new file mode 100644 index 00000000000..dd0ef50813d --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0054_participatecta3.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-16 18:00 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import modelcluster.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0053_participatehighlights2'), + ] + + operations = [ + migrations.CreateModel( + name='ParticipateCTA3', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('foo', models.TextField(blank=True)), + ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='cta3', to='wagtailpages.ParticipatePage2')), + ], + options={ + 'abstract': False, + }, + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0055_participatecta3_newctahero.py b/network-api/networkapi/wagtailpages/migrations/0055_participatecta3_newctahero.py new file mode 100644 index 00000000000..34051d6a3c5 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0055_participatecta3_newctahero.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-16 18:08 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailimages', '0020_add-verbose-name'), + ('wagtailpages', '0054_participatecta3'), + ] + + operations = [ + migrations.AddField( + model_name='participatecta3', + name='NEWctaHero', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='NEWprimary_hero_participate', to='wagtailimages.Image', verbose_name='Primary Hero Image'), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0056_auto_20180816_1811.py b/network-api/networkapi/wagtailpages/migrations/0056_auto_20180816_1811.py new file mode 100644 index 00000000000..621185bfe21 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0056_auto_20180816_1811.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-16 18:11 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0055_participatecta3_newctahero'), + ] + + operations = [ + migrations.RemoveField( + model_name='participatecta3', + name='NEWctaHero', + ), + migrations.RemoveField( + model_name='participatecta3', + name='page', + ), + migrations.DeleteModel( + name='ParticipateCTA3', + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0057_auto_20180816_2054.py b/network-api/networkapi/wagtailpages/migrations/0057_auto_20180816_2054.py new file mode 100644 index 00000000000..8789bf53ada --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0057_auto_20180816_2054.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-16 20:54 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import wagtail.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailimages', '0020_add-verbose-name'), + ('wagtailpages', '0056_auto_20180816_1811'), + ] + + operations = [ + migrations.AddField( + model_name='participatepage2', + name='ctaButtonTitle3', + field=models.CharField(blank=True, max_length=250, verbose_name='Button Text'), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaButtonURL3', + field=models.TextField(blank=True, verbose_name='Button URL'), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaCommitment3', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaHero3', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='primary_hero_participate3', to='wagtailimages.Image', verbose_name='Primary Hero Image'), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaHeroHeader3', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaHeroSubhead3', + field=wagtail.core.fields.RichTextField(blank=True), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0058_auto_20180816_2204.py b/network-api/networkapi/wagtailpages/migrations/0058_auto_20180816_2204.py new file mode 100644 index 00000000000..bd26431d87a --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0058_auto_20180816_2204.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-16 22:04 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import modelcluster.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0057_auto_20180816_2054'), + ] + + operations = [ + migrations.CreateModel( + name='CTA4', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sort_order', models.IntegerField(blank=True, editable=False, null=True)), + ('commitment', models.CharField(blank=True, help_text='Amount of time required (eg: "30 min commitment")', max_length=256)), + ], + options={ + 'verbose_name': 'cta', + 'verbose_name_plural': 'ctas', + 'ordering': ['sort_order'], + 'abstract': False, + }, + ), + migrations.RemoveField( + model_name='participatepage2', + name='ctaButtonTitle3', + ), + migrations.RemoveField( + model_name='participatepage2', + name='ctaButtonURL3', + ), + migrations.AddField( + model_name='cta4', + name='page', + field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='cta4', to='wagtailpages.ParticipatePage2'), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0059_cta4_hero.py b/network-api/networkapi/wagtailpages/migrations/0059_cta4_hero.py new file mode 100644 index 00000000000..9cf1eb0a13a --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0059_cta4_hero.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-16 22:07 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailimages', '0020_add-verbose-name'), + ('wagtailpages', '0058_auto_20180816_2204'), + ] + + operations = [ + migrations.AddField( + model_name='cta4', + name='hero', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='cta_hero', to='wagtailimages.Image', verbose_name='Hero Image'), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0060_auto_20180816_2219.py b/network-api/networkapi/wagtailpages/migrations/0060_auto_20180816_2219.py new file mode 100644 index 00000000000..09f8212351f --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0060_auto_20180816_2219.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-16 22:19 +from __future__ import unicode_literals + +from django.db import migrations, models +import wagtail.core.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0059_cta4_hero'), + ] + + operations = [ + migrations.AddField( + model_name='cta4', + name='buttonTitle', + field=models.CharField(blank=True, max_length=250, verbose_name='Button Text'), + ), + migrations.AddField( + model_name='cta4', + name='buttonURL', + field=models.TextField(blank=True, verbose_name='Button URL'), + ), + migrations.AddField( + model_name='cta4', + name='header', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='cta4', + name='subhead', + field=wagtail.core.fields.RichTextField(blank=True), + ), + ] diff --git a/network-api/networkapi/wagtailpages/models.py b/network-api/networkapi/wagtailpages/models.py index f7a1cee2ae3..49656079391 100644 --- a/network-api/networkapi/wagtailpages/models.py +++ b/network-api/networkapi/wagtailpages/models.py @@ -574,12 +574,37 @@ class ParticipatePage2(PrimaryPage): blank=True, ) + ctaHero3 = models.ForeignKey( + 'wagtailimages.Image', + null=True, + blank=True, + on_delete=models.SET_NULL, + related_name='primary_hero_participate3', + verbose_name='Primary Hero Image', + ) + + ctaHeroHeader3 = models.TextField( + blank=True, + ) + + ctaHeroSubhead3 = RichTextField( + features=[ + 'bold', 'italic', 'link', + ], + blank=True, + ) + + ctaCommitment3 = models.TextField( + blank=True, + ) + h2 = models.TextField( blank=True, ) h2Subheader = models.TextField( blank=True, + verbose_name='H2 Subheader', ) content_panels = Page.content_panels + [ @@ -593,7 +618,7 @@ class ParticipatePage2(PrimaryPage): ], heading="Primary CTA"), FieldPanel('h2'), FieldPanel('h2Subheader'), - InlinePanel('featured_highlights', label='Highlights', max_num=3), + InlinePanel('featured_highlights', label='Highlights Group 1', max_num=3), MultiFieldPanel([ ImageChooserPanel('ctaHero2'), FieldPanel('ctaHeroHeader2'), @@ -602,7 +627,14 @@ class ParticipatePage2(PrimaryPage): FieldPanel('ctaButtonTitle2'), FieldPanel('ctaButtonURL2'), ], heading="CTA 2"), - InlinePanel('featured_highlights2', label='Highlights2', max_num=6), + InlinePanel('featured_highlights2', label='Highlights Group 2', max_num=6), + MultiFieldPanel([ + ImageChooserPanel('ctaHero3'), + FieldPanel('ctaHeroHeader3'), + FieldPanel('ctaHeroSubhead3'), + FieldPanel('ctaCommitment3'), + ], heading="CTA 3"), + InlinePanel('cta4', label='CTA Group 4', max_num=3), ] @@ -675,6 +707,68 @@ class Meta: def __str__(self): return self.page.title + '->' + self.highlight.title +class CTABase(WagtailOrderable, models.Model): + hero = models.ForeignKey( + 'wagtailimages.Image', + null=True, + blank=True, + on_delete=models.SET_NULL, + related_name='cta_hero', + verbose_name='Hero Image', + ) + + header = models.TextField( + blank=True, + ) + + subhead = RichTextField( + features=[ + 'bold', 'italic', 'link', + ], + blank=True, + ) + + commitment = models.CharField( + blank=True, + max_length=256, + help_text='Amount of time required (eg: "30 min commitment")', + ) + + buttonTitle = models.CharField( + verbose_name='Button Text', + max_length=250, + blank=True, + ) + + buttonURL = models.TextField( + verbose_name='Button URL', + blank=True, + ) + + panels = [ + ImageChooserPanel('hero'), + FieldPanel('header'), + FieldPanel('subhead'), + FieldPanel('commitment'), + FieldPanel('buttonTitle'), + FieldPanel('buttonURL'), + ] + + class Meta: + abstract = True + verbose_name = 'cta' + verbose_name_plural = 'ctas' + ordering = ['sort_order'] # not automatically inherited! + + def __str__(self): + return self.page.title + '->' + self.highlight.title + +class CTA4(CTABase): + page = ParentalKey( + 'wagtailpages.ParticipatePage2', + related_name='cta4', + ) + class ParticipateHighlightsBase(WagtailOrderable, models.Model): page = ParentalKey( 'wagtailpages.ParticipatePage2', diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html index 01cc8868e40..73dc9206657 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html @@ -42,12 +42,20 @@

{{ page.h2 }}

{% for highlight in page.featured_highlights2.all %} -
+
{% card highlight.highlight.image.url highlight.highlight.title highlight.highlight.description highlight.highlight.link_url highlight.highlight.link_label highlight.commitment %}
{% endfor %}
+ {% cardCTA page.ctaHero3 page.ctaHeroHeader3 page.ctaHeroSubhead3 None None page.ctaCommitment3 %} + +
+ {% for cta in page.cta4.all %} + {% cardLarge cta.hero cta.header cta.subhead cta.buttonURL cta.buttonTitle cta.commitment %} + {% endfor %} +
+ {% endblock %} diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html index 7e0eb4f6deb..0d66b2896b1 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html @@ -9,7 +9,9 @@

{{ title }}

{{ commitment }}
{% endif %} + {% if link_url %} {{ link_label }} + {% endif %}
{% image image format-png as hero %} diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-large.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-large.html new file mode 100644 index 00000000000..6dc097cece1 --- /dev/null +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-large.html @@ -0,0 +1,14 @@ +{% load wagtailcore_tags wagtailimages_tags %} + +
+
+ {% image image fill-1080x600-c100 format-jpeg as hero %} + +
+
+

{{ title }}

+

{{ description | richtext }}

+

{{ commitment }}

+ {{ link_label }} +
+
diff --git a/network-api/networkapi/wagtailpages/templatetags/card_tags.py b/network-api/networkapi/wagtailpages/templatetags/card_tags.py index 3de6c45af9a..4350cb0d15d 100644 --- a/network-api/networkapi/wagtailpages/templatetags/card_tags.py +++ b/network-api/networkapi/wagtailpages/templatetags/card_tags.py @@ -24,3 +24,14 @@ def cardCTA(image, title, description, link_url, link_label, commitment=None): 'link_label': link_label, 'commitment': commitment, } + +@register.inclusion_tag('wagtailpages/tags/card-large.html') +def cardLarge(image, title, description, link_url, link_label, commitment=None): + return { + 'image': image, + 'title': title, + 'description': description, + 'link_url': link_url, + 'link_label': link_label, + 'commitment': commitment, + } From 6f183c56f542183bd0f7aa21ffafe66583dbaa07 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Thu, 16 Aug 2018 15:59:22 -0700 Subject: [PATCH 13/21] migration yo --- .../migrations/0061_auto_20180816_2259.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 network-api/networkapi/wagtailpages/migrations/0061_auto_20180816_2259.py diff --git a/network-api/networkapi/wagtailpages/migrations/0061_auto_20180816_2259.py b/network-api/networkapi/wagtailpages/migrations/0061_auto_20180816_2259.py new file mode 100644 index 00000000000..2105fb43a70 --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0061_auto_20180816_2259.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-16 22:59 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0060_auto_20180816_2219'), + ] + + operations = [ + migrations.AlterField( + model_name='participatepage2', + name='h2Subheader', + field=models.TextField(blank=True, verbose_name='H2 Subheader'), + ), + ] From 78ff7f799d66bfd3672c54b53597e844c14b8168 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Thu, 16 Aug 2018 16:27:03 -0700 Subject: [PATCH 14/21] lint --- network-api/networkapi/wagtailpages/models.py | 6 ++++++ .../networkapi/wagtailpages/templatetags/card_tags.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/network-api/networkapi/wagtailpages/models.py b/network-api/networkapi/wagtailpages/models.py index 49656079391..4a4ec030bdc 100644 --- a/network-api/networkapi/wagtailpages/models.py +++ b/network-api/networkapi/wagtailpages/models.py @@ -707,6 +707,7 @@ class Meta: def __str__(self): return self.page.title + '->' + self.highlight.title + class CTABase(WagtailOrderable, models.Model): hero = models.ForeignKey( 'wagtailimages.Image', @@ -763,12 +764,14 @@ class Meta: def __str__(self): return self.page.title + '->' + self.highlight.title + class CTA4(CTABase): page = ParentalKey( 'wagtailpages.ParticipatePage2', related_name='cta4', ) + class ParticipateHighlightsBase(WagtailOrderable, models.Model): page = ParentalKey( 'wagtailpages.ParticipatePage2', @@ -794,18 +797,21 @@ class Meta: def __str__(self): return self.page.title + '->' + self.highlight.title + class ParticipateHighlights(ParticipateHighlightsBase): page = ParentalKey( 'wagtailpages.ParticipatePage2', related_name='featured_highlights', ) + class ParticipateHighlights2(ParticipateHighlightsBase): page = ParentalKey( 'wagtailpages.ParticipatePage2', related_name='featured_highlights2', ) + class Homepage(MetadataPageMixin, Page): hero_headline = models.CharField( max_length=140, diff --git a/network-api/networkapi/wagtailpages/templatetags/card_tags.py b/network-api/networkapi/wagtailpages/templatetags/card_tags.py index 4350cb0d15d..9ad9c38f107 100644 --- a/network-api/networkapi/wagtailpages/templatetags/card_tags.py +++ b/network-api/networkapi/wagtailpages/templatetags/card_tags.py @@ -14,6 +14,7 @@ def card(image, title, description, link_url, link_label, commitment=None): 'commitment': commitment, } + @register.inclusion_tag('wagtailpages/tags/card-cta.html') def cardCTA(image, title, description, link_url, link_label, commitment=None): return { @@ -25,6 +26,7 @@ def cardCTA(image, title, description, link_url, link_label, commitment=None): 'commitment': commitment, } + @register.inclusion_tag('wagtailpages/tags/card-large.html') def cardLarge(image, title, description, link_url, link_label, commitment=None): return { From 0012570c40ac8feb98dc45608d41d54efb40e08d Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Mon, 20 Aug 2018 10:15:38 -0700 Subject: [PATCH 15/21] basic p1 tweaks --- .../templates/wagtailpages/static/participate_page2.html | 6 +++--- source/sass/components/commitment.scss | 2 +- source/sass/views/initiatives.scss | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html index 73dc9206657..04a83ea4670 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html @@ -6,10 +6,10 @@ {% block content %} {% image page.ctaHero format-jpeg as big_hero %} -
-
+
+
-
+

{{ page.ctaHeroHeader }}

{{ page.ctaHeroSubhead | richtext }}

{{ page.ctaCommitment }}

diff --git a/source/sass/components/commitment.scss b/source/sass/components/commitment.scss index aa66a8df506..9cf277e3ea9 100644 --- a/source/sass/components/commitment.scss +++ b/source/sass/components/commitment.scss @@ -1,5 +1,5 @@ .commitment { - font-family: NunitoSans-Regular; + font-family: "Nunito Sans"; font-size: 12px; color: #909090; letter-spacing: 0.5px; diff --git a/source/sass/views/initiatives.scss b/source/sass/views/initiatives.scss index 539b8a25836..29b181b61d7 100644 --- a/source/sass/views/initiatives.scss +++ b/source/sass/views/initiatives.scss @@ -3,5 +3,5 @@ } .bottom-line { - border-bottom: 1px solid #979797; + border-bottom: 1px solid #ccc; } From ae2861847e88deda4f78f191973ceb583334a900 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Mon, 20 Aug 2018 11:22:52 -0700 Subject: [PATCH 16/21] scaffolding social links --- .../migrations/0062_auto_20180820_1757.py | 30 +++++++++++++++++++ .../migrations/0063_auto_20180820_1815.py | 25 ++++++++++++++++ .../migrations/0064_auto_20180820_1818.py | 25 ++++++++++++++++ network-api/networkapi/wagtailpages/models.py | 20 +++++++++++++ .../static/participate_page2.html | 2 +- .../templates/wagtailpages/tags/card-cta.html | 14 +++++++++ .../wagtailpages/templatetags/card_tags.py | 6 +++- 7 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 network-api/networkapi/wagtailpages/migrations/0062_auto_20180820_1757.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0063_auto_20180820_1815.py create mode 100644 network-api/networkapi/wagtailpages/migrations/0064_auto_20180820_1818.py diff --git a/network-api/networkapi/wagtailpages/migrations/0062_auto_20180820_1757.py b/network-api/networkapi/wagtailpages/migrations/0062_auto_20180820_1757.py new file mode 100644 index 00000000000..d441162847a --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0062_auto_20180820_1757.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-20 17:57 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0061_auto_20180816_2259'), + ] + + operations = [ + migrations.AddField( + model_name='participatepage2', + name='ctaFacebook3', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaGenericShare3', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='participatepage2', + name='ctaTwitter3', + field=models.TextField(blank=True), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0063_auto_20180820_1815.py b/network-api/networkapi/wagtailpages/migrations/0063_auto_20180820_1815.py new file mode 100644 index 00000000000..53b90f5bb4b --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0063_auto_20180820_1815.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-20 18:15 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0062_auto_20180820_1757'), + ] + + operations = [ + migrations.RenameField( + model_name='participatepage2', + old_name='ctaGenericShare3', + new_name='ctaEmailShareBody', + ), + migrations.AddField( + model_name='participatepage2', + name='ctaEmailShareSubject', + field=models.TextField(blank=True), + ), + ] diff --git a/network-api/networkapi/wagtailpages/migrations/0064_auto_20180820_1818.py b/network-api/networkapi/wagtailpages/migrations/0064_auto_20180820_1818.py new file mode 100644 index 00000000000..e5379bc80ca --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0064_auto_20180820_1818.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-08-20 18:18 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0063_auto_20180820_1815'), + ] + + operations = [ + migrations.RenameField( + model_name='participatepage2', + old_name='ctaEmailShareBody', + new_name='ctaEmailShareBody3', + ), + migrations.RenameField( + model_name='participatepage2', + old_name='ctaEmailShareSubject', + new_name='ctaEmailShareSubject3', + ), + ] diff --git a/network-api/networkapi/wagtailpages/models.py b/network-api/networkapi/wagtailpages/models.py index 4a4ec030bdc..dad6c869774 100644 --- a/network-api/networkapi/wagtailpages/models.py +++ b/network-api/networkapi/wagtailpages/models.py @@ -598,6 +598,22 @@ class ParticipatePage2(PrimaryPage): blank=True, ) + ctaFacebook3 = models.TextField( + blank=True, + ) + + ctaTwitter3 = models.TextField( + blank=True, + ) + + ctaEmailShareBody3 = models.TextField( + blank=True, + ) + + ctaEmailShareSubject3 = models.TextField( + blank=True, + ) + h2 = models.TextField( blank=True, ) @@ -633,6 +649,10 @@ class ParticipatePage2(PrimaryPage): FieldPanel('ctaHeroHeader3'), FieldPanel('ctaHeroSubhead3'), FieldPanel('ctaCommitment3'), + FieldPanel('ctaFacebook3'), + FieldPanel('ctaTwitter3'), + FieldPanel('ctaEmailShareSubject3'), + FieldPanel('ctaEmailShareBody3'), ], heading="CTA 3"), InlinePanel('cta4', label='CTA Group 4', max_num=3), ] diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html index 04a83ea4670..c10809faaed 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/static/participate_page2.html @@ -49,7 +49,7 @@

{{ page.h2 }}

- {% cardCTA page.ctaHero3 page.ctaHeroHeader3 page.ctaHeroSubhead3 None None page.ctaCommitment3 %} + {% cardCTA page.ctaHero3 page.ctaHeroHeader3 page.ctaHeroSubhead3 None None page.ctaCommitment3 page.ctaFacebook3 page.ctaTwitter3 page.ctaEmailShareSubject3 page.ctaEmailShareBody3 %}
{% for cta in page.cta4.all %} diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html index 0d66b2896b1..277044c6cbe 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html @@ -12,6 +12,20 @@

{{ title }}

{% if link_url %} {{ link_label }} {% endif %} + +
{% image image format-png as hero %} diff --git a/network-api/networkapi/wagtailpages/templatetags/card_tags.py b/network-api/networkapi/wagtailpages/templatetags/card_tags.py index 9ad9c38f107..c7b8a9037b4 100644 --- a/network-api/networkapi/wagtailpages/templatetags/card_tags.py +++ b/network-api/networkapi/wagtailpages/templatetags/card_tags.py @@ -16,7 +16,7 @@ def card(image, title, description, link_url, link_label, commitment=None): @register.inclusion_tag('wagtailpages/tags/card-cta.html') -def cardCTA(image, title, description, link_url, link_label, commitment=None): +def cardCTA(image, title, description, link_url, link_label, commitment=None, facebook=None, twitter=None, email_subject=None, email_body=None): return { 'image': image, 'title': title, @@ -24,6 +24,10 @@ def cardCTA(image, title, description, link_url, link_label, commitment=None): 'link_url': link_url, 'link_label': link_label, 'commitment': commitment, + 'facebook': facebook, + 'twitter': twitter, + 'email_subject': email_subject, + 'email_body': email_body, } From d4c37e9b5af4c0e96e56a37ff26e0b56a7b2dfbb Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Mon, 20 Aug 2018 11:45:14 -0700 Subject: [PATCH 17/21] adding social glyphs --- .../templates/wagtailpages/tags/card-cta.html | 8 ++++---- source/images/glyphs/share/email.svg | 17 +++++++++++++++++ source/images/glyphs/share/fb.svg | 17 +++++++++++++++++ source/images/glyphs/share/twitter.svg | 17 +++++++++++++++++ source/sass/components/card.scss | 19 +++++++++++++++++++ 5 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 source/images/glyphs/share/email.svg create mode 100644 source/images/glyphs/share/fb.svg create mode 100644 source/images/glyphs/share/twitter.svg diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html index 277044c6cbe..168945eec1b 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html @@ -13,17 +13,17 @@

{{ title }}

{{ link_label }} {% endif %} - diff --git a/source/images/glyphs/share/email.svg b/source/images/glyphs/share/email.svg new file mode 100644 index 00000000000..dfa5cd0a520 --- /dev/null +++ b/source/images/glyphs/share/email.svg @@ -0,0 +1,17 @@ + + + + Group 4 + Created with Sketch. + + + + + + + + + + + + \ No newline at end of file diff --git a/source/images/glyphs/share/fb.svg b/source/images/glyphs/share/fb.svg new file mode 100644 index 00000000000..17449b21f56 --- /dev/null +++ b/source/images/glyphs/share/fb.svg @@ -0,0 +1,17 @@ + + + + Group 2 + Created with Sketch. + + + + + + + + + + + + \ No newline at end of file diff --git a/source/images/glyphs/share/twitter.svg b/source/images/glyphs/share/twitter.svg new file mode 100644 index 00000000000..3776826688f --- /dev/null +++ b/source/images/glyphs/share/twitter.svg @@ -0,0 +1,17 @@ + + + + Group 3 + Created with Sketch. + + + + + + + + + + + + \ No newline at end of file diff --git a/source/sass/components/card.scss b/source/sass/components/card.scss index 73413b51264..db9c1739578 100644 --- a/source/sass/components/card.scss +++ b/source/sass/components/card.scss @@ -23,4 +23,23 @@ background-position: center; min-height: 300px; } + + .social-link { + width: 37px; + height: 37px; + margin-right: 20px; + background-size: contain; + } + + .social-link-facebook { + background-image: url(/_images/glyphs/share/fb.svg); + } + + .social-link-twitter { + background-image: url(/_images/glyphs/share/twitter.svg); + } + + .social-link-email { + background-image: url(/_images/glyphs/share/email.svg); + } } From f9925a5c74f9f800a0cf20106665d7a0abba46b5 Mon Sep 17 00:00:00 2001 From: Gavin Lazar Suntop Date: Mon, 20 Aug 2018 11:50:14 -0700 Subject: [PATCH 18/21] better share links --- .../wagtailpages/templates/wagtailpages/tags/card-cta.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html index 168945eec1b..abd396c94c6 100644 --- a/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html +++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/tags/card-cta.html @@ -15,11 +15,11 @@

{{ title }}