Skip to content

Make "history" a top-link on Manage Matchgrid and shorten link text to History (CO-2527) #49

Merged
merged 3 commits into from
Nov 23, 2022
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
3 changes: 3 additions & 0 deletions app/resources/locales/en_US/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
3 changes: 2 additions & 1 deletion app/src/View/Helper/MenuHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
3 changes: 2 additions & 1 deletion app/templates/MatchgridRecords/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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; ?>"
Expand Down