252 lines
9.8 KiB
HTML
252 lines
9.8 KiB
HTML
{extends file="admin-layout.tpl"}
|
|
|
|
{block name="check-permissions"}admin.catalog.view{/block}
|
|
|
|
{block name="page-title"}{intl l='Edit product'}{/block}
|
|
|
|
{block name="main-content"}
|
|
<div class="catalog edit-product">
|
|
<div id="wrapper" class="container">
|
|
|
|
{include file="includes/catalog-breadcrumb.html" editing_category="false" editing_product="true"}
|
|
|
|
<div class="row">
|
|
{loop name="product_edit" type="product" visible="*" id=$product_id backend_context="1" lang=$edit_language_id}
|
|
<div class="col-md-12 general-block-decorator">
|
|
<div class="row">
|
|
<div class="col-md-7 title">
|
|
{intl l='Edit product %title' title=$TITLE}
|
|
</div>
|
|
|
|
<div class="col-md-5 actions">
|
|
|
|
{if $HAS_PREVIOUS != 0}
|
|
<a href="{url path='/admin/products/update' product_id=$PREVIOUS}" class="btn btn-default" title="{intl l='Edit previous product'}"><span class="glyphicon glyphicon-arrow-left"></span></a>
|
|
{else}
|
|
<a href="#" disabled="disabled" class="btn btn-default"><span class="glyphicon glyphicon-arrow-left"></span></a>
|
|
{/if}
|
|
|
|
<a href="{$URL}" target="_blank" class="btn btn-default" title="{intl l='Preview product page'}"><span class="glyphicon glyphicon-eye-open"></span></a>
|
|
|
|
{if $HAS_NEXT != 0}
|
|
<a href="{url path='/admin/products/update' product_id=$NEXT}" class="btn btn-default" title="{intl l='Edit next product'}"><span class="glyphicon glyphicon-arrow-right"></span></a>
|
|
{else}
|
|
<a href="#" disabled="disabled" class="btn btn-default"><span class="glyphicon glyphicon-arrow-right"></span></a>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
|
|
<ul class="nav nav-tabs" id="tabbed-menu">
|
|
<li {if $current_tab == 'general'}class="active"{/if}><a href="#general" data-toggle="tab">{intl l="General description"}</a></li>
|
|
<li {if $current_tab == 'attributes'}class="active"{/if}><a href="#attributes" data-toggle="tab">{intl l="Attributes & Features"}</a></li>
|
|
<li {if $current_tab == 'content'}class="active"{/if}><a href="#content" data-toggle="tab">{intl l="Content & accessories"}</a></li>
|
|
<li {if $current_tab == 'images'}class="active"{/if}><a href="#images" data-toggle="tab">{intl l="Images"}</a></li>
|
|
<li {if $current_tab == 'documents'}class="active"{/if}><a href="#documents" data-toggle="tab">{intl l="Documents"}</a></li>
|
|
<li {if $current_tab == 'modules'}class="active"{/if}><a href="#modules" data-toggle="tab">{intl l="Modules"}</a></li>
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
|
|
<div class="tab-pane fade {if $current_tab == 'general'}active in{/if}" id="general">
|
|
|
|
{include file="includes/product-general-tab.html"}
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane fade {if $current_tab == 'attributes'}active in{/if}" id="attributes">
|
|
|
|
{include file="includes/product-attributes-tab.html"}
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane fade {if $current_tab == 'content'}active in{/if}" id="content">
|
|
|
|
{include file="includes/product-content-tab.html"}
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane fade {if $current_tab == 'images'}active in{/if}" id="images">
|
|
</div>
|
|
|
|
<div class="tab-pane fade {if $current_tab == 'documents'}active in{/if}" id="documents">
|
|
</div>
|
|
|
|
<div class="tab-pane fade {if $current_tab == 'modules'}active in{/if}" id="modules">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/loop}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{/block}
|
|
|
|
{block name="javascript-initialization"}
|
|
|
|
{javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
|
|
<script src="{$asset_url}"></script>
|
|
{/javascripts}
|
|
|
|
<script src="{url file='/tinymce/tinymce.min.js'}"></script>
|
|
<script>
|
|
tinymce.init({
|
|
selector: ".wysiwyg",
|
|
theme: "modern",
|
|
menubar : false,
|
|
language: "",
|
|
plugins: [
|
|
"advlist autolink link image lists charmap print preview hr anchor pagebreak",
|
|
"searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking",
|
|
"table contextmenu directionality emoticons paste textcolor filemanager"
|
|
],
|
|
toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect | filemanager | link unlink anchor | image media | forecolor backcolor | print preview code ",
|
|
image_advtab: true ,
|
|
external_filemanager_path:"{url file='/tinymce/plugins/filemanager/'}'",
|
|
filemanager_title:"{intl l='Files manager'}" ,
|
|
external_plugins: { "filemanager" : "{url file='/tinymce/plugins/filemanager/plugin.min.js'}"}
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
$(function() {
|
|
|
|
$('.use_default_rewriten_url').click(function(ev) {
|
|
alert("Not functionnal");
|
|
|
|
ev.preventDefault();
|
|
});
|
|
|
|
// Set proper content ID in delete content from
|
|
$('a.delete-content').click(function(ev) {
|
|
$('#content_delete_id').val($(this).data('id'));
|
|
$('#folder_delete_id').val($('#folder_id').val());
|
|
});
|
|
|
|
// Set proper content ID in accessory delete from
|
|
$('a.delete-accessory').click(function(ev) {
|
|
$('#accessory_delete_id').val($(this).data('id'));
|
|
$('#accessory_category_delete_id').val($('#accessory_category_id').val());
|
|
});
|
|
|
|
|
|
// Load content on folder selection
|
|
$('#folder_id').change(function(event) {
|
|
var val = $(this).val();
|
|
|
|
if (val != "") {
|
|
$.ajax({
|
|
url : '{url path="/admin/product/$product_id/available-related-content/"}' + $(this).val() + '.xml',
|
|
type : 'get',
|
|
dataType : 'json',
|
|
success : function(json) {
|
|
$('#content_id :not(:first-child)').remove();
|
|
|
|
var have_content = false;
|
|
|
|
$.each(json, function(idx, value) {
|
|
$('#content_id').append($('<option>').text(value.title).attr('value', value.id));
|
|
|
|
have_content = true; // Lame...
|
|
});
|
|
|
|
if (have_content) {
|
|
$('#content_selector_empty').addClass('hide');
|
|
$('#content_selector').removeClass('hide');
|
|
}
|
|
else {
|
|
$('#content_selector_empty').removeClass('hide');
|
|
$('#content_selector').addClass('hide');
|
|
}
|
|
|
|
}
|
|
});
|
|
}
|
|
else {
|
|
$('#content_selector_empty').addClass('hide');
|
|
$('#content_selector').addClass('hide');
|
|
}
|
|
});
|
|
|
|
// Load content on folder selection
|
|
$('#accessory_category_id').change(function(event) {
|
|
var val = $(this).val();
|
|
|
|
if (val != "") {
|
|
$.ajax({
|
|
url : '{url path="/admin/product/$product_id/available-accessories/"}' + $(this).val() + '.xml',
|
|
type : 'get',
|
|
dataType : 'json',
|
|
success : function(json) {
|
|
$('#accessory_id :not(:first-child)').remove();
|
|
|
|
var have_content = false;
|
|
|
|
$.each(json, function(idx, value) {
|
|
$('#accessory_id').append($('<option>').text(value.title).attr('value', value.id));
|
|
|
|
have_content = true; // Lame...
|
|
});
|
|
|
|
if (have_content) {
|
|
$('#accessory_selector_empty').addClass('hide');
|
|
$('#accessory_selector').removeClass('hide');
|
|
}
|
|
else {
|
|
$('#accessory_selector_empty').removeClass('hide');
|
|
$('#accessory_selector').addClass('hide');
|
|
}
|
|
|
|
}
|
|
});
|
|
}
|
|
else {
|
|
$('#accessory_selector_empty').addClass('hide');
|
|
$('#accessory_selector').addClass('hide');
|
|
}
|
|
});
|
|
|
|
{* Inline editing of accessory position using bootstrap-editable *}
|
|
|
|
$('.accessoryPositionChange').editable({
|
|
type : 'text',
|
|
title : '{intl l="Enter new accessory position"}',
|
|
mode : 'popup',
|
|
inputclass : 'input-mini',
|
|
placement : 'left',
|
|
success : function(response, newValue) {
|
|
// The URL template
|
|
var url = "{url noamp='1' path='admin/product/update-accessory-position/' accessory_id='__ID__' product_id=$product_id position='__POS__'}";
|
|
|
|
// Perform subtitutions
|
|
url = url.replace('__ID__', $(this).data('id')).replace('__POS__', newValue);
|
|
|
|
// Reload the page
|
|
location.href = url;
|
|
}
|
|
});
|
|
|
|
// Initialize folder (id={$folder_id}) select value
|
|
{if $folder_id != 0}
|
|
$('#folder_id').val("{$folder_id}").change();
|
|
{/if}
|
|
|
|
// Initialize folder (id={$folder_id}) select value
|
|
{if $accessory_category_id != 0}
|
|
$('#accessory_category_id').val("{$accessory_category_id}").change();
|
|
{/if}
|
|
|
|
// Unselect all options in attribute + feature tab
|
|
$('.clear_feature_value').click(function(event){
|
|
$('#feature_value_' + $(this).data('id') + ' option').prop('selected', false);
|
|
|
|
event.preventDefault();
|
|
});
|
|
});
|
|
</script>
|
|
{/block} |