fixes issues in #16850 (#16986)

* fixes issues in #16850: issue 3 and 5

* Add link text for 'clear' button on table column

* Translate aria label

---------

Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
Andrew Gormley 2024-08-01 01:18:33 +01:00 committed by GitHub
parent 455a73f92d
commit 40fe303f00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -173,6 +173,7 @@ class ToggleColumn(tables.CheckBoxColumn):
kwargs['attrs'] = { kwargs['attrs'] = {
'th': { 'th': {
'class': 'w-1', 'class': 'w-1',
'aria-label': _('Select all'),
}, },
'td': { 'td': {
'class': 'w-1', 'class': 'w-1',

View File

@ -1,4 +1,5 @@
{% load django_tables2 %} {% load django_tables2 %}
{% load i18n %}
<table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %} hx-disinherit="hx-target hx-select" hx-swap="outerHTML"> <table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %} hx-disinherit="hx-target hx-select" hx-swap="outerHTML">
{% if table.show_header %} {% if table.show_header %}
<thead <thead
@ -14,6 +15,7 @@
<a href="#" <a href="#"
hx-get="{{ table.htmx_url }}{% querystring table.prefixed_order_by_field='' %}" hx-get="{{ table.htmx_url }}{% querystring table.prefixed_order_by_field='' %}"
class="text-danger" class="text-danger"
title="{% trans "Clear ordering" %}"
><i class="mdi mdi-close"></i></a> ><i class="mdi mdi-close"></i></a>
</div> </div>
{% endif %} {% endif %}