Skip to content

Commit

Permalink
Update localization strings and ensure breadcrumbs and the hamburger …
Browse files Browse the repository at this point in the history
…menu appear only when they should (CO-2141)
  • Loading branch information
arlen committed Sep 17, 2021
1 parent b1557ff commit 838aa4d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 36 deletions.
35 changes: 16 additions & 19 deletions app/src/Locale/en_US/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,6 @@ msgid "match.home.welcome"
msgstr "Welcome to {0}."

### Informational Messages
msgid "match.in.matchgrid"
msgstr "Matchgrid"

msgid "match.in.matchgrid.config"
msgstr "Matchgrid Configuration"

msgid "match.in.matchgrid.display"
msgstr "Display all records associated with this Matchgrid."

Expand All @@ -499,19 +493,6 @@ msgstr "There are no matchgrids currently defined."
msgid "match.in.pagination.format"
msgstr "Page {{page}} of {{pages}}, Viewing {{start}}-{{end}} of {{count}}"

### Menu Items
msgid "match.me.display"
msgstr "Display"

msgid "match.me.manage"
msgstr "Manage"

msgid "match.me.platform"
msgstr "Platform"

msgid "match.me.reconcile"
msgstr "Reconcile"

### Operations (Commands)
msgid "match.op.add.a"
msgstr "Add New {0}"
Expand All @@ -538,6 +519,9 @@ msgid "match.op.delete.confirm"
msgstr "Are you sure you wish to delete this record ({0})?"

msgid "match.op.display"
msgstr "Display"

msgid "match.op.display.records"
msgstr "Display Records"

msgid "match.op.duplicate"
Expand Down Expand Up @@ -582,10 +566,16 @@ msgstr "Display"
msgid "match.op.page.goto"
msgstr "Go To Page"

msgid "match.op.platform"
msgstr "Platform"

msgid "match.op.previous"
msgstr "Previous"

msgid "match.op.reconcile"
msgstr "Reconcile"

msgid "match.op.reconcile.requests"
msgstr "Reconcile Requests"

msgid "match.op.reconcile.a"
Expand Down Expand Up @@ -642,3 +632,10 @@ msgstr "Request could not be canonically resolved, pending record {0} created"

msgid "match.rs.saved"
msgstr "Saved"

### Titles
msgid "match.ti.matchgrid.config"
msgstr "Matchgrid Configuration"

msgid "match.ti.matchgrid"
msgstr "Matchgrid: {0}"
6 changes: 3 additions & 3 deletions app/src/Template/Element/menuMain.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<li class="configMenu">
<?= $this->Html->link(
'<em class="material-icons" aria-hidden="true">home</em>
<span class="menu-title">' . __('match.me.manage') . '</span>',
<span class="menu-title">' . __('match.op.manage') . '</span>',
['controller' => 'Matchgrids',
'action' => 'manage',
$vv_cur_mg->id],
Expand All @@ -46,7 +46,7 @@
<li class="configMenu">
<?= $this->Html->link(
'<em class="material-icons" aria-hidden="true">list</em>
<span class="menu-title">' . __('match.me.display') . '</span>',
<span class="menu-title">' . __('match.op.display') . '</span>',
['controller' => 'MatchgridRecords',
'action' => 'index',
'matchgrid_id' => $vv_cur_mg->id],
Expand All @@ -58,7 +58,7 @@
<li class="configMenu">
<?= $this->Html->link(
'<em class="material-icons" aria-hidden="true">check_circle</em>
<span class="menu-title">' . __('match.me.reconcile') . '</span>',
<span class="menu-title">' . __('match.op.reconcile') . '</span>',
['controller' => 'Matchgrids',
'action' => 'pending',
$vv_cur_mg->id],
Expand Down
4 changes: 2 additions & 2 deletions app/src/Template/Element/menuTop.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<?php if($vv_menu_permissions['gridroles']): ?>
<li id="top-menu-platform">
<a class="dropdown-toggle" href="#" role="button" id="platform-dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="top-menu-link-text" id="user-common-name">
Platform
<span class="top-menu-link-text">
<?= __('match.op.platform'); ?>
</span>
<em class="material-icons">settings</em>
</a>
Expand Down
18 changes: 10 additions & 8 deletions app/src/Template/Layout/default.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ if(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'M

<?php
// cleanse the controller and action strings and insert them into the body classes
$controller_stripped = preg_replace('/[^a-zA-Z0-9\-_]/', '', $this->request->getParam('controller'));
$action_stripped = preg_replace('/[^a-zA-Z0-9\-_]/', '', $this->request->getParam('action'));
$controller_stripped = preg_replace('/[^a-zA-Z0-9\-_]/', '', strtolower($this->request->getParam('controller')));
$action_stripped = preg_replace('/[^a-zA-Z0-9\-_]/', '', strtolower($this->request->getParam('action')));
$bodyClasses = $controller_stripped . ' ' .$action_stripped;

// add further body classes as needed
Expand All @@ -90,7 +90,7 @@ if(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'M
<!-- Primary layout -->
<div id="comanage-wrapper">
<div id="top-bar">
<?php if(!empty($vv_user)): ?>
<?php if(!empty($vv_user) && !empty($vv_cur_mg)): ?>
<div id="co-hamburger"><em class="material-icons">menu</em></div>
<?php endif; // vv_user ?>
<nav id="top-menu">
Expand All @@ -102,7 +102,7 @@ if(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'M
<div id="siteTitle">
<?php if(!empty($vv_cur_mg)): ?>
<?= $this->Html->link(
__('match.in.matchgrid') . ": " . $vv_cur_mg['table_name'],
__('match.ti.matchgrid',[$vv_cur_mg['table_name']]),
['controller' => 'Matchgrids',
'action' => 'manage',
$vv_cur_mg->id],
Expand Down Expand Up @@ -138,10 +138,12 @@ if(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'M
<main id="main">
<div id="content">
<div id="content-inner">
<!-- insert breadcrumbs -->
<div id="breadcrumbs">
<?= $this->element('breadcrumbs'); ?>
</div>
<?php if($controller_stripped != 'matchgrids' && $action_stripped != 'select'): ?>
<!-- insert breadcrumbs on all but the front (select matchgrid) page -->
<div id="breadcrumbs">
<?= $this->element('breadcrumbs'); ?>
</div>
<?php endif; ?>

<!-- insert the anchor that is the target of accessible "skip to content" link -->
<a id="content-start"></a>
Expand Down
6 changes: 3 additions & 3 deletions app/src/Template/Matchgrids/manage.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ declare(strict_types = 1);
<!-- Matchgrid Management -->
<div id="matchgrid-management" class="call-to-action-blocks">
<div class="call-to-action">
<?= $this->Html->link('<em class="material-icons" aria-hidden="true">list</em>' . __('match.op.display'),
<?= $this->Html->link('<em class="material-icons" aria-hidden="true">list</em>' . __('match.op.display.records'),
['controller' => 'MatchgridRecords',
'action' => 'index',
'matchgrid_id' => $vv_cur_mg->id],
Expand All @@ -46,7 +46,7 @@ declare(strict_types = 1);
<div class="call-to-action-text"><?= __('match.in.matchgrid.display'); ?></div>
</div>
<div class="call-to-action">
<?= $this->Html->link('<em class="material-icons" aria-hidden="true">check_circle</em>' . __('match.op.reconcile'),
<?= $this->Html->link('<em class="material-icons" aria-hidden="true">check_circle</em>' . __('match.op.reconcile.requests'),
['controller' => 'Matchgrids',
'action' => 'pending',
$vv_cur_mg->id],
Expand All @@ -58,7 +58,7 @@ declare(strict_types = 1);

<!-- Matchgrid Configuration -->
<?php if($vv_menu_permissions['gridroles']): ?>
<h2><?= __('match.in.matchgrid.config'); ?></h2>
<h2><?= __('match.ti.matchgrid.config'); ?></h2>
<ul id="matchgrid-config-menu">
<?php
if(!empty($vv_cur_mg)) {
Expand Down
2 changes: 1 addition & 1 deletion app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ a {
#logo img {
height: 38px;
}
/* USER MENU */
/* TOP MENU */
#top-menu {
z-index: 4;
}
Expand Down

0 comments on commit 838aa4d

Please sign in to comment.