* remove all commitment code

* vestigial

* update migrations

Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com>
This commit is contained in:
Pomax 2020-06-01 16:09:51 -07:00 коммит произвёл GitHub
Родитель 8433992824
Коммит 4e4906c09b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
13 изменённых файлов: 45 добавлений и 124 удалений

Просмотреть файл

@ -8549,31 +8549,8 @@ a.text-gray-dark:focus, a.text-gray-dark:hover {
#multipage-nav .multipage-draft::after {
content: "🐣"; }
.commitment {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
z-index: 1; }
.commitment::before {
content: "";
background: url(../_images/hand.svg) no-repeat;
width: 14px;
height: 20px;
display: block;
margin-right: 6px; }
.card-regular {
position: relative; }
.card-regular .commitment {
position: absolute;
top: 16px;
left: 16px;
background: #ffffff;
border: 1px solid #cccccc;
padding: 4px 8px; }
.card-regular .key-item .rich-text {
-webkit-box-flex: 1;
-ms-flex: 1;

Просмотреть файл

@ -26,14 +26,12 @@ class ParticipatePage2Factory(PageFactory):
# first block
ctaHero = SubFactory(ImageFactory)
ctaHeroHeader = Faker('text', max_nb_chars=50)
ctaCommitment = Faker('text', max_nb_chars=10)
ctaButtonTitle = Faker('text', max_nb_chars=50)
ctaButtonURL = Faker('url')
# second block
ctaHero2 = SubFactory(ImageFactory)
ctaHeroHeader2 = Faker('text', max_nb_chars=50)
ctaCommitment2 = Faker('text', max_nb_chars=10)
ctaButtonTitle2 = Faker('text', max_nb_chars=50)
ctaButtonURL2 = Faker('url')
@ -41,7 +39,6 @@ class ParticipatePage2Factory(PageFactory):
ctaHero3 = SubFactory(ImageFactory)
ctaHeroHeader3 = Faker('text', max_nb_chars=50)
ctaHeroSubhead3 = Faker('paragraph', nb_sentences=5, variable_nb_sentences=True)
ctaCommitment3 = Faker('text', max_nb_chars=10)
ctaFacebook3 = Faker('text', max_nb_chars=20)
ctaTwitter3 = Faker('text', max_nb_chars=20)
ctaEmailShareBody3 = Faker('text', max_nb_chars=20)

Просмотреть файл

@ -0,0 +1,37 @@
# Generated by Django 2.2.12 on 2020-05-27 20:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailpages', '0100_auto_20200527_2243'),
]
operations = [
migrations.RemoveField(
model_name='cta4',
name='commitment',
),
migrations.RemoveField(
model_name='participatehighlights',
name='commitment',
),
migrations.RemoveField(
model_name='participatehighlights2',
name='commitment',
),
migrations.RemoveField(
model_name='participatepage2',
name='ctaCommitment',
),
migrations.RemoveField(
model_name='participatepage2',
name='ctaCommitment2',
),
migrations.RemoveField(
model_name='participatepage2',
name='ctaCommitment3',
),
]

Просмотреть файл

@ -156,10 +156,6 @@ class ParticipatePage2(PrimaryPage):
blank=True,
)
ctaCommitment = models.TextField(
blank=True,
)
ctaButtonTitle = models.CharField(
verbose_name='Button Text',
max_length=250,
@ -191,10 +187,6 @@ class ParticipatePage2(PrimaryPage):
blank=True,
)
ctaCommitment2 = models.TextField(
blank=True,
)
ctaButtonTitle2 = models.CharField(
verbose_name='Button Text',
max_length=250,
@ -226,10 +218,6 @@ class ParticipatePage2(PrimaryPage):
blank=True,
)
ctaCommitment3 = models.TextField(
blank=True,
)
ctaFacebook3 = models.TextField(
blank=True,
)
@ -261,7 +249,6 @@ class ParticipatePage2(PrimaryPage):
ImageChooserPanel('ctaHero'),
FieldPanel('ctaHeroHeader'),
FieldPanel('ctaHeroSubhead'),
FieldPanel('ctaCommitment'),
FieldPanel('ctaButtonTitle'),
FieldPanel('ctaButtonURL'),
],
@ -276,7 +263,6 @@ class ParticipatePage2(PrimaryPage):
ImageChooserPanel('ctaHero2'),
FieldPanel('ctaHeroHeader2'),
FieldPanel('ctaHeroSubhead2'),
FieldPanel('ctaCommitment2'),
FieldPanel('ctaButtonTitle2'),
FieldPanel('ctaButtonURL2'),
],
@ -289,7 +275,6 @@ class ParticipatePage2(PrimaryPage):
ImageChooserPanel('ctaHero3'),
FieldPanel('ctaHeroHeader3'),
FieldPanel('ctaHeroSubhead3'),
FieldPanel('ctaCommitment3'),
FieldPanel('ctaFacebook3'),
FieldPanel('ctaTwitter3'),
FieldPanel('ctaEmailShareSubject3'),
@ -408,12 +393,6 @@ class CTABase(WagtailOrderable, models.Model):
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,
@ -429,7 +408,6 @@ class CTABase(WagtailOrderable, models.Model):
ImageChooserPanel('hero'),
FieldPanel('header'),
FieldPanel('subhead'),
FieldPanel('commitment'),
FieldPanel('buttonTitle'),
FieldPanel('buttonURL'),
]
@ -457,14 +435,8 @@ class ParticipateHighlightsBase(WagtailOrderable, models.Model):
related_name='featured_highlights',
)
highlight = models.ForeignKey('highlights.Highlight', on_delete=models.CASCADE, 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:

Просмотреть файл

@ -13,7 +13,6 @@
<div class="col-12 col-md-10 col-xl-5 mb-2">
<h1 class="h1-heading">{{ page.ctaHeroHeader }}</h1>
<div class="body-large">{{ page.ctaHeroSubhead | richtext }}</div>
<p class="h6-heading commitment">{{ page.ctaCommitment }}</p>
<a class="btn btn-primary" href={{ page.ctaButtonURL }}>{{ page.ctaButtonTitle }}</a>
</div>
</div>
@ -32,34 +31,34 @@
<div class="row">
{% for highlight in page.featured_highlights.all %}
<div class="col-md-6 col-lg-4 {% if forloop.counter == 3 %}d-md-none d-lg-block{% endif %}">
{% card 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 %}
</div>
{% endfor %}
</div>
</div>
{% cardCTA page.ctaHero2 page.ctaHeroHeader2 page.ctaHeroSubhead2 page.ctaButtonURL2 page.ctaButtonTitle2 page.ctaCommitment2 %}
{% cardCTA page.ctaHero2 page.ctaHeroHeader2 page.ctaHeroSubhead2 page.ctaButtonURL2 page.ctaButtonTitle2 %}
<div class="my-5">
<div class="row">
{% for highlight in page.featured_highlights2.all %}
<div class="col-md-6 col-lg-4">
{% card 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 %}
</div>
{% endfor %}
</div>
</div>
{% cardCTA page.ctaHero3 page.ctaHeroHeader3 page.ctaHeroSubhead3 None None page.ctaCommitment3 page.ctaFacebook3 page.ctaTwitter3 page.ctaEmailShareSubject3 page.ctaEmailShareBody3 %}
{% cardCTA page.ctaHero3 page.ctaHeroHeader3 page.ctaHeroSubhead3 None None page.ctaFacebook3 page.ctaTwitter3 page.ctaEmailShareSubject3 page.ctaEmailShareBody3 %}
<div class="my-5">
{% for cta in page.cta4.all %}
<div class="d-block d-sm-none">
{% image cta.hero width-320 as temp %}
{% card temp.url cta.header cta.subhead cta.buttonURL cta.buttonTitle cta.commitment %}
{% card temp.url cta.header cta.subhead cta.buttonURL cta.buttonTitle %}
</div>
<div class="d-none d-sm-block">
{% cardLarge cta.hero cta.header cta.subhead cta.buttonURL cta.buttonTitle cta.commitment %}
{% cardLarge cta.hero cta.header cta.subhead cta.buttonURL cta.buttonTitle %}
</div>
{% endfor %}
</div>

Просмотреть файл

@ -5,10 +5,6 @@
<h3 class="">{{ title }}</h3>
<div class="body-large">{{ description | richtext }}</div>
{% if commitment %}
<div class="h6-heading commitment mb-3">{{ commitment }}</div>
{% endif %}
{% if link_url %}
<a class="btn btn-secondary" href="{{ link_url }}">{{ link_label }}</a>
{% endif %}

Просмотреть файл

@ -11,7 +11,6 @@
<div class="col-12 col-md-6">
<h3 class="h2-heading">{{ title }}</h3>
<div class="body-large">{{ description | richtext }}</div>
<p class="commitment h6-heading">{{ commitment }}</p>
<a href="{{ link_url }}" class="btn btn-secondary">{{ link_label }}</a>
</div>
</div>

Просмотреть файл

@ -2,10 +2,6 @@
<div class="card-regular h-100 d-flex flex-column">
{% if commitment %}
<div class="h6-heading commitment">{{ commitment }}</div>
{% endif %}
<img src={{ image }} class="full-bleed-xs" />
<div class="full-bleed-xs d-flex flex-1">

Просмотреть файл

@ -5,7 +5,7 @@ register = template.Library()
@register.inclusion_tag('wagtailpages/tags/card.html')
def card(image, title, description, link_url, link_label, commitment=None):
def card(image, title, description, link_url, link_label):
parsedDescription = BeautifulSoup(description, 'html.parser')
return {
@ -15,7 +15,6 @@ def card(image, title, description, link_url, link_label, commitment=None):
'description_is_rich_text': len(parsedDescription.find_all(True)) > 0,
'link_url': link_url,
'link_label': link_label,
'commitment': commitment,
}
@ -26,7 +25,6 @@ def cardCTA(
description,
link_url,
link_label,
commitment=None,
facebook=None,
twitter=None,
email_subject=None,
@ -38,7 +36,6 @@ def cardCTA(
'description': description,
'link_url': link_url,
'link_label': link_label,
'commitment': commitment,
'facebook': facebook,
'twitter': twitter,
'email_subject': email_subject,
@ -47,12 +44,11 @@ def cardCTA(
@register.inclusion_tag('wagtailpages/tags/card-large.html')
def cardLarge(image, title, description, link_url, link_label, commitment=None):
def cardLarge(image, title, description, link_url, link_label):
return {
'image': image,
'title': title,
'description': description,
'link_url': link_url,
'link_label': link_label,
'commitment': commitment,
}

Просмотреть файл

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 13.9 19.1" style="enable-background:new 0 0 13.9 19.1;" xml:space="preserve">
<style type="text/css">
.st0{fill:#999999;}
</style>
<title>Page 1</title>
<desc>Created with Sketch.</desc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-0.1v1.8c0,0.3,0.2,0.5,0.5,0.5s0.5-0.2,0.5-0.5
v-2.3c0.8-0.4,1.5-1,1.9-1.8c0,0,0.1-0.2,0.2-0.3c0.5-0.9,1.9-3.3,2.9-4.9C13.9,9.2,13.9,8.9,13.9,8.6z"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 1.7 KiB

Просмотреть файл

@ -1,15 +1,6 @@
.card-regular {
position: relative;
.commitment {
position: absolute;
top: 16px;
left: 16px;
background: $white;
border: 1px solid $gray-20;
padding: 4px 8px;
}
.key-item {
.rich-text {
flex: 1;

Просмотреть файл

@ -1,14 +0,0 @@
.commitment {
display: flex;
align-items: center;
z-index: 1;
&::before {
content: "";
background: url(../_images/hand.svg) no-repeat;
width: 14px;
height: 20px;
display: block;
margin-right: 6px;
}
}

Просмотреть файл

@ -31,7 +31,6 @@ $bp-xl: #{map-get($grid-breakpoints, xl)}; // >= 1200px
@import "./components/nav";
@import "./components/primary-nav";
@import "./components/multipage-nav";
@import "./components/commitment";
@import "./components/card";
@import "./components/airtable-block";
@import "./components/image-text-mini";