From a924a9c46b5cbeb4dc0af8c6373cb46ee612e2bf Mon Sep 17 00:00:00 2001 From: Daniel Miranda Date: Thu, 23 Sep 2021 10:59:19 -0700 Subject: [PATCH 1/6] rebase --- .../0036_productpage_mozilla_says.py | 18 +++++++++++ .../wagtailpages/pagemodels/products.py | 10 ++++++ .../templates/buyersguide/product_page.html | 4 ++- .../buyers-guide/mozilla-says/thumb-down.svg | 4 +++ .../buyers-guide/mozilla-says/thumb-side.svg | 4 +++ .../buyers-guide/mozilla-says/thumb-up.svg | 4 +++ source/sass/buyers-guide/views/product.scss | 31 +++++++++++++++++++ 7 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 network-api/networkapi/wagtailpages/migrations/0036_productpage_mozilla_says.py create mode 100644 source/images/buyers-guide/mozilla-says/thumb-down.svg create mode 100644 source/images/buyers-guide/mozilla-says/thumb-side.svg create mode 100644 source/images/buyers-guide/mozilla-says/thumb-up.svg diff --git a/network-api/networkapi/wagtailpages/migrations/0036_productpage_mozilla_says.py b/network-api/networkapi/wagtailpages/migrations/0036_productpage_mozilla_says.py new file mode 100644 index 00000000000..b6e79820bcd --- /dev/null +++ b/network-api/networkapi/wagtailpages/migrations/0036_productpage_mozilla_says.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.11 on 2021-09-21 21:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailpages', '0035_auto_20210910_2042'), + ] + + operations = [ + migrations.AddField( + model_name='productpage', + name='mozilla_says', + field=models.BooleanField(blank=True, help_text='Whether or not Mozilla would recommend this product. Will appear as a thumbs up/down/middle.', null=True), + ), + ] diff --git a/network-api/networkapi/wagtailpages/pagemodels/products.py b/network-api/networkapi/wagtailpages/pagemodels/products.py index b6c07473885..e2ad3ba93c9 100644 --- a/network-api/networkapi/wagtailpages/pagemodels/products.py +++ b/network-api/networkapi/wagtailpages/pagemodels/products.py @@ -419,6 +419,12 @@ class ProductPage(AirtableMixin, FoundationMetadataPageMixin, Page): help_text="What's the worst thing that could happen by using this product?", blank=True, ) + mozilla_says = models.BooleanField( + null=True, + blank=True, + help_text='Whether or not Mozilla would recommend this product. ' + 'Will appear as a thumbs up/down/middle.', + ) """ privacy_policy_links = Orderable, defined in ProductPagePrivacyPolicyLink @@ -553,6 +559,7 @@ def map_import_fields(cls): "Manages security help text": "manage_vulnerabilities_helptext", "Has privacy policy": "privacy_policy", "Privacy policy help text": "privacy_policy_helptext", + "Mozilla Says": "mozilla_says", } return mappings @@ -597,6 +604,7 @@ def get_export_fields(self): "Manages security help text": self.manage_vulnerabilities_helptext, "Has privacy policy": self.privacy_policy, "Privacy policy help text": self.privacy_policy_helptext, + "Mozilla Says": self.mozilla_says } def get_status_for_airtable(self): @@ -647,6 +655,7 @@ def get_voting_json(self): FieldPanel('blurb'), ImageChooserPanel('image'), FieldPanel('worst_case'), + FieldPanel('mozilla_says') ], heading='General Product Details', classname='collapsible' @@ -771,6 +780,7 @@ def get_voting_json(self): TranslatableField('manage_vulnerabilities_helptext'), SynchronizedField('privacy_policy'), TranslatableField('privacy_policy_helptext'), + SynchronizedField('mozilla_says'), ] @property diff --git a/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html b/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html index f34234aaac2..e9db81c178a 100644 --- a/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html +++ b/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html @@ -73,8 +73,10 @@

{{product.title}}

{% endif %} -
+

{% blocktrans with date=product.review_date|date:"DATE_FORMAT" context "Date format (e.g. Nov. 19, 2020)" %}Review date: {{ date }}{% endblocktrans %}

+ | +

Mozilla Says

{{product.blurb}}

diff --git a/source/images/buyers-guide/mozilla-says/thumb-down.svg b/source/images/buyers-guide/mozilla-says/thumb-down.svg new file mode 100644 index 00000000000..949c3f6d3bd --- /dev/null +++ b/source/images/buyers-guide/mozilla-says/thumb-down.svg @@ -0,0 +1,4 @@ + + + + diff --git a/source/images/buyers-guide/mozilla-says/thumb-side.svg b/source/images/buyers-guide/mozilla-says/thumb-side.svg new file mode 100644 index 00000000000..0672151d6f6 --- /dev/null +++ b/source/images/buyers-guide/mozilla-says/thumb-side.svg @@ -0,0 +1,4 @@ + + + + diff --git a/source/images/buyers-guide/mozilla-says/thumb-up.svg b/source/images/buyers-guide/mozilla-says/thumb-up.svg new file mode 100644 index 00000000000..0042aa30d38 --- /dev/null +++ b/source/images/buyers-guide/mozilla-says/thumb-up.svg @@ -0,0 +1,4 @@ + + + + diff --git a/source/sass/buyers-guide/views/product.scss b/source/sass/buyers-guide/views/product.scss index be5c5d5a99d..d2074f178b1 100644 --- a/source/sass/buyers-guide/views/product.scss +++ b/source/sass/buyers-guide/views/product.scss @@ -201,6 +201,37 @@ } } } + + .subheading-divider { + padding: 0em 0.5em 0em 0.5em; + @media (max-width: $bp-md) { + display: none; + } + } + + .mozilla-says { + &::after { + content: " "; + display: inline-block; + width: 1.5em; + height: 1.5em; + margin-left: 4px; + position: relative; + vertical-align: middle; + } + } + + .thumb-down::after { + background: url(../_images/buyers-guide/mozilla-says/thumb-down.svg) + no-repeat; + } + .thumb-up::after { + background: url(../_images/buyers-guide/mozilla-says/thumb-up.svg) no-repeat; + } + .thumb-side::after { + background: url(../_images/buyers-guide/mozilla-says/thumb-side.svg) + no-repeat; + } } .spy { From 65392c3375e212a93f783d80e05926992efb95cf Mon Sep 17 00:00:00 2001 From: Daniel Miranda Date: Tue, 21 Sep 2021 15:08:31 -0700 Subject: [PATCH 2/6] updated migrations --- ...tpage_mozilla_says.py => 0037_productpage_mozilla_says.py} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename network-api/networkapi/wagtailpages/migrations/{0036_productpage_mozilla_says.py => 0037_productpage_mozilla_says.py} (80%) diff --git a/network-api/networkapi/wagtailpages/migrations/0036_productpage_mozilla_says.py b/network-api/networkapi/wagtailpages/migrations/0037_productpage_mozilla_says.py similarity index 80% rename from network-api/networkapi/wagtailpages/migrations/0036_productpage_mozilla_says.py rename to network-api/networkapi/wagtailpages/migrations/0037_productpage_mozilla_says.py index b6e79820bcd..30b061502cf 100644 --- a/network-api/networkapi/wagtailpages/migrations/0036_productpage_mozilla_says.py +++ b/network-api/networkapi/wagtailpages/migrations/0037_productpage_mozilla_says.py @@ -1,4 +1,4 @@ -# Generated by Django 3.1.11 on 2021-09-21 21:13 +# Generated by Django 3.1.11 on 2021-09-21 22:02 from django.db import migrations, models @@ -6,7 +6,7 @@ class Migration(migrations.Migration): dependencies = [ - ('wagtailpages', '0035_auto_20210910_2042'), + ('wagtailpages', '0036_auto_20210917_0050'), ] operations = [ From 2e2c4d59238b0c7999ba8408a5957c2173dabe83 Mon Sep 17 00:00:00 2001 From: Daniel Miranda Date: Tue, 21 Sep 2021 15:45:46 -0700 Subject: [PATCH 3/6] Update product_page.html --- .../wagtailpages/templates/buyersguide/product_page.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html b/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html index e9db81c178a..b50814c4544 100644 --- a/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html +++ b/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html @@ -74,7 +74,11 @@

{{product.title}}

{% endif %}
+<<<<<<< HEAD

{% blocktrans with date=product.review_date|date:"DATE_FORMAT" context "Date format (e.g. Nov. 19, 2020)" %}Review date: {{ date }}{% endblocktrans %}

+======= +

{% blocktrans with date=product.review_date|date:"DATE_FORMAT" context "Date format (e.g. Nov. 19, 2020)" %}Review date: {{ date }}{% endblocktrans %}

+>>>>>>> e4b64977... Update product_page.html |

Mozilla Says

From 0c84e52f8e3335a953146642526ded275d8b006b Mon Sep 17 00:00:00 2001 From: Daniel Miranda Date: Wed, 22 Sep 2021 10:06:43 -0700 Subject: [PATCH 4/6] Update network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Théo Chevalier --- .../wagtailpages/templates/buyersguide/product_page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html b/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html index b50814c4544..e163b621903 100644 --- a/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html +++ b/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html @@ -80,7 +80,7 @@

{{product.title}}

{% blocktrans with date=product.review_date|date:"DATE_FORMAT" context "Date format (e.g. Nov. 19, 2020)" %}Review date: {{ date }}{% endblocktrans %}

>>>>>>> e4b64977... Update product_page.html | -

Mozilla Says

+

{% trans "Mozilla Says" context "This string is followed by a thumb up, thumb down, or thumb on the side icon to summarize Mozilla’s review of the product" %}

{{product.blurb}}

From df9e40c2b0acb714251281b75c543787bb24554d Mon Sep 17 00:00:00 2001 From: Daniel Miranda Date: Wed, 22 Sep 2021 10:10:12 -0700 Subject: [PATCH 5/6] Update product_page.html --- .../wagtailpages/templates/buyersguide/product_page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html b/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html index e163b621903..9d21f137226 100644 --- a/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html +++ b/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html @@ -80,7 +80,7 @@

{{product.title}}

{% blocktrans with date=product.review_date|date:"DATE_FORMAT" context "Date format (e.g. Nov. 19, 2020)" %}Review date: {{ date }}{% endblocktrans %}

>>>>>>> e4b64977... Update product_page.html | -

{% trans "Mozilla Says" context "This string is followed by a thumb up, thumb down, or thumb on the side icon to summarize Mozilla’s review of the product" %}

+

{% trans "Mozilla says" context "This string is followed by a thumb up, thumb down, or thumb on the side icon to summarize Mozilla’s review of the product" %}

{{product.blurb}}

From d46fa1899f641940bf40e266b607748a70099a18 Mon Sep 17 00:00:00 2001 From: Daniel Miranda Date: Thu, 23 Sep 2021 14:45:25 -0700 Subject: [PATCH 6/6] updated rebase and commits --- .../wagtailpages/templates/buyersguide/product_page.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html b/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html index 9d21f137226..9860b040160 100644 --- a/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html +++ b/network-api/networkapi/wagtailpages/templates/buyersguide/product_page.html @@ -74,11 +74,7 @@

{{product.title}}

{% endif %}
-<<<<<<< HEAD

{% blocktrans with date=product.review_date|date:"DATE_FORMAT" context "Date format (e.g. Nov. 19, 2020)" %}Review date: {{ date }}{% endblocktrans %}

-======= -

{% blocktrans with date=product.review_date|date:"DATE_FORMAT" context "Date format (e.g. Nov. 19, 2020)" %}Review date: {{ date }}{% endblocktrans %}

->>>>>>> e4b64977... Update product_page.html |

{% trans "Mozilla says" context "This string is followed by a thumb up, thumb down, or thumb on the side icon to summarize Mozilla’s review of the product" %}