<div class="modal-header">
  <button type="button" class="pull-right btn btn-danger btn-sm" data-dismiss="modal" aria-hidden="true"><i class="fa fa-close"></i></button>
  <h4 class="modal-title">{{ text_size }}</h4>
</div>
<div class="modal-body" id="body-mass-product-weight">
  <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-mass-product-weight" class="form-horizontal">	
	<div class="alert alert-info"><i class="fa fa-info-circle"></i> {{ text_edit_info }}</div>
	<div class="form-group">
	  <div class="col-sm-3">
		<label class="control-label" for="input-length">{{ entry_length }}</label>
		<div class="input-group">
		  <span class="input-group-addon"><input type="checkbox" name="status_length" value="1" /></span>
		  <input type="text" name="length" value="" placeholder="{{ entry_length }}" id="input-length" class="form-control" />
		</div>
	  </div>
	  <div class="col-sm-3">
		<label class="control-label" for="input-height">{{ entry_height }}</label>
		<div class="input-group">
		  <span class="input-group-addon"><input type="checkbox" name="status_height" value="1" /></span>
		  <input type="text" name="height" value="" placeholder="{{ entry_height }}" id="input-height" class="form-control" />
		</div>
	  </div>	
	  <div class="col-sm-3">
		<label class="control-label" for="input-width">{{ entry_width }}</label>
		<div class="input-group">
		  <span class="input-group-addon"><input type="checkbox" name="status_width" value="1" /></span>
		  <input type="text" name="width" value="" placeholder="{{ entry_width }}" id="input-width" class="form-control" />
		</div>
	  </div>
	  <div class="col-sm-3">
		<label class="control-label" for="input-length-class">{{ entry_length_class }}</label>
		<div class="input-group">
		  <span class="input-group-addon"><input type="checkbox" name="status_length_class" value="1" /></span>
		  <select name="length_class_id" id="input-length-class" class="form-control">
			{% for length_class in length_classes %}
			  <option value="{{ length_class.length_class_id }}">{{ length_class.title }}</option>
			{% endfor %}
		  </select>
		</div>
	  </div>
	</div>
	<div class="form-group">
	  <div class="col-sm-6">
		<label class="control-label" for="input-weight">{{ entry_weight }}</label>
		<div class="input-group">
		  <span class="input-group-addon"><input type="checkbox" name="status_weight" value="1" /></span>
		  <input type="text" name="weight" value="" placeholder="{{ entry_weight }}" id="input-weight" class="form-control" />
		</div>
	  </div>
	  <div class="col-sm-6">
		<label class="control-label" for="input-length-class">{{ entry_weight_class }}</label>
		<div class="input-group">
		  <span class="input-group-addon"><input type="checkbox" name="status_weight_class" value="1" /></span>
		  <select name="weight_class_id" id="input-weight-class" class="form-control">
			{% for weight_class in weight_classes %}
			  <option value="{{ weight_class.weight_class_id }}">{{ weight_class.title }}</option>
			{% endfor %}
		  </select>
		</div>
	  </div>
	</div>
  </form>
</div>
<div class="modal-footer">
  <div class="text-center"><a data-form="form-mass-product-weight" class="button-save btn btn-primary"><i class="fa fa-save"></i> {{ button_save }}</a></div>
</div>
<script type="text/javascript"><!--
$(".button-save").on('click', function(){		
	$.ajax({
		url: $('#' + $(this).data('form')).attr('action'),
		type: 'post',
		dataType: 'json',
		data: $('#product-list input[type=\'checkbox\']:checked, #' + $(this).data('form') + ' input[type=\'text\'], #' + $(this).data('form') + ' input[type=\'checkbox\']:checked, #' + $(this).data('form') + ' select'),
		success: function(json) {				
			if (json['error']) {
				$('#form-mass-product-weight').before('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
				
				$('.alert-danger').delay(1500).fadeOut(500);	
			}
								
			if (json['success']) {
				$('#form-mass-product-weight').before('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');	
				
				setTimeout(function(){
					$('#modal-product-edit').modal('hide');
				}, 1000)
			}
		}
	});
});  
//--></script>