Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions network-api/networkapi/mozfest/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Meta:
'gathering of educators, activists, technologists, artists, and '
'young people dedicated to creating a better, healthier open internet.')
banner_video_url = Faker('url')
banner_cta_label = 'Watch last year\'s recap video'
banner_heading_text = Faker('sentence', nb_words=6, variable_nb_words=True)

banner_carousel = Faker('streamfield', fields=['banner_carousel'])
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.11 on 2021-10-28 21:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('mozfest', '0023_auto_20211019_0025'),
]

operations = [
migrations.AddField(
model_name='mozfesthomepage',
name='banner_cta_label',
field=models.CharField(blank=True, help_text='The label for the CTA that scrolls down to the banner video when clicked', max_length=250),
),
]
11 changes: 10 additions & 1 deletion network-api/networkapi/mozfest/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ class MozfestHomepage(MozfestPrimaryPage):
help_text='A banner heading specific to the homepage'
)

banner_cta_label = models.CharField(
max_length=250,
null=False,
blank=True,
help_text='The label for the CTA that scrolls down to the banner video when clicked',
)

banner_guide_text = models.CharField(
max_length=1000,
blank=True,
Expand Down Expand Up @@ -208,6 +215,7 @@ class MozfestHomepage(MozfestPrimaryPage):
FieldPanel('cta_button_label'),
FieldPanel('cta_button_destination'),
FieldPanel('banner_heading'),
FieldPanel('banner_cta_label'),
StreamFieldPanel('banner_carousel'),
FieldPanel('banner_guide_text'),
FieldPanel('banner_video_url'),
Expand All @@ -219,7 +227,7 @@ class MozfestHomepage(MozfestPrimaryPage):
content_panels = [
field for field in all_panels
if field.field_name not in [
'banner', 'header', 'intro', 'banner_carousel', 'banner_guide_text',
'banner', 'header', 'intro', 'banner_carousel', 'banner_guide_text', 'banner_cta_label',
'banner_video', 'banner_video_url',
]
]
Expand Down Expand Up @@ -251,6 +259,7 @@ class MozfestHomepage(MozfestPrimaryPage):
TranslatableField('cta_button_label'),
SynchronizedField('cta_button_destination'),
TranslatableField('banner_heading'),
TranslatableField('banner_cta_label'),
TranslatableField('banner_guide_text'),
SynchronizedField('banner_video_url'),
TranslatableField('banner_carousel'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<div class="tw-container tw-relative tw-z-20 tw-text-white">
<div>
<h1 class="tw-text-white tw-font-bold tw-mb-5">{{ page.banner_heading }}</h1>
{% if page.banner_video %}
<button id="mozfest-hero-video-cta" class="btn btn-primary tw-bg-white tw-text-black hover:tw-bg-blue hover:tw-text-white">{% trans "Watch last year’s recap video" %}</button>
{% if page.banner_video and page.banner_cta_label %}
<button id="mozfest-hero-video-cta" class="btn btn-primary tw-bg-white tw-text-black hover:tw-bg-blue hover:tw-text-white">{{ page.banner_cta_label }}</button>
{% endif %}
</div>

Expand Down