Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@foxbunny
Copy link
Collaborator

@foxbunny foxbunny commented Feb 3, 2025

  • Affects base layout and any page using it
  • Reserves the main-content id for the H2 heading in the layout template
  • Can be overridden by blanking out the bypass_target block

The original intent was to target event pages only, but unless this breaks other pages somewhere, it's an even better solution from the accessibility standpoint.

@foxbunny foxbunny requested a review from ThiefMaster February 3, 2025 04:58
@ThiefMaster ThiefMaster force-pushed the event-page-bypass-link branch from d86bfde to 5bc27ba Compare February 3, 2025 09:54
@ThiefMaster
Copy link
Member

LGTM!

In cases of conference events, the main conference page does not have such a title though. Likewise for "lecture" and "meeting" events. I think this solves it, but for lectures/meetings this includes the full event area including the title, location, etc. (I guess that's also "main content"?). Feel free to adjust or lmk if you agree that it should be done like this, then I can commit it myself and add it here before merging:

diff --git a/indico/modules/events/templates/display/conference.html b/indico/modules/events/templates/display/conference.html
index 5566af63a2..7e8887bee6 100644
--- a/indico/modules/events/templates/display/conference.html
+++ b/indico/modules/events/templates/display/conference.html
@@ -3,7 +3,7 @@
 {% from 'attachments/_attachments.html' import render_attachments %}

 {% block content %}
-    <div class="conferenceDetails">
+    <div class="conferenceDetails" id="main-content" data-bypass-target="{% trans %}Skip to main content{% endtrans %}">
         <div itemprop="description" class="description js-mathjax editor-output">
             {{ event.description }}
         </div>
diff --git a/indico/modules/events/templates/display/indico/lecture.html b/indico/modules/events/templates/display/indico/lecture.html
index 5c0e67a524..523b852028 100644
--- a/indico/modules/events/templates/display/indico/lecture.html
+++ b/indico/modules/events/templates/display/indico/lecture.html
@@ -11,7 +11,9 @@
                        or event.contact_emails or event.contact_phones
                        or (event.references and event.type == 'meeting') or hook_event_header %}

-<div class="event-wrapper {% block event_classes %}{% endblock %}">
+<div class="event-wrapper {% block event_classes %}{% endblock %}"
+     id="main-content"
+     data-bypass-target="{% trans %}Skip to main content{% endtrans %}">
     {% block header %}
         <div class="event-header event-header-lecture {%- if not has_subheader %} round-bottom-corners{% endif %}">
             <div class="event-title">
diff --git a/indico/modules/events/templates/display/indico/meeting.html b/indico/modules/events/templates/display/indico/meeting.html
index 7d6cc948c7..fad91783a7 100644
--- a/indico/modules/events/templates/display/indico/meeting.html
+++ b/indico/modules/events/templates/display/indico/meeting.html
@@ -12,7 +12,9 @@
                        or event.contact_emails or event.contact_phones
                        or (event.references and event.type == 'meeting') or hook_event_header %}

-<div class="event-wrapper {% block event_classes %}{% endblock %}">
+<div class="event-wrapper {% block event_classes %}{% endblock %}"
+     id="main-content"
+     data-bypass-target="{% trans %}Skip to main content{% endtrans %}">
     {% block header %}
         <div class="event-header {%- if not has_subheader %} round-bottom-corners{% endif %}">
             <div class="event-title">

@foxbunny foxbunny added the a11y label Feb 4, 2025
@foxbunny
Copy link
Collaborator Author

foxbunny commented Feb 4, 2025

LGTM. If there's a need to adjust that later, we can do it easily.

@ThiefMaster ThiefMaster force-pushed the event-page-bypass-link branch from 5bc27ba to 59d6fbe Compare February 4, 2025 08:49
foxbunny and others added 2 commits February 4, 2025 09:52
- Affects base layout and any page using it
- Reserves the `main-content` id for the H2 heading in the layout
  template
- Can be overridden by blanking out the bypass_target block
@ThiefMaster ThiefMaster force-pushed the event-page-bypass-link branch from 59d6fbe to 54dec71 Compare February 4, 2025 08:52
@ThiefMaster ThiefMaster added this to the v3.3 milestone Feb 4, 2025
@ThiefMaster ThiefMaster merged commit 7f41fc7 into indico:master Feb 4, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.