<div class="newsletter-popup">
  <div class="popup_inside astron_popup">
    <img class="close_popup lazyload" data-src="{{ 'newsletter_modal_close_button.png' | asset_url }}" alt="" />
    <div class="left_img">
      {% if section.settings.image != blank %}
      	{% include 'image-element', image: section.settings.image, alt: section.settings.image %}
      {% endif %}
    </div>
    <div class="newsletter_form">
      <div class="footer_content_right">
        <div class="site-popup__newsletter
                    {% if section.blocks.size == 1 %} site-footer__single-block--centered{% endif %}">
          {%- assign formId = 'ContactFooter' -%}
          {% if section.settings.title != blank %}
          	<h2>{{ section.settings.title }}</h2>
          {% endif %}
          {% if section.settings.content != blank %}
          	<p>{{ section.settings.content }}</p>
          {% endif %}
          {% form 'customer', id: formId, novalidate: 'novalidate' %}
          {%- if form.posted_successfully? -%}
          <p class="form-message form-message--success" tabindex="-1" data-form-status>
            {{ 'general.newsletter_form.confirmation' | t }}
          </p>
          {%- endif -%}
          <input type="hidden" name="contact[tags]" value="newsletter">
          <div class="input-group {% if form.errors %} input-group--error{% endif %}">
            <input type="email"
                   name="contact[email]"
                   id="{{ formId }}-email"
                   class="input-group__field newsletter__input{% if form.errors %} input--error{% endif %}"
                   value="{{ form.email }}"
                   placeholder="Seu melhor e-mail"
                   aria-label="{{ 'general.newsletter_form.email_placeholder' | t }}"
                   aria-required="true"
                   required
                   autocorrect="off"
                   autocapitalize="off"
                   {% if form.errors %}
                   aria-invalid="true"
                   aria-describedby="{{ formId }}-email-error"
                   data-form-status
                   {% endif %}>
            <span class="input-group__btn">
              <button type="submit" class="btn newsletter__submit" name="commit" id="Subscribe">
                <span class="newsletter__submit-text--large">Cadastrar</span>
              </button>
            </span>
          </div>
          {% if form.errors contains 'email' %}
          <span id="{{ formId }}-email-error" class="input-error-message">
            <span class="visually-hidden">{{ 'general.accessibility.error' | t }} </span>
            {% include 'icon-error' %}
            <span class="site-footer__newsletter-error">{{ form.errors.translated_fields['email'] | capitalize }} {{ form.errors.messages['email'] }}.</span>
          </span>
          {% endif %}
          {% endform %}
        </div>
  	</div>
	</div>
</div>




{% comment %}
<script type="text/javascript">
  jQuery(document).ready(function (){
    setTimeout(function(){
    	jQuery('.newsletter-popup').show();
      }, 20000);
  });
</script>
{% endcomment %}


{% schema %}
  {
    "name": "Newsletter",
    "settings": [
  	{
  		"type": "image_picker",
  		"id": "image",
  		"label": "Imagem"
  	},
  	{
  		"type": "text",
  		"id": "title",
  		"label": "Título"
  	},
  	{
  		"type": "textarea",
  		"id": "content",
  		"label": "Conteúdo"
  	}

  	]
  }
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}
