Add import positionning
modifié: core/lib/Thelia/Controller/Admin/ImportController.php modifié: templates/backOffice/default/import.html
This commit is contained in:
@@ -444,6 +444,8 @@ class ImportController extends BaseAdminController
|
|||||||
$event = new UpdatePositionEvent($id, $this->getMode($mode), $value);
|
$event = new UpdatePositionEvent($id, $this->getMode($mode), $value);
|
||||||
$this->dispatch(TheliaEvents::IMPORT_CHANGE_POSITION, $event);
|
$this->dispatch(TheliaEvents::IMPORT_CHANGE_POSITION, $event);
|
||||||
|
|
||||||
|
|
||||||
|
return $this->render('import');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function changeCategoryPosition()
|
public function changeCategoryPosition()
|
||||||
|
|||||||
@@ -41,13 +41,15 @@
|
|||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-striped table-condensed table-left-aligned">
|
<table class="table table-striped table-condensed table-left-aligned">
|
||||||
<caption class="clearfix">
|
<caption class="clearfix">
|
||||||
<a href="{url path="/admin/import/position/category/up/{$ID}{if $url_import}?{$url_import}{/if}"}">
|
{admin_position_block
|
||||||
<span class="glyphicon glyphicon-arrow-up"></span>
|
resource="admin.import"
|
||||||
</a>
|
access="UPDATE"
|
||||||
{$POSITION}
|
path={url path="admin/import/position/category"}
|
||||||
<a href="{url path="/admin/import/position/category/down/{$ID}{if $url_import}?{$url_import}{/if}"}">
|
url_parameter="id"
|
||||||
<span class="glyphicon glyphicon-arrow-down"></span>
|
in_place_edit_class="importCategoryPositionChange"
|
||||||
</a>
|
position=$POSITION
|
||||||
|
id=$ID
|
||||||
|
}
|
||||||
{$TITLE}
|
{$TITLE}
|
||||||
</caption>
|
</caption>
|
||||||
<thead>
|
<thead>
|
||||||
@@ -82,13 +84,15 @@
|
|||||||
<a href="#category_{$category_title}" class="btn-show-import-modal" data-id="{$ID}" data-url="{$URL}">{$TITLE}</a>
|
<a href="#category_{$category_title}" class="btn-show-import-modal" data-id="{$ID}" data-url="{$URL}">{$TITLE}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{url path="/admin/import/position/up/{if $url_category}?{$url_category}{/if}{$ID}"}">
|
{admin_position_block
|
||||||
<span class="glyphicon glyphicon-arrow-up"></span>
|
resource="admin.import"
|
||||||
</a>
|
access="UPDATE"
|
||||||
{$POSITION}
|
path={url path="admin/import/position"}
|
||||||
<a href="{url path="/admin/import/position/down/{$ID}{if $url_category}?{$url_category}{/if}"}">
|
url_parameter="id"
|
||||||
<span class="glyphicon glyphicon-arrow-down"></span>
|
in_place_edit_class="importPositionChange"
|
||||||
</a>
|
position=$POSITION
|
||||||
|
id=$ID
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@@ -119,9 +123,56 @@
|
|||||||
</div>
|
</div>
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
|
{block name="javascript-initialization"}
|
||||||
|
|
||||||
|
{javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
|
||||||
|
<script src="{$asset_url}"></script>
|
||||||
|
{/javascripts}
|
||||||
|
|
||||||
|
{/block}
|
||||||
|
|
||||||
{block name="javascript-last-call"}
|
{block name="javascript-last-call"}
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
$('.importPositionChange').editable({
|
||||||
|
type : 'text',
|
||||||
|
title : "{intl l="Enter new import position"}",
|
||||||
|
mode : 'popup',
|
||||||
|
inputclass : 'input-mini',
|
||||||
|
placement : 'left',
|
||||||
|
success : function(response, newValue) {
|
||||||
|
// The URL template
|
||||||
|
var url = "{url noamp='1' path='/admin/import/position' id='__ID__' value='__POS__'}";
|
||||||
|
|
||||||
|
// Perform subtitutions
|
||||||
|
url = url.replace('__ID__', $(this).data('id'))
|
||||||
|
.replace('__POS__', newValue);
|
||||||
|
|
||||||
|
// Reload the page
|
||||||
|
location.href = url;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.importCategoryPositionChange').editable({
|
||||||
|
type : 'text',
|
||||||
|
title : "{intl l="Enter new import category position"}",
|
||||||
|
mode : 'popup',
|
||||||
|
inputclass : 'input-mini',
|
||||||
|
placement : 'left',
|
||||||
|
success : function(response, newValue) {
|
||||||
|
// The URL template
|
||||||
|
var url = "{url noamp='1' path='/admin/import/position/category' id='__ID__' value='__POS__'}";
|
||||||
|
|
||||||
|
// Perform subtitutions
|
||||||
|
url = url.replace('__ID__', $(this).data('id'))
|
||||||
|
.replace('__POS__', newValue);
|
||||||
|
|
||||||
|
// Reload the page
|
||||||
|
location.href = url;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var import_modal = $("#import-modal");
|
var import_modal = $("#import-modal");
|
||||||
|
|
||||||
$(".btn-show-import-modal").click(function() {
|
$(".btn-show-import-modal").click(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user