Skip to content

Commit

Permalink
Fix a11y issues.
Browse files Browse the repository at this point in the history
TNL-6440, TNL-6439
  • Loading branch information
cahrens committed Feb 10, 2017
1 parent f57db71 commit 906d704
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 44 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]",
description = ("A wiki system written for the Django framework."),
Expand Down
3 changes: 1 addition & 2 deletions wiki/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}))
84 changes: 43 additions & 41 deletions wiki/templates/wiki/dir.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,60 +22,62 @@
{% trans "Add article" %}
</a>
</div>
<div class="pull-right">
{{ filter_form.query }}
<div class="pull-right input-prepend">
{{ filter_form.query.label_tag }} {{ filter_form.query }}
{% if filter_query %}
<div class="pull-right filter-clear">
<a href="{{ self_url }}">{% trans "clear" %}</a>
</div>
{% endif %}
</div>
{% if filter_query %}
<div class="pull-right filter-clear">
<a href="{{ self_url }}">({% trans "clear" %})</a>
</div>
{% endif %}

<div class="clearfix"></div>
</div>
</form>

<p>
{% 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 <strong><a href="{{ self_url }}">/{{ path }}</a></strong>. There {{ articles_plur_verb }} <strong>{{ cnt }} {{ articles_plur }}</strong> 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 %}
</p>

<table class="table table-striped">
<tr>
<th>{% trans "Title" %}</th>
<th>{% trans "Slug" %}</th>
<th>{% trans "Last modified" %}</th>
</tr>
{% for urlpath in directory %}
<tr>
<td>
<a href="{% url 'wiki:get' path=urlpath.path %}"> {{ urlpath.article.current_revision.title }} </a>
<a href="{% url 'wiki:dir' path=urlpath.path %}" class="list-children"></a>
{% if urlpath.article.current_revision.deleted %}
<span class="icon-trash"></span>
{% endif %}
{% if urlpath.article.current_revision.locked %}
<span class="icon-lock"></span>
{% endif %}
</td>
<td>
{{ urlpath.slug }}
</td>
<td>
{{ urlpath.article.current_revision.created|naturaltime }}
</td>
</tr>
{% empty%}
{% if directory %}
<table class="table table-striped">
<tr>
<td colspan="100">
<em>{% trans "There are no articles in this level" %}</em>
</td>
<th scope="col">{% trans "Title" %}</th>
<th scope="col">{% trans "Slug" %}</th>
<th scope="col">{% trans "Last modified" %}</th>
</tr>
{% endfor %}
</table>
{% for urlpath in directory %}
<tr>
<td>
<a href="{% url 'wiki:get' path=urlpath.path %}"> {{ urlpath.article.current_revision.title }} </a>
<a href="{% url 'wiki:dir' path=urlpath.path %}" class="list-children"></a>
{% if urlpath.article.current_revision.deleted %}
<span class="icon-trash"></span>
{% endif %}
{% if urlpath.article.current_revision.locked %}
<span class="icon-lock"></span>
{% endif %}
</td>
<td>
{{ urlpath.slug }}
</td>
<td>
{{ urlpath.article.current_revision.created|naturaltime }}
</td>
</tr>
{% endfor %}
</table>
{% endif %}

{% include "wiki/includes/pagination.html" %}

Expand Down

0 comments on commit 906d704

Please sign in to comment.