-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #712 from City-of-Helsinki/UHF-8442_hearing_paragraph
UHF-8442 Hearing paragraph
- Loading branch information
Showing
9 changed files
with
293 additions
and
3 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.component--hearings { | ||
background: $color-silver-light; | ||
} | ||
|
||
.component--hearings .component__container { | ||
padding-bottom: $spacing-double; | ||
padding-top: $spacing-double; | ||
|
||
@include breakpoint($breakpoint-m) { | ||
padding-bottom: $spacing-quadruple; | ||
padding-top: $spacing-quadruple; | ||
} | ||
} | ||
|
||
.hearings__count-container { | ||
@include font('small'); | ||
margin-bottom: $spacing; | ||
|
||
.hearings__count { | ||
font-weight: $font-weight-bold; | ||
} | ||
} | ||
|
||
.hearings__results { | ||
margin-bottom: $spacing-double; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
templates/content/external-entity--helfi-hearings.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{% set card_hearing_classes = ['card--hearing'] %} | ||
|
||
{% if content.comments[0]['#context'].value == '1' %} | ||
{% set card_hearing_comments = content.comments[0]['#context'].value ~ ' ' ~ 'comment'|t({}, {'context': 'Hearing activity suffix singular'}) %} | ||
{% else %} | ||
{% set card_hearing_comments = content.comments[0]['#context'].value ~ ' ' ~ 'comments'|t({}, {'context': 'Hearing activity suffix plural'}) %} | ||
{% endif %} | ||
|
||
{% if content.open_at[0]['#context'].value is not empty %} | ||
{% set card_published_on = content.open_at[0]['#context'].value|date('j.n.Y') %} | ||
{% else %} | ||
{% set card_published_on = '-' %} | ||
{% endif %} | ||
|
||
{% if content.close_at[0]['#context'].value is not empty %} | ||
{% set card_unpublished_on = content.close_at[0]['#context'].value|date('j.n.Y') ~ ' ' ~ 'at'|t({}, {'context': 'Word in between hearing unpublished date and time'}) ~ ' ' ~ node.unpublish_on.value|date('H:i') %} | ||
{% else %} | ||
{% set card_unpublished_on = '-' %} | ||
{% endif %} | ||
|
||
{% if available_in_languages %} | ||
{% embed '@hdbt/component/card.twig' with { | ||
card_modifier_class: card_hearing_classes|join(' '), | ||
card_title: content.title[0]['#context'].value, | ||
card_title_lang: content.langcode[0]['#context'].value, | ||
card_image: content.main_image, | ||
card_url: content.url[0]['#context'].value, | ||
card_url_external: true, | ||
card_metas: [ | ||
{ | ||
icon: 'clock', | ||
label: 'Opened'|t({}, {'context': 'Label for hearing opened date'}), | ||
content: card_published_on, | ||
}, | ||
{ | ||
icon: 'clock', | ||
label: 'Closes'|t({}, {'context': 'Label for hearing closes date'}), | ||
content: card_unpublished_on, | ||
}, | ||
{ | ||
icon: 'speechbubble-text', | ||
label: 'Activity'|t({}, {'context': 'Label for hearing activity row'}), | ||
content: card_hearing_comments, | ||
}, | ||
], | ||
card_tags: [ | ||
{ | ||
tag: available_in_languages, | ||
color: 'alert', | ||
} | ||
], | ||
} %} | ||
{% endembed %} | ||
{% else %} | ||
{% embed '@hdbt/component/card.twig' with { | ||
card_modifier_class: card_hearing_classes|join(' '), | ||
card_title: content.title[0]['#context'].value, | ||
card_image: content.main_image, | ||
card_url: content.url[0]['#context'].value, | ||
card_url_external: true, | ||
card_metas: [ | ||
{ | ||
icon: 'clock', | ||
label: 'Opened'|t({}, {'context': 'Label for hearing opened date'}), | ||
content: card_published_on, | ||
}, | ||
{ | ||
icon: 'clock', | ||
label: 'Closes'|t({}, {'context': 'Label for hearing closes date'}), | ||
content: card_unpublished_on, | ||
}, | ||
{ | ||
icon: 'speechbubble-text', | ||
label: 'Activity'|t({}, {'context': 'Label for hearing activity row'}), | ||
content: card_hearing_comments, | ||
}, | ||
] | ||
} %} | ||
{% endembed %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{% block paragraph %} | ||
|
||
{% embed "@hdbt/misc/component.twig" with | ||
{ | ||
component_classes: [ | ||
'component--hearings', | ||
], | ||
component_title_level: 'h2', | ||
component_title: content.field_hearings_title, | ||
component_description: content.field_hearings_description, | ||
component_content_class: 'hearings', | ||
} | ||
%} | ||
{% block component_content %} | ||
{% if content.list %} | ||
{% set hearings_count = content.list[0]['#helfi_hearings'].get('count')[0].value %} | ||
<section class="hearings__results"> | ||
<div class="hearings__count-container"> | ||
<span class="hearings__count">{{ hearings_count }}</span> | ||
{% trans with {'context': 'Hearings count'}%}plan open for commenting{% plural hearings_count %}plans open for commenting{% endtrans %} | ||
</div> | ||
{{ content.list }} | ||
</section> | ||
{% include '@hdbt/navigation/link-button.html.twig' with { | ||
type: 'primary', | ||
label: 'See all plans'|t({},{'context': 'See all plans link text'}), | ||
url: 'https://kerrokantasi.hel.fi/hearings/list?lang=' ~ current_langcode, | ||
class: 'hearings__link', | ||
is_external: true, | ||
open_in_a_new_window: true, | ||
} %} | ||
{% else %} | ||
<section class="hearings__results"> | ||
<p>{{ "At the moment there is no open hearings for commenting."|t }}</p> | ||
</section> | ||
{% include '@hdbt/navigation/link-button.html.twig' with { | ||
type: 'primary', | ||
label: 'See all already closed plans'|t({},{'context': 'See closed plans link text'}), | ||
url: 'https://kerrokantasi.hel.fi/hearings/list?lang=' ~ current_langcode, | ||
class: 'hearings__link', | ||
is_external: true, | ||
open_in_a_new_window: true, | ||
} %} | ||
{% endif %} | ||
{% endblock component_content %} | ||
{% endembed %} | ||
{% endblock paragraph %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters