chg: [metaTemplates:index] Improved conflict text
parent
fa49821731
commit
9a1d254b01
|
@ -57,15 +57,26 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
||||||
'titleHtml_vars' => ['name'],
|
'titleHtml_vars' => ['name'],
|
||||||
'bodyHtml' => $this->Html->nestedList([
|
'bodyHtml' => $this->Html->nestedList([
|
||||||
__('Only one template per scope can be set as the default template'),
|
__('Only one template per scope can be set as the default template'),
|
||||||
'{{1}}',
|
'{{0}}',
|
||||||
]),
|
]),
|
||||||
'bodyHtml_vars' => [
|
'bodyHtml_vars' => [
|
||||||
'scope',
|
|
||||||
[
|
[
|
||||||
'function' => function($row, $data) {
|
'function' => function($row, $data) {
|
||||||
$conflictingTemplate = getConflictingTemplate($row, $data);
|
$conflictingTemplate = getConflictingTemplate($row, $data);
|
||||||
if (!empty($conflictingTemplate)) {
|
if (!empty($conflictingTemplate)) {
|
||||||
return sprintf('<span class="text-danger font-weight-bolder">%s</span> %s', __('Conflict with:'), h($conflictingTemplate->name));
|
return sprintf(
|
||||||
|
"<span class=\"text-danger font-weight-bolder\">%s</span> %s.<br />
|
||||||
|
<span class=\"font-weight-bolder\">%s</span> %s <span class=\"font-weight-bolder\">%s</span>",
|
||||||
|
__('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));
|
return __('Current scope: {0}', h($row->scope));
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue