-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --sidebar option to create:controller (#1208)
Co-authored-by: Luke Towers <[email protected]>
- Loading branch information
1 parent
dd7f500
commit 33087e8
Showing
8 changed files
with
187 additions
and
3 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
64 changes: 64 additions & 0 deletions
64
modules/backend/console/scaffold/controller/sidebar/create.stub
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,64 @@ | ||
<?php Block::put('breadcrumb') ?> | ||
<ul> | ||
<li><a href="<?= Backend::url('{{ controller_url }}') ?>"><?= e(trans('{{ model_lang_key }}.label_plural')) ?></a></li> | ||
<li><?= e(trans($this->pageTitle)) ?></li> | ||
</ul> | ||
<?php Block::endPut() ?> | ||
|
||
<?php if (!$this->fatalError): ?> | ||
|
||
<?php Block::put('form-contents') ?> | ||
<div class="layout"> | ||
|
||
<div class="layout-row"> | ||
<?= $this->formRenderOutsideFields() ?> | ||
<?= $this->formRenderPrimaryTabs() ?> | ||
</div> | ||
|
||
<div class="form-buttons"> | ||
<div class="loading-indicator-container"> | ||
<button | ||
type="button" | ||
data-request="onSave" | ||
data-hotkey="ctrl+s, cmd+s" | ||
data-load-indicator="<?= e(trans('backend::lang.form.creating_name', ['name' => trans('{{ model_lang_key }}.label')])); ?>" | ||
class="btn btn-primary"> | ||
<?= e(trans('backend::lang.form.create')); ?> | ||
</button> | ||
<button | ||
type="button" | ||
data-request="onSave" | ||
data-request-data="close:1" | ||
data-hotkey="ctrl+enter, cmd+enter" | ||
data-load-indicator="<?= e(trans('backend::lang.form.creating_name', ['name' => trans('{{ model_lang_key }}.label')])); ?>" | ||
class="btn btn-default"> | ||
<?= e(trans('backend::lang.form.create_and_close')); ?> | ||
</button> | ||
<span class="btn-text"> | ||
or <a href="<?= Backend::url('{{ controller_url }}') ?>"><?= e(trans('backend::lang.form.cancel')); ?></a> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
<?php Block::endPut() ?> | ||
|
||
<?php Block::put('form-sidebar') ?> | ||
<div class="hide-tabs"><?= $this->formRenderSecondaryTabs() ?></div> | ||
<?php Block::endPut() ?> | ||
|
||
<?php Block::put('body') ?> | ||
<?= Form::open(['class'=>'layout stretch']) ?> | ||
<?= $this->makeLayout('form-with-sidebar') ?> | ||
<?= Form::close() ?> | ||
<?php Block::endPut() ?> | ||
|
||
<?php else: ?> | ||
<div class="control-breadcrumb"> | ||
<?= Block::placeholder('breadcrumb') ?> | ||
</div> | ||
<div class="padded-container"> | ||
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p> | ||
<p><a href="<?= Backend::url('{{ controller_url }}') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')); ?></a></p> | ||
</div> | ||
<?php endif ?> |
39 changes: 39 additions & 0 deletions
39
modules/backend/console/scaffold/controller/sidebar/preview.stub
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,39 @@ | ||
<?php Block::put('breadcrumb') ?> | ||
<ul> | ||
<li><a href="<?= Backend::url('{{ controller_url }}') ?>"><?= e(trans('{{ model_lang_key }}.label_plural')) ?></a></li> | ||
<li><?= e(trans($this->pageTitle)) ?></li> | ||
</ul> | ||
<?php Block::endPut() ?> | ||
|
||
<?php if (!$this->fatalError): ?> | ||
|
||
<?php Block::put('form-contents') ?> | ||
<div class="layout"> | ||
|
||
<div class="layout-row"> | ||
<?= $this->formRenderOutsideFields() ?> | ||
<?= $this->formRenderPrimaryTabs() ?> | ||
</div> | ||
|
||
</div> | ||
<?php Block::endPut() ?> | ||
|
||
<?php Block::put('form-sidebar') ?> | ||
<div class="hide-tabs"><?= $this->formRenderSecondaryTabs() ?></div> | ||
<?php Block::endPut() ?> | ||
|
||
<?php Block::put('body') ?> | ||
<?= Form::open(['class'=>'layout stretch']) ?> | ||
<?= $this->makeLayout('form-with-sidebar') ?> | ||
<?= Form::close() ?> | ||
<?php Block::endPut() ?> | ||
|
||
<?php else: ?> | ||
<div class="control-breadcrumb"> | ||
<?= Block::placeholder('breadcrumb') ?> | ||
</div> | ||
<div class="padded-container"> | ||
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p> | ||
<p><a href="<?= Backend::url('{{ controller_url }}') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')); ?></a></p> | ||
</div> | ||
<?php endif ?> |
72 changes: 72 additions & 0 deletions
72
modules/backend/console/scaffold/controller/sidebar/update.stub
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,72 @@ | ||
<?php Block::put('breadcrumb') ?> | ||
<ul> | ||
<li><a href="<?= Backend::url('{{ controller_url }}') ?>"><?= e(trans('{{ model_lang_key }}.label_plural')) ?></a></li> | ||
<li><?= e(trans($this->pageTitle)) ?></li> | ||
</ul> | ||
<?php Block::endPut() ?> | ||
|
||
<?php if (!$this->fatalError): ?> | ||
|
||
<?php Block::put('form-contents') ?> | ||
<div class="layout"> | ||
|
||
<div class="layout-row"> | ||
<?= $this->formRenderOutsideFields() ?> | ||
<?= $this->formRenderPrimaryTabs() ?> | ||
</div> | ||
|
||
<div class="form-buttons"> | ||
<div class="loading-indicator-container"> | ||
<button | ||
type="button" | ||
data-request="onSave" | ||
data-request-data="redirect:0" | ||
data-hotkey="ctrl+s, cmd+s" | ||
data-load-indicator="<?= e(trans('backend::lang.form.saving_name', ['name' => trans('{{ model_lang_key }}.label')])); ?>" | ||
class="btn btn-primary"> | ||
<?= e(trans('backend::lang.form.save')); ?> | ||
</button> | ||
<button | ||
type="button" | ||
data-request="onSave" | ||
data-request-data="close:1" | ||
data-hotkey="ctrl+enter, cmd+enter" | ||
data-load-indicator="<?= e(trans('backend::lang.form.saving_name', ['name' => trans('{{ model_lang_key }}.label')])); ?>" | ||
class="btn btn-default"> | ||
<?= e(trans('backend::lang.form.save_and_close')); ?> | ||
</button> | ||
<button | ||
type="button" | ||
class="wn-icon-trash-o btn-icon danger pull-right" | ||
data-request="onDelete" | ||
data-load-indicator="<?= e(trans('backend::lang.form.deleting_name', ['name' => trans('{{ model_lang_key }}.label')])); ?>" | ||
data-request-confirm="<?= e(trans('backend::lang.form.confirm_delete')); ?>"> | ||
</button> | ||
<span class="btn-text"> | ||
or <a href="<?= Backend::url('{{ controller_url }}') ?>"><?= e(trans('backend::lang.form.cancel')); ?></a> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
<?php Block::endPut() ?> | ||
|
||
<?php Block::put('form-sidebar') ?> | ||
<div class="hide-tabs"><?= $this->formRenderSecondaryTabs() ?></div> | ||
<?php Block::endPut() ?> | ||
|
||
<?php Block::put('body') ?> | ||
<?= Form::open(['class'=>'layout stretch']) ?> | ||
<?= $this->makeLayout('form-with-sidebar') ?> | ||
<?= Form::close() ?> | ||
<?php Block::endPut() ?> | ||
|
||
<?php else: ?> | ||
<div class="control-breadcrumb"> | ||
<?= Block::placeholder('breadcrumb') ?> | ||
</div> | ||
<div class="padded-container"> | ||
<p class="flash-message static error"><?= e(trans($this->fatalError)) ?></p> | ||
<p><a href="<?= Backend::url('{{ controller_url }}') ?>" class="btn btn-default"><?= e(trans('backend::lang.form.return_to_list')); ?></a></p> | ||
</div> | ||
<?php endif ?> |
File renamed without changes.
File renamed without changes.
File renamed without changes.