wcag - various

This commit is contained in:
rimu 2024-01-23 19:17:05 +13:00
parent bc63e773e1
commit 23637b713a
33 changed files with 74 additions and 74 deletions

View file

@ -401,7 +401,7 @@ function setupKeyboardShortcuts() {
didSomething = true; didSomething = true;
} }
} else if (event.key === 'Enter') { } else if (event.key === 'Enter') {
if(currentPost) { if(currentPost && document.activeElement.tagName !== 'a') {
currentPost.querySelector('.post_teaser_title_a').click(); currentPost.querySelector('.post_teaser_title_a').click();
didSomething = true; didSomething = true;
} }

View file

@ -401,7 +401,7 @@ body {
font-size: 0.95rem; font-size: 0.95rem;
} }
nav.navbar { div.navbar {
border-bottom: 1px solid rgba(0, 40, 100, 0.12); border-bottom: 1px solid rgba(0, 40, 100, 0.12);
min-height: 60px; min-height: 60px;
} }
@ -570,7 +570,7 @@ nav.navbar {
} }
.domain_link { .domain_link {
color: #bbb; color: #777;
font-size: 73%; font-size: 73%;
} }
.domain_link a { .domain_link a {

View file

@ -8,7 +8,7 @@ body {
font-size: 0.95rem; font-size: 0.95rem;
} }
nav.navbar { div.navbar {
border-bottom: 1px solid rgba(0, 40, 100, 0.12); border-bottom: 1px solid rgba(0, 40, 100, 0.12);
min-height: 60px; min-height: 60px;
} }
@ -181,10 +181,10 @@ nav.navbar {
} }
.domain_link { .domain_link {
color: $grey; color: #777;
font-size: 73%; font-size: 73%;
a { a {
color: $dark-grey; color: #777;
} }
} }

View file

@ -38,7 +38,7 @@
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
<nav aria-label="Pagination" class="mt-4"> <nav aria-label="Pagination" class="mt-4" role="navigation">
{% if prev_url %} {% if prev_url %}
<a href="{{ prev_url }}" class="btn btn-primary" rel="nofollow"> <a href="{{ prev_url }}" class="btn btn-primary" rel="nofollow">
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }} <span aria-hidden="true">&larr;</span> {{ _('Previous page') }}

View file

@ -41,7 +41,7 @@
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
<nav aria-label="Pagination" class="mt-4"> <nav aria-label="Pagination" class="mt-4" role="navigation">
{% if prev_url %} {% if prev_url %}
<a href="{{ prev_url }}" class="btn btn-primary"> <a href="{{ prev_url }}" class="btn btn-primary">
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }} <span aria-hidden="true">&larr;</span> {{ _('Previous page') }}

View file

@ -46,7 +46,7 @@
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
<nav aria-label="Pagination" class="mt-4"> <nav aria-label="Pagination" class="mt-4" role="navigation">
{% if prev_url %} {% if prev_url %}
<a href="{{ prev_url }}" class="btn btn-primary"> <a href="{{ prev_url }}" class="btn btn-primary">
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }} <span aria-hidden="true">&larr;</span> {{ _('Previous page') }}

View file

@ -51,7 +51,7 @@
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
<nav aria-label="Pagination" class="mt-4"> <nav aria-label="Pagination" class="mt-4" role="navigation">
{% if prev_url %} {% if prev_url %}
<a href="{{ prev_url }}" class="btn btn-primary"> <a href="{{ prev_url }}" class="btn btn-primary">
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }} <span aria-hidden="true">&larr;</span> {{ _('Previous page') }}

View file

@ -91,11 +91,11 @@
{% endblock %} {% endblock %}
</head> </head>
<body class="d-flex flex-column{{ ' low_bandwidth' if low_bandwidth }}"> <body class="d-flex flex-column{{ ' low_bandwidth' if low_bandwidth }}">
<a href="#outer_container" class="skip-link" role="navigation" aria-label="Skip main navigation">Skip to main content</a> <a href="#outer_container" class="skip-link" role="navigation" aria-label="Skip main navigation" tabindex="">Skip to main content</a>
<!-- Page content --> <!-- Page content -->
{% block navbar %} {% block navbar %}
<nav class="navbar navbar-expand-lg"> <div class="navbar navbar-expand-lg">
<div class="{{ 'container-lg' if post_layout != 'masonry_wide' else 'container-fluid' }}"> <div class="{{ 'container-lg' if post_layout != 'masonry_wide' else 'container-fluid' }}" role="banner">
<a class="navbar-brand" href="/">{% if not low_bandwidth %}<img src="/static/images/logo2.png" alt="Logo" width="50" height="50" />{% endif %}{{ g.site.name }}</a> <a class="navbar-brand" href="/">{% if not low_bandwidth %}<img src="/static/images/logo2.png" alt="Logo" width="50" height="50" />{% endif %}{{ g.site.name }}</a>
{% if current_user.is_authenticated %} {% if current_user.is_authenticated %}
<a class="nav-link d-lg-none" href="/notifications" aria-label="{{ _('Notifications') }}"> <a class="nav-link d-lg-none" href="/notifications" aria-label="{{ _('Notifications') }}">
@ -115,14 +115,14 @@
<ul class="nav navbar-nav ml-md-4"> <ul class="nav navbar-nav ml-md-4">
{% if current_user.is_anonymous %} {% if current_user.is_anonymous %}
<li class="nav-item dropdown{% if active_parent == 'home' %} active{% endif %}"> <li class="nav-item dropdown{% if active_parent == 'home' %} active{% endif %}">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/home" role="button" aria-haspopup="true" aria-expanded="false">{{ _('Home') }}</a> <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/home" aria-haspopup="true" aria-expanded="false">{{ _('Home') }}</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a class="dropdown-item{% if active_child == 'popular' %} active{% endif %}" href="/home"><span class="fe fe-home"></span>{{ _('Home') }}</a></li> <li><a class="dropdown-item{% if active_child == 'popular' %} active{% endif %}" href="/home"><span class="fe fe-home"></span>{{ _('Home') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'popular' %} active{% endif %}" href="/popular"><span class="fe fe-popular"></span>{{ _('Popular') }}</a></li> <li><a class="dropdown-item{% if active_child == 'popular' %} active{% endif %}" href="/popular"><span class="fe fe-popular"></span>{{ _('Popular') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'all_posts' %} active{% endif %}" href="/all"><span class="fe fe-all"></span>{{ _('All posts') }}</a></li> <li><a class="dropdown-item{% if active_child == 'all_posts' %} active{% endif %}" href="/all"><span class="fe fe-all"></span>{{ _('All posts') }}</a></li>
</ul> </ul>
<li class="nav-item dropdown{% if active_parent == 'communities' %} active{% endif %}"> <li class="nav-item dropdown{% if active_parent == 'communities' %} active{% endif %}">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/communities" role="button" aria-haspopup="true" aria-expanded="false">{{ _('Communities') }}</a> <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/communities" aria-haspopup="true" aria-expanded="false">{{ _('Communities') }}</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a class="dropdown-item{% if active_child == 'list_communities' %} active{% endif %}" href="/communities">{{ _('Browse all') }}</a></li> <li><a class="dropdown-item{% if active_child == 'list_communities' %} active{% endif %}" href="/communities">{{ _('Browse all') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'list_topics' %} active{% endif %}" href="/topics">{{ _('By topic') }}</a></li> <li><a class="dropdown-item{% if active_child == 'list_topics' %} active{% endif %}" href="/topics">{{ _('By topic') }}</a></li>
@ -133,14 +133,14 @@
<li class="nav-item"><a class="nav-link" href="/donate">{{ _('Donate') }}</a></li> <li class="nav-item"><a class="nav-link" href="/donate">{{ _('Donate') }}</a></li>
{% else %} {% else %}
<li class="nav-item dropdown{% if active_parent == 'home' %} active{% endif %}"> <li class="nav-item dropdown{% if active_parent == 'home' %} active{% endif %}">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/home" role="button" aria-haspopup="true" aria-expanded="false">{{ _('Home') }}</a> <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/home" aria-haspopup="true" aria-expanded="false">{{ _('Home') }}</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a class="dropdown-item{% if active_child == 'popular' %} active{% endif %}" href="/home"><span class="fe fe-home"></span>{{ _('Home') }}</a></li> <li><a class="dropdown-item{% if active_child == 'popular' %} active{% endif %}" href="/home"><span class="fe fe-home"></span>{{ _('Home') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'popular' %} active{% endif %}" href="/popular"><span class="fe fe-popular"></span>{{ _('Popular') }}</a></li> <li><a class="dropdown-item{% if active_child == 'popular' %} active{% endif %}" href="/popular"><span class="fe fe-popular"></span>{{ _('Popular') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'all_posts' %} active{% endif %}" href="/all"><span class="fe fe-all"></span>{{ _('All posts') }}</a></li> <li><a class="dropdown-item{% if active_child == 'all_posts' %} active{% endif %}" href="/all"><span class="fe fe-all"></span>{{ _('All posts') }}</a></li>
</ul> </ul>
<li class="nav-item dropdown{% if active_parent == 'communities' %} active{% endif %}"> <li class="nav-item dropdown{% if active_parent == 'communities' %} active{% endif %}">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/communities" role="button" aria-haspopup="true" aria-expanded="false">{{ _('Communities') }}</a> <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/communities" aria-haspopup="true" aria-expanded="false">{{ _('Communities') }}</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a class="dropdown-item{% if active_child == 'list_communities' %} active{% endif %}" href="/communities">{{ _('Browse all') }}</a></li> <li><a class="dropdown-item{% if active_child == 'list_communities' %} active{% endif %}" href="/communities">{{ _('Browse all') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'list_topics' %} active{% endif %}" href="/topics">{{ _('By topic') }}</a></li> <li><a class="dropdown-item{% if active_child == 'list_topics' %} active{% endif %}" href="/topics">{{ _('By topic') }}</a></li>
@ -159,7 +159,7 @@
</ul> </ul>
</li> </li>
<li class="nav-item dropdown{% if active_parent == 'account' %} active{% endif %}"> <li class="nav-item dropdown{% if active_parent == 'account' %} active{% endif %}">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/u/{{ current_user.user_name }}" role="button" aria-haspopup="true" aria-expanded="false">{{ _('Account') }}</a> <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/u/{{ current_user.user_name }}" aria-haspopup="true" aria-expanded="false">{{ _('Account') }}</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a class="dropdown-item{% if active_child == 'view_profile' %} active{% endif %}" href="/u/{{ current_user.user_name }}">{{ _('View profile') }}</a></li> <li><a class="dropdown-item{% if active_child == 'view_profile' %} active{% endif %}" href="/u/{{ current_user.user_name }}">{{ _('View profile') }}</a></li>
<li><a class="dropdown-item{% if active_child == 'edit_profile' %} active{% endif %}" href="/u/{{ current_user.user_name }}/profile">{{ _('Edit profile') }}</a></li> <li><a class="dropdown-item{% if active_child == 'edit_profile' %} active{% endif %}" href="/u/{{ current_user.user_name }}/profile">{{ _('Edit profile') }}</a></li>
@ -182,17 +182,17 @@
</a> </a>
</li> </li>
{% endif %} {% endif %}
<li class="nav-item"><a class="nav-link" id="light_mode" aria-label="{{ _('Light mode') }}"><span class="fe fe-sun" title="{{ _('Light mode') }}"></span></a></li> <li class="nav-item" aria-label="{{ _('Light mode') }}"><a class="nav-link" id="light_mode" href="#" tabindex=""><span class="fe fe-sun" title="{{ _('Light mode') }}"></span></a></li>
<li class="nav-item"><a class="nav-link" id="dark_mode" aria-label="{{ _('Dark mode') }}"><span class="fe fe-moon" title="{{ _('Dark mode') }}"></span></a></li> <li class="nav-item" aria-label="{{ _('Dark mode') }}"><a class="nav-link" id="dark_mode" href="#" tabindex=""><span class="fe fe-moon" title="{{ _('Dark mode') }}"></span></a></li>
</ul> </ul>
</div> </div>
</div> </div>
</nav> </div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div id="outer_container" class="{{ 'container-lg' if post_layout != 'masonry_wide' else 'container-fluid' }} flex-shrink-0"> <div id="outer_container" class="{{ 'container-lg' if post_layout != 'masonry_wide' else 'container-fluid' }} flex-shrink-0" role="main">
{% with messages = get_flashed_messages(with_categories=True) %} {% with messages = get_flashed_messages(with_categories=True) %}
{% if messages %} {% if messages %}
{% for category, message in messages %} {% for category, message in messages %}
@ -204,7 +204,7 @@
{# application content needs to be provided in the app_content block #} {# application content needs to be provided in the app_content block #}
{% block app_content %}{% endblock %} {% block app_content %}{% endblock %}
</div> </div>
<footer class="footer mt-auto"> <footer class="footer mt-auto" role="contentinfo">
<p id="timeSpent" class="text-center mt-4" title="This is how long you have spent using PieFed during this month. We hope this use of your time aligns with your priorities and values."></p> <p id="timeSpent" class="text-center mt-4" title="This is how long you have spent using PieFed during this month. We hope this use of your time aligns with your priorities and values."></p>
{% if not low_bandwidth %} {% if not low_bandwidth %}
<p class="text-center mt-4"><a href="https://liberapay.com/PieFed/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p> <p class="text-center mt-4"><a href="https://liberapay.com/PieFed/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>

View file

@ -7,7 +7,7 @@
<div class="card mt-5"> <div class="card mt-5">
<div class="card-body p-6"> <div class="card-body p-6">
<div class="card-title">{{ _('Create community') }}</div> <div class="card-title">{{ _('Create community') }}</div>
<form method="post" enctype="multipart/form-data" id="add_local_community_form"> <form method="post" enctype="multipart/form-data" id="add_local_community_form" role="form">
{{ form.csrf_token() }} {{ form.csrf_token() }}
{{ render_field(form.community_name) }} {{ render_field(form.community_name) }}
<div class="form-group">{{ form.url.label(class_="form-control-label required") }} <div class="form-group">{{ form.url.label(class_="form-control-label required") }}

View file

@ -5,7 +5,7 @@
<div class="row"> <div class="row">
<div class="col-12 col-md-8 position-relative main_pane"> <div class="col-12 col-md-8 position-relative main_pane">
<h1>{{ _('Create post') }}</h1> <h1>{{ _('Create post') }}</h1>
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data" role="form">
{{ form.csrf_token() }} {{ form.csrf_token() }}
{{ render_field(form.communities) }} {{ render_field(form.communities) }}
<nav id="post_type_chooser"> <nav id="post_type_chooser">
@ -95,7 +95,7 @@
</form> </form>
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<div class="card mt-3"> <div class="card mt-3">
<div class="card-header"> <div class="card-header">
<h2>{{ community.title }}</h2> <h2>{{ community.title }}</h2>

View file

@ -17,7 +17,7 @@
</ol> </ol>
</nav> </nav>
</div> </div>
<img class="community_icon_big bump_up rounded-circle" src="{{ community.icon_image() }}" /> <img class="community_icon_big bump_up rounded-circle" src="{{ community.icon_image() }}" alt="Community icon" />
<h1 class="mt-2">{{ community.title }} <h1 class="mt-2">{{ community.title }}
{% if current_user.is_authenticated %} {% if current_user.is_authenticated %}
{% include 'community/_notification_toggle.html' %} {% include 'community/_notification_toggle.html' %}
@ -36,7 +36,7 @@
</ol> </ol>
</nav> </nav>
<div class="col-2"> <div class="col-2">
<img class="community_icon_big rounded-circle" src="{{ community.icon_image() }}" /> <img class="community_icon_big rounded-circle" src="{{ community.icon_image() }}" alt="Community icon" />
</div> </div>
<div class="col-10"> <div class="col-10">
<h1 class="mt-3">{{ community.title }} <h1 class="mt-3">{{ community.title }}
@ -82,7 +82,7 @@
</div> </div>
{% endif %} {% endif %}
<nav aria-label="Pagination" class="mt-4"> <nav aria-label="Pagination" class="mt-4" role="navigation">
{% if prev_url %} {% if prev_url %}
<a href="{{ prev_url }}" class="btn btn-primary" rel='nofollow'> <a href="{{ prev_url }}" class="btn btn-primary" rel='nofollow'>
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }} <span aria-hidden="true">&larr;</span> {{ _('Previous page') }}
@ -96,7 +96,7 @@
</nav> </nav>
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
@ -152,7 +152,7 @@
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
{% for community in related_communities %} {% for community in related_communities %}
<li class="list-group-item"> <li class="list-group-item">
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" /> <a href="/c/{{ community.link() }}" aria-label="{{ _('Go to community') }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" alt="" />
{{ community.display_name() }} {{ community.display_name() }}
</a> </a>
</li> </li>

View file

@ -21,7 +21,7 @@
</div> </div>
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
</div> </div>
</div> </div>

View file

@ -22,7 +22,7 @@
</div> </div>
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
</div> </div>
</div> </div>

View file

@ -16,7 +16,7 @@
<p>Liberapay is preferred as it has lower fees.</p> <p>Liberapay is preferred as it has lower fees.</p>
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<div class="card mt-3"> <div class="card mt-3">
<div class="card-header"> <div class="card-header">
<h2>{{ _('About %(site_name)s', site_name=g.site.name) }}</h2> <h2>{{ _('About %(site_name)s', site_name=g.site.name) }}</h2>

View file

@ -14,7 +14,7 @@
{% endfor %} {% endfor %}
</div> </div>
<nav aria-label="Pagination" class="mt-4"> <nav aria-label="Pagination" class="mt-4" role="navigation">
{% if prev_url %} {% if prev_url %}
<a href="{{ prev_url }}" class="btn btn-primary" rel="nofollow"> <a href="{{ prev_url }}" class="btn btn-primary" rel="nofollow">
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }} <span aria-hidden="true">&larr;</span> {{ _('Previous page') }}
@ -28,7 +28,7 @@
</nav> </nav>
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<!-- <div class="card"> <!-- <div class="card">
<div class="card-body"> <div class="card-body">
<form method="get"> <form method="get">
@ -45,7 +45,7 @@
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
{% for community in active_communities %} {% for community in active_communities %}
<li class="list-group-item"> <li class="list-group-item">
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" /> <a href="/c/{{ community.link() }}"><img src="{{ community.icon_image() }}" class="community_icon rounded-circle" loading="lazy" alt="" />
{{ community.display_name() }} {{ community.display_name() }}
</a> </a>
</li> </li>

View file

@ -53,7 +53,7 @@
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<div class="card mt-3"> <div class="card mt-3">
<div class="card-header"> <div class="card-header">
<h2>{{ _('About %(site_name)s', site_name=g.site.name) }}</h2> <h2>{{ _('About %(site_name)s', site_name=g.site.name) }}</h2>

View file

@ -17,7 +17,7 @@
{% if topics %} {% if topics %}
<span class="mt-1 pl-4"> <span class="mt-1 pl-4">
<form method="get">Topic: <form method="get">Topic:
<select name="topic_id" class="form-control-sm submit_on_change"> <select name="topic_id" class="form-control-sm submit_on_change" aria-label="{{ _('Choose a topic to filter communities by') }}">
<option value="0">All</option> <option value="0">All</option>
{% for topic in topics %} {% for topic in topics %}
<option value="{{ topic.id }}" {{ 'selected' if topic.id == topic_id }}>{{ topic.name }}</option> <option value="{{ topic.id }}" {{ 'selected' if topic.id == topic_id }}>{{ topic.name }}</option>
@ -44,23 +44,23 @@
<table class="communities_table table table-striped table-hover w-100"> <table class="communities_table table table-striped table-hover w-100">
<thead> <thead>
<tr> <tr>
<th scope="col"> </th> <th> </th>
<th scope="col" {% if not low_bandwidth %}colspan="2"{% endif %}> <th {% if not low_bandwidth %}colspan="2"{% endif %}>
<a href="?sort_by=title{{ ' desc' if sort_by.text == 'community.title' }}" title="{{ _('Sort by name') }}" class="no-underline" rel="nofollow">{{ _('Community') }} <a href="?sort_by=title{{ ' desc' if sort_by.text == 'community.title' }}" title="{{ _('Sort by name') }}" class="no-underline" rel="nofollow">{{ _('Community') }}
<span class="{{ 'fe fe-chevron-up' if sort_by.text == 'community.title' }}{{ 'fe fe-chevron-down' if sort_by.text == 'community.title desc' }}"></span> <span class="{{ 'fe fe-chevron-up' if sort_by.text == 'community.title' }}{{ 'fe fe-chevron-down' if sort_by.text == 'community.title desc' }}"></span>
</a> </a>
</th> </th>
<th scope="col"> <th>
<a href="?sort_by=post_count{{ ' desc' if sort_by.text == 'community.post_count' }}" title="{{ _('Sort by post count') }}" class="no-underline" rel="nofollow">{{ _('Posts') }} <a href="?sort_by=post_count{{ ' desc' if sort_by.text == 'community.post_count' }}" title="{{ _('Sort by post count') }}" class="no-underline" rel="nofollow">{{ _('Posts') }}
<span class="{{ 'fe fe-chevron-up' if sort_by.text == 'community.post_count' }}{{ 'fe fe-chevron-down' if sort_by.text == 'community.post_count desc' }}"></span> <span class="{{ 'fe fe-chevron-up' if sort_by.text == 'community.post_count' }}{{ 'fe fe-chevron-down' if sort_by.text == 'community.post_count desc' }}"></span>
</a> </a>
</th> </th>
<th scope="col"> <th>
<a href="?sort_by=post_reply_count{{ ' desc' if sort_by.text == 'community.post_reply_count' }}" title="{{ _('Sort by reply count') }}" class="no-underline" rel="nofollow">{{ _('Comments') }} <a href="?sort_by=post_reply_count{{ ' desc' if sort_by.text == 'community.post_reply_count' }}" title="{{ _('Sort by reply count') }}" class="no-underline" rel="nofollow">{{ _('Comments') }}
<span class="{{ 'fe fe-chevron-up' if sort_by.text == 'community.post_reply_count' }}{{ 'fe fe-chevron-down' if sort_by.text == 'community.post_reply_count desc' }}"></span> <span class="{{ 'fe fe-chevron-up' if sort_by.text == 'community.post_reply_count' }}{{ 'fe fe-chevron-down' if sort_by.text == 'community.post_reply_count desc' }}"></span>
</a> </a>
</th> </th>
<th scope="col"> <th>
<a href="?sort_by=last_active{{ ' desc' if sort_by.text == 'community.last_active' }}" title="{{ _('Sort by recent activity') }}" class="no-underline" rel="nofollow">{{ _('Active') }} <a href="?sort_by=last_active{{ ' desc' if sort_by.text == 'community.last_active' }}" title="{{ _('Sort by recent activity') }}" class="no-underline" rel="nofollow">{{ _('Active') }}
<span class="{{ 'fe fe-chevron-up' if sort_by.text == 'community.last_active' }}{{ 'fe fe-chevron-down' if sort_by.text == 'community.last_active desc' }}"></span> <span class="{{ 'fe fe-chevron-up' if sort_by.text == 'community.last_active' }}{{ 'fe fe-chevron-down' if sort_by.text == 'community.last_active desc' }}"></span>
</a> </a>
@ -83,10 +83,10 @@
{% endif %}</td> {% endif %}</td>
{% if not low_bandwidth %} {% if not low_bandwidth %}
<td width="46"> <td width="46">
<a href="/c/{{ community.link() }}"><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" /></a> <a href="/c/{{ community.link() }}" aria-label="{{ _('View community') }}"><img src="{{ community.icon_image('tiny') }}" class="community_icon rounded-circle" loading="lazy" alt="" /></a>
</td> </td>
{% endif %} {% endif %}
<td scope="row" class="pl-0"><a href="/c/{{ community.link() }}">{{ community.display_name() }}</a></td> <td class="pl-0"><a href="/c/{{ community.link() }}" aria-label="{{ _('View community') }}">{{ community.display_name() }}</a></td>
<td>{{ community.post_count }}</td> <td>{{ community.post_count }}</td>
<td>{{ community.post_reply_count }}</td> <td>{{ community.post_reply_count }}</td>
<td>{{ moment(community.last_active).fromNow(refresh=True) }}</td> <td>{{ moment(community.last_active).fromNow(refresh=True) }}</td>

View file

@ -19,11 +19,11 @@
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" height="50" loading="lazy" /></a> alt="{{ post.image.alt_text if post.image.alt_text else '' }}" height="50" loading="lazy" /></a>
{% elif post.type == POST_TYPE_IMAGE %} {% elif post.type == POST_TYPE_IMAGE %}
{% if post.image_id %} {% if post.image_id %}
<a href="{{ post.image.view_url() }}" rel="nofollow ugc" target="_blank"><img src="{{ post.image.thumbnail_url() }}" <a href="{{ post.image.view_url() }}" rel="nofollow ugc" aria-label="{{ _('View image') }}" target="_blank"><img src="{{ post.image.thumbnail_url() }}"
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" height="50" loading="lazy" /></a> alt="{{ post.image.alt_text if post.image.alt_text else '' }}" height="50" loading="lazy" /></a>
{% endif %} {% endif %}
{% else %} {% else %}
<a href="{{ url_for('activitypub.post_ap', post_id=post.id) }}"><img src="{{ post.image.thumbnail_url() }}" <a href="{{ url_for('activitypub.post_ap', post_id=post.id) }}" aria-label="{{ _('Read post') }}"><img src="{{ post.image.thumbnail_url() }}"
alt="{{ post.image.alt_text if post.image.alt_text else '' }}" height="50" loading="lazy" /></a> alt="{{ post.image.alt_text if post.image.alt_text else '' }}" height="50" loading="lazy" /></a>
{% endif %} {% endif %}
</div> </div>
@ -34,16 +34,16 @@
{% if post.url and 'youtube.com' in post.url %} {% if post.url and 'youtube.com' in post.url %}
<span class="fe fe-video"></span> <span class="fe fe-video"></span>
{% endif %} {% endif %}
<a href="{{ post.url }}" rel="nofollow ugc" target="_blank" class="post_link"> <a href="{{ post.url }}" rel="nofollow ugc" target="_blank" class="post_link" aria-label="{{ _('Read article') }}">
<img src="/static/images/external_link_black.svg" class="external_link_icon" alt="External link" /> <img src="/static/images/external_link_black.svg" class="external_link_icon" alt="External link" />
</a> </a>
<span class="domain_link">(<a href="/d/{{ post.domain_id }}">{{ post.domain.name }}</a>)</span> <span class="domain_link">(<a href="/d/{{ post.domain_id }}" aria-label="{{ _('All posts about this domain') }}">{{ post.domain.name }}</a>)</span>
{% endif %} {% endif %}
{% if post.reports and current_user.is_authenticated and post.community.is_moderator(current_user) %} {% if post.reports and current_user.is_authenticated and post.community.is_moderator(current_user) %}
<span class="red fe fe-report" title="{{ _('Reported. Check post for issues.') }}"></span> <span class="red fe fe-report" title="{{ _('Reported. Check post for issues.') }}"></span>
{% endif %} {% endif %}
</h3> </h3>
<span class="small">{% if show_post_community %}<strong><a href="/c/{{ post.community.link() }}">c/{{ post.community.name }}</a></strong>{% endif %} <span class="small">{% if show_post_community %}<strong><a href="/c/{{ post.community.link() }}" aria-label="{{ _('Go to community') }}">c/{{ post.community.name }}</a></strong>{% endif %}
by {{ render_username(post.author) }} {{ moment(post.last_active if sort == 'active' else post.posted_at).fromNow() }}</span> by {{ render_username(post.author) }} {{ moment(post.last_active if sort == 'active' else post.posted_at).fromNow() }}</span>
</div> </div>
@ -51,8 +51,8 @@
</div> </div>
<div class="row utilities_row"> <div class="row utilities_row">
<div class="col-6"> <div class="col-6">
<a href="{{ url_for('activitypub.post_ap', post_id=post.id, sort='new' if sort == 'active' else None, _anchor='post_replies') }}" aria-label="{{ _('View comments') }}"><span class="fe fe-reply"></span></a> <a href="{{ url_for('activitypub.post_ap', post_id=post.id, sort='new' if sort == 'active' else None, _anchor='post_replies') }}" aria-label="{{ _('View comments') }}"><span class="fe fe-reply"></span></a>
<a href="{{ url_for('activitypub.post_ap', post_id=post.id, sort='new' if sort == 'active' else None, _anchor='post_replies') }}">{{ post.reply_count }}</a> <a href="{{ url_for('activitypub.post_ap', post_id=post.id, sort='new' if sort == 'active' else None, _anchor='post_replies') }}" aria-label="{{ _('View comments') }}">{{ post.reply_count }}</a>
{% if post.type == POST_TYPE_IMAGE %} {% if post.type == POST_TYPE_IMAGE %}
{% if post.image_id %} {% if post.image_id %}
<a href="{{ post.image.view_url() }}" rel="nofollow ugc" class="preview_image" aria-label="{{ _('View image') }}"><span class="fe fe-magnify"></span></a> <a href="{{ post.image.view_url() }}" rel="nofollow ugc" class="preview_image" aria-label="{{ _('View image') }}"><span class="fe fe-magnify"></span></a>

View file

@ -31,7 +31,7 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">

View file

@ -83,7 +83,7 @@
</div> </div>
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">

View file

@ -150,7 +150,7 @@
{% endif %} {% endif %}
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">

View file

@ -37,7 +37,7 @@
<div class="row"> <div class="row">
<div class="col-12 col-md-8 position-relative main_pane"> <div class="col-12 col-md-8 position-relative main_pane">
<h1>{{ _('Edit post') }}</h1> <h1>{{ _('Edit post') }}</h1>
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data" role="form">
{{ form.csrf_token() }} {{ form.csrf_token() }}
{{ render_field(form.communities) }} {{ render_field(form.communities) }}
<nav id="post_type_chooser"> <nav id="post_type_chooser">
@ -116,7 +116,7 @@
</form> </form>
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<div class="card mt-3"> <div class="card mt-3">
<div class="card-header"> <div class="card-header">
<h2>{{ post.community.title }}</h2> <h2>{{ post.community.title }}</h2>

View file

@ -31,7 +31,7 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">

View file

@ -71,7 +71,7 @@
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
</div> </div>
</div> </div>

View file

@ -12,7 +12,7 @@
</ol> </ol>
</nav> </nav>
<h1 class="mt-2">{{ _('Delete %(username)s', username=user.link()) }}</h1> <h1 class="mt-2">{{ _('Delete %(username)s', username=user.link()) }}</h1>
<form method='post'> <form method='post' role="form">
<p class="btn-warning">{{ _('You are about to permanently delete the account with the username "<strong>%(username)s</strong>." This means your profile will disappear, pictures will be deleted. Text-based posts will stay but look like they are from someone named "deleted."', username=user.user_name) }}</p> <p class="btn-warning">{{ _('You are about to permanently delete the account with the username "<strong>%(username)s</strong>." This means your profile will disappear, pictures will be deleted. Text-based posts will stay but look like they are from someone named "deleted."', username=user.user_name) }}</p>
<p>{{ _('Once you hit delete, nobody can use "%(username)s" as a username again. We are doing this so nobody pretends to be you.', username=user.user_name) }}</p> <p>{{ _('Once you hit delete, nobody can use "%(username)s" as a username again. We are doing this so nobody pretends to be you.', username=user.user_name) }}</p>
<p>{{ _("We will tell other websites (fediverse instances) that your account is gone. But it's up to them to decide what to do with any copies they have of your stuff. Some websites work differently than ours.") }}</p> <p>{{ _("We will tell other websites (fediverse instances) that your account is gone. But it's up to them to decide what to do with any copies they have of your stuff. Some websites work differently than ours.") }}</p>

View file

@ -23,7 +23,7 @@
{% else %} {% else %}
<h1 class="mt-2">{{ _('Add filter') }}</h1> <h1 class="mt-2">{{ _('Add filter') }}</h1>
{% endif %} {% endif %}
<form method='post'> <form method='post' role="form">
{{ form.csrf_token() }} {{ form.csrf_token() }}
{{ render_field(form.title) }} {{ render_field(form.title) }}
<h4>{{ _('Filter in these places') }}</h4> <h4>{{ _('Filter in these places') }}</h4>

View file

@ -12,7 +12,7 @@
</ol> </ol>
</nav> </nav>
<h1 class="mt-2">{{ _('Edit profile of %(name)s', name=user.user_name) }}</h1> <h1 class="mt-2">{{ _('Edit profile of %(name)s', name=user.user_name) }}</h1>
<form method='post' enctype="multipart/form-data"> <form method='post' enctype="multipart/form-data" role="form">
{{ form.csrf_token() }} {{ form.csrf_token() }}
{{ render_field(form.title) }} {{ render_field(form.title) }}
{{ render_field(form.email) }} {{ render_field(form.email) }}

View file

@ -12,7 +12,7 @@
</ol> </ol>
</nav> </nav>
<h1 class="mt-2">{{ _('Change settings') }}</h1> <h1 class="mt-2">{{ _('Change settings') }}</h1>
<form method='post' enctype="multipart/form-data"> <form method='post' enctype="multipart/form-data" role="form">
{{ form.csrf_token() }} {{ form.csrf_token() }}
{{ render_field(form.newsletter) }} {{ render_field(form.newsletter) }}
{{ render_field(form.ignore_bots) }} {{ render_field(form.ignore_bots) }}

View file

@ -18,7 +18,7 @@
<h1 class="mt-2">{{ _('Filters') }}</h1> <h1 class="mt-2">{{ _('Filters') }}</h1>
<p>{{ _('Filters can hide posts that contain keywords you specify, either by making them less noticeable or invisible.') }}</p> <p>{{ _('Filters can hide posts that contain keywords you specify, either by making them less noticeable or invisible.') }}</p>
{% if filters %} {% if filters %}
<table class="table table-striped"> <table class="table table-striped" role="table">
<tr> <tr>
<th>{{ _('Name') }}</th> <th>{{ _('Name') }}</th>
<th>{{ _('Keywords') }}</th> <th>{{ _('Keywords') }}</th>

View file

@ -38,7 +38,7 @@
{% endif %} {% endif %}
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<div class="card mt-3"> <div class="card mt-3">
<div class="card-header"> <div class="card-header">

View file

@ -29,7 +29,7 @@
{% endif %} {% endif %}
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
<div class="card mt-3"> <div class="card mt-3">
<div class="card-header"> <div class="card-header">

View file

@ -14,12 +14,12 @@
</ol> </ol>
</nav> </nav>
</div> </div>
<img class="community_icon_big bump_up rounded-circle" src="{{ user.avatar_image() }}" /> <img class="community_icon_big bump_up rounded-circle" src="{{ user.avatar_image() }}" alt="{{ _('Profile pic') }}" />
<h1 class="mt-2">{{ user.display_name() if user.is_local() else user.display_name() + ', ' + user.ap_id }}</h1> <h1 class="mt-2">{{ user.display_name() if user.is_local() else user.display_name() + ', ' + user.ap_id }}</h1>
{% elif user.avatar_image() != '' %} {% elif user.avatar_image() != '' %}
<div class="row"> <div class="row">
<div class="col-2"> <div class="col-2">
<img class="community_icon_big rounded-circle" src="{{ user.avatar_image() }}" /> <img class="community_icon_big rounded-circle" src="{{ user.avatar_image() }}" alt="{{ _('Profile pic') }}" />
</div> </div>
<div class="col-10"> <div class="col-10">
<h1 class="mt-3">{{ user.display_name() if user.is_local() else user.display_name() + ', ' + user.ap_id }}</h1> <h1 class="mt-3">{{ user.display_name() if user.is_local() else user.display_name() + ', ' + user.ap_id }}</h1>
@ -38,7 +38,7 @@
{% if current_user.is_authenticated %} {% if current_user.is_authenticated %}
<div class="profile_action_buttons"> <div class="profile_action_buttons">
{% if user.matrix_user_id %} {% if user.matrix_user_id %}
<a class="btn btn-primary" href="https://matrix.to/#/{{ user.matrix_user_id }}" rel="nofollow">{{ _('Send message') }}</a> <a class="btn btn-primary" href="https://matrix.to/#/{{ user.matrix_user_id }}" rel="nofollow" aria-label="{{ _('Send message with matrix chat') }}">{{ _('Send message') }}</a>
{% endif %} {% endif %}
{% if current_user.id != user.id %} {% if current_user.id != user.id %}
{% if current_user.has_blocked_user(user.id) %} {% if current_user.has_blocked_user(user.id) %}
@ -60,7 +60,7 @@
{% include 'post/_post_teaser.html' %} {% include 'post/_post_teaser.html' %}
{% endfor %} {% endfor %}
</div> </div>
<nav aria-label="Pagination" class="mt-4"> <nav aria-label="{{ _('Post pagination') }}" class="mt-4" role="navigation">
{% if post_prev_url %} {% if post_prev_url %}
<a href="{{ post_prev_url }}" class="btn btn-primary"> <a href="{{ post_prev_url }}" class="btn btn-primary">
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }} <span aria-hidden="true">&larr;</span> {{ _('Previous page') }}
@ -83,7 +83,7 @@
{% include 'post/_post_reply_teaser.html' %} {% include 'post/_post_reply_teaser.html' %}
{% endfor %} {% endfor %}
</div> </div>
<nav aria-label="Pagination" class="mt-4"> <nav aria-label="{{ _('Comment pagination') }}" class="mt-4" role="navigation">
{% if replies_prev_url %} {% if replies_prev_url %}
<a href="{{ replies_prev_url }}#comments" class="btn btn-primary"> <a href="{{ replies_prev_url }}#comments" class="btn btn-primary">
<span aria-hidden="true">&larr;</span> {{ _('Previous page') }} <span aria-hidden="true">&larr;</span> {{ _('Previous page') }}
@ -100,7 +100,7 @@
{% endif %} {% endif %}
</div> </div>
<div class="col-12 col-md-4 side_pane"> <div class="col-12 col-md-4 side_pane" role="complementary">
{% if current_user.is_authenticated and current_user.id == user.id %} {% if current_user.is_authenticated and current_user.id == user.id %}
<div class="card mt-3"> <div class="card mt-3">
<div class="card-header"> <div class="card-header">

View file

@ -26,7 +26,7 @@ import os
def show_people(): def show_people():
people = User.query.filter_by(ap_id=None, deleted=False, banned=False).all() people = User.query.filter_by(ap_id=None, deleted=False, banned=False).all()
return render_template('user/people.html', people=people, moderating_communities=moderating_communities(current_user.get_id()), return render_template('user/people.html', people=people, moderating_communities=moderating_communities(current_user.get_id()),
joined_communities=joined_communities(current_user.get_id())) joined_communities=joined_communities(current_user.get_id()), title=_('People'))
def show_profile(user): def show_profile(user):