Add aria-label to icons with title attributes

This commit is contained in:
Michael Vickers 2020-10-02 21:48:19 +01:00 committed by Frédéric Guillot
parent de56529291
commit eafd82f564
11 changed files with 37 additions and 31 deletions

View File

@ -3,8 +3,8 @@
<th class="board-swimlane-header" colspan="<?= $swimlane['nb_columns'] ?>">
<?php if (! $not_editable): ?>
<a href="#" class="board-swimlane-toggle" data-swimlane-id="<?= $swimlane['id'] ?>">
<i class="fa fa-chevron-circle-up hide-icon-swimlane-<?= $swimlane['id'] ?>" title="<?= t('Collapse swimlane') ?>"></i>
<i class="fa fa-chevron-circle-down show-icon-swimlane-<?= $swimlane['id'] ?>" title="<?= t('Expand swimlane') ?>" style="display: none"></i>
<i class="fa fa-chevron-circle-up hide-icon-swimlane-<?= $swimlane['id'] ?>" title="<?= t('Collapse swimlane') ?>" role="button" aria-label="<?= t('Collapse swimlane') ?>"></i>
<i class="fa fa-chevron-circle-down show-icon-swimlane-<?= $swimlane['id'] ?>" title="<?= t('Expand swimlane') ?>" role="button" aria-label="<?= t('Expand swimlane') ?>" style="display: none"></i>
</a>
<?php endif ?>

View File

@ -31,7 +31,7 @@
data-task-limit="<?= $column['task_limit'] ?>">
<div class="board-rotation-wrapper">
<div class="board-column-title board-rotation board-toggle-column-view" data-column-id="<?= $column['id'] ?>" title="<?= t('Show this column') ?>">
<i class="fa fa-plus-square" title="<?= $this->text->e($column['title']) ?>"></i> <?= $this->text->e($column['title']) ?>
<i class="fa fa-plus-square" title="<?= $this->text->e($column['title']) ?>" role="button" aria-label="<?= t('Show this column') ?>"></i> <?= $this->text->e($column['title']) ?>
</div>
</div>
</div>

View File

@ -42,13 +42,13 @@
<div class="task-board-icons-row">
<?php if ($task['is_milestone'] == 1): ?>
<span title="<?= t('Milestone') ?>">
<i class="fa fa-flag flag-milestone"></i>
<i class="fa fa-flag flag-milestone" role="img" aria-label="<?= t('Milestone') ?>"></i>
</span>
<?php endif ?>
<?php if ($task['score']): ?>
<span class="task-score" title="<?= t('Complexity') ?>">
<i class="fa fa-trophy"></i>
<i class="fa fa-trophy" role="img" aria-label="<?= t('Complexity') ?>"></i>
<?= $this->text->e($task['score']) ?>
</span>
<?php endif ?>
@ -104,7 +104,8 @@
<?php if ($task['nb_comments'] > 0): ?>
<?php if ($not_editable): ?>
<span title="<?= $task['nb_comments'] == 1 ? t('%d comment', $task['nb_comments']) : t('%d comments', $task['nb_comments']) ?>"><i class="fa fa-comments-o"></i>&nbsp;<?= $task['nb_comments'] ?></span>
<?php $aria_label = $task['nb_comments'] == 1 ? t('%d comment', $task['nb_comments']) : t('%d comments', $task['nb_comments']); ?>
<span title="<?= $aria_label ?>" role="img" aria-label="<?= $aria_label ?>"><i class="fa fa-comments-o"></i>&nbsp;<?= $task['nb_comments'] ?></span>
<?php else: ?>
<?= $this->modal->medium(
'comments-o',

View File

@ -26,7 +26,7 @@
<?php foreach ($columns as $column): ?>
<tr data-column-id="<?= $column['id'] ?>">
<td>
<i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>"></i>&nbsp;
<i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>" role="button" aria-label="<?= t('Change column position') ?>"></i>&nbsp;
<div class="dropdown">
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog"></i><i class="fa fa-caret-down"></i></a>
<ul>

View File

@ -35,7 +35,7 @@
</span>
<?php if ($project['is_private']): ?>
<i class="fa fa-lock fa-fw" title="<?= t('Personal project') ?>"></i>
<i class="fa fa-lock fa-fw" title="<?= t('Personal project') ?>" role="img" aria-label="<?= t('Personal project') ?>"></i>
<?php endif ?>
<?= $this->hook->render('template:dashboard:project:after-title', array('project' => $project)) ?>

View File

@ -2,11 +2,11 @@
&nbsp;
<?php if ($project['is_public']): ?>
<i class="fa fa-share-alt fa-fw" title="<?= t('Shared project') ?>"></i>
<i class="fa fa-share-alt fa-fw" title="<?= t('Shared project') ?>" role="img" aria-label="<?= t('Shared project') ?>"></i>
<?php endif ?>
<?php if ($project['is_private']): ?>
<i class="fa fa-lock fa-fw" title="<?= t('Personal project') ?>"></i>
<i class="fa fa-lock fa-fw" title="<?= t('Personal project') ?>" role="img" aria-label="<?= t('Personal project') ?>"></i>
<?php endif ?>
<?php if ($this->user->hasAccess('ProjectUserOverviewController', 'managers')): ?>

View File

@ -17,7 +17,7 @@
<td>
<div class="subtask-table-td">
<?php if ($editable): ?>
<i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change subtask position') ?>"></i>&nbsp;
<i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change subtask position') ?>" role="button" aria-label="<?= t('Change subtask position') ?>"></i>&nbsp;
<?= $this->render('subtask/menu', array(
'task' => $task,
'subtask' => $subtask,

View File

@ -14,7 +14,7 @@
<tr data-swimlane-id="<?= $swimlane['id'] ?>">
<td>
<?php if (! isset($disable_handle)): ?>
<i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>"></i>&nbsp;
<i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>" role="button" aria-label="<?= t('Change column position') ?>"></i>&nbsp;
<?php endif ?>
<div class="dropdown">

View File

@ -6,13 +6,13 @@
<?php endif ?>
<?php if ($task['is_milestone'] == 1): ?>
<span title="<?= t('Milestone') ?>">
<i class="fa fa-flag flag-milestone"></i>
<i class="fa fa-flag flag-milestone" role="img" aria-label="<?= t('Milestone') ?>"></i>
</span>
<?php endif ?>
<?php if ($task['score']): ?>
<span class="task-score" title="<?= t('Complexity') ?>">
<i class="fa fa-trophy"></i>
<i class="fa fa-trophy" role="img" aria-label="<?= t('Complexity') ?>"></i>
<?= $this->text->e($task['score']) ?>
</span>
<?php endif ?>
@ -25,7 +25,7 @@
<?php if (! empty($task['date_started'])): ?>
<span title="<?= t('Start date') ?>" class="task-date">
<i class="fa fa-clock-o"></i>
<i class="fa fa-clock-o" role="img" aria-label="<?= t('Start date') ?>"></i>
<?= $this->dt->date($task['date_started']) ?>
</span>
<?php endif ?>
@ -38,7 +38,7 @@
task-date-today
<?php endif ?>
">
<i class="fa fa-calendar"></i>
<i class="fa fa-calendar" role="img" aria-label="<?= t('Due date') ?>"></i>
<?= $this->dt->datetime($task['date_due']) ?>
</span>
<?php endif ?>
@ -78,7 +78,8 @@
$task['nb_comments'] == 1 ? t('%d comment', $task['nb_comments']) : t('%d comments', $task['nb_comments'])
) ?>
<?php else: ?>
<span title="<?= $task['nb_comments'] == 1 ? t('%d comment', $task['nb_comments']) : t('%d comments', $task['nb_comments']) ?>"><i class="fa fa-comments-o"></i>&nbsp;<?= $task['nb_comments'] ?></span>
<?php $aria_label = $task['nb_comments'] == 1 ? t('%d comment', $task['nb_comments']) : t('%d comments', $task['nb_comments']); ?>
<span title="<?= $aria_label ?>" role="img" aria-label="<?= $aria_label ?>"><i class="fa fa-comments-o"></i>&nbsp;<?= $task['nb_comments'] ?></span>
<?php endif ?>
<?php endif ?>

View File

@ -15,7 +15,7 @@
<?php $users_groups = $this->user->getUsersGroupNames($user['id']); ?>
<?php $groups_list_tooltip = t('%s is a member of the following group(s): %s', $user['name'] ?: $user['username'], implode(', ', $users_groups['full_list'])); ?>
<?php if ($users_groups['has_groups']): ?>
<span title="<?= $groups_list_tooltip ?>">
<span title="<?= $groups_list_tooltip ?>" role="img" aria-label="<?= $groups_list_tooltip ?>">
<i class="fa fa-fw fa-group" aria-hidden="true"></i><?= $this->text->implode(', ', $users_groups['limited_list']) ?>
<?php if ($users_groups['shown'] != $users_groups['total']): ?>
&nbsp;<?= t('%d/%d group(s) shown', $users_groups['shown'], $users_groups['total']) ?>

View File

@ -1,55 +1,59 @@
<div class="table-list-icons">
<?php if ($user['notifications_enabled'] == 1): ?>
<span title="<?= t('Notifications are activated') ?>">
<i class="fa fa-bell-o" aria-hidden="true"></i>
<i class="fa fa-bell-o" role="img" aria-label="<?= t('Notifications are activated') ?>"></i>
</span>
<?php endif ?>
<?php if ($user['notifications_enabled'] == 0): ?>
<span title="<?= t('Notifications are disabled') ?>">
<i class="fa fa-bell-slash-o" aria-hidden="true"></i>
<i class="fa fa-bell-slash-o" role="img" aria-label="<?= t('Notifications are disabled') ?>"></i>
</span>
<?php endif ?>
<?php if ($user['twofactor_activated'] == 1): ?>
<span title="<?= t('Two factor authentication enabled') ?>">
<i class="fa fa-shield" aria-hidden="true"></i>
<i class="fa fa-shield" role="img" aria-label="<?= t('Two factor authentication enabled') ?>"></i>
</span>
<?php endif ?>
<?php if ($user['is_ldap_user'] == 1): ?>
<span title="<?= t('Remote user') ?>">
<i class="fa fa-cloud" aria-hidden="true"></i>
<i class="fa fa-cloud" role="img" aria-label="<?= t('Remote user') ?>"></i>
</span>
<?php endif ?>
<?php if ($user['lock_expiration_date'] != 0): ?>
<span title="<?= t('Account locked until:') ?> <?= $this->dt->datetime($user['lock_expiration_date']) ?>">
<i class="fa fa-lock" aria-hidden="true"></i>
<?php $aria_label = t('Account locked until:') . ' ' . $this->dt->datetime($user['lock_expiration_date']); ?>
<span title="<?= $aria_label ?>">
<i class="fa fa-lock" role="img" aria-label="<?= $aria_label ?>"></i>
</span>
<?php endif ?>
<?php if ($user['role'] == 'app-admin'): ?>
<span title="<?= $this->user->getRoleName($user['role']) ?>">
<i class="fa fa-star" aria-hidden="true"></i>
<?php $aria_label = $this->user->getRoleName($user['role']); ?>
<span title="<?= $aria_label ?>">
<i class="fa fa-star" role="img" aria-label="<?= $aria_label ?>"></i>
</span>
<?php endif ?>
<?php if ($user['role'] == 'app-manager'): ?>
<span title="<?= $this->user->getRoleName($user['role']) ?>">
<i class="fa fa-star-half-o" aria-hidden="true"></i>
<?php $aria_label = $this->user->getRoleName($user['role']); ?>
<span title="<?= $aria_label ?>">
<i class="fa fa-star-half-o" role="img" aria-label="<?= $aria_label ?>"></i>
</span>
<?php endif ?>
<?php if ($user['role'] == 'app-user'): ?>
<span title="<?= $this->user->getRoleName($user['role']) ?>">
<i class="fa fa-star-o" aria-hidden="true"></i>
<?php $aria_label = $this->user->getRoleName($user['role']); ?>
<span title="<?= $aria_label ?>">
<i class="fa fa-star-o" role="img" aria-label="<?= $aria_label ?>"></i>
</span>
<?php endif ?>
<?php if ($user['is_active'] == 0): ?>
<span title="<?= t('User disabled') ?>">
<i class="fa fa-ban" aria-hidden="true"></i>
<i class="fa fa-ban" role="img" aria-label="<?= t('User disabled') ?>"></i>
</span>
<?php endif ?>
</div>