From 6183d6d8e2d93a7f35f8c61e33436240c9c84390 Mon Sep 17 00:00:00 2001 From: e-five <146029455+e-five256@users.noreply.github.com> Date: Thu, 19 Oct 2023 19:30:00 -0400 Subject: [PATCH 1/6] handle alt text overflow on broken avatar images --- assets/styles/components/_comment.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/styles/components/_comment.scss b/assets/styles/components/_comment.scss index 02b406985..5e4ddf168 100644 --- a/assets/styles/components/_comment.scss +++ b/assets/styles/components/_comment.scss @@ -86,11 +86,13 @@ $comment-margin-sm: .3rem; grid-area: avatar; display: none; margin: 0; - + img{ width: 30px; height: 30px; + display: inline-block; + overflow: hidden; } @include media-breakpoint-up(sm) { From f0c0ceac6c5a3d359f543c7ee7354cf841d95d9a Mon Sep 17 00:00:00 2001 From: e-five <146029455+e-five256@users.noreply.github.com> Date: Thu, 19 Oct 2023 19:47:06 -0400 Subject: [PATCH 2/6] hide alt text as well --- assets/styles/components/_comment.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/styles/components/_comment.scss b/assets/styles/components/_comment.scss index 5e4ddf168..d48bc7bc9 100644 --- a/assets/styles/components/_comment.scss +++ b/assets/styles/components/_comment.scss @@ -92,6 +92,8 @@ $comment-margin-sm: .3rem; width: 30px; height: 30px; display: inline-block; + text-indent: 100%; + white-space: nowrap; overflow: hidden; } From bbba69af38714d067d2f48d73be1e15b926176b3 Mon Sep 17 00:00:00 2001 From: e-five <146029455+e-five256@users.noreply.github.com> Date: Fri, 20 Oct 2023 07:16:34 -0400 Subject: [PATCH 3/6] add class to user avatar template move display and overflow settings to include all avatars remove hiding of alt text --- assets/styles/components/_comment.scss | 4 ---- assets/styles/components/_user.scss | 7 ++++++- templates/components/user_avatar.html.twig | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/assets/styles/components/_comment.scss b/assets/styles/components/_comment.scss index d48bc7bc9..17c874c90 100644 --- a/assets/styles/components/_comment.scss +++ b/assets/styles/components/_comment.scss @@ -91,10 +91,6 @@ $comment-margin-sm: .3rem; img{ width: 30px; height: 30px; - display: inline-block; - text-indent: 100%; - white-space: nowrap; - overflow: hidden; } @include media-breakpoint-up(sm) { diff --git a/assets/styles/components/_user.scss b/assets/styles/components/_user.scss index e774c05c6..ff63c5e87 100644 --- a/assets/styles/components/_user.scss +++ b/assets/styles/components/_user.scss @@ -41,6 +41,11 @@ } } +.user-avatar { + display: inline-block; + overflow: hidden; +} + .user-inline { img { border-radius: 50%; @@ -316,4 +321,4 @@ td .user__actions { align-items: center; margin-bottom: 1rem; } -} \ No newline at end of file +} diff --git a/templates/components/user_avatar.html.twig b/templates/components/user_avatar.html.twig index 1b25bc76a..c37d1ad62 100644 --- a/templates/components/user_avatar.html.twig +++ b/templates/components/user_avatar.html.twig @@ -4,7 +4,8 @@ href="{{ path('user_overview', {username: user.username}) }}"> {% endif %} {% if user.avatar %} - {{ user.username ~' '~ 'avatar'|trans|lower }} From c741ed6b544fae29f5f9a787cc1536fd5fc20c5b Mon Sep 17 00:00:00 2001 From: e-five <146029455+e-five256@users.noreply.github.com> Date: Fri, 20 Oct 2023 07:35:13 -0400 Subject: [PATCH 4/6] add styling to inline user avatars --- assets/styles/components/_user.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/styles/components/_user.scss b/assets/styles/components/_user.scss index ff63c5e87..00308419d 100644 --- a/assets/styles/components/_user.scss +++ b/assets/styles/components/_user.scss @@ -51,6 +51,8 @@ border-radius: 50%; vertical-align: middle; margin-right: 0.25rem; + display: inline-block; + overflow: hidden; @include media-breakpoint-down(sm) { width: 25px; From 62ac63b218d372abc68c4110cae529dec012bf28 Mon Sep 17 00:00:00 2001 From: e-five <146029455+e-five256@users.noreply.github.com> Date: Fri, 20 Oct 2023 07:43:05 -0400 Subject: [PATCH 5/6] add class to all avatar imgs translate alt text on notifications panel --- assets/styles/components/_user.scss | 2 -- templates/components/user_inline.html.twig | 4 ++-- templates/entry/_info.html.twig | 3 ++- templates/magazine/_moderators_sidebar.html.twig | 3 ++- templates/post/_info.html.twig | 3 ++- templates/user/_info.html.twig | 3 ++- templates/user/_list.html.twig | 3 ++- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/assets/styles/components/_user.scss b/assets/styles/components/_user.scss index 00308419d..ff63c5e87 100644 --- a/assets/styles/components/_user.scss +++ b/assets/styles/components/_user.scss @@ -51,8 +51,6 @@ border-radius: 50%; vertical-align: middle; margin-right: 0.25rem; - display: inline-block; - overflow: hidden; @include media-breakpoint-down(sm) { width: 25px; diff --git a/templates/components/user_inline.html.twig b/templates/components/user_inline.html.twig index 18c87416a..80155372b 100644 --- a/templates/components/user_inline.html.twig +++ b/templates/components/user_inline.html.twig @@ -6,7 +6,7 @@ {% if user.avatar and showAvatar %} {{ user.username ~ ' avatar' }} + alt="{{ user.username ~' '~ 'avatar'|trans|lower }}"> {% endif %} {{ user.apPreferredUsername ?? user.username|username -}} - \ No newline at end of file + diff --git a/templates/entry/_info.html.twig b/templates/entry/_info.html.twig index 32962a797..895034e03 100644 --- a/templates/entry/_info.html.twig +++ b/templates/entry/_info.html.twig @@ -3,7 +3,8 @@
{% if entry.user.avatar %}
- {{ entry.user.username ~' '~ 'avatar'|trans|lower }}
diff --git a/templates/magazine/_moderators_sidebar.html.twig b/templates/magazine/_moderators_sidebar.html.twig index e7c16eb6c..838ec9c12 100644 --- a/templates/magazine/_moderators_sidebar.html.twig +++ b/templates/magazine/_moderators_sidebar.html.twig @@ -4,7 +4,8 @@ {% for moderator in magazine.moderators|slice(0, 5) %}
  • {% if moderator.user.avatar %} - {{ moderator.user.username ~ ' ' ~ 'avatar'|trans|lower }} diff --git a/templates/post/_info.html.twig b/templates/post/_info.html.twig index b4c164682..ce3e8d75f 100644 --- a/templates/post/_info.html.twig +++ b/templates/post/_info.html.twig @@ -3,7 +3,8 @@
    {% if post.user.avatar %}
    - {{ post.user.username ~' '~ 'avatar'|trans|lower }}
    diff --git a/templates/user/_info.html.twig b/templates/user/_info.html.twig index 78084d025..02655bb65 100644 --- a/templates/user/_info.html.twig +++ b/templates/user/_info.html.twig @@ -4,7 +4,8 @@
    {% if user.avatar %}
    - {{ user.username ~' '~ 'avatar'|trans|lower }}
    diff --git a/templates/user/_list.html.twig b/templates/user/_list.html.twig index 922c102f5..73dd011cf 100644 --- a/templates/user/_list.html.twig +++ b/templates/user/_list.html.twig @@ -13,7 +13,8 @@
  • {% if user.avatar %}
    - {{ user.username ~' '~ 'avatar'|trans|lower }}
    From f690d089935443cd37bd4d443800173f082e2465 Mon Sep 17 00:00:00 2001 From: e-five <146029455+e-five256@users.noreply.github.com> Date: Fri, 20 Oct 2023 07:46:46 -0400 Subject: [PATCH 6/6] add class to inline must have overlooked it while fixing translation --- templates/components/user_inline.html.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/components/user_inline.html.twig b/templates/components/user_inline.html.twig index 80155372b..2aab13705 100644 --- a/templates/components/user_inline.html.twig +++ b/templates/components/user_inline.html.twig @@ -4,7 +4,8 @@ class="user-inline" title="{{ user.username|username(true) }}"> {% if user.avatar and showAvatar %} - {{ user.username ~' '~ 'avatar'|trans|lower }} {% endif %}