Skip to content

Commit

Permalink
Update stubs to latest spec
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Feb 9, 2024
1 parent c5c5038 commit 3f737c5
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 26 deletions.
35 changes: 24 additions & 11 deletions src/Scaffold/Console/controller/create.stub
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,38 @@

<?php if (!$this->fatalError): ?>

<?= Form::open(['class' => 'layout']) ?>
<?= Form::open(['class' => 'd-flex flex-column h-100']) ?>

<div class="layout-row">
<div class="flex-grow-1">
<?= $this->formRender() ?>
</div>

<div class="form-buttons">
<div class="loading-indicator-container">
<div data-control="loader-container">
<button
type="submit"
data-request="onSave"
data-request-message="<?= __("Creating :name...", ['name' => $formRecordName]) ?>"
data-hotkey="ctrl+s, cmd+s"
data-load-indicator="<?= e(trans('backend::lang.form.creating_name', ['name'=>$formRecordName])) ?>"
class="btn btn-primary">
<?= e(trans('backend::lang.form.create')) ?>
<?= __("Create") ?>
</button>
<button
type="button"
data-request="onSave"
data-request-data="close:1"
data-request-data="{ close: 1 }"
data-request-message="<?= __("Creating :name...", ['name' => $formRecordName]) ?>"
data-hotkey="ctrl+enter, cmd+enter"
data-load-indicator="<?= e(trans('backend::lang.form.creating_name', ['name'=>$formRecordName])) ?>"
class="btn btn-default">
<?= e(trans('backend::lang.form.create_and_close')) ?>
<?= __("Create & Close") ?>
</button>
<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('{{namespace_path}}/{{lower_name}}') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
<span class="button-separator"><?= __("or") ?></span>
<a
href="<?= Backend::url('{{namespace_path}}/{{lower_name}}') ?>"
class="btn btn-link p-0">
<?= __("Cancel") ?>
</a>
</span>
</div>
</div>
Expand All @@ -42,7 +47,15 @@

<?php else: ?>

<p class="flash-message static error"><?= e($this->fatalError) ?></p>
<p><a href="<?= Backend::url('{{namespace_path}}/{{lower_name}}') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
<p class="flash-message static error">
<?= e($this->fatalError) ?>
</p>
<p>
<a
href="<?= Backend::url('{{namespace_path}}/{{lower_name}}') ?>"
class="btn btn-default">
<?= __("Return to List") ?>
</a>
</p>

<?php endif ?>
43 changes: 28 additions & 15 deletions src/Scaffold/Console/controller/update.stub
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,47 @@

<?php if (!$this->fatalError): ?>

<?= Form::open(['class' => 'layout']) ?>
<?= Form::open(['class' => 'd-flex flex-column h-100']) ?>

<div class="layout-row">
<div class="flex-grow-1">
<?= $this->formRender() ?>
</div>

<div class="form-buttons">
<div class="loading-indicator-container">
<div data-control="loader-container">
<button
type="submit"
data-request="onSave"
data-request-data="redirect:0"
data-request-data="{ redirect: 0 }"
data-hotkey="ctrl+s, cmd+s"
data-load-indicator="<?= e(trans('backend::lang.form.saving_name', ['name'=>$formRecordName])) ?>"
data-request-message="<?= __("Saving :name...", ['name' => $formRecordName]) ?>"
class="btn btn-primary">
<?= e(trans('backend::lang.form.save')) ?>
<?= __("Save") ?>
</button>
<button
type="button"
data-request="onSave"
data-request-data="close:1"
data-request-data="{ close: 1 }"
data-browser-redirect-back
data-hotkey="ctrl+enter, cmd+enter"
data-load-indicator="<?= e(trans('backend::lang.form.saving_name', ['name'=>$formRecordName])) ?>"
data-request-message="<?= __("Saving :name...", ['name' => $formRecordName]) ?>"
class="btn btn-default">
<?= e(trans('backend::lang.form.save_and_close')) ?>
<?= __("Save & Close") ?>
</button>
<button
type="button"
class="oc-icon-trash-o btn-icon danger pull-right"
class="oc-icon-delete btn-icon danger pull-right"
data-request="onDelete"
data-load-indicator="<?= e(trans('backend::lang.form.deleting_name', ['name'=>$formRecordName])) ?>"
data-request-confirm="<?= e(trans('backend::lang.form.confirm_delete')) ?>">
data-request-message="<?= __("Deleting :name...", ['name' => $formRecordName]) ?>"
data-request-confirm="<?= __("Delete this record?") ?>">
</button>
<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('{{namespace_path}}/{{lower_name}}') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
<span class="button-separator"><?= __("or") ?></span>
<a
href="<?= Backend::url('{{namespace_path}}/{{lower_name}}') ?>"
class="btn btn-link p-0">
<?= __("Cancel") ?>
</a>
</span>
</div>
</div>
Expand All @@ -51,7 +56,15 @@

<?php else: ?>

<p class="flash-message static error"><?= e($this->fatalError) ?></p>
<p><a href="<?= Backend::url('{{namespace_path}}/{{lower_name}}') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')) ?></a></p>
<p class="flash-message static error">
<?= e($this->fatalError) ?>
</p>
<p>
<a
href="<?= Backend::url('{{namespace_path}}/{{lower_name}}') ?>"
class="btn btn-default">
<?= __("Return to List") ?>
</a>
</p>

<?php endif ?>

0 comments on commit 3f737c5

Please sign in to comment.