From 9a1d254b013eca795ac3fdb4a0cd680faab9abe1 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Thu, 10 Dec 2020 17:05:51 +0100 Subject: [PATCH] chg: [metaTemplates:index] Improved conflict text --- templates/MetaTemplates/index.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/templates/MetaTemplates/index.php b/templates/MetaTemplates/index.php index 1e61267..11864f2 100644 --- a/templates/MetaTemplates/index.php +++ b/templates/MetaTemplates/index.php @@ -57,15 +57,26 @@ echo $this->element('genericElements/IndexTable/index_table', [ 'titleHtml_vars' => ['name'], 'bodyHtml' => $this->Html->nestedList([ __('Only one template per scope can be set as the default template'), - '{{1}}', + '{{0}}', ]), 'bodyHtml_vars' => [ - 'scope', [ 'function' => function($row, $data) { $conflictingTemplate = getConflictingTemplate($row, $data); if (!empty($conflictingTemplate)) { - return sprintf('%s %s', __('Conflict with:'), h($conflictingTemplate->name)); + return sprintf( + "%s %s.
+ %s %s %s", + __('Conflict with:'), + $this->Html->link( + h($conflictingTemplate->name), + '/metaTemplates/view/' . h($conflictingTemplate->id), + ['target' => '_blank'] + ), + __('By proceeding'), + h($conflictingTemplate->name), + __('will not be the default anymore') + ); } return __('Current scope: {0}', h($row->scope)); },