Skip to content

Commit

Permalink
Merge branch 'main' into 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
khalima committed Oct 31, 2023
2 parents b952eb3 + 00176c7 commit 7eb8d4c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion hdbt.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Base theme for Helsinki Drupal instances.
type: theme
base theme: stable9
tags: sub-theme
core_version_requirement: ^8 || ^9
core_version_requirement: ^9 || ^10
'interface translation project': hdbt
'interface translation server pattern': themes/contrib/hdbt/translations/%language.po

Expand Down
5 changes: 4 additions & 1 deletion hdbt.theme
Original file line number Diff line number Diff line change
Expand Up @@ -1600,9 +1600,12 @@ function hdbt_preprocess_paragraph__event_list(&$variables): void {
$variables['#attached']['drupalSettings']['helfi_events']['data'][$paragraph->id()] = $settings;
}

/** @var \Drupal\Core\Extension\ExtensionPathResolver $extensionPathResolver */
$extensionPathResolver = \Drupal::service('extension.path.resolver');

// Render image placeholder for use in frontend.
$variables['#attached']['drupalSettings']['helfi_events']['imagePlaceholder'] = twig_render_template(
drupal_get_path('theme', 'hdbt') . '/templates/misc/image-placeholder.twig',
$extensionPathResolver->getPath('theme', 'hdbt') . '/templates/misc/image-placeholder.twig',
[
'image_placeholder' => 'calendar-clock',
'theme_hook_original' => '',
Expand Down
2 changes: 1 addition & 1 deletion templates/media/media--remote-video.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
'src': media_attributes.src,
'height': media_attributes.height,
'width': media_attributes.width,
'title': iframe_title,
'title': 'Video: ' ~ iframe_title,
'type': 'video',
}
}
Expand Down
16 changes: 8 additions & 8 deletions templates/navigation/menu--external-menu--fallback.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@

{# Render "back" menu link. #}
{% if menu_link_back %}
{% spaceless %}
{% apply spaceless %}
{% set menu_link_back_title %}
<span class="mmenu__back-wrapper">{{ menu_link_back.title }}</span>
{% endset %}
{% set link_attributes = {'class': [ 'mmenu__back mmenu__back--in-path' ]} %}
{{ link(menu_link_back_title, menu_link_back.url, link_attributes) }}
{% endspaceless %}
{% endapply %}
{% endif %}

{# Current page link #}
{% if menu_link_current_or_parent %}
{% spaceless %}
{% apply spaceless %}
{% set menu_link_current_or_parent_title %}
{{ menu_link_current_or_parent.title }}
{% endset %}
Expand All @@ -52,7 +52,7 @@
'aria-current': menu_link_current_or_parent.is_currentPage ? 'page': null,
} %}
{{ link(menu_link_current_or_parent_title, menu_link_current_or_parent.url, link_attributes) }}
{% endspaceless %}
{% endapply %}
{% endif %}

{% if items %}
Expand All @@ -78,7 +78,7 @@
{% endset %}

{% if not item.is_nolink %}
{% spaceless %}
{% apply spaceless %}
{% set link_attributes = {
'class': [
'mmenu__item-link',
Expand All @@ -87,7 +87,7 @@
'aria-current': item.is_currentPage ? 'page': null,
} %}
{{ link(item_title, item.url, link_attributes) }}
{% endspaceless %}
{% endapply %}
{% else %}
<span{{ create_attribute({'class': 'mmenu__item__nolink'} ) }}>{{ item_title }}</span>
{% endif %}
Expand All @@ -96,10 +96,10 @@
{% set next_item_title %}
<span class="visually-hidden">{{ 'Open submenu:'|t({}, {'context': 'Mobile navigation submenu prefix'}) }} {{ item_title }}</span>
{% endset %}
{% spaceless %}
{% apply spaceless %}
{% set link_attributes = { 'class': [ 'mmenu__forward' ] } %}
{{ link(next_item_title, item.next_url, link_attributes) }}
{% endspaceless %}
{% endapply %}
{% endif %}
</li>
{% endfor %}
Expand Down
4 changes: 2 additions & 2 deletions templates/navigation/menu--external-menu--mega-menu.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
{% endset %}

{% if not item.is_nolink %}
{% spaceless %}
{% apply spaceless %}

{% set icon_name = (item.url.getOption('attributes')).icon %}
{% if icon_name %}
Expand All @@ -94,7 +94,7 @@

{{ link(item_title, item.url, link_attributes) }}

{% endspaceless %}
{% endapply %}
{% else %}
<span{{ create_attribute({'class': 'megamenu__item__nolink'} ) }}>{{ item.title }}</span>
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions templates/navigation/menu--mobile.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

{% set item_title = item.title %}
{% if not item.is_nolink %}
{% spaceless %}
{% apply spaceless %}

{% set icon_name = (item.url.getOption('attributes')).icon %}
{% if icon_name %}
Expand All @@ -89,7 +89,7 @@

{{ link(item_title, item.url, link_attributes) }}

{% endspaceless %}
{% endapply %}
{% else %}
<span{{ create_attribute({'class': 'cssnav__item__nolink'} ) }}>{{ item.title }}</span>
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions templates/navigation/menu.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<li{{ item.attributes.removeAttribute('class', 'lang').addClass(item_classes) }}>
<span class="menu__link-wrapper">
{% if not item.is_nolink %}
{% spaceless %}
{% apply spaceless %}

{% set item_title %}
{% set icon_name = (item.url.getOption('attributes')).icon %}
Expand All @@ -95,7 +95,7 @@

{{ link(item_title, item.url, link_attributes) }}

{% endspaceless %}
{% endapply %}
{% else %}
<span{{ create_attribute({'class': item_classes|merge(['menu__nolink'])}) }}><span class="menu__link__text" id="{{ item_is_collabsible ? link_id }}"{{ item_lang }}>{{ item.title }}</span></span>
{% endif %}
Expand Down

0 comments on commit 7eb8d4c

Please sign in to comment.