|
28 | 28 | <div class="row"> |
29 | 29 | <aside class="column"> |
30 | 30 | <div class="side-nav"> |
31 | | - <h4 class="heading"><?= __('Actions') ?></h4> |
32 | | - <?= $this->Html->link(__('Edit {{ singularHumanName }}'), ['action' => 'edit', {{ pK|raw }}], ['class' => 'side-nav-item']) ?> |
33 | | - <?= $this->Form->postLink(__('Delete {{ singularHumanName }}'), ['action' => 'delete', {{ pK|raw }}], ['confirm' => __('Are you sure you want to delete # {0}?', {{ pK|raw }}), 'class' => 'side-nav-item']) ?> |
34 | | - <?= $this->Html->link(__('List {{ pluralHumanName }}'), ['action' => 'index'], ['class' => 'side-nav-item']) ?> |
35 | | - <?= $this->Html->link(__('New {{ singularHumanName }}'), ['action' => 'add'], ['class' => 'side-nav-item']) ?> |
| 31 | + <h4 class="heading"><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'Actions') ?></h4> |
| 32 | + <?= $this->Html->link({% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'Edit {{ singularHumanName }}'), ['action' => 'edit', {{ pK|raw }}], ['class' => 'side-nav-item']) ?> |
| 33 | + <?= $this->Form->postLink({% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'Delete {{ singularHumanName }}'), ['action' => 'delete', {{ pK|raw }}], ['confirm' => {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'Are you sure you want to delete # {0}?', {{ pK|raw }}), 'class' => 'side-nav-item']) ?> |
| 34 | + <?= $this->Html->link({% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'List {{ pluralHumanName }}'), ['action' => 'index'], ['class' => 'side-nav-item']) ?> |
| 35 | + <?= $this->Html->link({% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'New {{ singularHumanName }}'), ['action' => 'add'], ['class' => 'side-nav-item']) ?> |
| 36 | +{% set done = [] %} |
36 | 37 | </div> |
37 | 38 | </aside> |
38 | 39 | <div class="column column-80"> |
|
44 | 45 | {%~ if associationFields[field] is defined %} |
45 | 46 | {%~ set details = associationFields[field] %} |
46 | 47 | <tr> |
47 | | - <th><?= __('{{ details.property|humanize }}') ?></th> |
| 48 | + <th><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'{{ details.property|humanize }}') ?></th> |
48 | 49 | <td><?= ${{ singularVar }}->hasValue('{{ details.property }}') ? $this->Html->link(${{ singularVar }}->{{ details.property }}->{{ details.displayField }}, ['controller' => '{{ details.controller }}', 'action' => 'view', ${{ singularVar }}->{{ details.property }}->{{ details.primaryKey[0] }}]) : '' ?></td> |
49 | 50 | </tr> |
50 | 51 | {%~ else %} |
51 | 52 | <tr> |
52 | | - <th><?= __('{{ field|humanize }}') ?></th> |
| 53 | + <th><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'{{ field|humanize }}') ?></th> |
53 | 54 | <td><?= h(${{ singularVar }}->{{ field }}) ?></td> |
54 | 55 | </tr> |
55 | 56 | {%~ endif %} |
|
58 | 59 | {% if associations.HasOne %} |
59 | 60 | {%~ for alias, details in associations.HasOne %} |
60 | 61 | <tr> |
61 | | - <th><?= __('{{ alias|underscore|singularize|humanize }}') ?></th> |
| 62 | + <th><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'{{ alias|underscore|singularize|humanize }}') ?></th> |
62 | 63 | <td><?= ${{ singularVar }}->hasValue('{{ details.property }}') ? $this->Html->link(${{ singularVar }}->{{ details.property }}->{{ details.displayField }}, ['controller' => '{{ details.controller }}', 'action' => 'view', ${{ singularVar }}->{{ details.property }}->{{ details.primaryKey[0] }}]) : '' ?></td> |
63 | 64 | </tr> |
64 | 65 | {%~ endfor %} |
65 | 66 | {% endif %} |
66 | 67 | {% if groupedFields.number %} |
67 | 68 | {%~ for field in groupedFields.number %} |
68 | 69 | <tr> |
69 | | - <th><?= __('{{ field|humanize }}') ?></th> |
70 | | - {%~ set columnData = Bake.columnData(field, schema) %} |
71 | | - {%~ if columnData.null %} |
| 70 | + <th><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'{{ field|humanize }}') ?></th> |
| 71 | +{% set columnData = Bake.columnData(field, schema) %} |
| 72 | +{% if columnData.null %} |
72 | 73 | <td><?= ${{ singularVar }}->{{ field }} === null ? '' : $this->Number->format(${{ singularVar }}->{{ field }}) ?></td> |
73 | 74 | {%~ else %} |
74 | 75 | <td><?= $this->Number->format(${{ singularVar }}->{{ field }}) ?></td> |
|
79 | 80 | {% if groupedFields.enum %} |
80 | 81 | {%~ for field in groupedFields.enum %} |
81 | 82 | <tr> |
82 | | - <th><?= __('{{ field|humanize }}') ?></th> |
| 83 | + <th><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'{{ field|humanize }}') ?></th> |
83 | 84 | {%~ set columnData = Bake.columnData(field, schema) %} |
84 | 85 | {%~ set supportsLabel = Bake.enumSupportsLabel(field, schema) %} |
85 | 86 | {%~ if columnData.null %} |
|
93 | 94 | {% if groupedFields.date %} |
94 | 95 | {%~ for field in groupedFields.date %} |
95 | 96 | <tr> |
96 | | - <th><?= __('{{ field|humanize }}') ?></th> |
| 97 | + <th><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'{{ field|humanize }}') ?></th> |
97 | 98 | <td><?= h(${{ singularVar }}->{{ field }}) ?></td> |
98 | 99 | </tr> |
99 | 100 | {%~ endfor %} |
100 | 101 | {% endif %} |
101 | 102 | {% if groupedFields.boolean %} |
102 | 103 | {%~ for field in groupedFields.boolean %} |
103 | 104 | <tr> |
104 | | - <th><?= __('{{ field|humanize }}') ?></th> |
105 | | - <td><?= ${{ singularVar }}->{{ field }} ? __('Yes') : __('No'); ?></td> |
| 105 | + <th><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'{{ field|humanize }}') ?></th> |
| 106 | + <td><?= ${{ singularVar }}->{{ field }} ? {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'Yes') : {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'No'); ?></td> |
106 | 107 | </tr> |
107 | 108 | {%~ endfor %} |
108 | 109 | {% endif %} |
109 | 110 | </table> |
110 | 111 | {% if groupedFields.text %} |
111 | 112 | {%~ for field in groupedFields.text %} |
112 | 113 | <div class="text"> |
113 | | - <strong><?= __('{{ field|humanize }}') ?></strong> |
| 114 | + <strong><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'{{ field|humanize }}') ?></strong> |
114 | 115 | <blockquote> |
115 | 116 | <?= $this->Text->autoParagraph(h(${{ singularVar }}->{{ field }})); ?> |
116 | 117 | </blockquote> |
|
122 | 123 | {%~ set otherSingularVar = alias|singularize|variable %} |
123 | 124 | {%~ set otherPluralHumanName = details.controller|underscore|humanize %} |
124 | 125 | <div class="related"> |
125 | | - <h4><?= __('Related {{ otherPluralHumanName }}') ?></h4> |
| 126 | + <h4><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'Related {{ otherPluralHumanName }}') ?></h4> |
126 | 127 | <?php if (!empty(${{ singularVar }}->{{ details.property }})) : ?> |
127 | 128 | <div class="table-responsive"> |
128 | 129 | <table> |
129 | 130 | <tr> |
130 | 131 | {%~ for field in details.fields %} |
131 | | - <th><?= __('{{ field|humanize }}') ?></th> |
| 132 | + <th><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'{{ field|humanize }}') ?></th> |
132 | 133 | {%~ endfor %} |
133 | | - <th class="actions"><?= __('Actions') ?></th> |
| 134 | + <th class="actions"><?= {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'Actions') ?></th> |
134 | 135 | </tr> |
135 | 136 | <?php foreach (${{ singularVar }}->{{ details.property }} as ${{ otherSingularVar }}) : ?> |
136 | 137 | <tr> |
|
139 | 140 | {%~ endfor %} |
140 | 141 | {%~ set otherPk = '$' ~ otherSingularVar ~ '->' ~ details.primaryKey[0] %} |
141 | 142 | <td class="actions"> |
142 | | - <?= $this->Html->link(__('View'), ['controller' => '{{ details.controller }}', 'action' => 'view', {{ otherPk|raw }}]) ?> |
143 | | - <?= $this->Html->link(__('Edit'), ['controller' => '{{ details.controller }}', 'action' => 'edit', {{ otherPk|raw }}]) ?> |
| 143 | + <?= $this->Html->link({% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'View'), ['controller' => '{{ details.controller }}', 'action' => 'view', {{ otherPk|raw }}]) ?> |
| 144 | + <?= $this->Html->link({% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'Edit'), ['controller' => '{{ details.controller }}', 'action' => 'edit', {{ otherPk|raw }}]) ?> |
144 | 145 | <?= $this->Form->postLink( |
145 | | - __('Delete'), |
| 146 | + {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'Delete'), |
146 | 147 | ['controller' => '{{ details.controller }}', 'action' => 'delete', {{ otherPk|raw }}], |
147 | 148 | [ |
148 | 149 | 'method' => 'delete', |
149 | | - 'confirm' => __('Are you sure you want to delete # {0}?', {{ otherPk|raw }}), |
| 150 | + 'confirm' => {% if useDomain %}__d('{{ plugin }}', {% else %}__({% endif %}'Are you sure you want to delete # {0}?', {{ otherPk|raw }}), |
150 | 151 | ] |
151 | 152 | ) ?> |
152 | 153 | </td> |
|
0 commit comments