featured.twig (5668B)
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-module" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button> 7 <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div> 8 <h1>{{ heading_title }}</h1> 9 <ul class="breadcrumb"> 10 {% for breadcrumb in breadcrumbs %} 11 <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li> 12 {% endfor %} 13 </ul> 14 </div> 15 </div> 16 <div class="container-fluid"> 17 {% if error_warning %} 18 <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }} 19 <button type="button" class="close" data-dismiss="alert">×</button> 20 </div> 21 {% endif %} 22 <div class="panel panel-default"> 23 <div class="panel-heading"> 24 <h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_edit }}</h3> 25 </div> 26 <div class="panel-body"> 27 <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-module" class="form-horizontal"> 28 <div class="form-group"> 29 <label class="col-sm-2 control-label" for="input-name">{{ entry_name }}</label> 30 <div class="col-sm-10"> 31 <input type="text" name="name" value="{{ name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control" /> 32 {% if error_name %} 33 <div class="text-danger">{{ error_name }}</div> 34 {% endif %} 35 </div> 36 </div> 37 <div class="form-group"> 38 <label class="col-sm-2 control-label" for="input-product"><span data-toggle="tooltip" title="{{ help_product }}">{{ entry_product }}</span></label> 39 <div class="col-sm-10"> 40 <input type="text" name="product_name" value="" placeholder="{{ entry_product }}" id="input-product" class="form-control" /> 41 <div id="featured-product" class="well well-sm" style="height: 150px; overflow: auto;"> 42 {% for product in products %} 43 <div id="featured-product{{ product.product_id }}"><i class="fa fa-minus-circle"></i> {{ product.name }} 44 <input type="hidden" name="product[]" value="{{ product.product_id }}" /> 45 </div> 46 {% endfor %} 47 </div> 48 </div> 49 </div> 50 <div class="form-group"> 51 <label class="col-sm-2 control-label" for="input-limit">{{ entry_limit }}</label> 52 <div class="col-sm-10"> 53 <input type="text" name="limit" value="{{ limit }}" placeholder="{{ entry_limit }}" id="input-limit" class="form-control" /> 54 </div> 55 </div> 56 <div class="form-group"> 57 <label class="col-sm-2 control-label" for="input-width">{{ entry_width }}</label> 58 <div class="col-sm-10"> 59 <input type="text" name="width" value="{{ width }}" placeholder="{{ entry_width }}" id="input-width" class="form-control" /> 60 {% if error_width %} 61 <div class="text-danger">{{ error_width }}</div> 62 {% endif %} 63 </div> 64 </div> 65 <div class="form-group"> 66 <label class="col-sm-2 control-label" for="input-height">{{ entry_height }}</label> 67 <div class="col-sm-10"> 68 <input type="text" name="height" value="{{ height }}" placeholder="{{ entry_height }}" id="input-height" class="form-control" /> 69 {% if error_height %} 70 <div class="text-danger">{{ error_height }}</div> 71 {% endif %} 72 </div> 73 </div> 74 <div class="form-group"> 75 <label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label> 76 <div class="col-sm-10"> 77 <select name="status" id="input-status" class="form-control"> 78 {% if status %} 79 <option value="1" selected="selected">{{ text_enabled }}</option> 80 <option value="0">{{ text_disabled }}</option> 81 {% else %} 82 <option value="1">{{ text_enabled }}</option> 83 <option value="0" selected="selected">{{ text_disabled }}</option> 84 {% endif %} 85 </select> 86 </div> 87 </div> 88 </form> 89 </div> 90 </div> 91 </div> 92 <script type="text/javascript"><!-- 93 $('input[name=\'product_name\']').autocomplete({ 94 source: function(request, response) { 95 $.ajax({ 96 url: 'index.php?route=catalog/product/autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request), 97 dataType: 'json', 98 success: function(json) { 99 response($.map(json, function(item) { 100 return { 101 label: item['name'], 102 value: item['product_id'] 103 } 104 })); 105 } 106 }); 107 }, 108 select: function(item) { 109 $('input[name=\'product_name\']').val(''); 110 111 $('#featured-product' + item['value']).remove(); 112 113 $('#featured-product').append('<div id="featured-product' + item['value'] + '"><i class="fa fa-minus-circle"></i> ' + item['label'] + '<input type="hidden" name="product[]" value="' + item['value'] + '" /></div>'); 114 } 115 }); 116 117 $('#featured-product').delegate('.fa-minus-circle', 'click', function() { 118 $(this).parent().remove(); 119 }); 120 //--></script></div> 121 {{ footer }}