Improve a11y of embedded content
authorMarcel Werk <burntime@woltlab.com>
Fri, 19 May 2023 15:38:42 +0000 (17:38 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 19 May 2023 15:38:42 +0000 (17:38 +0200)
com.woltlab.wcf/templates/articleBBCode.tpl
wcfsetup/install/files/acp/templates/articleBBCode.tpl
wcfsetup/install/files/style/ui/embeddedContent.scss

index 7ce169740767d5cddec7e577e3f399774e80005b..949f0e180605d8af749e4c9ea8a2ed9d64a39c80 100644 (file)
@@ -8,23 +8,25 @@
                        loading="lazy"
                        alt="">
 
-        <div class="embeddedContentCategory">{lang}wcf.article.bbcode.type{/lang}</div>
+               <div class="embeddedContentCategory">{lang}wcf.article.bbcode.type{/lang}</div>
                
-               <div class="embeddedContentTitle" id="{$titleHash}_articleTitle{@$article->articleID}">{$article->getTitle()}</div>
+               <div class="embeddedContentTitle" id="{$titleHash}_articleTitle{@$article->articleID}">
+                       <a href="{@$article->getLink()}" class="embeddedContentTitleLink">{$article->getTitle()}</a>
+               </div>
                
                <div class="embeddedContentDescription">
                        {@$article->getFormattedTeaser()}
                </div>
-
-               <a href="{@$article->getLink()}" class="embeddedContentLinkShadow"></a>
        </div>
        
        <div class="embeddedContentMeta">
-               {user object=$article->getUserProfile() type='avatar32' class='embeddedContentMetaImage' ariaHidden='true' tabindex='-1'}
+               <div class="embeddedContentMetaImage">
+                       {@$article->getUserProfile()->getAvatar()->getImageTag(32)}
+               </div>
                
                <div class="embeddedContentMetaContent">
                        <div class="embeddedContentMetaAuthor">
-                               {user object=$article->getUserProfile() class='username'}
+                               {@$article->getUserProfile()->getFormattedUsername()}
                        </div>
                        
                        <div class="embeddedContentMetaTime">
index 7ce169740767d5cddec7e577e3f399774e80005b..949f0e180605d8af749e4c9ea8a2ed9d64a39c80 100644 (file)
@@ -8,23 +8,25 @@
                        loading="lazy"
                        alt="">
 
-        <div class="embeddedContentCategory">{lang}wcf.article.bbcode.type{/lang}</div>
+               <div class="embeddedContentCategory">{lang}wcf.article.bbcode.type{/lang}</div>
                
-               <div class="embeddedContentTitle" id="{$titleHash}_articleTitle{@$article->articleID}">{$article->getTitle()}</div>
+               <div class="embeddedContentTitle" id="{$titleHash}_articleTitle{@$article->articleID}">
+                       <a href="{@$article->getLink()}" class="embeddedContentTitleLink">{$article->getTitle()}</a>
+               </div>
                
                <div class="embeddedContentDescription">
                        {@$article->getFormattedTeaser()}
                </div>
-
-               <a href="{@$article->getLink()}" class="embeddedContentLinkShadow"></a>
        </div>
        
        <div class="embeddedContentMeta">
-               {user object=$article->getUserProfile() type='avatar32' class='embeddedContentMetaImage' ariaHidden='true' tabindex='-1'}
+               <div class="embeddedContentMetaImage">
+                       {@$article->getUserProfile()->getAvatar()->getImageTag(32)}
+               </div>
                
                <div class="embeddedContentMetaContent">
                        <div class="embeddedContentMetaAuthor">
-                               {user object=$article->getUserProfile() class='username'}
+                               {@$article->getUserProfile()->getFormattedUsername()}
                        </div>
                        
                        <div class="embeddedContentMetaTime">
index 328e1fa4564864e02455869dc3e0b137d7ac5e2f..03b28ff28559890df508ca3920a065735eccec4d 100644 (file)
        position: relative;
 }
 
+.embeddedContentTitleLink {
+       color: inherit;
+
+       &::before {
+               bottom: 0;
+               content: "";
+               left: 0;
+               position: absolute;
+               right: 0;
+               top: 0;
+       }
+
+       &:hover,
+       &:focus {
+               color: inherit;
+       }
+}
+
+/* @deprecated 6.0 Use `.embeddedContentTitleLink` instead */
 .embeddedContentLinkShadow {
        bottom: 0;
        left: 0;