-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: fenn-cs <[email protected]>
- Loading branch information
Showing
23 changed files
with
491 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php namespace Lovata\Shopaholic\Controllers; | ||
|
||
use BackendMenu; | ||
use Backend\Classes\Controller; | ||
|
||
/** | ||
* Product Slugs Back-end Controller | ||
*/ | ||
class ProductSlugs extends Controller | ||
{ | ||
/** | ||
* @var array Behaviors that are implemented by this controller. | ||
*/ | ||
public $implement = [ | ||
'Backend.Behaviors.FormController', | ||
'Backend.Behaviors.ListController', | ||
'Backend.Behaviors.RelationController', | ||
]; | ||
|
||
public $formConfig = 'config_form.yaml'; | ||
public $listConfig = 'config_list.yaml'; | ||
public $relationConfig = 'config_relation.yaml'; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
//BackendMenu::setContext('Lovata.Shopaholic', 'shopaholic', 'productslugs'); | ||
BackendMenu::setContext('Lovata.Shopaholic', 'shopaholic-menu-main', 'shopaholic-menu-products'); | ||
|
||
} | ||
} |
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 @@ | ||
<?= $this->relationRender('product_slug') ?> |
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,21 @@ | ||
<div data-control="toolbar"> | ||
<a | ||
href="<?= Backend::url('lovata/shopaholic/productslugs/create') ?>" | ||
class="btn btn-primary oc-icon-plus"> | ||
New Product Slug | ||
</a> | ||
|
||
<button | ||
class="btn btn-danger oc-icon-trash-o" | ||
disabled="disabled" | ||
onclick="$(this).data('request-data', { checked: $('.control-list').listWidget('getChecked') })" | ||
data-request="onDelete" | ||
data-request-confirm="Are you sure you want to delete the selected Product Slugs?" | ||
data-trigger-action="enable" | ||
data-trigger=".control-list input[type=checkbox]" | ||
data-trigger-condition="checked" | ||
data-request-success="$(this).prop('disabled', 'disabled')" | ||
data-stripe-load-indicator> | ||
Delete selected | ||
</button> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# =================================== | ||
# Form Behavior Config | ||
# =================================== | ||
|
||
# Record name | ||
name: Product Slug | ||
|
||
# Model Form Field configuration | ||
form: $/lovata/shopaholic/models/productslug/fields.yaml | ||
|
||
# Model Class name | ||
modelClass: Lovata\Shopaholic\Models\ProductSlug | ||
|
||
# Default redirect location | ||
defaultRedirect: lovata/shopaholic/productslugs | ||
|
||
# Create page | ||
create: | ||
title: backend::lang.form.create_title | ||
redirect: lovata/shopaholic/productslugs/update/:id | ||
redirectClose: lovata/shopaholic/productslugs | ||
|
||
# Update page | ||
update: | ||
title: backend::lang.form.update_title | ||
redirect: lovata/shopaholic/productslugs | ||
redirectClose: lovata/shopaholic/productslugs | ||
|
||
# Preview page | ||
preview: | ||
title: backend::lang.form.preview_title |
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 @@ | ||
# =================================== | ||
# List Behavior Config | ||
# =================================== | ||
|
||
# Model List Column configuration | ||
list: $/lovata/shopaholic/models/productslug/columns.yaml | ||
|
||
# Model Class name | ||
modelClass: Lovata\Shopaholic\Models\ProductSlug | ||
|
||
# List Title | ||
title: Manage Product Slugs | ||
|
||
# Link URL for each record | ||
recordUrl: lovata/shopaholic/productslugs/update/:id | ||
|
||
# Message to display if the list is empty | ||
noRecordsMessage: backend::lang.list.no_records | ||
|
||
# Records to display per page | ||
recordsPerPage: 20 | ||
|
||
# Options to provide the user when selecting how many records to display per page | ||
perPageOptions: [20, 40, 80, 100, 120] | ||
|
||
# Display page numbers with pagination, disable to improve performance | ||
showPageNumbers: true | ||
|
||
# Displays the list column set up button | ||
showSetup: true | ||
|
||
# Displays the sorting link on each column | ||
showSorting: true | ||
|
||
# Default sorting column | ||
# defaultSort: | ||
# column: created_at | ||
# direction: desc | ||
|
||
# Display checkboxes next to each record | ||
showCheckboxes: true | ||
|
||
# Toolbar widget configuration | ||
toolbar: | ||
# Partial for toolbar buttons | ||
buttons: list_toolbar | ||
|
||
# Search widget configuration | ||
search: | ||
prompt: backend::lang.list.search_prompt |
Empty file.
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 Block::put('breadcrumb') ?> | ||
<ul> | ||
<li><a href="<?= Backend::url('lovata/shopaholic/productslugs') ?>">Product Slugs</a></li> | ||
<li><?= e($this->pageTitle) ?></li> | ||
</ul> | ||
<?php Block::endPut() ?> | ||
|
||
<?php if (!$this->fatalError): ?> | ||
|
||
<?= Form::open(['class' => 'layout']) ?> | ||
|
||
<div class="layout-row"> | ||
<?= $this->formRender() ?> | ||
</div> | ||
|
||
<div class="form-buttons"> | ||
<div class="loading-indicator-container"> | ||
<button | ||
type="submit" | ||
data-request="onSave" | ||
data-hotkey="ctrl+s, cmd+s" | ||
data-load-indicator="Creating ProductSlug..." | ||
class="btn btn-primary"> | ||
Create | ||
</button> | ||
<button | ||
type="button" | ||
data-request="onSave" | ||
data-request-data="close:1" | ||
data-hotkey="ctrl+enter, cmd+enter" | ||
data-load-indicator="Creating ProductSlug..." | ||
class="btn btn-default"> | ||
Create and Close | ||
</button> | ||
<span class="btn-text"> | ||
or <a href="<?= Backend::url('lovata/shopaholic/productslugs') ?>">Cancel</a> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<?= Form::close() ?> | ||
|
||
<?php else: ?> | ||
|
||
<p class="flash-message static error"><?= e($this->fatalError) ?></p> | ||
<p><a href="<?= Backend::url('lovata/shopaholic/productslugs') ?>" class="btn btn-default">Return to product slugs list</a></p> | ||
|
||
<?php endif ?> |
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,2 @@ | ||
|
||
<?= $this->listRender() ?> |
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,19 @@ | ||
<?php Block::put('breadcrumb') ?> | ||
<ul> | ||
<li><a href="<?= Backend::url('lovata/shopaholic/productslugs') ?>">Product Slugs</a></li> | ||
<li><?= e($this->pageTitle) ?></li> | ||
</ul> | ||
<?php Block::endPut() ?> | ||
|
||
<?php if (!$this->fatalError): ?> | ||
|
||
<div class="form-preview"> | ||
<?= $this->formRenderPreview() ?> | ||
</div> | ||
|
||
<?php else: ?> | ||
|
||
<p class="flash-message static error"><?= e($this->fatalError) ?></p> | ||
<p><a href="<?= Backend::url('lovata/shopaholic/productslugs') ?>" class="btn btn-default">Return to product slugs list</a></p> | ||
|
||
<?php endif ?> |
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,56 @@ | ||
<?php Block::put('breadcrumb') ?> | ||
<ul> | ||
<li><a href="<?= Backend::url('lovata/shopaholic/productslugs') ?>">Product Slugs</a></li> | ||
<li><?= e($this->pageTitle) ?></li> | ||
</ul> | ||
<?php Block::endPut() ?> | ||
|
||
<?php if (!$this->fatalError): ?> | ||
|
||
<?= Form::open(['class' => 'layout']) ?> | ||
|
||
<div class="layout-row"> | ||
<?= $this->formRender() ?> | ||
</div> | ||
|
||
<div class="form-buttons"> | ||
<div class="loading-indicator-container"> | ||
<button | ||
type="submit" | ||
data-request="onSave" | ||
data-request-data="redirect:0" | ||
data-hotkey="ctrl+s, cmd+s" | ||
data-load-indicator="Saving ProductSlug..." | ||
class="btn btn-primary"> | ||
<u>S</u>ave | ||
</button> | ||
<button | ||
type="button" | ||
data-request="onSave" | ||
data-request-data="close:1" | ||
data-hotkey="ctrl+enter, cmd+enter" | ||
data-load-indicator="Saving ProductSlug..." | ||
class="btn btn-default"> | ||
Save and Close | ||
</button> | ||
<button | ||
type="button" | ||
class="oc-icon-trash-o btn-icon danger pull-right" | ||
data-request="onDelete" | ||
data-load-indicator="Deleting ProductSlug..." | ||
data-request-confirm="Delete this productslug?"> | ||
</button> | ||
<span class="btn-text"> | ||
or <a href="<?= Backend::url('lovata/shopaholic/productslugs') ?>">Cancel</a> | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<?= Form::close() ?> | ||
|
||
<?php else: ?> | ||
|
||
<p class="flash-message static error"><?= e($this->fatalError) ?></p> | ||
<p><a href="<?= Backend::url('lovata/shopaholic/productslugs') ?>" class="btn btn-default">Return to product slugs list</a></p> | ||
|
||
<?php endif ?> |
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
Oops, something went wrong.