-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #990 from cakephp/fix-enum-gen
Improve enum generation
- Loading branch information
Showing
18 changed files
with
389 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* @var \Bake\Test\App\View\AppView $this | ||
* @var iterable<\Cake\Datasource\EntityInterface> $bakeUsers | ||
*/ | ||
?> | ||
<div class="bakeUsers index content"> | ||
<?= $this->Html->link(__('New Bake User'), ['action' => 'add'], ['class' => 'button float-right']) ?> | ||
<h3><?= __('Bake Users') ?></h3> | ||
<div class="table-responsive"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th><?= $this->Paginator->sort('id') ?></th> | ||
<th><?= $this->Paginator->sort('username') ?></th> | ||
<th><?= $this->Paginator->sort('status') ?></th> | ||
<th><?= $this->Paginator->sort('created') ?></th> | ||
<th><?= $this->Paginator->sort('updated') ?></th> | ||
<th class="actions"><?= __('Actions') ?></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php foreach ($bakeUsers as $bakeUser): ?> | ||
<tr> | ||
<td><?= $this->Number->format($bakeUser->id) ?></td> | ||
<td><?= h($bakeUser->username) ?></td> | ||
<td><?= $bakeUser->status === null ? '' : h($bakeUser->status->label()) ?></td> | ||
<td><?= h($bakeUser->created) ?></td> | ||
<td><?= h($bakeUser->updated) ?></td> | ||
<td class="actions"> | ||
<?= $this->Html->link(__('View'), ['action' => 'view', $bakeUser->id]) ?> | ||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $bakeUser->id]) ?> | ||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $bakeUser->id], ['confirm' => __('Are you sure you want to delete # {0}?', $bakeUser->id)]) ?> | ||
</td> | ||
</tr> | ||
<?php endforeach; ?> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="paginator"> | ||
<ul class="pagination"> | ||
<?= $this->Paginator->first('<< ' . __('first')) ?> | ||
<?= $this->Paginator->prev('< ' . __('previous')) ?> | ||
<?= $this->Paginator->numbers() ?> | ||
<?= $this->Paginator->next(__('next') . ' >') ?> | ||
<?= $this->Paginator->last(__('last') . ' >>') ?> | ||
</ul> | ||
<p><?= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?></p> | ||
</div> | ||
</div> |
48 changes: 48 additions & 0 deletions
48
tests/comparisons/Template/testBakeIndexWithEnumNoLabel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* @var \Bake\Test\App\View\AppView $this | ||
* @var iterable<\Cake\Datasource\EntityInterface> $articles | ||
*/ | ||
?> | ||
<div class="articles index content"> | ||
<?= $this->Html->link(__('New Article'), ['action' => 'add'], ['class' => 'button float-right']) ?> | ||
<h3><?= __('Articles') ?></h3> | ||
<div class="table-responsive"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th><?= $this->Paginator->sort('id') ?></th> | ||
<th><?= $this->Paginator->sort('author_id') ?></th> | ||
<th><?= $this->Paginator->sort('title') ?></th> | ||
<th><?= $this->Paginator->sort('published') ?></th> | ||
<th class="actions"><?= __('Actions') ?></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php foreach ($articles as $article): ?> | ||
<tr> | ||
<td><?= $this->Number->format($article->id) ?></td> | ||
<td><?= $article->hasValue('author') ? $this->Html->link($article->author->name, ['controller' => 'Authors', 'action' => 'view', $article->author->id]) : '' ?></td> | ||
<td><?= h($article->title) ?></td> | ||
<td><?= $article->published === null ? '' : h($article->published->value) ?></td> | ||
<td class="actions"> | ||
<?= $this->Html->link(__('View'), ['action' => 'view', $article->id]) ?> | ||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $article->id]) ?> | ||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $article->id], ['confirm' => __('Are you sure you want to delete # {0}?', $article->id)]) ?> | ||
</td> | ||
</tr> | ||
<?php endforeach; ?> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="paginator"> | ||
<ul class="pagination"> | ||
<?= $this->Paginator->first('<< ' . __('first')) ?> | ||
<?= $this->Paginator->prev('< ' . __('previous')) ?> | ||
<?= $this->Paginator->numbers() ?> | ||
<?= $this->Paginator->next(__('next') . ' >') ?> | ||
<?= $this->Paginator->last(__('last') . ' >>') ?> | ||
</ul> | ||
<p><?= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?></p> | ||
</div> | ||
</div> |
50 changes: 50 additions & 0 deletions
50
tests/comparisons/Template/testBakeIndexWithEnumWithLabel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* @var \Bake\Test\App\View\AppView $this | ||
* @var iterable<\Cake\Datasource\EntityInterface> $bakeUsers | ||
*/ | ||
?> | ||
<div class="bakeUsers index content"> | ||
<?= $this->Html->link(__('New Bake User'), ['action' => 'add'], ['class' => 'button float-right']) ?> | ||
<h3><?= __('Bake Users') ?></h3> | ||
<div class="table-responsive"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th><?= $this->Paginator->sort('id') ?></th> | ||
<th><?= $this->Paginator->sort('username') ?></th> | ||
<th><?= $this->Paginator->sort('status') ?></th> | ||
<th><?= $this->Paginator->sort('created') ?></th> | ||
<th><?= $this->Paginator->sort('updated') ?></th> | ||
<th class="actions"><?= __('Actions') ?></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php foreach ($bakeUsers as $bakeUser): ?> | ||
<tr> | ||
<td><?= $this->Number->format($bakeUser->id) ?></td> | ||
<td><?= h($bakeUser->username) ?></td> | ||
<td><?= $bakeUser->status === null ? '' : h($bakeUser->status->label()) ?></td> | ||
<td><?= h($bakeUser->created) ?></td> | ||
<td><?= h($bakeUser->updated) ?></td> | ||
<td class="actions"> | ||
<?= $this->Html->link(__('View'), ['action' => 'view', $bakeUser->id]) ?> | ||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $bakeUser->id]) ?> | ||
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $bakeUser->id], ['confirm' => __('Are you sure you want to delete # {0}?', $bakeUser->id)]) ?> | ||
</td> | ||
</tr> | ||
<?php endforeach; ?> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="paginator"> | ||
<ul class="pagination"> | ||
<?= $this->Paginator->first('<< ' . __('first')) ?> | ||
<?= $this->Paginator->prev('< ' . __('previous')) ?> | ||
<?= $this->Paginator->numbers() ?> | ||
<?= $this->Paginator->next(__('next') . ' >') ?> | ||
<?= $this->Paginator->last(__('last') . ' >>') ?> | ||
</ul> | ||
<p><?= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?></p> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,4 +94,4 @@ | |
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.