shop.balmet.com

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

etsy_edit.twig (5531B)


      1 {{ header }}{{ column_left }}
      2 <div id="content">
      3   <div class="page-header">
      4     <div class="container-fluid">
      5       <div class="pull-right">
      6         <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default" id="btn-cancel"><i class="fa fa-reply"></i></a>
      7       </div>
      8       <h1>{{ heading_title }}</h1>      <ul class="breadcrumb">
      9         {% for breadcrumb in breadcrumbs %}
     10         <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
     11         {% endfor %}
     12       </ul>
     13     </div>
     14   </div>
     15   <div class="container-fluid">
     16     <div class="panel panel-default">
     17       <div class="panel-heading">
     18         <h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_edit }}</h3>
     19       </div>
     20       <div class="panel-body">
     21         <div id="page-listing">
     22           {% if error_warning %}
     23           <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}</div>
     24           {% endif %}
     25           <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form" class="form-horizontal">
     26             <input type="hidden" name="etsy_item_id" value="{{ etsy_item_id }}" />
     27             <input type="hidden" name="product_id" value="{{ product_id }}"/>
     28             <ul class="nav nav-tabs">
     29               <li class="active"><a href="#tab-listing-general" data-toggle="tab">{{ tab_general }}</a></li>
     30             </ul>
     31             <div class="tab-content">
     32               <div id="tab-listing-general" class="tab-pane active">
     33                 <div class="form-group required">
     34                   <label class="col-sm-2 control-label" for="input-title">{{ entry_title }}</label>
     35                   <div class="col-sm-10">
     36                     <input type="text" name="title" value="{{ listing.title }}" placeholder="{{ entry_title }}" id="input-title" class="form-control" />
     37                   </div>
     38                 </div>
     39                 <div class="form-group required">
     40                   <label class="col-sm-2 control-label" for="input-description">{{ entry_description }}</label>
     41                   <div class="col-sm-10">
     42                     <textarea name="description" placeholder="{{ entry_description }}" id="input-description" class="form-control">{{ listing.description }}</textarea>
     43                   </div>
     44                 </div>
     45                 <div class="form-group required">
     46                   <label class="col-sm-2 control-label" for="input-price">{{ entry_price }}</label>
     47                   <div class="col-sm-10">
     48                     <input type="text" name="price" value="{{ listing.price }}" placeholder="{{ entry_price }}" id="input-price" class="form-control" />
     49                   </div>
     50                 </div>
     51                 <div class="form-group required">
     52                   <label class="col-sm-2 control-label" for="input-state">{{ entry_state }}</label>
     53                   <div class="col-sm-10">
     54                     <select name="state" id="input-state" class="form-control">
     55                       {% for state in setting.state %}
     56                       <option value="{{ state }}" {% if listing.state == state %} selected{% endif %}>{{ state }}</option>
     57                       {% endfor %}
     58                     </select>
     59                   </div>
     60                 </div>
     61               </div>
     62               <div class="well">
     63                 <div class="row">
     64                   <div class="col-sm-12 text-right">
     65                     <a data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary" id="button-save"><i class="fa fa-save"></i></a>
     66                   </div>
     67                 </div>
     68               </div>
     69             </div>
     70           </form>
     71         </div>
     72         <div id="page-listing-success" style="display:none;">
     73           <div class="well">
     74             <div class="row">
     75               <div class="col-sm-12">
     76                 <h3>{{ text_updated }}</h3>
     77               </div>
     78             </div>
     79           </div>
     80         </div>
     81       </div>
     82     </div>
     83   </div>
     84 </div>
     85 <script type="text/javascript"><!--
     86   var image_count = 1;
     87 
     88   $('#button-save').bind('click', function() {
     89     $.ajax({
     90       url: 'index.php?route=extension/openbay/etsy_product/editsubmit&user_token={{ user_token }}',
     91       beforeSend: function(){
     92         $('#button-submit').empty().html('<i class="fa fa-cog fa-lg fa-spin"></i>').attr('disabled','disabled');
     93       },
     94       type: 'post',
     95       data: $("#form").serialize(),
     96       dataType: 'json',
     97       success: function(json) {
     98         if (json.error) {
     99           if (json.code) {
    100             alert(json.error);
    101           } else {
    102             $.each(json.error, function( k, v ) {
    103               alert(v);
    104             });
    105           }
    106           $('#button-submit').empty().html('<span>{{ button_submit }}</span>').removeAttr('disabled');
    107         } else {
    108           if (json.listing_id) {
    109             $('#page-listing').hide();
    110             $('#page-listing-success').fadeIn();
    111             $('#button-submit').empty().html('<span>{{ button_submit }}</span>').removeAttr('disabled');
    112           }
    113         }
    114       },
    115       error: function (xhr, ajaxOptions, thrownError) {
    116         if (xhr.status != 0) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); }
    117         $('#button-submit').empty().html('<span>{{ button_submit }}</span>').removeAttr('disabled');
    118       }
    119     });
    120   });
    121 
    122 //--></script>
    123 {{ footer }}