Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-11032: Changed exclusion logic for table of contents #1133

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/css/styles.min.css

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/scss/06_components/messages/_dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
}
}

.dialog__header {
// If there is close-button on the header it is printed first for accessibility reasons on dom.
// To have them other way around visually we check that if there is more than one element in the dialog__header
// and flip them around.
.dialog__header:has(> :nth-child(2)) {
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
Expand Down
1 change: 1 addition & 0 deletions templates/content/node--survey.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
'class': [
'dialog',
'dialog--survey',
'hide-from-table-of-contents',
],
'id': 'helfi-survey'
} %}
Expand Down
2 changes: 1 addition & 1 deletion templates/field/field--toc-enabled.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% if toc_enabled|render|striptags|trim is not empty %}
<div class="table-of-contents">
<div id="helfi-toc-table-of-contents" class="table-of-contents__container table-of-contents__js">
<div id="helfi-toc-table-of-contents" class="table-of-contents__container table-of-contents__js hide-from-table-of-contents">
{% if toc_title|render %}
{% set title_attributes = {
'class': [
Expand Down
4 changes: 2 additions & 2 deletions templates/layout/page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
<div class="main-content">

{% if has_sidebar_first %}
<div class="layout-sidebar-first">
<div class="layout-sidebar-first hide-from-table-of-contents">
{% block page_sidebar_first %}
{{ page.sidebar_first }}
{% endblock page_sidebar_first %}
Expand All @@ -182,7 +182,7 @@
</div>

{% if has_sidebar_second %}
<aside class="layout-sidebar-second">
<aside class="layout-sidebar-second hide-from-table-of-contents">
{% block page_sidebar_second %}
{{ page.sidebar_second }}
{% endblock page_sidebar_second %}
Expand Down
9 changes: 8 additions & 1 deletion templates/layout/region--breadcrumb.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@
* @see template_preprocess_region()
*/
#}
{%
set classes = [
'breadcrumb__container',
'hide-from-table-of-contents',
]
%}

{% if content %}
<div{{ attributes.addClass('breadcrumb__container') }}>
<div{{ attributes.addClass(classes) }}>
{{ content }}
</div>
{% endif %}
10 changes: 9 additions & 1 deletion templates/layout/region--tools.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@
* @see template_preprocess_region()
*/
#}

{%
set classes = [
'tools__container',
'hide-from-table-of-contents',
]
%}

{% if content|render %}
<div{{ attributes.addClass('tools__container') }}>
<div{{ attributes.addClass(classes) }}>
{{ content }}
</div>
{% endif %}
2 changes: 1 addition & 1 deletion templates/misc/embedded-content-cookie-compliance.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="embedded-content-cookie-compliance media-{{ media_id }}">
<div class="embedded-content-cookie-compliance media-{{ media_id }} hide-from-table-of-contents">
<div class="message" {{ alternative_language ? create_attribute({'lang': lang_attributes.fallback_lang, 'dir': lang_attributes.fallback_dir}) }}>
{% include '@hdbt/misc/icon.twig' ignore missing with {icon: 'alert-circle-fill'} %}
<h2>{{ 'Content cannot be displayed'|t({}, {'context': 'Cookie compliance'}) }}</h2>
Expand Down
2 changes: 1 addition & 1 deletion templates/module/helfi-chart/chart-iframe.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<div class="helfi-charts-content" data-src="{{ url }}" data-title="{{ title }}"></div>

<div class="helfi-charts-cookie-compliance js-helfi-charts-cookie-compliance" style="display: none;">
<div class="helfi-charts-cookie-compliance js-helfi-charts-cookie-compliance hide-from-table-of-contents" style="display: none;">
<div class="message">
{% include '@hdbt/misc/icon.twig' ignore missing with {icon: 'alert-circle-fill'} %}
<h2>{{ 'Chart cannot be displayed'|t({}, {'context': 'Helfi Charts cookie compliance'}) }}</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#}
<div class="rns" style="display: none;"></div>

<div class="react-and-share-cookie-compliance js-react-and-share-cookie-compliance" style="display: none;">
<div class="react-and-share-cookie-compliance js-react-and-share-cookie-compliance hide-from-table-of-contents" style="display: none;">
<div class="message">
{% include '@hdbt/misc/icon.twig' ignore missing with {icon: 'alert-circle-fill'} %}
<h2>{{ 'Would you like to give feedback on this page?'|t({}, {'context': 'React & Share cookie compliance'}) }}</h2>
Expand Down
Loading