Add import API module files and templates
- Created front.js for handling frontend JavaScript functionalities. - Added index.php files for both the views and templates to manage redirection and access control. - Implemented configure.tpl for admin configuration settings with AJAX functionality for field retrieval. - Developed delete.tpl for product deletion with progress tracking. - Introduced file_upload.tpl for file upload handling with drag-and-drop support. - Created import.tpl for managing product imports with progress indicators. - Added list.tpl for displaying uploaded files with action links. - Implemented temp.tpl for queuing products with visual feedback. - Enhanced index.php for module access control. - Updated templates to include necessary JavaScript for AJAX operations and user interactions.
This commit is contained in:
87
modules/import_api/views/templates/admin/configure.tpl
Normal file
87
modules/import_api/views/templates/admin/configure.tpl
Normal file
@@ -0,0 +1,87 @@
|
||||
{*
|
||||
* 2007-2018 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2018 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
|
||||
|
||||
<div class="panel" id="tab-general">
|
||||
<p>Source: {$file_name}</p>
|
||||
<div style="min-height:20px">
|
||||
<p id="api-loader" style="display:none"> Please wait while module read file
|
||||
<span class="hidden-xs" >
|
||||
<i class="icon-refresh icon-spin icon-fw"></i>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<button id="reload-fields">Reload file</button>
|
||||
<a class="pull-right" href="{$import_link}">Go to import page</a>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function find_fields() {
|
||||
$.ajax({
|
||||
url: '{$get_fields_link}',
|
||||
type: 'post',
|
||||
data: $('#tab-general :input'),
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$('#api-loader').show();
|
||||
$('#configuration_form').hide();
|
||||
$('#reload-fields').button('loading');
|
||||
|
||||
},
|
||||
complete: function() {
|
||||
$('#api-loader').hide();
|
||||
$('#configuration_form').show();
|
||||
$('#reload-fields').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
if(json['error']){
|
||||
alert(json['error']);
|
||||
} else {
|
||||
$('.api_field').empty();
|
||||
$('.api_field').append(new Option('--Please select--', 0));
|
||||
$.each(json.field, function(key, value) {
|
||||
$('.api_field').append(new Option(value, value));
|
||||
});
|
||||
|
||||
}
|
||||
$('#import_api_fields').val(json.fields);
|
||||
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
{if !$file_settings.fields}
|
||||
find_fields();
|
||||
{/if}
|
||||
});
|
||||
|
||||
$(document).delegate('#reload-fields', 'click', function() {
|
||||
find_fields();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user