Add time elements for accessibility
This commit is contained in:
parent
87c12f47e9
commit
b4c7f88b3d
3 changed files with 12 additions and 4 deletions
|
@ -41,7 +41,9 @@
|
|||
{% if snap.file %}<a href="{{ snap.file.url }}">{{ "attachment"|remix }}</a>{% endif %}
|
||||
</td>
|
||||
<th class="date" scope="row">
|
||||
<a href="{{ snap.get_absolute_url }}">{{ snap.date|date:"Y-m-d" }}</a>
|
||||
<a href="{{ snap.get_absolute_url }}">
|
||||
<time datetime="{{ snap.date|date:"Y-m-d" }}">{{ snap.date|date:"Y-m-d" }}</time>
|
||||
</a>
|
||||
</th>
|
||||
{% if not account %}
|
||||
<td class="r">{{ snap.account.icon|remix }}</td>
|
||||
|
|
|
@ -43,7 +43,9 @@
|
|||
<td class="c">
|
||||
{% for invoice in trans.invoices %}<a href="{{ invoice.file.url }}">{{ "attachment"|remix }}</a>{% endfor %}
|
||||
</td>
|
||||
<td class="date">{{ trans.date|date:"Y-m-d" }}</td>
|
||||
<td class="date">
|
||||
<time datetime="{{ trans.date|date:"Y-m-d" }}">{{ trans.date|date:"Y-m-d" }}</time>
|
||||
</td>
|
||||
<th scope="row" class="l">
|
||||
<a href="{{ trans.get_absolute_url }}">{{ trans.name }}</a>
|
||||
</th>
|
||||
|
|
|
@ -18,7 +18,8 @@ def month_url(context, month, cls="", fmt="Y-m"):
|
|||
|
||||
url = reverse(url_name, kwargs=url_params)
|
||||
return mark_safe(
|
||||
f"""<a class="{cls}" href="{url}">{date(month, fmt).capitalize()}</a>"""
|
||||
f"""<a class="{cls}" href="{url}"><time datetime="{date(month, "Y-m")}">"""
|
||||
f"""{date(month, fmt).capitalize()}</time></a>"""
|
||||
)
|
||||
|
||||
|
||||
|
@ -29,4 +30,7 @@ def year_url(context, year, cls=""):
|
|||
url_name, url_params = ac_url("transaction_year", {"year": year}, context)
|
||||
|
||||
url = reverse(url_name, kwargs=url_params)
|
||||
return mark_safe(f"""<a class="{cls}" href="{url}">{ year }</a>""")
|
||||
return mark_safe(
|
||||
f"""<a class="{cls}" href="{url}">"""
|
||||
f"""<time datetime="{year}">{year}</time></a>"""
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue