Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ARIA attributes to essential elements #232

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion legal_db/templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h1 class="hero-title-big">404</h1>
<h2 class="b-header">{% trans "Page Not Found!" %}</h2>
<p class="margin-vertical-normal">{% trans "The page you are looking for doesn't exist." %}</p>
<a href="{% url 'home' %}" class="button">{% trans "Return Home" %}</a>
<a href="{% url 'home' %}" class="button" role="button">{% trans "Return Home" %}</a>
</div>
</main>
{% endblock %}
6 changes: 3 additions & 3 deletions legal_db/templates/legal_db/case/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load i18n %}

{% block body_content %}
<section class="hero case">
<section class="hero case" aria-label="{{ case.name}}">
<div class="container">
{% include "legal_db/partials/_breadcrumb.html" %}
<h2 class="hero-title b-header">{{ case.name }}</h2>
Expand All @@ -11,7 +11,7 @@ <h2 class="hero-title b-header">{{ case.name }}</h2>
<section class="details">
<div class="container">
<div class="columns">
<aside class="column is-one-third">
<aside class="column is-one-third" aria-label="{% trans 'Case Details' %}">
<div class="margin-bottom-bigger">
<h4 class="b-header margin-bottom-small">{% trans "Country" %}</h4>
<p>{{ case.country.name }}</p>
Expand Down Expand Up @@ -45,7 +45,7 @@ <h4 class="b-header margin-bottom-small">{% trans "Relevant materials" %}</h4>
</ul>
</div>
</aside>
<article class="column is-two-thirds">
<article class="column is-two-thirds" aria-label="{% trans 'Case Information' %}">
<h3 class="b-header margin-bottom-small">{% trans "Background information" %}</h3>
<p>{{ case.background }}</p>
<br/>
Expand Down
8 changes: 4 additions & 4 deletions legal_db/templates/legal_db/case/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ <h1 class="hero-title title is-2">{% trans "Case Submission" %}</h1>
<section class="columns submit is-centered">
<div class="column is-9">
<div class="container">
<form class="form case" action="{% url 'case_submit' %}" method="post">
<form class="form case" action="{% url 'case_submit' %}" method="post" aria-label="Case Submission Form">
{% csrf_token %}
{% if case_form.non_field_errors %}
<div class="notification warning">
<div class="notification warning" role="alert">
<strong class="notification-container">{{ case_form.non_field_errors }}</strong>
</div>
{% endif %}
Expand Down Expand Up @@ -147,7 +147,7 @@ <h4 class="b-header">{% trans "Links to relevant materials" %}</h4>
Please include any links to pleadings, briefs, and opinions in the lawsuit, as well as blog posts, academic articles, or other relevant materials. At least one URL is required.
{% endblocktrans %}
</p>
<div id="link-formset">
<div id="link-formset" aria-live="polite">
{{ link_formset.management_form }}
{% for link_form in link_formset %}
<div id="link-form-{{ forloop.counter0 }}">
Expand All @@ -167,7 +167,7 @@ <h4 class="b-header">{% trans "Links to relevant materials" %}</h4>
{{ link_form.url.errors }}
</div>
<div class="column is-1">
<button type="button" class="button is-delete" onclick="deleteLinkForm('link-form-{{ forloop.counter0 }}')">
<button type="button" class="button is-delete" onclick="deleteLinkForm('link-form-{{ forloop.counter0 }}')" aria-label="Delete this link form">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put the string in translation tags:

aria-label="{% trans 'Delete this link form' %}"

<i class="icon cross"></i>
</button>
</div>
Expand Down
4 changes: 3 additions & 1 deletion legal_db/templates/legal_db/case/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ <h2 class="card-title">{% trans "Contribute" %}</h2>
<div id="tags" aria-expanded="true">
{% for tag in tags %}
<label for="tag-check-{{ forloop.counter }}" id="tag-label-{{ forloop.counter }}"
class="button tag case margin-right-small margin-vertical-smaller{% if tag.checked %} selected{% endif %}">
class="button tag case margin-right-small margin-vertical-smaller{% if tag.checked %} selected{% endif %}"
role="checkbox" aria-checked="{% if tag.checked %}true{% else %}false{% endif %}"
>
{{ tag.name }}
<input type="checkbox" class="tag__check" name="tags[]"
id="tag-check-{{ forloop.counter }}"
Expand Down
2 changes: 1 addition & 1 deletion legal_db/templates/legal_db/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1 class="hero-title title is-2">{% trans "Frequently Asked Questions" %}</h1>
</div>
<div>
{% for faq in faqs %}
<article class="faq__content">
<article class="faq__content" aria-label="Frequently Asked Questions">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put the string in trans tags:

aria-label="{% trans 'Frequently Asked Questions' %}"

<div id="faq-head-{{ forloop.counter }}" class="faq__head" aria-expanded="false">
<h5 class="faq__title">{{ faq.question }}</h5>
</div>
Expand Down
6 changes: 3 additions & 3 deletions legal_db/templates/legal_db/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h3 class="subtitle is-4 padding-bottom-big">{% trans "Cases" %}</h3>
</div>
<div class="column is-half">
<article class="card entry-post link no-border">
<a href="{% url 'case_index' %}" class="has-background-tomato">
<a href="{% url 'case_index' %}" class="has-background-tomato" aria-label="{% trans 'Go to Caselaw Database' %}">
<span class="card-content has-bottom-link">
<h3 class="b-header has-text-white">{% trans "Caselaw Database" %}</h3>
<span class="content">{% trans "The Case Law Database includes court decisions from around the globe concerning Creative Commons." %}</span>
Expand All @@ -50,7 +50,7 @@ <h3 class="subtitle is-4 padding-bottom-big">{% trans "Scholarship" %}</h3>
</div>
<div class="column is-half">
<article class="card entry-post link no-border">
<a href="{% url 'scholarship_index' %}" class="has-background-forest-green">
<a href="{% url 'scholarship_index' %}" class="has-background-forest-green" aria-label="{% trans 'Navigate to Legal Scholarship Database' %}">
<span class="card-content has-bottom-link">
<h3 class="b-header has-text-white">{% trans "Legal Scholarship Database" %}</h3>
<span class="content">{% trans "The Scholarship Database aims to provide users with resources concerning the use, interpretation, and enforceability of Creative Commons licenses." %}</span>
Expand All @@ -77,7 +77,7 @@ <h2 class="title is-3">{% trans "Contribute" %}</h2>
</div>
<div class="column is-half">
<article class="card entry-post link">
<a href="{% url 'faq' %}">
<a href="{% url 'faq' %}" aria-label="{% trans 'Navigate to Frequently Asked Questions' %}">
{% blocktrans trimmed %}
<span class="card-eyebrow">Check the</span>
<h2 class="card-title">Frequently asked questions</h2>
Expand Down
12 changes: 6 additions & 6 deletions legal_db/templates/legal_db/partials/_breadcrumb.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{% load i18n %}
{% with current_path=request.resolver_match.url_name %}
<nav class="breadcrumb caption bold" aria-label="breadcrumbs">
<nav class="breadcrumb caption bold" aria-label="{% trans 'breadcrumbs' %}">
<ul>
<li><a href="{% url 'home' %}">{% trans "Home" %}</a></li>

{% if current_path == 'case_index' %}
<li class="is-active"><a>{% trans "Cases" %}</a></li>
<li class="is-active" aria-current="page"><a>{% trans "Cases" %}</a></li>

{% elif current_path == 'case_detail' %}
<li><a href="{% url 'case_index' %}">{% trans "Cases" %}</a></li>
<li class="is-active"><a>{% trans "Case Detail" %}</a></li>
<li class="is-active" aria-current="page"><a>{% trans "Case Detail" %}</a></li>

{% elif current_path == 'scholarship_index' %}
<li class="is-active"><a>{% trans "Scholarship" %}</a></li>
<li class="is-active" aria-current="page"><a>{% trans "Scholarship" %}</a></li>

{% elif current_path == 'scholarship_detail' %}
<li><a href="{% url 'scholarship_index' %}">{% trans "Scholarship" %}</a></li>
<li class="is-active"><a>{% trans "Scholarship Detail" %}</a></li>
<li class="is-active" aria-current="page"><a>{% trans "Scholarship Detail" %}</a></li>

{% elif current_path == 'faq' %}
<li class="is-active"><a>{% trans "FAQ" %}</a></li>
<li class="is-active" aria-current="page"><a>{% trans "FAQ" %}</a></li>

{% endif %}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion legal_db/templates/legal_db/partials/_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<form action="{% url 'set_language' %}" method="post">
{% csrf_token %}
<div class="select">
<select name="language" onchange="this.form.submit()">
<select name="language" onchange="this.form.submit()" aria-label="{% trans 'Select language' %}">
<option disabled>{% trans 'Languages available' %}</option>
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as languages %}
Expand Down
3 changes: 2 additions & 1 deletion legal_db/templates/legal_db/partials/_search.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% load i18n widget_tweaks %}

<section class="columns is-gapless is-vcentered margin-top-big margin-bottom-small">
<section class="columns is-gapless is-vcentered margin-top-big margin-bottom-small" aria-label="{% trans 'Search and Filters' %}">
<div class="column is-8">
<div role="search" method="get" class="field has-addons" aria-label="{% trans 'Search form' %}">
<div class="field has-addons">
<div class="control has-icons-left search-input">
<label for="{{ form.keywords.id_for_label }}" class="is-sr-only">{% trans "Search:" %} </label>
Expand Down
4 changes: 2 additions & 2 deletions legal_db/templates/legal_db/scholarship/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load i18n %}

{% block body_content %}
<div class="hero scholarship">
<div class="hero scholarship" role="banner" aria-label="{% trans'Hero title' %}">
<div class="container">
{% include "legal_db/partials/_breadcrumb.html" %}
<h2 class="hero-title b-header">{{ scholarship.title }}</h2>
Expand All @@ -11,7 +11,7 @@ <h2 class="hero-title b-header">{{ scholarship.title }}</h2>
<div class="details">
<div class="container">
<div class="columns">
<aside class="column is-one-third">
<aside class="column is-one-third" aria-label="{% trans 'Scholarship detials' %}">
<div class="margin-bottom-bigger">
<h4 class="b-header margin-bottom-small">{% trans "License on article" %}</h4>
{% if not scholarship.license %} <p class="has-text-grey">{% trans "Unknown" %}</p>
Expand Down
2 changes: 1 addition & 1 deletion legal_db/templates/legal_db/scholarship/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1 class="hero-title title is-2">{% trans "Scholarship Submission" %}</h1>
<form class="form scholarship" action="{% url 'scholarship_submit' %}" method="post">
{% csrf_token %}
{% if scho_form.non_field_errors %}
<div class="notification warning">
<div class="notification warning" role="alert" aria-live="assertive">
<strong class="notification-container">{{ scho_form.non_field_errors }}</strong>
</div>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ def main():
except Exception:
print("ERROR (1) Unhandled exception:", file=sys.stderr)
print(traceback.print_exc(), file=sys.stderr)
sys.exit(1)
sys.exit(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please restore the newline at end of file