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

[7931] templates/home_page: add anchor links for blocks according to WCAG ta… #949

Merged
merged 1 commit into from
Dec 14, 2023
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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/gruenbuch/templates/gruenbuch_detail_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h1>{{ page.page_title }}</h1>
<p>{{ page.subtitle }}</p>
{% endif %}
{% for block in self.body %}
{{ block }}
{% include_block block with block_id=block.id %}
{% endfor %}
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion apps/gruenbuch/templates/gruenbuch_overview_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1>{{ page.page_title }}</h1>
</div>
</section>
{% for block in self.body %}
{{ block }}
{% include_block block with block_id=block.id %}
{% endfor %}
{% if settings.apps_settings.Downloads.gruenbuch %}
{% with download=settings.apps_settings.Downloads.gruenbuch %}
Expand Down
15 changes: 11 additions & 4 deletions apps/home/blocks.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from wagtail import blocks
from wagtail.embeds import blocks as embed_blocks
from wagtail.images.blocks import ImageChooserBlock

HELPTEXT_RICHTEXT_A11Y = _('For accessibility please make sure that you do not'
' leave out levels when using the headlines. That'
' means, that there should always be an h2 before'
' using an h3.')
HELPTEXT_RICHTEXT_A11Y = mark_safe(
_('For accessibility please make sure that you do not'
' leave out levels when using the headlines. That'
' means, that there should always be an h2 before'
' using an h3.<br>'
' To get the anchor tag for any block: click the'
' chain link symbol at the to left of the block icon and'
' then copy the id from the browser url bar'
' (example: block-1e495692-5fad-4133-86c5-0c42e19b4ad2-section)')
)
NEWSLETTER_EMAIL_DEFAULT = _('Your email address')
NEWSLETTER_DSGVO_DEFAULT = _(
'Ich willige in die Speicherung und Nutzung meiner E-Mail-Adresse für '
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/home/templates/apps_home/blocks/faq_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% get_identifier value as identifier %}


<section class="modul-teaser-marketing fullwidth ds-block--base {% if self.background_color %}ds-block--fullwidth ds-block--{{ self.background_color }}{% endif %}">
<section class="modul-teaser-marketing fullwidth ds-block--base {% if self.background_color %}ds-block--fullwidth ds-block--{{ self.background_color }}{% endif %}" id="block-{{ block_id }}-section">
<div class="content-container fullwidth__inner">
{% if self.faq_title %}
<h2 class="title">
Expand Down
4 changes: 2 additions & 2 deletions apps/home/templates/apps_home/blocks/image_swiper_block.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load wagtailcore_tags wagtailimages_tags i18n %}

<div class="modul-buehne ds-block--base">
<section class="modul-buehne ds-block--base" id="block-{{ block_id }}-section">
<div class="swiper-container swiper">
<div class="swiper-controls">
<div class="swiper-button-prev" title="{% trans 'Previous picture' %}"></div>
Expand Down Expand Up @@ -68,4 +68,4 @@ <h2 class="title">{{ value.title }}</h2>

</ul>
</div>
</div>
</section>
2 changes: 1 addition & 1 deletion apps/home/templates/apps_home/blocks/newsletter_block.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load static i18n widget_tweaks form_field_tags %}

<section class="modul-teaser-marketing fullwidth ds-block--base {% if self.background_color %}ds-block--fullwidth ds-block--{{ self.background_color }}{% endif %}">
<section class="modul-teaser-marketing fullwidth ds-block--base {% if self.background_color %}ds-block--fullwidth ds-block--{{ self.background_color }}{% endif %}" id="block-{{ block_id }}-section">
<div class="content-container fullwidth__inner">
{% if self.title %}
<h2 class="title">
Expand Down
2 changes: 1 addition & 1 deletion apps/home/templates/apps_home/blocks/paragraph_block.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load block_tags %}

<section class="modul-text_bild ds-block--base">
<section class="modul-text_bild ds-block--base" id="block-{{ block_id }}-section">
<div class="text textile">
{{ self.body }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/home/templates/apps_home/blocks/quote_block.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load i18n wagtailcore_tags %}

<blockquote class="modul-testimonial ds-block--base">
<blockquote class="modul-testimonial ds-block--base" id="block-{{ block_id }}-section">
<div class="textbox">
<i class="fas fa-quote-left quote" aria-hidden="true"></i>
<div class="text">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<!-- colours are needed for text colour styling -->
<article class="modul-teaser-marketing boxed fullwidth ds-block--base
{% if self.background_color %} ds-block--{{ self.background_color }}{% endif %}"
id="block-{{ block_id }}-section"
>
<div class="background-image {% if self.background_color %}ds-block--{{ self.background_color }}{% else %}pink{% endif %}" aria-hidden="true">
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load i18n wagtailcore_tags wagtailimages_tags %}

<section class="modul-multiteaser ds-block--base">
<section class="modul-multiteaser ds-block--base" id="block-{{ block_id }}-section">
<h2 class="title">{{ value.title }}</h2>
<ul class="flexgrid grid--{{self.column_count}}">
{% for value in self.column %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load i18n wagtailcore_tags wagtailimages_tags %}
{% image value.image fill-800x600 as image %}

<article class="modul-teaser-marketing imageteaser fullwidth ds-block--base ds-block--fullwidth {% if self.background_color %}ds-block--{{ self.background_color }}{% else %}pink{% endif %}" >
<article class="modul-teaser-marketing imageteaser fullwidth ds-block--base ds-block--fullwidth {% if self.background_color %}ds-block--{{ self.background_color }}{% else %}pink{% endif %}" id="block-{{ block_id }}-section">
<div class="background-image {% if self.background_color %}ds-block--{{ self.background_color }}{% endif %}" aria-hidden="true">
</div>
<div class="content-container fullwidth__inner">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load i18n wagtailcore_tags wagtailimages_tags %}
{% image value.image fill-800x600 as image %}

<article class="modul-teaser ds-block--base" data-add-clickable-area="smart">
<article class="modul-teaser ds-block--base" data-add-clickable-area="smart" id="block-{{ block_id }}-section">
<div class="image">
<div class="image__image">
{% image value.image fill-800x600 as image %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load i18n wagtailcore_tags wagtailimages_tags %}

<section class="modul-icontiles ds-modul-icontiles">
<section class="modul-icontiles ds-modul-icontiles" id="block-{{ block_id }}-section">
<h2 class="title">{{ value.title }}</h2>
<div class=icontiles__inner>
<ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load i18n wagtailcore_tags wagtailimages_tags %}
{% image value.image fill-800x600 as image %}

<section class="modul-text_bild ds-block--base ds-block--fullwidth imagealign{% if self.image_alignment == 'left' %}left{% else %}right{% endif %} fifty">
<section class="modul-text_bild ds-block--base ds-block--fullwidth imagealign{% if self.image_alignment == 'left' %}left{% else %}right{% endif %} fifty" id="block-{{ block_id }}-section">
<div class="image">
<div class="image__image">
<img src="{{ image.url }}" alt="{{ image.alt }}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load block_tags i18n wagtailcore_tags %}

<section class="modul-teaser-marketing fullwidth ds-block--base {% if self.background_color %}ds-block--fullwidth ds-block--{{ self.background_color }}{% endif %}">
<section class="modul-teaser-marketing fullwidth ds-block--base {% if self.background_color %}ds-block--fullwidth ds-block--{{ self.background_color }}{% endif %}" id="block-{{ block_id }}-section">
<div class="content-container fullwidth__inner">
<div class="ds-block__maincontent--small">
<h2 class="title thesis-ds-block__title">{{ value.title }}</h2>
Expand Down
2 changes: 1 addition & 1 deletion apps/home/templates/apps_home/blocks/video_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% get_identifier value as identifier %}
{% get_video_provider value.video.url as video_provider %}

<section class="modul-video ds-block--base">
<section class="modul-video ds-block--base" id="block-{{ block_id }}-section">
{% if value.title %}
<h2 class="title">{{ value.title }}</h2>
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions apps/home/templates/apps_home/detail_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{{ page.page_title }}</h1>
{% for block in page.body %}
{% include_block block %}
{% for block in self.body %}
{% include_block block with block_id=block.id %}
{% endfor %}
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion apps/home/templates/apps_home/home_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h1 class="title">{{ page.page_title }}</h1>
</section>
<div id="layout-grid__area--maincontent">
{% for block in self.body %}
{{ block }}
{% include_block block with block_id=block.id %}
{% endfor %}
</div>

Expand Down
2 changes: 1 addition & 1 deletion apps/home/templates/apps_home/overview_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1>{{ page.page_title }}</h1>
{{ self.page_intro|richtext }}
</section>
{% for block in self.body %}
{{ block }}
{% include_block block with block_id=block.id %}
{% endfor %}
</div>
{% endblock %}
6 changes: 3 additions & 3 deletions apps/home/templates/apps_home/simple_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{{ page.page_title }}</h1>
{% for block in page.body %}
{% include_block block %}
{% endfor %}
{% for block in self.body %}
{% include_block block with block_id=block.id %}
{% endfor %}
</div>
{% endblock %}