Skip to content

Commit

Permalink
template updates
Browse files Browse the repository at this point in the history
  • Loading branch information
philli-m committed Jun 16, 2022
1 parent 9bf79d0 commit 390dde4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 50 deletions.
36 changes: 3 additions & 33 deletions adhocracy-plus/assets/scss/components/_blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,6 @@ $block-padding-md: 7.5 * $padding;
text-align: left;
}

.block-img-col-1 {
@extend .col-md-7;

img {
display: inline-block;
float: left;
padding-right: $padding;
}
}

.block-img-col-2 {
@extend .col-md-5;

.block-img-col__image {
width: 100%;
position: relative;

@media screen and (min-width: $breakpoint-xxl) {
margin-top: 2 * $spacer;
}
}
}

// old block styling, still used in activity block
.block--bordered {
padding: 1em;
Expand All @@ -88,7 +65,6 @@ $block-padding-md: 7.5 * $padding;

// responsive padding for image, 2 col cta
.homepage__wrapper {
.block-img-col-1,
.block-row-2 {
padding: 2 * $padding;

Expand Down Expand Up @@ -128,26 +104,20 @@ $block-padding-md: 7.5 * $padding;
width: 80px;
border-bottom: solid 8px $brand-secondary;
}

.block-img-col-1 {
h2:after {
left: 0;
}
}
}

// coloured background block
.block-background_cta_block .block > :first-child {
.block-background_cta_block .block-light {
background-color: $brand-secondary;
}

.block-background_cta_block .block > :last-child {
.block-background_cta_block .block-dark {
background-color: $brand-primary;
color: $text-color-inverted;
}

// linked for specificty
.btn--transparent.block-bg_btn-2 {
.block-dark .btn--transparent {
color: $text-color-inverted;
border-color: $text-color-inverted;

Expand Down
11 changes: 2 additions & 9 deletions apps/cms/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,8 @@ class Meta:

# 2-col, richtext, CTA btn, background colour
class ColBackgroundCTABlock(blocks.StructBlock):
columns_count = blocks.ChoiceBlock(choices=[
(1, 'One column'),
(2, 'Two columns')

], default=2)

columns = blocks.ListBlock(
CallToActionBlock(label='CTA with Background')
)
column1_bg = CallToActionBlock(label='CTA column light blue')
column2_bg = CallToActionBlock(label='CTA column dark blue')

class Meta:
template = 'a4_candy_cms_pages/blocks/col_background_cta_block.html'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{% load wagtailcore_tags %}

<div class="block row">
{% for column in value.columns %}
<div class="block-col-{{ value.columns_count }}">
{{ column.body }}
{% if column.link %}
<div class="block-col_cta-content">
<a href="{{ column.link }}" class="btn btn--full btn--transparent block-bg_btn-{{ forloop.counter }} mt-3">{{ column.link_text }}</a>
</div>
<div class="block-col-2 block-light">
{{ value.column1.body }}
{% if value.column1.link %}
<div class="block-col_cta-content">
<a href="{{ column1.link }}" class="btn btn--full btn--transparent mt-3">{{ column1.link_text }}</a>
</div>
{% endif %}
</div>
<div class="block-col-2 block-dark">
{{ column2.body }}
{% if value.column2.link %}
<div class="block-col_cta-content">
<a href="{{ column2.link }}" class="btn btn--full btn--transparent mt-3">{{ column2.link_text }}</a>
</div>
{% endfor %}
{% endif %}
</div>
</div>

0 comments on commit 390dde4

Please sign in to comment.