From 93fab49457b430b97b6ad5d1e5f65fa4af021f61 Mon Sep 17 00:00:00 2001
From: Rasmus Fuhse <fuhse@data-quest.de>
Date: Tue, 23 Apr 2024 08:46:46 +0000
Subject: [PATCH] =?UTF-8?q?Resolve=20"Barrierefreiheit:=20Blubber=20Benach?=
 =?UTF-8?q?richtigungsstatus=20ist=20nicht=20f=C3=BCr=20Screenreader=20erk?=
 =?UTF-8?q?ennbar"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #4061

Merge request studip/studip!2907
---
 resources/assets/javascripts/lib/blubber.js | 1 +
 templates/blubber/global_context.php        | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/resources/assets/javascripts/lib/blubber.js b/resources/assets/javascripts/lib/blubber.js
index 3e93985e493..4e724b46cbd 100644
--- a/resources/assets/javascripts/lib/blubber.js
+++ b/resources/assets/javascripts/lib/blubber.js
@@ -47,6 +47,7 @@ const Blubber = {
                 subscribe: follow,
             });
         }).then(() => {
+            elements.attr('aria-pressed', follow ? 'true' : 'false');
             elements.toggleClass('unfollowed', !follow);
         }).finally(() => {
             elements.removeClass('loading');
diff --git a/templates/blubber/global_context.php b/templates/blubber/global_context.php
index 77c4a2905e6..4a524076ed3 100644
--- a/templates/blubber/global_context.php
+++ b/templates/blubber/global_context.php
@@ -7,6 +7,8 @@
        onClick="STUDIP.Blubber.followunfollow('global'); return false;"
        class="followunfollow<?= $unfollowed ? " unfollowed" : "" ?>"
        title="<?= _("Benachrichtigungen für diese Konversation abstellen.") ?>"
+       aria-pressed="<?= $unfollowed ? 'false' : 'true' ?>"
+       role="button"
        data-thread_id="global">
         <?= Icon::create("decline")->asImg(20, ['class' => "follow text-bottom"]) ?>
         <?= Icon::create("notification2")->asImg(20, ['class' => "unfollow text-bottom"]) ?>
-- 
GitLab