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 | 8 |
1 files changed, 7 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 0b2dd28..17e7be0 100644 --- a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/view.twig +++ b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/view.twig @@ -149,7 +149,7 @@ {% for alias, details in relations %} {% set otherSingularVar = alias|variable %} {% set otherPluralHumanName = details.controller|underscore|humanize %} -{% set fields = BakeExtra.filterFieldsOther(details.fields, details.controller) %} +{% set fields = BakeExtra.filterFieldsOther(details.fields, details.controller, details.foreignKey) %} <div class="related"> <h4><?= __('Related {{ otherPluralHumanName }}') ?></h4> <?php if (!empty(${{ singularVar }}->{{ details.property }})): ?> @@ -167,9 +167,15 @@ {% endfor %} {% set otherPk = '$' ~ otherSingularVar ~ '->' ~ details.primaryKey[0] %} <td class="actions"> +{% if BakeExtra.hasAction('view', details.controller) %} <?= $this->Html->link(__('View'), ['controller' => '{{ details.controller }}', 'action' => 'view', {{ otherPk|raw }}]) ?> +{% endif %} +{% if BakeExtra.hasAction('edit', details.controller) %} <?= $this->Html->link(__('Edit'), ['controller' => '{{ details.controller }}', 'action' => 'edit', {{ otherPk|raw }}]) ?> +{% endif %} +{% if BakeExtra.hasAction('delete', details.controller) %} <?= $this->Form->postLink(__('Delete'), ['controller' => '{{ details.controller }}', 'action' => 'delete', {{ otherPk|raw }}], ['confirm' => __('Are you sure you want to delete # {0}?', {{ otherPk|raw }})]) ?> +{% endif %} </td> </tr> <?php endforeach; ?> |