Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/resources/locales/en_US/menu.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@

# Menu Messages

msgid "aria.label.actions"
msgstr "Actions menu"

msgid "aria.label.lightbox"
msgstr "Registry lightbox"

msgid "aria.label.lightbox.main"
msgstr "Registry lightbox content"

msgid "aria.label.search"
msgstr "Search and user menu"

msgid "aria.label.subnavigation"
msgstr "Subnavigation"

msgid "aria.label.subnavigation.links"
msgstr "Subnavigation secondary links"

msgid "artifacts"
msgstr "Available {0} Artifacts"

Expand Down
3 changes: 2 additions & 1 deletion app/src/View/Helper/VueHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ class VueHelper extends Helper {
'value.copied',
],
'menu' => [
'person.canvas'
'aria.label.lightbox',
'person.canvas',
],
'operation' => [
'add',
Expand Down
2 changes: 1 addition & 1 deletion app/templates/Dashboards/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

<div id="search-results">
<?php if($resultsCount): ?>
<nav id="cm-searchresults-subnav-tabs" class="cm-subnav-tabs">
<nav id="cm-searchresults-subnav-tabs" class="cm-subnav-tabs" aria-label="<?= __d('menu','aria.label.subnavigation') ?>">
<ul class="nav nav-tabs" role="tablist">
<?php $isFirstTab = true; ?>
<?php foreach(['People', 'Groups'] as $i=>$pm): ?>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/element/bulk/checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
id="<?= $id ?>"
<?php if(!empty($entity)):?>
data-entity="<?= htmlspecialchars(json_encode($entity), ENT_QUOTES, 'UTF-8') ?>"
data-entity-id="<?= $entity->id ?>">
<?php endif ?>
data-entity-id="<?= $entity->id ?>"
<?php endif ?>>
<label class="form-check-label" for="<?= $id ?>">
<?= $label ?>
</label>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/element/menuAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class="<?= $actionsMenuClass; ?>">
'data-bs-toggle' => 'dropdown',
'aria-haspopup' => 'true',
'aria-expanded' => 'false',
'title' => __d('field', 'action')
'aria-label' => __d('menu', 'aria.label.actions')
);
print $this->Html->link(
'<span class="' . $actionsIconClass . '" aria-hidden="true">' . $actionsIcon . '</span> ' . $actionsTitle,
Expand Down
2 changes: 1 addition & 1 deletion app/templates/element/mveaModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
template: `
<Modal id="mvea":title="this.modal.title">
<template v-slot:body="body">
<iframe :src="this.modal.url"/>
<iframe :src="this.modal.url" :aria-label="this.txt['menu.aria.label.lightbox']"/>
</template>
</Modal>
`
Expand Down
174 changes: 90 additions & 84 deletions app/templates/element/pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,94 +36,100 @@
$appStateId = $this->ApplicationState->getId(ApplicationStateEnum::PaginationLimit);
?>
<div id="pagination" class="<?= $paginationClass; ?>">
<span class="paginationCounter">
<?= $this->Paginator->counter(__d('information', 'pagination.format')) ?>
</span>

<?php if($this->Paginator->hasPage(2)): ?>
<!-- show the pagination elements if there is more than 1 page -->
<?php if($this->Paginator->hasPrev()): ?>
<ul class="paginationFirstPrev">
<?= $this->Paginator->first(__d('operation', 'first')); ?>
<?= $this->Paginator->prev(__d('operation', 'previous'), ['class' => 'disabled']) ?>
</ul>
<?php endif; ?>
<ul class="paginationNumbers">
<?= $this->Paginator->numbers() ?>
</ul>
<?php if($this->Paginator->hasNext()): ?>
<ul class="paginationNextLast">
<?= $this->Paginator->next(__d('operation', 'next'), ['class' => 'disabled']) ?>
<?= $this->Paginator->last(__d('operation', 'last')); ?>
</ul>
<?php endif; ?>
<form id="goto-page"
class="pagination-form"
method="get"
onsubmit="gotoPage(this.pageNum.value,
<?= $this->Paginator->counter('{{pages}}') ?>,
'<?= __d('error', 'pagenum.nan') ?>',
'<?= __d('error', 'pagenum.exceeded', [$this->Paginator->counter('{{pages}}')]) ?>',
'<?= $this->Paginator->generateUrl() ?>');
return false;">
<label for="pageNum"><?= __d('operation', 'page.goto') ?></label>
<input type="text" size="3" name="pageNum" id="pageNum"/>
<input type="submit" value="<?= __d('operation', 'go') ?>"/>
</form>
<?php endif; ?>
<div class="pagination-elements">
<nav aria-label="pagination links" id="pagination-links">
<?php if($this->Paginator->hasPrev()): ?>
<ul class="paginationFirstPrev">
<?= $this->Paginator->first(__d('operation', 'first')); ?>
<?= $this->Paginator->prev(__d('operation', 'previous'), ['class' => 'disabled']) ?>
</ul>
<?php endif; ?>
<ul class="paginationNumbers">
<?= $this->Paginator->numbers() ?>
</ul>
<?php if($this->Paginator->hasNext()): ?>
<ul class="paginationNextLast">
<?= $this->Paginator->next(__d('operation', 'next'), ['class' => 'disabled']) ?>
<?= $this->Paginator->last(__d('operation', 'last')); ?>
</ul>
<?php endif; ?>
</nav>
<form id="goto-page"
class="pagination-form"
method="get"
onsubmit="gotoPage(this.pageNum.value,
<?= $this->Paginator->counter('{{pages}}') ?>,
'<?= __d('error', 'pagenum.nan') ?>',
'<?= __d('error', 'pagenum.exceeded', [$this->Paginator->counter('{{pages}}')]) ?>',
'<?= $this->Paginator->generateUrl() ?>');
return false;">
<label for="pageNum"><?= __d('operation', 'page.goto') ?></label>
<input type="text" size="3" name="pageNum" id="pageNum"/>
<input type="submit" value="<?= __d('operation', 'go') ?>"/>
</form>

<?php if($this->Paginator->counter('{{count}}') > 20): ?>
<?= $this->Form->create(null, [ 'type' => 'get', 'id' => 'set-pagination-form', 'class' => 'pagination-form' ]) ?>
<?php
// Provide a form for setting the page limit.
// Default is 20 records (XXX but will be 25), maximum is 100.
// For now we will simply hard-code the options from 25 - 100.

<?php if($this->Paginator->counter('{{count}}') > 20): ?>
<?= $this->Form->create(null, [ 'type' => 'get', 'id' => 'set-pagination-form', 'class' => 'pagination-form' ]) ?>
<?php
// Provide a form for setting the page limit.
// Default is 20 records (XXX but will be 25), maximum is 100.
// For now we will simply hard-code the options from 25 - 100.


// This is similar to Paginator->limitControl, but we have to manually
// re-insert query params that we want to maintain through the limit adjustment
// This is similar to Paginator->limitControl, but we have to manually
// re-insert query params that we want to maintain through the limit adjustment

// Note: we specifically do NOT retain the 'page' param, because we should always go
// back to page one when using this form; otherwise we can easily get a page/limit mismatch that breaks.
$queryParams = ['sort', 'direct'];

if(!empty($vv_primary_link)) {
$queryParams[] = $vv_primary_link;
}

foreach($queryParams as $p) {
if(!empty($this->request->getQuery($p))) {
print $this->Form->hidden($p, ['default' => $this->request->getQuery($p)]);
// Note: we specifically do NOT retain the 'page' param, because we should always go
// back to page one when using this form; otherwise we can easily get a page/limit mismatch that breaks.
$queryParams = ['sort', 'direct'];

if(!empty($vv_primary_link)) {
$queryParams[] = $vv_primary_link;
}
}

print $this->Form->control('limit', [
'type' => 'select',
'label' => __d('operation', 'page.display'),
'value' => $this->request->getQuery('limit') ?? $paginationLimit,
'options' => [25 => 25, 50 => 50, 75 => 75, 100 => 100]
]);
?>
<script>
$(function() {
$('#set-pagination-form').on('submit', function(event) {
event.preventDefault()
const submitButton = $(this).find('[type=submit]')[0]
setApplicationState(
$('#limit').find(":selected").val(),
$(submitButton),
true // view reload
);
})
});
</script>
<?= $this->Form->submit(__d('operation', 'go'), [
'data-coid' => $vv_cur_co->id ?? '',
'data-appstateid' => $appStateId,
'data-stateattr' => ApplicationStateEnum::PaginationLimit,
'data-webroot' => $this->request->getAttribute('webroot'),
'data-username' => $vv_user['username'] ?? '',
'data-personid' => $vv_person_id ?? '',
]) ?>
<?= $this->Form->end() ?>
<?php endif; ?>

foreach($queryParams as $p) {
if(!empty($this->request->getQuery($p))) {
print $this->Form->hidden($p, ['default' => $this->request->getQuery($p)]);
}
}

print $this->Form->control('limit', [
'type' => 'select',
'label' => __d('operation', 'page.display'),
'value' => $this->request->getQuery('limit') ?? $paginationLimit,
'options' => [25 => 25, 50 => 50, 75 => 75, 100 => 100]
]);
?>
<script>
$(function() {
$('#set-pagination-form').on('submit', function(event) {
event.preventDefault()
const submitButton = $(this).find('[type=submit]')[0]
setApplicationState(
$('#limit').find(":selected").val(),
$(submitButton),
true // view reload
);
})
});
</script>
<?= $this->Form->submit(__d('operation', 'go'), [
'data-coid' => $vv_cur_co->id ?? '',
'data-appstateid' => $appStateId,
'data-stateattr' => ApplicationStateEnum::PaginationLimit,
'data-webroot' => $this->request->getAttribute('webroot'),
'data-username' => $vv_user['username'] ?? '',
'data-personid' => $vv_person_id ?? '',
]) ?>
<?= $this->Form->end() ?>
<?php endif; ?>
</div>
<?php endif; ?>

<div class="pagination-counter">
<?= $this->Paginator->counter(__d('information', 'pagination.format')) ?>
</div>
</div>
3 changes: 1 addition & 2 deletions app/templates/element/peopleAutocomplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@
'id' => $fieldName,
'value' => '',
'type' => 'text',
'class' => 'visually-hidden',
'label' => false,
'class' => 'visually-hidden'
]
);
}
Expand Down
5 changes: 3 additions & 2 deletions app/templates/element/searchGlobal.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<span class="visually-hidden"><?= __d('operation','search') ?></span>
</button>

<div id="global-search" class="dropdown-menu">
<div id="global-search" class="dropdown-menu" role="search">
<?php
print $this->Form->create(null, $options);
print $this->Form->hidden('co_id', ['default' => $vv_cur_co->id]);
Expand All @@ -60,7 +60,8 @@
[
'id' => 'q',
'class' => $globalSearchInputClass,
'placeholder' => __d('field','search.placeholder')
'placeholder' => __d('field','search.placeholder'),
'type' => 'search'
]
);
print $this->Form->button(
Expand Down
6 changes: 4 additions & 2 deletions app/templates/element/subnavigation/navBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
</div>

<!-- Top-Level Subnavigation Tabs -->
<nav id="cm-<?= $fullModelsName ?>-subnav-tabs" class="cm-subnav-tabs">
<nav id="cm-<?= $fullModelsName ?>-subnav-tabs" class="cm-subnav-tabs"
aria-label="<?= __d('menu','aria.label.subnavigation') ?>">
<ul class="nav nav-tabs">
<?= $this->element('subnavigation/tabList')?>
</ul>
Expand All @@ -68,7 +69,8 @@
// Check the nested elements if they allow navigation for this action
&& in_array($vv_action, $subNavAttributes['nested']['action'][$fullModelsName] ?? [], true)
): ?>
<nav id="cm-<?= $fullModelsName ?>-subnav-links" class="cm-subnav-links">
<nav id="cm-<?= $fullModelsName ?>-subnav-links" class="cm-subnav-links"
aria-label="<?= __d('menu','aria.label.subnavigation.links') ?>">
<ul class="list-inline">
<?= $this->element('subnavigation/inlineList')?>
</ul>
Expand Down
6 changes: 3 additions & 3 deletions app/templates/layout/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
</header>

<?php if(!$isActivePetition): ?>
<div id="top-bar">
<div id="top-bar" role="region" aria-label="<?= __d('menu','aria.label.search') ?>">
<?php if(!empty($vv_user) && !empty($vv_cur_co) && !$isCoSelectView): ?>
<div id="top-controls">
<div id="co-hamburger"><em class="material-symbols">menu</em></div>
Expand Down Expand Up @@ -217,7 +217,7 @@
<?= $this->element('menuMain') ?>
<?php endif ?>

<main id="main">
<main id="main" aria-label="main content">
<div id="content">
<div id="content-inner">
<?php if(!$isActivePetition): ?>
Expand All @@ -242,7 +242,7 @@
</div>

<!-- loading animation -->
<div id="co-loading"><span></span><span></span><span></span></div>
<div id="co-loading" aria-hidden="true"><span></span><span></span><span></span></div>

<!-- modal dialog boxes -->
<?= $this->element('dialog') // used for confirmations ?>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/layout/iframe.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<body class="<?= $bodyClasses ?>" onload="jsOnLoadCallHooks()">
<!-- Iframe layout -->
<div id="comanage-iframe-wrapper">
<main id="main">
<main id="main" aria-label="<?= __d('menu','aria.label.lightbox.main') ?>'">
<div id="content">
<!-- insert the page internal content -->
<?= $this->fetch('content') ?>
Expand All @@ -123,7 +123,7 @@
</div>

<!-- loading animation -->
<div id="co-loading"><span></span><span></span><span></span></div>
<div id="co-loading" aria-hidden="true"><span></span><span></span><span></span></div>

<!-- modal dialog box -->
<?= $this->element('dialog') ?>
Expand Down
Loading