Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make "history" a top-link on Manage Matchgrid and shorten link text t…
…o History (CO-2527) (COmanage#49)

* Improve Manage Matchgrid layout: make Matchgrid History a top-link, and shorten label to "History" (CO-2527)

* Update to Matchgrid History top-link label (CO-2527)

* Test for empty vv_attr_id for topLinks (CO-2527)
arlen committed Nov 23, 2022
1 parent 0cde4fb commit 1027902
Showing 5 changed files with 31 additions and 13 deletions.
3 changes: 3 additions & 0 deletions app/resources/locales/en_US/default.po
@@ -671,6 +671,9 @@ msgstr "differences"
msgid "match.op.highlight.matches"
msgstr "matches"

msgid "match.op.history"
msgstr "History"

msgid "match.op.last"
msgstr "Last"

3 changes: 2 additions & 1 deletion app/src/View/Helper/MenuHelper.php
@@ -79,7 +79,8 @@ public function getMenuIcon($action) {
'Edit' => 'edit',
'Duplicate' => 'content_copy',
'Default' => 'link', // default icon for arbitrary menu items
'Delete' => 'delete'
'Delete' => 'delete',
'History' => 'history'
);

return $icon[$action];
3 changes: 2 additions & 1 deletion app/templates/MatchgridRecords/columns.inc
@@ -82,6 +82,7 @@ $indexActions = [
'sorid' => $e->sorid
];
},
'icon' => 'history'
'icon' => 'history',
'label' => __('match.op.history')
]
];
33 changes: 23 additions & 10 deletions app/templates/Matchgrids/manage.php
@@ -31,6 +31,29 @@
<div class="pageTitle">
<h1><?= $vv_title; ?></h1>
</div>

<?php
// topLinks menu dropdown / button listing
$action_args = array();
$action_args['vv_attr_mdl'] = "IndexTopLinks";
$action_args['vv_actions'][] = array(
'order' => $this->Menu->getMenuOrder('Add'),
'icon' => $this->Menu->getMenuIcon('History'),
'url' => $this->Url->build([
'controller' => 'MatchgridHistoryRecords',
'action' => 'index',
'?' => ['matchgrid_id' => $vv_cur_mg->id]
]),
'label' => __('match.ct.MatchgridHistoryRecords',2)
);

// Output the topLinks
if(!empty($action_args['vv_actions'])) {
print '<div id="topLinks" class="field-actions">';
print $this->element('menuAction', $action_args);
print '</div>';
}
?>
</div>

<section class="inner-content">
@@ -61,15 +84,5 @@
?>
<div class="call-to-action-text"><?= __('match.in.matchgrid.reconcile'); ?></div>
</div>
<div class="call-to-action">
<?= $this->Html->link('<em class="material-icons" aria-hidden="true">list</em>' . __('match.op.display.history'),
['controller' => 'MatchgridHistoryRecords',
'action' => 'index',
'?' => ['matchgrid_id' => $vv_cur_mg->id]
],
['escape' => false, 'class' => 'btn btn-default']);
?>
<div class="call-to-action-text"><?= __('match.in.matchgrid.history'); ?></div>
</div>
</div>
</section>
2 changes: 1 addition & 1 deletion app/templates/element/menuAction.php
@@ -28,7 +28,7 @@
$actionsCount = count($vv_actions);
$actionsCountClass = $actionsCount > 0 ? ' actions-count-' . $actionsCount : '';
$actionsMenuClass = 'field-actions-menu dropdown dropleft' . $actionsCountClass;
$actionsMenuUid = md5($vv_attr_mdl . $vv_attr_id);
$actionsMenuUid = md5($vv_attr_mdl . (!empty($vv_attr_id) ? $vv_attr_id : ''));
?>

<div id="action-menu_<?= $actionsMenuUid; ?>"

0 comments on commit 1027902

Please sign in to comment.