shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

fba_settings.twig (12222B)


      1 {{ header }}{{ column_left }}
      2 <div id="content">
      3   <div class="page-header">
      4     <div class="container-fluid">
      5       <div class="pull-right">
      6         <button type="submit" form="form-fba-settings" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary" onclick="validateForm(); return false;"><i class="fa fa-check-circle"></i></button>
      7         <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a>
      8       </div>
      9       <h1>{{ heading_title }}</h1>
     10       <ul class="breadcrumb">
     11         {% for breadcrumb in breadcrumbs %}
     12         <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
     13         {% endfor %}
     14       </ul>
     15     </div>
     16   </div>
     17   <div class="container-fluid">
     18     {% if error_warning %}
     19       <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}</div>
     20     {% endif %}
     21     <div class="panel panel-default">
     22       <div class="panel-heading">
     23         <h3 class="panel-title"><i class="fa fa-amazon"></i> {{ text_edit }}</h3>
     24       </div>
     25       <div class="panel-body">
     26         <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-fba-settings" class="form-horizontal">
     27           {% if openbay_fba_api_key is empty %}
     28           <a href="{{ link_signup }}" target="_blank"><div class="alert alert-info"><h5 style="font-size: 14px;"><i class="fa fa-user-plus fa-2x"></i>&nbsp;&nbsp;{{ text_register_banner }}</h5></div></a>
     29           {% endif %}
     30           <div class="tab-pane active" id="tab-general">
     31             <div class="well" id="credential-container">
     32               <div class="form-group">
     33                 <label class="col-sm-2 control-label" for="openbay_fba_api_key"><span data-toggle="tooltip" data-container="#tab-content" title="{{ help_api_key }}">{{ entry_api_key }}</span></label>
     34                 <div class="col-sm-10">
     35                   <input type="text" name="openbay_fba_api_key" value="{{ openbay_fba_api_key }}" placeholder="{{ entry_api_key }}" id="openbay_fba_api_key" class="form-control credentials" />
     36                 </div>
     37               </div>
     38               <div class="form-group">
     39                 <label class="col-sm-2 control-label" for="openbay_fba_encryption_key"><span data-toggle="tooltip" data-container="#tab-content" title="{{ help_encryption_key }}">{{ entry_encryption_key }}</span></label>
     40                 <div class="col-sm-10">
     41                   <input type="text" name="openbay_fba_encryption_key" value="{{ openbay_fba_encryption_key }}" placeholder="{{ entry_encryption_key }}" id="openbay_fba_encryption_key" class="form-control credentials" />
     42                 </div>
     43               </div>
     44               <div class="form-group">
     45                 <label class="col-sm-2 control-label" for="openbay_fba_encryption_iv"><span data-toggle="tooltip" data-container="#tab-content" title="{{ help_encryption_iv }}">{{ entry_encryption_iv }}</span></label>
     46                 <div class="col-sm-10">
     47                   <input type="text" name="openbay_fba_encryption_iv" value="{{ openbay_fba_encryption_iv }}" placeholder="{{ entry_encryption_iv }}" id="openbay_fba_encryption_iv" class="form-control credentials" />
     48                 </div>
     49               </div>
     50               <div class="form-group">
     51                 <label class="col-sm-2 control-label" for="openbay_fba_api_account_id"><span data-toggle="tooltip" data-container="#tab-content" title="{{ help_account_id }}">{{ entry_account_id }}</span></label>
     52                 <div class="col-sm-10">
     53                   <input type="text" name="openbay_fba_api_account_id" value="{{ openbay_fba_api_account_id }}" placeholder="{{ entry_account_id }}" id="openbay_fba_api_account_id" class="form-control credentials" />
     54                 </div>
     55               </div>
     56               <div class="form-group">
     57                 <div class="col-sm-12 pull-right">
     58                   <a class="btn btn-info pull-right" id="button-verify">{{ button_verify }}</a>
     59                 </div>
     60               </div>
     61             </div>
     62             <div class="form-group">
     63               <label class="col-sm-2 control-label" for="openbay_fba_status">{{ text_status }}</label>
     64               <div class="col-sm-10">
     65                 <select name="openbay_fba_status" id="openbay_fba_status" class="form-control">
     66                   {% if openbay_fba_status %}
     67                   <option value="1" selected="selected">{{ text_enabled }}</option>
     68                   <option value="0">{{ text_disabled }}</option>
     69                   {% else %}
     70                   <option value="1">{{ text_enabled }}</option>
     71                   <option value="0" selected="selected">{{ text_disabled }}</option>
     72                   {% endif %}
     73                 </select>
     74               </div>
     75             </div>
     76             <div class="form-group">
     77               <label class="col-sm-2 control-label" for="openbay_fba_debug_log"><span data-toggle="tooltip" data-container="#tab-content" title="{{ help_debug_log }}">{{ entry_debug_log }}</span></label>
     78               <div class="col-sm-10">
     79                 <select name="openbay_fba_debug_log" id="openbay_fba_debug_log" class="form-control">
     80                   {% if openbay_fba_debug_log %}
     81                   <option value="1" selected="selected">{{ text_yes }}</option>
     82                   <option value="0">{{ text_no }}</option>
     83                   {% else %}
     84                   <option value="1">{{ text_yes }}</option>
     85                   <option value="0" selected="selected">{{ text_no }}</option>
     86                   {% endif %}
     87                 </select>
     88               </div>
     89             </div>
     90             <div class="form-group">
     91               <label class="col-sm-2 control-label" for="openbay_fba_send_orders"><span data-toggle="tooltip" data-container="#tab-content" title="{{ help_send_orders }}">{{ entry_send_orders }}</span></label>
     92               <div class="col-sm-10">
     93                 <select name="openbay_fba_send_orders" id="openbay_fba_send_orders" class="form-control">
     94                   {% if openbay_fba_send_orders %}
     95                   <option value="1" selected="selected">{{ text_yes }}</option>
     96                   <option value="0">{{ text_no }}</option>
     97                   {% else %}
     98                   <option value="1">{{ text_yes }}</option>
     99                   <option value="0" selected="selected">{{ text_no }}</option>
    100                   {% endif %}
    101                 </select>
    102               </div>
    103             </div>
    104             <div class="form-group">
    105               <label class="col-sm-2 control-label" for="openbay_fba_only_fill_complete"><span data-toggle="tooltip" data-container="#tab-content" title="{{ help_only_fill_complete }}">{{ entry_only_fill_complete }}</span></label>
    106               <div class="col-sm-10">
    107                 <select name="openbay_fba_only_fill_complete" id="openbay_fba_only_fill_complete" class="form-control">
    108                   {% if openbay_fba_only_fill_complete %}
    109                   <option value="1" selected="selected">{{ text_yes }}</option>
    110                   <option value="0">{{ text_no }}</option>
    111                   {% else %}
    112                   <option value="1">{{ text_yes }}</option>
    113                   <option value="0" selected="selected">{{ text_no }}</option>
    114                   {% endif %}
    115                 </select>
    116               </div>
    117             </div>
    118             <div class="form-group">
    119               <label class="col-sm-2 control-label" for="openbay_fba_order_prefix"><span data-toggle="tooltip" data-container="#tab-content" title="{{ help_order_id_prefix }}">{{ entry_order_id_prefix }}</span></label>
    120               <div class="col-sm-10">
    121                 <p class="alert alert-warning"><i class="fa fa-exclamation-circle"></i> {{ text_prefix_warning }}</p>
    122                 <input{% if prefix_can_edit == false %} disabled{% endif %} type="text" name="openbay_fba_order_prefix" value="{{ openbay_fba_order_prefix }}" placeholder="{{ entry_order_id_prefix }}" id="openbay_fba_order_prefix" class="form-control" />
    123               </div>
    124             </div>
    125             <div class="form-group">
    126               <label class="col-sm-2 control-label" for="openbay_fba_fulfill_policy"><span data-toggle="tooltip" data-container="#tab-content" title="{{ help_fulfill_policy }}">{{ entry_fulfill_policy }}</span></label>
    127               <div class="col-sm-10">
    128                 <select name="openbay_fba_fulfill_policy" id="openbay_fba_fulfill_policy" class="form-control ftpsetting">
    129                   {% for code,text in fulfillment_policy %}
    130                     <option value="{{ code }}" {% if openbay_fba_fulfill_policy == code %} selected{% endif %}>{{ text }}</option>
    131                   {% endfor %}
    132                 </select>
    133               </div>
    134             </div>
    135             <div class="form-group">
    136               <label class="col-sm-2 control-label" for="openbay_fba_shipping_speed"><span data-toggle="tooltip" data-container="#tab-content" title="{{ help_shipping_speed }}">{{ entry_shipping_speed }}</span></label>
    137               <div class="col-sm-10">
    138                 <select name="openbay_fba_shipping_speed" id="openbay_fba_shipping_speed" class="form-control ftpsetting">
    139                   {% for code,text in shipping_speed %}
    140                     <option value="{{ code }}" {% if openbay_fba_shipping_speed == code %} selected{% endif %}>{{ text }}</option>
    141                   {% endfor %}
    142                 </select>
    143               </div>
    144             </div>
    145             <div class="form-group">
    146               <label class="col-sm-2 control-label" for="openbay_fba_order_trigger_status"><span data-toggle="tooltip" data-container="#tab-content" title="{{ help_new_order_status }}">{{ entry_new_order_status }}</span></label>
    147               <div class="col-sm-10">
    148                 <select name="openbay_fba_order_trigger_status" id="openbay_fba_order_trigger_status" class="form-control">
    149                   {% for status in order_statuses %}
    150                     <option value="{{ status.order_status_id }}" {% if openbay_fba_order_trigger_status == status.order_status_id %} selected{% endif %}>{{ status.name }}</option>
    151                   {% endfor %}
    152                 </select>
    153               </div>
    154             </div>
    155           </div>
    156         </form>
    157       </div>
    158     </div>
    159   </div>
    160 </div>
    161 <script type="text/javascript"><!--
    162 $('#button-verify').click(function() {
    163   $.ajax({
    164     url: 'index.php?route=extension/openbay/fba/verifycredentials&user_token={{ user_token }}',
    165     dataType: 'json',
    166     method: 'POST',
    167     data: { 'openbay_fba_api_key' : $('#openbay_fba_api_key').val(), 'openbay_fba_api_account_id' : $('#openbay_fba_api_account_id').val(), 'openbay_fba_encryption_key' : $('#openbay_fba_encryption_key').val() },
    168     beforeSend: function() {
    169       $('#button-verify').empty().html('<i class="fa fa-cog fa-lg fa-spin"></i>').attr('disabled','disabled');
    170       $('.alert-dismissible').remove();
    171     },
    172     success: function(json) {
    173       if (json.error === false) {
    174         $('#credential-container').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ text_validate_success }}</div>');
    175       } else {
    176         if (json.error_messages) {
    177           $.each(json.error_messages, function(error_key, error_message) {
    178             $('#credential-container').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + error_message.message + '</div>');
    179           });
    180         } else {
    181           $('#credential-container').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_validation }}</div>');
    182           $('#button-verify').html('{{ button_verify }}');
    183         }
    184       }
    185       $('#button-verify').empty().html('{{ button_verify }}').removeAttr('disabled');
    186     },
    187     failure: function() {
    188       $('#button-verify').empty().html('{{ button_verify }}').removeAttr('disabled');
    189     }
    190   });
    191 });
    192 //--></script>
    193 {{ footer }}