From 25b8bf6a2e5cdbf921ca8ba4a994f57c1c859844 Mon Sep 17 00:00:00 2001 From: Michael Manfre Date: Wed, 7 Dec 2022 11:12:43 -0500 Subject: Keyboard navigation --- static/css/style.css | 19 +++++++++++++++++++ templates/activities/_like.html | 4 ++-- templates/activities/_mini_post.html | 4 ++-- templates/activities/_post.html | 30 +++++++++++++++--------------- templates/activities/_reply.html | 2 +- templates/activities/local.html | 2 +- templates/base.html | 17 +++++++++-------- 7 files changed, 49 insertions(+), 29 deletions(-) diff --git a/static/css/style.css b/static/css/style.css index 1f9220f..430ab2a 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1149,3 +1149,22 @@ table.metadata td.name { color: var(--color-highlight); transition: 0.2s; } + + +/* Accessibility */ +.screenreader-text { + position: absolute; + left: -999px; + width: 1px; + height: 1px; + top: auto; +} + +.screenreader-text:focus { + color: black; + display: inline-block; + height: auto; + width: auto; + position: static; + margin: auto; +} diff --git a/templates/activities/_like.html b/templates/activities/_like.html index 8eec8cd..07dc01d 100644 --- a/templates/activities/_like.html +++ b/templates/activities/_like.html @@ -1,9 +1,9 @@ {% if post.pk in interactions.like %} - + {% else %} - + {% endif %} diff --git a/templates/activities/_mini_post.html b/templates/activities/_mini_post.html index 80ed213..19fad76 100644 --- a/templates/activities/_mini_post.html +++ b/templates/activities/_mini_post.html @@ -1,8 +1,8 @@ {% load static %} {% load activity_tags %} -
+
- + diff --git a/templates/activities/_post.html b/templates/activities/_post.html index e764747..4e5cb7c 100644 --- a/templates/activities/_post.html +++ b/templates/activities/_post.html @@ -1,22 +1,22 @@ {% load static %} {% load activity_tags %} -
+
- + {% if request.identity %} -
+ {% endif %} - +
diff --git a/templates/activities/_reply.html b/templates/activities/_reply.html index a6cc81a..89cbad7 100644 --- a/templates/activities/_reply.html +++ b/templates/activities/_reply.html @@ -1,4 +1,4 @@ - + diff --git a/templates/activities/local.html b/templates/activities/local.html index b6f246e..c03b0c0 100644 --- a/templates/activities/local.html +++ b/templates/activities/local.html @@ -4,7 +4,7 @@ {% block content %} {% for post in page_obj %} - {% include "activities/_post.html" %} + {% include "activities/_post.html" with feedindex=forloop.counter %} {% empty %} No posts yet. {% endfor %} diff --git a/templates/base.html b/templates/base.html index ac79b24..df8ebdf 100644 --- a/templates/base.html +++ b/templates/base.html @@ -20,7 +20,8 @@ {% block extra_head %}{% endblock %} - + Skip to Content + Skip to Navigation
{% if user.is_authenticated %} - + - + {% if allows_refresh %} - + {% endif %}
- + {% if not request.identity %} No Identity @@ -52,7 +53,7 @@ {% else %}
- Login + Login {% endif %}
@@ -61,11 +62,11 @@ {% block pre_content %} {% endblock %}
-
+
{% block content %} {% endblock %}
-
+
{% block right_content %} {% include "activities/_menu.html" %} {% endblock %} -- cgit v1.2.3