shelve .a11y in favor of aria-label, add admin link on top, fix a bug that makes impressum mandatory

This commit is contained in:
Yusur 2025-07-16 22:14:35 +02:00
parent b821f39bbf
commit 8361890d4a
8 changed files with 37 additions and 36 deletions

View file

@ -39,7 +39,7 @@ class AppConfig(ConfigOptions):
private_assets = ConfigValue(cast=ssv_list) private_assets = ConfigValue(cast=ssv_list)
jquery_url = ConfigValue(default='https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js') jquery_url = ConfigValue(default='https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js')
app_is_behind_proxy = ConfigValue(cast=bool, default=False) app_is_behind_proxy = ConfigValue(cast=bool, default=False)
impressum = ConfigValue(cast=twocolon_list, default=None) impressum = ConfigValue(cast=twocolon_list, default='')
app_config = AppConfig() app_config = AppConfig()

View file

@ -171,12 +171,6 @@ body
padding: 12px padding: 12px
max-width: 960px max-width: 960px
.a11y
overflow: hidden
width: 0
height: 0
display: inline-block
.centered .centered
text-align: center text-align: center
font-size: 110% font-size: 110%

View file

@ -387,3 +387,7 @@ textarea.create_text
form.boundaryless & form.boundaryless &
min-height: 8em min-height: 8em
\:is(input, select, textarea).fullwidth
width: 100%
padding: 0

View file

@ -10,9 +10,9 @@
<link rel="stylesheet" href="{{ private_style }}" /> <link rel="stylesheet" href="{{ private_style }}" />
{% endfor %} {% endfor %}
</head> </head>
<body class="admin"> <body class="admin {{ theme_classes(current_user.color_theme) }}">
<header class="header"> <header class="header">
<h1><a href="{{ url_for('admin.homepage') }}"><span class="faint">{{ app_name }}:</span> Admin</a></h1> <h1><span class="faint">{{ app_name }}:</span> <a href="{{ url_for('admin.homepage') }}">Admin</a></h1>
</header> </header>
<div class="content"> <div class="content">
{% for message in get_flashed_messages() %} {% for message in get_flashed_messages() %}

View file

@ -38,8 +38,8 @@
<input type="search" name="q" placeholder="Search among {{ post_count }} posts…"> <input type="search" name="q" placeholder="Search among {{ post_count }} posts…">
<input type="submit" value="Search"> <input type="submit" value="Search">
</form> </form>
<a href="/search"> <a href="/search" aria-label="Search" title="Search">
<i class="icon icon-search"></i><span class="a11y">search</span> {{ icon('search') }}
</a> </a>
</li> </li>
{% endif %} {% endif %}
@ -47,26 +47,32 @@
<!-- no user --> <!-- no user -->
{% elif current_user.is_authenticated %} {% elif current_user.is_authenticated %}
<li class="nomobile"> <li class="nomobile">
<a class="round border-accent" href="/create" title="Create a post"> <a class="round border-accent" href="/create" title="Create a post" aria-label="Create a post">
<i class="icon icon-add"></i> {{ icon('add') }}
<span class="a11y">create</span>
<span>New post</span> <span>New post</span>
</a> </a>
</li> </li>
<li><a href="{{ current_user.url() }}" title="{{ current_user.handle() }}'s profile">{{ icon('profile')}}<span class="a11y">profile</span></a> {% if current_user.is_administrator %}
<li class="nomobile">
<a href="/admin" title="Admin Tools" aria-label="Admin Tools">
{{ icon('mod') }}
</a>
</li>
{% endif %}
<li><a href="{{ current_user.url() }}" title="{{ current_user.handle() }}'s profile" aria-label="User profile">{{ icon('profile') }}</a>
<div class="header-username"> <div class="header-username">
<strong class="header-username-name">{{ current_user.handle() }}</strong> <strong class="header-username-name">{{ current_user.handle() }}</strong>
<span class="header-username-karma">{{ icon('karma') }} {{ current_user.karma }} karma</span> <span class="header-username-karma">{{ icon('karma') }} {{ current_user.karma }} karma</span>
</div></li> </div></li>
<li><a href="/logout" title="Log out"> <li><a href="/logout" title="Log out" aria-label="Log out">
{{ icon('logout') }} <span class="a11y">log out</span> {{ icon('logout') }}
</a></li> </a></li>
{% else %} {% else %}
<li><a href="/login" title="Log in"> <li><a href="/login" title="Log in" aria-label="Log in">
{{ icon('logout') }}<span class="a11y">log in</span> {{ icon('logout') }}
</a></li> </a></li>
<li><a href="/register" title="Register"> <li><a href="/register" title="Create account" aria-label="Create account">
{{ icon('join') }}<span class="a11y">register</span> {{ icon('join') }}
</a></li> </a></li>
{% endif %} {% endif %}
</ul> </ul>

View file

@ -16,11 +16,10 @@
<p>Posting as <strong>{{ current_user.handle() }}</strong></p> <p>Posting as <strong>{{ current_user.handle() }}</strong></p>
<p>Post to: <input type="text" name="to" placeholder="{{ current_user.handle() }}"></p> <p>Post to: <input type="text" name="to" placeholder="{{ current_user.handle() }}"></p>
<div> <div>
<span class="a11y">Title:</span><input type="text" name="title" placeholder="An interesting title" maxlength="256"> <input type="text" name="title" placeholder="An interesting title" maxlength="256" class="fullwidth" />
</div> </div>
<div> <div>
<span class="a11y">Text:</span> <textarea name="text" placeholder="What's happening?" class="create_text fullwidth">{{ request.args['preload'] }}</textarea>
<textarea name="text" placeholder="What's happening?" class="create_text">{{ request.args['preload'] }}</textarea>
</div> </div>
{#<dd id="fileInputContainer"><a href="javascript:attachFileInput();">Add a file...</a>#} {#<dd id="fileInputContainer"><a href="javascript:attachFileInput();">Add a file...</a>#}
<div>{{ privacy_select() }}</div> <div>{{ privacy_select() }}</div>

View file

@ -14,8 +14,7 @@
<form action="{{ url_for('edit.edit_post', id=p.id) }}" method="POST" enctype="multipart/form-data" class="boundaryless"> <form action="{{ url_for('edit.edit_post', id=p.id) }}" method="POST" enctype="multipart/form-data" class="boundaryless">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div> <div>
<span class="a11y">Text:</span> <textarea name="text" placeholder="What's happening?" class="create_text fullwidth">{{ p.text_content }}</textarea></dd>
<textarea name="text" placeholder="What's happening?" class="create_text">{{ p.text_content }}</textarea></dd>
</div> </div>
<div>{{ privacy_select(p.privacy) }}</div> <div>{{ privacy_select(p.privacy) }}</div>
<div> <div>

View file

@ -26,22 +26,22 @@
{% macro feed_upvote(postid, count, uservote=0) %} {% macro feed_upvote(postid, count, uservote=0) %}
<div class="upvote-button" data-endpoint="{{ postid|to_b32l }}"> <div class="upvote-button" data-endpoint="{{ postid|to_b32l }}">
{% if uservote > 0 %} {% if uservote > 0 %}
<a href="javascript:void 0" class="upvote-button-up active"> <a href="javascript:void 0" class="upvote-button-up active" aria-label="upvoted">
<i class="icon icon-upvote_fill"></i><span class="a11y">upvoted</span> {{ icon('upvote', True) }}
</a> </a>
{% else %} {% else %}
<a href="javascript:void 0" class="upvote-button-up"> <a href="javascript:void 0" class="upvote-button-up" aria-label="upvote">
<i class="icon icon-upvote"></i><span class="a11y">upvote</span> {{ icon('upvote') }}
</a> </a>
{% endif %} {% endif %}
<strong class="upvote-count">{{ count }}</strong> <strong class="upvote-count">{{ count }}</strong>
{% if uservote < 0 %} {% if uservote < 0 %}
<a href="javascript:void 0" class="upvote-button-down active"> <a href="javascript:void 0" class="upvote-button-down active" aria-label="downvoted">
<i class="icon icon-downvote_fill"></i><span class="a11y">downvoted</span> {{ icon('downvote', True) }}
</a> </a>
{% else %} {% else %}
<a href="javascript:void 0" class="upvote-button-down"> <a href="javascript:void 0" class="upvote-button-down" aria-label="downvote">
<i class="icon icon-downvote"></i><span class="a11y">downvote</span> {{ icon('downvote') }}
</a> </a>
{% endif %} {% endif %}
</div> </div>
@ -86,9 +86,8 @@
{% macro comment_count(c) %} {% macro comment_count(c) %}
<div class="comment-count"> <div class="comment-count">
<a><i class="icon icon-comment"></i></a> <a aria-label="Comments">{{ icon('comment') }}</a>
<strong>{{ c }}</strong> <strong>{{ c }}</strong>
<span class="a11y">comments</span>
</div> </div>
{% endmacro %} {% endmacro %}