Skip to content

Commit

Permalink
UHF-9588: Merge branch 'UHF-9588' of https://github.com/City-of-Helsi…
Browse files Browse the repository at this point in the history
…nki/drupal-hdbt into UHF-9588
  • Loading branch information
teroelonen committed Mar 8, 2024
2 parents aa9c1ed + 9b91b9b commit 8852a99
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 42 deletions.
2 changes: 1 addition & 1 deletion dist/css/styles.min.css

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions src/scss/06_components/paragraphs/_hearings.scss
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
.component--hearings {
@include component-side-padding;
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;
@include font('lead');
margin-bottom: $spacing-and-half;

.hearings__count {
font-weight: $font-weight-bold;
}
}

.hearings__results {
margin-bottom: $spacing-double;
.hearings__list {
margin-top: $spacing-and-half;
}

.hearings__link-wrapper {
margin-top: $spacing-double;

@include breakpoint($breakpoint-m) {
margin-top: $spacing-quadruple;
}
}
18 changes: 13 additions & 5 deletions templates/navigation/link-button.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,31 @@
* - open_in_a_new_window: Boolean for opening in a new window and showing explanation.
* - icon: Boolean if first icon is enabled
* - icon_type: String for first icon type
* - link_options: array of attributes for the link such as class or data-attributes.
*
* Usage example:
* {% include '@hdbt/navigation/link-button.html.twig' with {
* type: 'primary',
* label: item.content['#title'],
* url: item.content['#url'],
* class: 'service-channel__link--example',
* link_options: {'class': ['service-channel__link--example']},
* open_in_a_new_window: true,
* } %}
*
* TODO: UHF-8793 Refactor hds-button (https://helsinkisolutionoffice.atlassian.net/browse/UHF-8793).
*/
#}
{% set link_options = {
'data-hds-component':'button',
'data-hds-variant': type,
} %}
{% if link_options %}
{% set link_options = link_options|merge({
'data-hds-component':'button',
'data-hds-variant': type,
}) %}
{% else %}
{% set link_options = {
'data-hds-component':'button',
'data-hds-variant': type,
} %}
{% endif %}

{% if open_in_a_new_window %}
{% set link_options = link_options|merge({target: '_blank', 'data-open-in-new-tab': true}) %}
Expand Down
41 changes: 23 additions & 18 deletions templates/paragraphs/paragraph--hearings.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% embed "@hdbt/misc/component.twig" with
{
component_classes: [
'component--full-width',
'component--hearings',
],
component_title_level: 'h2',
Expand All @@ -12,30 +13,34 @@
}
%}
{% 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__list">
{% if content.list %}
{% set hearings_count = content.list[0]['#helfi_hearings'].get('count')[0].value %}
<div class="hearings__count-container">
<span class="hearings__count">{{ hearings_count }}</span>
{% trans with {'context': 'Hearings count'}%}hearing open for commenting{% plural hearings_count %}hearings open for commenting{% endtrans %}
</div>
{{ content.list }}
</section>
{% include '@hdbt/navigation/link-button.html.twig' with {
type: 'primary',
label: 'See all hearings'|t({},{'context': 'See all hearings link text'}),
url: 'https://kerrokantasi.hel.fi/hearings/list?lang=' ~ current_langcode,
} %}
{% else %}
<section class="hearings__results">
<div class="hearings__link-wrapper">
{% include '@hdbt/navigation/link-button.html.twig' with {
type: 'primary',
label: 'See all hearings'|t({},{'context': 'See all hearings link text'}),
url: 'https://kerrokantasi.hel.fi/hearings/list?lang=' ~ current_langcode,
link_options: {'class': ['hearings__link']},
} %}
</div>
{% else %}
<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 hearings'|t({},{'context': 'See closed hearings link text'}),
url: 'https://kerrokantasi.hel.fi/hearings/list?lang=' ~ current_langcode,
} %}
{% endif %}
<div class="hearings__link-wrapper">
{% include '@hdbt/navigation/link-button.html.twig' with {
type: 'primary',
label: 'See all already closed hearings'|t({},{'context': 'See closed hearings link text'}),
url: 'https://kerrokantasi.hel.fi/hearings/list?lang=' ~ current_langcode,
link_options: {'class': ['hearings__link']},
} %}
</div>
{% endif %}
</div>
{% endblock component_content %}
{% endembed %}
{% endblock paragraph %}
2 changes: 1 addition & 1 deletion translations/fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ msgid "Activity"
msgstr "Aktiivisuus"

msgctxt "Hearings count"
msgid "plan open for commenting"
msgid "hearing open for commenting"
msgid_plural "hearings open for commenting"
msgstr[0] "kuuleminen avoinna kommentoitavaksi"
msgstr[1] "kuulemiset avoinna kommentoitavaksi"
Expand Down
11 changes: 8 additions & 3 deletions translations/sv.po
Original file line number Diff line number Diff line change
Expand Up @@ -608,13 +608,19 @@ msgctxt "Label for hearing activity row"
msgid "Activity"
msgstr "Aktivitet"

msgctxt "Hearings count"
msgid "hearing open for commenting"
msgid_plural "hearings open for commenting"
msgstr[0] "hörande öppna för kommentarer"
msgstr[1] "hörendet öppna för kommentarer"

msgctxt "See all hearings link text"
msgid "See all hearings"
msgstr "Se alla Hörandet"
msgstr "Se alla höranden"

msgctxt "See closed hearings link text"
msgid "See all already closed hearings"
msgstr "Se alla redan stängda Hörandet"
msgstr "Se alla redan stängda höranden"

msgctxt "Hearing available in languages"
msgid "Hearing only available in English"
Expand All @@ -632,7 +638,6 @@ msgctxt "News archive filter results heading"
msgid "Filter news items"
msgstr "Filtera nyheter"


msgctxt "News archive heading"
msgid "News based on your choices"
msgstr "Nyheter baserat på dina val"
Expand Down

0 comments on commit 8852a99

Please sign in to comment.