Skip to content

Commit

Permalink
Add hidden accessible titles
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelvickersuk committed Oct 6, 2020
1 parent b7c2003 commit af9aec8
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 23 deletions.
1 change: 1 addition & 0 deletions app/Helper/TaskHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ public function renderDueDateField(array $values, array $errors = array(), array
public function renderPriority($priority)
{
$html = '<span class="task-priority" title="'.t('Task priority').'">';
$html .= '<span class="ui-helper-hidden-accessible">'.t('Task priority').' </span>';
$html .= $this->helper->text->e($priority >= 0 ? 'P'.$priority : '-P'.abs($priority));
$html .= '</span>';

Expand Down
10 changes: 5 additions & 5 deletions app/Template/board/table_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<?php if ($swimlane['nb_swimlanes'] > 1 && $column['nb_tasks'] > 0): ?>
<span title="<?= t('Task count') ?>">
(<span id="task-number-column-<?= $column['id'] ?>"><?= $column['nb_tasks'] ?></span>)
(<span id="task-number-column-<?= $column['id'] ?>"><span class="ui-helper-hidden-accessible"><?= t('Task count') ?> </span><?= $column['nb_tasks'] ?></span>)
</span>
<?php endif ?>

Expand Down Expand Up @@ -84,13 +84,13 @@
<span class="pull-right">
<?php if ($swimlane['nb_swimlanes'] > 1 && ! empty($column['column_score'])): ?>
<span title="<?= t('Total score in this column across all swimlanes') ?>">
(<span><?= $column['column_score'] ?></span>)
(<span><span class="ui-helper-hidden-accessible"><?= t('Total score in this column across all swimlanes') ?> </span><?= $column['column_score'] ?></span>)
</span>
<?php endif ?>

<?php if (! empty($column['score'])): ?>
<span title="<?= t('Score') ?>">
<?= $column['score'] ?>
<span class="ui-helper-hidden-accessible"><?= t('Score') ?> </span><?= $column['score'] ?>
</span>
<?php endif ?>

Expand All @@ -102,9 +102,9 @@
<?php if (! empty($column['column_nb_open_tasks'])): ?>
<span title="<?= t('Total number of tasks in this column across all swimlanes') ?>" class="board-column-header-task-count">
<?php if ($column['task_limit'] > 0): ?>
(<span><?= $column['column_nb_open_tasks'] ?></span> / <span title="<?= t('Task limit') ?>"><?= $this->text->e($column['task_limit']) ?></span>)
(<span><span class="ui-helper-hidden-accessible"><?= t('Total number of tasks in this column across all swimlanes') ?> </span><?= $column['column_nb_open_tasks'] ?></span> / <span title="<?= t('Task limit') ?>"><span class="ui-helper-hidden-accessible"><?= t('Task limit') ?> </span><?= $this->text->e($column['task_limit']) ?></span>)
<?php else: ?>
(<span><?= $column['column_nb_open_tasks'] ?></span>)
(<span><span class="ui-helper-hidden-accessible"><?= t('Total number of tasks in this column across all swimlanes') ?> </span><?= $column['column_nb_open_tasks'] ?></span>)
<?php endif ?>
</span>
<?php endif ?>
Expand Down
4 changes: 2 additions & 2 deletions app/Template/board/table_swimlane.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<span title="<?= t('Task count') ?>" class="board-column-header-task-count swimlane-task-count-<?= $swimlane['id'] ?>">
<?php if ($swimlane['task_limit']): ?>
(<?= $swimlane['nb_tasks'] ?>/<?= $swimlane['task_limit'] ?>)
(<span><span class="ui-helper-hidden-accessible"><?= t('Task count') ?> </span><?= $swimlane['nb_tasks'] ?>/<?= $swimlane['task_limit'] ?>)
<?php else: ?>
(<?= $swimlane['nb_tasks'] ?>)
(<span><span class="ui-helper-hidden-accessible"><?= t('Task count') ?> </span><?= $swimlane['nb_tasks'] ?>)
<?php endif ?>
</span>
</th>
Expand Down
8 changes: 4 additions & 4 deletions app/Template/board/task_footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div class="task-board-icons-row">
<?php if ($task['reference']): ?>
<span class="task-board-reference" title="<?= t('Reference') ?>">
<?= $this->task->renderReference($task) ?>
<span class="ui-helper-hidden-accessible"><?= t('Reference') ?> </span><?= $this->task->renderReference($task) ?>
</span>
<?php endif ?>
</div>
Expand All @@ -55,7 +55,7 @@

<?php if (! empty($task['time_estimated']) || ! empty($task['time_spent'])): ?>
<span class="task-time-estimated" title="<?= t('Time spent and estimated') ?>">
<?= $this->text->e($task['time_spent']) ?>/<?= $this->text->e($task['time_estimated']) ?>h
<span class="ui-helper-hidden-accessible"><?= t('Time spent and estimated') ?> </span><?= $this->text->e($task['time_spent']) ?>/<?= $this->text->e($task['time_estimated']) ?>h
</span>
<?php endif ?>

Expand Down Expand Up @@ -124,8 +124,8 @@

<?php if ($task['is_active'] == 1): ?>
<div class="task-icon-age">
<span title="<?= t('Task age in days')?>" class="task-icon-age-total"><?= $this->dt->age($task['date_creation']) ?></span>
<span title="<?= t('Days in this column')?>" class="task-icon-age-column"><?= $this->dt->age($task['date_moved']) ?></span>
<span title="<?= t('Task age in days')?>" class="task-icon-age-total"><span class="ui-helper-hidden-accessible"><?= t('Task age in days') ?> </span><?= $this->dt->age($task['date_creation']) ?></span>
<span title="<?= t('Days in this column')?>" class="task-icon-age-column"><span class="ui-helper-hidden-accessible"><?= t('Days in this column') ?> </span><?= $this->dt->age($task['date_moved']) ?></span>
</div>
<?php else: ?>
<span class="task-board-closed"><i class="fa fa-ban fa-fw"></i><?= t('Closed') ?></span>
Expand Down
2 changes: 1 addition & 1 deletion app/Template/dashboard/overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</div>
<div class="table-list-details">
<?php foreach ($project['columns'] as $column): ?>
<strong title="<?= t('Task count') ?>"><?= $column['nb_open_tasks'] ?></strong>
<strong title="<?= t('Task count') ?>"><span class="ui-helper-hidden-accessible"><?= t('Task count') ?> </span><?= $column['nb_open_tasks'] ?></strong>
<small><?= $this->text->e($column['title']) ?></small>
<?php endforeach ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/Template/header/title.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<?php else: ?>
<?= $this->text->e($title) ?>
<?php if (! empty($project) && $project['task_limit'] && array_key_exists('nb_active_tasks', $project)): ?>
(<span><?= intval($project['nb_active_tasks']) ?></span> / <span title="<?= t('Task limit') ?>"><?= $this->text->e($project['task_limit']) ?></span>)
(<span><?= intval($project['nb_active_tasks']) ?></span> / <span title="<?= t('Task limit') ?>"><span class="ui-helper-hidden-accessible"><?= t('Task limit') ?> </span><?= $this->text->e($project['task_limit']) ?></span>)
<?php endif ?>
<?php endif ?>
</span>
Expand Down
2 changes: 1 addition & 1 deletion app/Template/project_overview/columns.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="project-overview-columns">
<?php foreach ($columns as $column): ?>
<div class="project-overview-column">
<strong title="<?= t('Task count') ?>"><?= $column['nb_open_tasks'] ?></strong>
<strong title="<?= t('Task count') ?>"><span class="ui-helper-hidden-accessible"><?= t('Task count') ?> </span><?= $column['nb_open_tasks'] ?></strong>
<small><?= $this->text->e($column['title']) ?></small>
</div>
<?php endforeach ?>
Expand Down
2 changes: 1 addition & 1 deletion app/Template/project_user_overview/roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</td>
<td class="dashboard-project-stats">
<?php foreach ($project['columns'] as $column): ?>
<strong title="<?= t('Task count') ?>"><?= $column['nb_open_tasks'] ?></strong>
<strong title="<?= t('Task count') ?>"><span class="ui-helper-hidden-accessible"><?= t('Task count') ?> </span><?= $column['nb_open_tasks'] ?></strong>
<span><?= $this->text->e($column['title']) ?></span>
<?php endforeach ?>
</td>
Expand Down
2 changes: 1 addition & 1 deletion app/Template/task_external_link/table.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<?= $this->text->e($link['type']) ?>
</td>
<td>
<a href="<?= $link['url'] ?>" title="<?= $this->text->e($link['url']) ?>" target="_blank"><?= $this->text->e($link['title']) ?></a>
<a href="<?= $link['url'] ?>" title="<?= $this->text->e($link['url']) ?>" target="_blank"><?= $this->text->e($link['title']) ?><span class="ui-helper-hidden-accessible"> (<?= $this->text->e($link['url']) ?>)</span></a>
</td>
<td>
<?= $this->text->e($link['dependency_label']) ?>
Expand Down
10 changes: 5 additions & 5 deletions app/Template/task_list/task_icons.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="task-list-icons">
<?php if ($task['reference']): ?>
<span class="task-board-reference" title="<?= t('Reference') ?>">
<?= $this->task->renderReference($task) ?>
<span class="ui-helper-hidden-accessible"><?= t('Reference') ?> </span><?= $this->task->renderReference($task) ?>
</span>
<?php endif ?>
<?php if ($task['is_milestone'] == 1): ?>
Expand All @@ -19,7 +19,7 @@

<?php if (! empty($task['time_estimated']) || ! empty($task['time_spent'])): ?>
<span class="task-time-estimated" title="<?= t('Time spent and estimated') ?>">
<?= $this->text->e($task['time_spent']) ?>/<?= $this->text->e($task['time_estimated']) ?>h
<span class="ui-helper-hidden-accessible"><?= t('Time spent and estimated') ?> </span><?= $this->text->e($task['time_spent']) ?>/<?= $this->text->e($task['time_estimated']) ?>h
</span>
<?php endif ?>

Expand Down Expand Up @@ -87,12 +87,12 @@
<?= $this->app->tooltipLink('<i class="fa fa-file-text-o"></i>', $this->url->href('BoardTooltipController', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']))) ?>
<?php endif ?>

<span title="<?= t('Position') ?>">(<?= $task['position'] ?>)</span>
<span title="<?= t('Position') ?>">(<span class="ui-helper-hidden-accessible"><?= t('Position') ?> </span><?= $task['position'] ?>)</span>

<?php if ($task['is_active'] == 1): ?>
<div class="task-icon-age">
<span title="<?= t('Task age in days')?>" class="task-icon-age-total"><?= $this->dt->age($task['date_creation']) ?></span>
<span title="<?= t('Days in this column')?>" class="task-icon-age-column"><?= $this->dt->age($task['date_moved']) ?></span>
<span title="<?= t('Task age in days')?>" class="task-icon-age-total"><span class="ui-helper-hidden-accessible"><?= t('Task age in days') ?> </span><?= $this->dt->age($task['date_creation']) ?></span>
<span title="<?= t('Days in this column')?>" class="task-icon-age-column"><span class="ui-helper-hidden-accessible"><?= t('Days in this column') ?> </span><?= $this->dt->age($task['date_moved']) ?></span>
</div>
<?php else: ?>
<span class="task-board-closed"><i class="fa fa-ban fa-fw"></i><?= t('Closed') ?></span>
Expand Down
4 changes: 2 additions & 2 deletions tests/units/Helper/TaskHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public function testFormatPriority()
$helper = new TaskHelper($this->container);

$this->assertEquals(
'<span class="task-priority" title="Task priority">P2</span>',
'<span class="task-priority" title="Task priority"><span class="ui-helper-hidden-accessible">Task priority </span>P2</span>',
$helper->renderPriority(2)
);

$this->assertEquals(
'<span class="task-priority" title="Task priority">-P6</span>',
'<span class="task-priority" title="Task priority"><span class="ui-helper-hidden-accessible">Task priority </span>-P6</span>',
$helper->renderPriority(-6)
);
}
Expand Down

0 comments on commit af9aec8

Please sign in to comment.