From 35be62896679cc2e8101d8ec822f66a823c05423 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Wed, 24 Jan 2024 09:23:44 +1300 Subject: [PATCH] wcag tweaks --- app/static/structure.css | 18 ++++++++++++++ app/static/structure.scss | 22 +++++++++++++++++ app/templates/base.html | 4 ++-- app/templates/post/_post_teaser.html | 35 +++++++++++++++++----------- 4 files changed, 63 insertions(+), 16 deletions(-) diff --git a/app/static/structure.css b/app/static/structure.css index 92ad1d61..b2ef4131 100644 --- a/app/static/structure.css +++ b/app/static/structure.css @@ -571,6 +571,17 @@ fieldset legend { float: right; padding-left: 0; padding-right: 0; + position: relative; +} +.post_list .post_teaser .thumbnail .fe { + display: block; + position: absolute; + right: 0; + background-color: rgba(255, 255, 255, 0.7); + padding-bottom: 1px; + padding-left: 1px; + border-radius: 2px; + top: 0; } .post_list .post_teaser .thumbnail img { height: 60px; @@ -585,6 +596,13 @@ fieldset legend { width: 133px; } } +.post_list .post_teaser .thumbnail.lbw .fe { + background: none; +} +.post_list .post_teaser .thumbnail.lbw .fe::before { + font-size: 28px; + padding-right: 7px; +} .post_list .post_teaser.blocked { opacity: 0.2; font-size: 80%; diff --git a/app/static/structure.scss b/app/static/structure.scss index 067abbf7..4c03400d 100644 --- a/app/static/structure.scss +++ b/app/static/structure.scss @@ -189,6 +189,18 @@ nav, etc which are used site-wide */ float: right; padding-left: 0; padding-right: 0; + position: relative; + + .fe { + display: block; + position: absolute; + right: 0; + background-color: rgba(256,256,256, 0.7); + padding-bottom: 1px; + padding-left: 1px; + border-radius: 2px; + top: 0; + } img { height: 60px; @@ -202,6 +214,16 @@ nav, etc which are used site-wide */ } } + + &.lbw { + .fe { + background: none; + } + .fe::before { + font-size: 28px; + padding-right: 7px; + } + } } &.blocked { opacity: 0.2; diff --git a/app/templates/base.html b/app/templates/base.html index b3509b3e..fa17c800 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -182,8 +182,8 @@ {% endif %} - - + + diff --git a/app/templates/post/_post_teaser.html b/app/templates/post/_post_teaser.html index d4c3e3bb..56793d26 100644 --- a/app/templates/post/_post_teaser.html +++ b/app/templates/post/_post_teaser.html @@ -12,19 +12,29 @@
{% include "post/_post_voting_buttons.html" %}
- {% if post.image_id and not low_bandwidth %} -
- {% if post.type == POST_TYPE_LINK %} - {{ post.image.alt_text if post.image.alt_text else '' }} - {% elif post.type == POST_TYPE_IMAGE %} - {% if post.image_id %} - {{ post.image.alt_text if post.image.alt_text else '' }} + {% if post.image_id %} +
+ {% if low_bandwidth %} + {% if post.type == POST_TYPE_LINK %} + + {% elif post.type == POST_TYPE_IMAGE %} + + {% else %} + {% endif %} {% else %} - {{ post.image.alt_text if post.image.alt_text else '' }} + {% if post.type == POST_TYPE_LINK %} + {{ post.image.alt_text if post.image.alt_text else '' }} + {% elif post.type == POST_TYPE_IMAGE %} + {% if post.image_id %} + {{ post.image.alt_text if post.image.alt_text else '' }} + {% endif %} + {% else %} + {{ post.image.alt_text if post.image.alt_text else '' }} + {% endif %} {% endif %}
{% endif %} @@ -34,9 +44,6 @@ {% if post.url and 'youtube.com' in post.url %} {% endif %} - - External link - ({{ post.domain.name }}) {% endif %} {% if post.reports and current_user.is_authenticated and post.community.is_moderator(current_user) %}