shop.balmet.com

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

developer.twig (6262B)


      1 <div class="modal-dialog">
      2   <div class="modal-content">
      3     <div class="modal-header">
      4       <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
      5       <h4 class="modal-title"><i class="fa fa-cog"></i> {{ heading_title }}</h4>
      6     </div>
      7     <div class="modal-body">
      8       <table class="table table-bordered">
      9         <thead>
     10           <tr>
     11             <td>{{ column_component }}</td>
     12             <td style="width: 150px;">{{ entry_cache }}</td>
     13             <td class="text-right" style="width: 1px;">{{ column_action }}</td>
     14           </tr>
     15         </thead>
     16         <tr>
     17           <td>{{ entry_theme }}</td>
     18           <td ><div class="btn-group" data-toggle="buttons">{% if developer_theme %}
     19               <label class="btn btn-success active" {% if not eval %}disabled="disabled"{% endif %}>
     20               <input type="radio" name="developer_theme" value="1" autocomplete="off" {% if not eval %}disabled="disabled"{% endif %} checked/>
     21               {{ button_on }}
     22               </label>
     23               {% else %}
     24               <label class="btn btn-success" {% if not eval %}disabled="disabled"{% endif %}>
     25               <input type="radio" name="developer_theme" value="1" autocomplete="off" {% if not eval %}disabled="disabled"{% endif %}/>
     26               {{ button_on }}
     27               </label>
     28               {% endif %}
     29               
     30               {% if not developer_theme %}
     31               <label class="btn btn-danger active" {% if not eval %}disabled="disabled"{% endif %}>
     32               <input type="radio" name="developer_theme" value="0" autocomplete="off" {% if not eval %}disabled="disabled"{% endif %} checked/>
     33               {{ button_off }}
     34               </label>
     35               {% else %}
     36               <label class="btn btn-danger" {% if not eval %}disabled="disabled"{% endif %}>
     37               <input type="radio" name="developer_theme" value="0" autocomplete="off" {% if not eval %}disabled="disabled"{% endif %}/>
     38               {{ button_off }}
     39               </label>
     40               {% endif %}</div></td>
     41           <td class="text-right"><button type="button" value="theme" data-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-warning"><i class="fa fa-refresh"></i></button></td>
     42         </tr>
     43         <tr>
     44           <td>{{ entry_sass }}</td>
     45           <td><div class="btn-group" data-toggle="buttons">{% if developer_sass %}
     46               <label class="btn btn-success active">
     47                 <input type="radio" name="developer_sass" value="1" autocomplete="off" checked>
     48                 {{ button_on }}</label>
     49               {% else %}
     50               <label class="btn btn-success">
     51                 <input type="radio" name="developer_sass" value="1" autocomplete="off">
     52                 {{ button_on }}</label>
     53               {% endif %}
     54               {% if not developer_sass %}
     55               <label class="btn btn-danger active">
     56                 <input type="radio" name="developer_sass" value="0" autocomplete="off" checked>
     57                 {{ button_off }}</label>
     58               {% else %}
     59               <label class="btn btn-danger">
     60                 <input type="radio" name="developer_sass" value="0" autocomplete="off">
     61                 {{ button_off }}</label>
     62               {% endif %}</div></td>
     63           <td class="text-right"><button type="button" value="sass" data-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-warning"><i class="fa fa-refresh"></i></button></td>
     64         </tr>
     65       </table>
     66     </div>
     67   </div>
     68 </div>
     69 <script type="text/javascript"><!--
     70 $('input[name=\'developer_theme\'], input[name=\'developer_sass\']').on('change', function() {
     71 	$.ajax({
     72 		url: 'index.php?route=common/developer/edit&user_token={{ user_token }}',		
     73 		type: 'post',
     74         data: $('input[name=\'developer_theme\']:checked, input[name=\'developer_sass\']:checked'),
     75 		dataType: 'json',
     76 		beforeSend: function() {
     77 			$('input[name=\'developer_theme\'], input[name=\'developer_sass\']').prop('disabled', true);
     78 		},
     79 		complete: function() {
     80 			$('input[name=\'developer_theme\'], input[name=\'developer_sass\']').prop('disabled', false);
     81 		},
     82 		success: function(json) {
     83             $('.alert-dismissible').remove();
     84 
     85             if (json['error']) {
     86                 $('#modal-developer .modal-body').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error']['warning'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
     87             }
     88 
     89             if (json['success']) {
     90 				$('#modal-developer .modal-body').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
     91 			}			
     92 		},
     93 		error: function(xhr, ajaxOptions, thrownError) {
     94 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
     95 		}
     96 	});	
     97 });	
     98 
     99 $('#modal-developer table button').on('click', function() {
    100 	var element = this;
    101 	
    102 	$.ajax({
    103 		url: 'index.php?route=common/developer/' + $(element).attr('value') + '&user_token={{ user_token }}',		
    104 		dataType: 'json',
    105 		beforeSend: function() {
    106 			$(element).button('loading');
    107 		},
    108 		complete: function() {
    109 			$(element).button('reset');
    110 		},
    111 		success: function(json) {
    112             $('.alert-dismissible').remove();
    113 
    114             if (json['error']) {
    115                 $('#modal-developer .modal-body').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error']['warning'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
    116             }
    117 
    118             if (json['success']) {
    119 				$('#modal-developer .modal-body').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
    120 			}			
    121 		},
    122 		error: function(xhr, ajaxOptions, thrownError) {
    123 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    124 		}
    125 	});
    126 });
    127 //--></script>