<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">{{ heading_generator_informations }}</h4>
</div>
<div class="modal-body">
  <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-seo-data" class="form-horizontal">
	<div class="form-group">
	  <div class="col-sm-6">
        <label class="control-label" for="template-url-alias">{{ heading_seo_url }}</label>
        <div class="input-group">
		  <span class="input-group-addon" data-toggle="tooltip" title="{{ help_template_seo_url }}"><i class="fa fa-exclamation-circle"></i> {{ column_template }}</span>
		  <input type="text" name="seo_template_information_seo_url" value="{{ seo_template_information_seo_url }}" id="template-seo-url" class="form-control" />
        </div>
		{{ text_informations_tags }}
      </div>
	  <div class="col-sm-6">
        <label class="control-label" for="input-overwrite"><span data-toggle="tooltip" title="{{ help_warning_overwrite }}">{{ column_overwrite }}</span></label>
		<div class="input-group">
		  <select name="overwrite_information" id="input-overwrite" class="form-control">
            <option value="dont_overwrite" selected="selected">{{ text_no_overwrite }}</option>
		    <option value="overwrite">{{ text_overwrite }}</option>
          </select>
		  <span class="input-group-btn">
		    <a onclick="generateSeoData('Informations', 'seo_url');" data-toggle="tooltip" title="{{ button_generate }}" class="btn btn-primary"><i class="fa fa-random"></i></a>
		  </span>
		</div>
      </div>
	</div>
	<div class="form-group">
	  <div class="col-sm-12">
        <label class="control-label" for="template-meta-title">{{ heading_meta_title }}</label>
        <div class="input-group">
		  <span class="input-group-addon" data-toggle="tooltip" title="{{ help_template_meta_title }}"><i class="fa fa-exclamation-circle"></i> {{ column_template }}</span>
		  <input type="text" name="seo_template_information_meta_title" value="{{ seo_template_information_meta_title }}" id="template-meta-title" class="form-control" />
		   <span class="input-group-btn">
		    <a onclick="generateSeoData('Informations', 'meta_title');" data-toggle="tooltip" title="{{ button_generate }}" class="btn btn-primary"><i class="fa fa-random"></i></a>
			<a onclick="deleteSeoData('Informations', 'meta_title');" data-toggle="tooltip" title="{{ button_del_meta_title }}" class="btn btn-danger"><i class="fa fa-trash-o"></i></a>
		   </span>
        </div>
		{{ text_informations_tags }}
      </div>
	</div>
	<div class="form-group{% if presence_column_meta_h1 == 'meta-tag-h1-not-in-opencart' %} hidden{% endif %}">
	  <div class="col-sm-12">
        <label class="control-label" for="template-meta-title">{{ heading_meta_h1 }}</label>
        <div class="input-group">
		  <span class="input-group-addon" data-toggle="tooltip" title="{{ help_template_meta_h1 }}"><i class="fa fa-exclamation-circle"></i> {{ column_template }}</span>
		  <input type="text" name="seo_template_information_meta_h1" value="{{ seo_template_information_meta_h1 }}" id="template-meta-h1" class="form-control" />
		   <span class="input-group-btn">
		    <a onclick="generateSeoData('Informations', 'meta_h1');" data-toggle="tooltip" title="{{ button_generate }}" class="btn btn-primary"><i class="fa fa-random"></i></a>
			<a onclick="deleteSeoData('Informations', 'meta_h1');" data-toggle="tooltip" title="{{ button_del_meta_h1 }}" class="btn btn-danger"><i class="fa fa-trash-o"></i></a>
		   </span>
        </div>
		{{ text_informations_tags }}
      </div>
	</div>
	<div class="form-group">
	  <div class="col-sm-12">
        <label class="control-label" for="template-meta-description">{{ heading_meta_description }}</label>
        <div class="input-group">
		  <span class="input-group-addon" data-toggle="tooltip" title="{{ help_template_meta_description }}"><i class="fa fa-exclamation-circle"></i> {{ column_template }}</span>
		  <input type="text" name="seo_template_information_meta_description" value="{{ seo_template_information_meta_description }}" id="template-meta-description" class="form-control" />
		   <span class="input-group-btn">
		    <a onclick="generateSeoData('Informations', 'meta_description');" data-toggle="tooltip" title="{{ button_generate }}" class="btn btn-primary"><i class="fa fa-random"></i></a>
			<a onclick="deleteSeoData('Informations', 'meta_description');" data-toggle="tooltip" title="{{ button_del_meta_description }}" class="btn btn-danger"><i class="fa fa-trash-o"></i></a>
		   </span>
        </div>
		{{ text_informations_meta_description_tags }}
      </div>
	</div>
	<div class="form-group">
	  <div class="col-sm-12">
        <label class="control-label" for="template-meta-keywords">{{ heading_meta_keywords }}</label>
        <div class="input-group">
		  <span class="input-group-addon" data-toggle="tooltip" title="{{ help_template_meta_keywords }}"><i class="fa fa-exclamation-circle"></i> {{ column_template }}</span>
		  <input type="text" name="seo_template_information_meta_keyword" value="{{ seo_template_information_meta_keyword }}" id="template-meta-keyword" class="form-control" />
		   <span class="input-group-btn">
		    <a onclick="generateSeoData('Informations', 'meta_keyword');" data-toggle="tooltip" title="{{ button_generate }}" class="btn btn-primary"><i class="fa fa-random"></i></a>
			<a onclick="deleteSeoData('Informations', 'meta_keyword');" data-toggle="tooltip" title="{{ button_del_meta_keywords }}" class="btn btn-danger"><i class="fa fa-trash-o"></i></a>
		   </span>
        </div>
		{{ text_informations_meta_keywords_tags }}
      </div>
	</div>
  </form>
</div>
<div class="modal-footer">
  <div class="text-center"><a data-form="form-seo-data" class="button-save btn btn-primary"><i class="fa fa-save"></i> {{ button_save_templates }}</a></div>
</div>
<script type="text/javascript"><!--
$(".button-save").on('click', function(){
	$.ajax({
		url: $('#' + $(this).data('form')).attr('action'),
		type: 'post',
		dataType: 'json',
		data: $('#' + $(this).data('form') + ' input[type=\'text\']'),
		success: function(json) {
			if (json['error']) {
				$('#form-seo-data').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-seo-data').before('<div class="alert alert-success"><i class="fa fa-exclamation-circle"></i> ' + json['success'] + '</div>');	
				
				$('.alert-success').delay(1500).fadeOut(500);
			}
		},
		error: function(xhr, ajaxOptions, thrownError) {
			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
		}
	});
});   
//--></script>