app/views/plugins/ecommerce/admin/coupons/form.html.erb in camaleon_ecommerce-0.0.4 vs app/views/plugins/ecommerce/admin/coupons/form.html.erb in camaleon_ecommerce-1.1

- old
+ new

@@ -2,11 +2,10 @@ <h2><span class="fa fa-tag"></span> <%= @coupon.new_record? ? "#{t('plugin.ecommerce.new_coupon')}" : "#{t('plugin.ecommerce.edit_coupon')}: #{@coupon.name}" %></h2> </div> <!-- PAGE CONTENT WRAPPER --> <div class="page-content-wrap"> - <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="panel panel-default"> <div class="panel-heading ui-draggable-handle"> <h3 class="panel-title"><%= t('plugin.ecommerce.form_coupon') %></h3> @@ -37,12 +36,15 @@ <label for=""><%= t('plugin.ecommerce.table.min_cart_total') %></label><br> <%= text_field_tag "options[min_cart_total]",options[:min_cart_total] || '', :class => "form-control required" %> </div> <div class="form-group"> - <label for=""><%= t('plugin.ecommerce.table.expiration_date') %></label><br> - <%= text_field_tag "options[expirate_date]",options[:expirate_date] || '', :class => "form-control required" %> + <label for=""><%= t('plugin.ecommerce.table.expiration_date') %></label><br> + <div class="input-group date date-input-box"> + <%= text_field_tag "options[expirate_date]",options[:expirate_date] || '', :class => "form-control required", "data-locale" => current_locale %> + <span class="add-on input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span> + </div> </div> <div class="form-group"> <label for=""><%= t('plugin.ecommerce.table.allowed_applications') %></label><br> <%= number_field_tag "options[allowed_applications]", options[:allowed_applications] || '1', :class => "form-control required" %> @@ -57,17 +59,15 @@ <a class="btn btn-default" href="<%= url_for action: :index %>" role="back"><%= t('camaleon_cms.admin.button.back')%></a> <button class="btn btn-primary pull-right" type="submit"><%= t('camaleon_cms.admin.button.submit')%></button> </div> <% end %> </div> - - </div> </div> </div> - -<% add_asset_library('datepicker') %> <script> - run.push(function(){ - jQuery( '#form-coupon' ).on( "change", 'input[type="number"], #options_min_cart_total', function() {setTimeout(function(){jQuery(this).val(Math.abs(jQuery(this).val()) || 0);}.bind(this), 60)}); - }) + jQuery(function(){ + var form = jQuery( '#form-coupon'); + form.on( "change", 'input[type="number"], #options_min_cart_total', function() {setTimeout(function(){jQuery(this).val(Math.abs(jQuery(this).val()) || 0);}.bind(this), 60)}); + form.find('#options_expirate_date').parent().datepicker(); + }); </script>