Skip to content

Commit

Permalink
home/blocks//templates: remove required from teaser text, update temp…
Browse files Browse the repository at this point in the history
…late and styling fixes #445
  • Loading branch information
Phillippa authored and philli-m committed Jan 16, 2023
1 parent 41441cf commit 7402061
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/home/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class TeaserBlock(blocks.StructBlock):
text = blocks.RichTextBlock()
text = blocks.RichTextBlock(required=False)
button_text = blocks.CharBlock()
button_link = blocks.PageChooserBlock()
icon = IconBlock()
Expand Down
4 changes: 4 additions & 0 deletions apps/home/templates/home/blocks/teaser_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

<div class="teasers-block__item l-col-3">
<i class="fa {{ value.icon }} teasers-block__icon"></i>
{% if value.text %}
<div class="teasers-block__text">{{ value.text|richtext }}</div>
{% else %}
<div class="teasers-block__spacer"></div>
{% endif %}
<a href="{% pageurl value.button_link %}" class="button button--primary">{{ value.button_text }}</a>
</div>
4 changes: 4 additions & 0 deletions tempelhof/assets/scss/components/_teasers_block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
margin-bottom: 0.7em;
}

.teasers-block__spacer {
margin-bottom: 1.75rem;
}

.teasers-block__icon {
font-size: 3.6rem;
color: contrast-color($bg-secondary, $text-secondary);
Expand Down

0 comments on commit 7402061

Please sign in to comment.