From 906d704c871edcf1602c06a2ce6ec53df9d9121e Mon Sep 17 00:00:00 2001 From: cahrens Date: Tue, 7 Feb 2017 11:24:19 -0500 Subject: [PATCH] Fix a11y issues. TNL-6440, TNL-6439 --- setup.py | 2 +- wiki/forms.py | 3 +- wiki/templates/wiki/dir.html | 84 ++++++++++++++++++------------------ 3 files changed, 45 insertions(+), 44 deletions(-) diff --git a/setup.py b/setup.py index 5e362a2fa..9c84b6c5b 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ def build_media_pattern(base_folder, file_extension): setup( name = "django-wiki", - version = "0.0.9", + version = "0.0.10", author = "Benjamin Bach", author_email = "benjamin@overtag.dk", description = ("A wiki system written for the Django framework."), diff --git a/wiki/forms.py b/wiki/forms.py index 6782e18fd..3f6b8c1c6 100644 --- a/wiki/forms.py +++ b/wiki/forms.py @@ -362,5 +362,4 @@ class Meta: class DirFilterForm(forms.Form): - query = forms.CharField(widget=forms.TextInput(attrs={'placeholder': _(u'Filter...'), - 'class': 'search-query'})) + query = forms.CharField(label=_(u'Filter'), widget=forms.TextInput(attrs={'class': 'search-query'})) diff --git a/wiki/templates/wiki/dir.html b/wiki/templates/wiki/dir.html index 3ef7aff8f..0d8b4ebed 100644 --- a/wiki/templates/wiki/dir.html +++ b/wiki/templates/wiki/dir.html @@ -22,14 +22,14 @@ {% trans "Add article" %} -
- {{ filter_form.query }} +
+ {{ filter_form.query.label_tag }} {{ filter_form.query }} + {% if filter_query %} + + {% endif %}
- {% if filter_query %} - - {% endif %}
@@ -37,45 +37,47 @@

{% with paginator.object_list.count as cnt %} - {% blocktrans with urlpath.path as path and cnt|pluralize:_("article,articles") as articles_plur and cnt|pluralize:_("is,are") as articles_plur_verb %} - Browsing /{{ path }}. There {{ articles_plur_verb }} {{ cnt }} {{ articles_plur }} in this level. - {% endblocktrans %} + {% if filter_query %} + {% blocktrans with cnt|pluralize:_("article,articles") as articles_plur and cnt|pluralize:_("matches,match") as match_plur %} + {{ cnt }} {{ articles_plur }} in this level {{ match_plur }} your search. + {% endblocktrans %} + {% else %} + {% blocktrans with cnt|pluralize:_("article,articles") as articles_plur and cnt|pluralize:_("is,are") as articles_plur_verb %} + There {{ articles_plur_verb }} {{ cnt }} {{ articles_plur }} in this level. + {% endblocktrans %} + {% endif %} {% endwith %}

- - - - - - - {% for urlpath in directory %} - - - - - - {% empty%} +{% if directory %} +
{% trans "Title" %}{% trans "Slug" %}{% trans "Last modified" %}
- {{ urlpath.article.current_revision.title }} - - {% if urlpath.article.current_revision.deleted %} - - {% endif %} - {% if urlpath.article.current_revision.locked %} - - {% endif %} - - {{ urlpath.slug }} - - {{ urlpath.article.current_revision.created|naturaltime }} -
- + + + - {% endfor %} -
- {% trans "There are no articles in this level" %} - {% trans "Title" %}{% trans "Slug" %}{% trans "Last modified" %}
+ {% for urlpath in directory %} + + + {{ urlpath.article.current_revision.title }} + + {% if urlpath.article.current_revision.deleted %} + + {% endif %} + {% if urlpath.article.current_revision.locked %} + + {% endif %} + + + {{ urlpath.slug }} + + + {{ urlpath.article.current_revision.created|naturaltime }} + + + {% endfor %} + +{% endif %} {% include "wiki/includes/pagination.html" %}