Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regrets Reporter Extension landing bottom half #7838

Merged
merged 18 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from networkapi.wagtailpages.models import (
YoutubeRegretsPage,
YoutubeRegretsReporterPage,
YoutubeRegretsReporterExtensionPage,
YoutubeRegrets2021Page,
)
from wagtail_factories import (
Expand Down Expand Up @@ -34,6 +35,19 @@ class Meta:
regret_stories = Faker('streamfield', fields=['regret_story']*28)


class YoutubeRegretsReporterExtensionPageFactory(PageFactory):
class Meta:
model = YoutubeRegretsReporterExtensionPage
exclude = (
'title_text',
'header_text',
'header',
)

title = 'Regrets Reporter Extension'
slug = 'regretsreporter'


class YoutubeRegrets2021PageFactory(PageFactory):
class Meta:
model = YoutubeRegrets2021Page
Expand Down Expand Up @@ -103,3 +117,18 @@ def generate(seed):
)
YoutubeRegrets2021PageFactory.create(parent=youtube_regrets)
reseed(seed)

# Youtube Extension Landing page
try:
youtube_index_page = WagtailPage.objects.get(title='Youtube')
print('youtube campaign index page exists')
except WagtailPage.DoesNotExist:
print('Generating a youtube campaign index page')
youtube_index_page = CampaignIndexPageFactory.create(
parent=home_page,
title='Youtube',
live=True
)
YoutubeRegretsReporterExtensionPageFactory.create(parent=youtube_index_page)

reseed(seed)
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 3.1.11 on 2021-11-17 20:39

from django.db import migrations, models
import django.db.models.deletion
import wagtailmetadata.models


class Migration(migrations.Migration):

dependencies = [
('wagtailcore', '0062_comment_models_and_pagesubscription'),
('wagtailimages', '0023_add_choose_permissions'),
('wagtailpages', '0056_remove_quote_list_block'),
]

operations = [
migrations.CreateModel(
name='YoutubeRegretsReporterExtensionPage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
('search_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image', verbose_name='Search image')),
],
options={
'verbose_name': 'YouTube Regrets Report Extension Page',
'verbose_name_plural': 'YouTube Regrets Report Extension Page',
},
bases=(wagtailmetadata.models.WagtailImageMetadataMixin, 'wagtailcore.page', models.Model),
),
]
2 changes: 2 additions & 0 deletions network-api/networkapi/wagtailpages/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
YoutubeRegretsPage,
YoutubeRegretsReporterPage,
YoutubeRegrets2021Page,
YoutubeRegretsReporterExtensionPage
)

from .pagemodels.publications.publication import (
Expand Down Expand Up @@ -142,4 +143,5 @@
YoutubeRegretsPage,
YoutubeRegrets2021Page,
YoutubeRegretsReporterPage,
YoutubeRegretsReporterExtensionPage,
]
17 changes: 17 additions & 0 deletions network-api/networkapi/wagtailpages/pagemodels/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,20 @@ def get_context(self, request):
class Meta:
verbose_name = "YouTube Regrets 2021 Page"
verbose_name_plural = "YouTube Regrets 2021 Pages"


class YoutubeRegretsReporterExtensionPage(FoundationMetadataPageMixin, Page):

template = 'wagtailpages/pages/youtube_regrets_reporter_extension.html'
max_count = 1
zen_nav = True

content_panels = Page.content_panels # Needed for wagtail-modeltranslation to work

def get_context(self, request):
context = super().get_context(request)
return set_main_site_nav_information(self, context, 'Homepage')

class Meta:
verbose_name = "YouTube Regrets Report Extension Page"
verbose_name_plural = "YouTube Regrets Report Extension Page"
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{% extends "pages/base.html" %}

{% load i18n %}

{% block body_id %}youtube-regrets-reporter-extension{% endblock %}

{% block content_wrapped %}
<div class="tw-container tw-my-5 tw-px-4">
<div class="tw-grid tw-grid-cols-1 small:tw-grid-cols-2 xlarge:tw-grid-cols-3 tw-gap-x-6">
<div class="tw-my-5">
<h3 class="h3-heading tw-mb-4">
{% trans "Control your recommendations." %}
</h3>
<p class='body tw-mb-0'>
{% blocktrans trimmed %}
Mozilla’s updated RegretsReporter browser extension helps you eliminate harmful YouTube recommendations — the clickbait,
the outrage, and all the other content you wish you never saw. By simply clicking an icon on any video on YouTube,
RegretsReporter sends a signal to YouTube asking it to stop surfacing content you find objectionable.
{% endblocktrans %}
</p>
</div>
<div class="tw-my-5">
<h3 class="h3-heading tw-mb-4">
{% trans "Avoid harmful content." %}
</h3>
<p class='body tw-mb-0'>
{% blocktrans with url="/campaigns/regrets-reporter/findings" trimmed %}
Sometimes YouTube recommendations can be spot on. But sometimes, they’re outright harmful. <a href="{{url}}" target="_blank">Research powered by Mozilla’s
RegretsReporter has revealed</a> that YouTube’s algorithm violates the platform’s very own policies, recommending
misinformation, violent content, hate speech, and scams.
{% endblocktrans %}
</p>
</div>
<div class="tw-my-5">
<h3 class="h3-heading tw-mb-4">
{% trans "Help solve the problem." %}
</h3>
<p class='body tw-mb-0'>
{% blocktrans with url="/blog/mozilla-crowdsourcing-research-youtube-recommendations" trimmed %}
RegretsReporter isn’t just a product — it’s also part of Mozilla’s ongoing research and advocacy into harmful
recommendation algorithms. You can choose to participate in Mozilla’s research, which provides vital insight into
whether YouTube recommendations can actually be tamed. (Mozilla initially launched RegretsReporter <a href="{{url}}" target="_blank">in September 2020</a>,
granting users the ability to flag harmful recommendations. That functionality still remains in this updated version of
the extension.)
{% endblocktrans %}
</p>
</div>
</div>
</div>
{% endblock %}
6 changes: 6 additions & 0 deletions network-api/networkapi/wagtailpages/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
YoutubeRegretsPage,
YoutubeRegrets2021Page,
YoutubeRegretsReporterPage,
YoutubeRegretsReporterExtensionPage,
ArticlePage,
PublicationPage,
CTA,
Expand Down Expand Up @@ -265,6 +266,11 @@ class YoutubeRegretsPage2021TR(TranslationOptions):
fields = {}


@register(YoutubeRegretsReporterExtensionPage)
class YoutubeRegretsReporterExtensionPageTR(TranslationOptions):
fields = {}


@register(YoutubeRegretsReporterPage)
class YoutubeRegretsReporterPageTR(TranslationOptions):
fields = {
Expand Down