diff options
Diffstat (limited to 'fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/view.twig')
-rw-r--r-- | fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/view.twig | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/view.twig b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/view.twig index 69abdd2..354ec12 100644 --- a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/view.twig +++ b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/view.twig @@ -48,16 +48,28 @@ <nav class="large-2 medium-3 columns" id="actions-sidebar"> <ul class="side-nav"> <li class="heading"><?= __('Actions') ?></li> +{% if BakeExtra.hasAction('edit', modelClass) %} <li><?= $this->Html->link(__('Edit {{ singularHumanName }}'), ['action' => 'edit', {{ pK|raw }}]) ?> </li> +{% endif %} +{% if BakeExtra.hasAction('delete', modelClass) %} <li><?= $this->Form->postLink(__('Delete {{ singularHumanName }}'), ['action' => 'delete', {{ pK|raw }}], ['confirm' => __('Are you sure you want to delete # {0}?', {{ pK|raw }})]) ?> </li> +{% endif %} +{% if BakeExtra.hasAction('index', modelClass) %} <li><?= $this->Html->link(__('List {{ pluralHumanName }}'), ['action' => 'index']) ?> </li> - <li><?= $this->Html->link(__('New {{ singularHumanName }}'), ['action' => 'add']) ?> </li> +{% endif %} {% set done = [] %} {% for type, data in associations %} {% for alias, details in data %} +{% if false %} +// Bug here _view.name is NULL +{% endif %} {% if details.controller is not same as(_view.name) and details.controller not in done %} +{% if BakeExtra.hasAction('index', details.controller) %} <li><?= $this->Html->link(__('List {{ alias|underscore|humanize }}'), ['controller' => '{{ details.controller }}', 'action' => 'index']) ?> </li> +{% endif %} +{% if BakeExtra.hasAction('add', details.controller) %} <li><?= $this->Html->link(__('New {{ alias|underscore|singularize|humanize }}'), ['controller' => '{{ details.controller }}', 'action' => 'add']) ?> </li> +{% endif %} {% set done = done|merge(['controller']) %} {% endif %} {% endfor %} |