{% trans_default_domain 'products' %}

<div {{ attributes }}>
   {{ form_start(form, {
      attr: {
         'data-action': 'live#action',
         'data-live-action-param': 'handleForm',
         'data-recaptcha-lazy': '',
         'data-watchdog': 'form',
      },
   }) }}
   {% set is_watchdog = this.productInfo %}

   {% if is_watchdog and this.isUserLoggedIn %}
      <a class="btn btn-outline btn-block" data-action="live#action" data-live-action-param="handleRemoveWatchdog">{{ 'watchdog.cancel'|trans }}</a>
      <a class="btn btn-outline btn-block" href="{{ this.showWatchUrl }}">{{ 'watchdog.show_guarded'|trans }}</a>
   {% endif %}

   {% if not is_watchdog %}
      <div class="product-info">
         <p class="title-default">{{ this.productTitle }}</p>
         {% if this.variationTitle %}
            <p class="variation">{{ this.variationTitle }}</p>
         {% endif %}
      </div>
      {% if this.watchPriceType %}
         <p>{{ 'watchdog.when_price_under'|trans }}</p>
         <div class="form-group">
            {{ form_row(form.minPrice, {attr: {class: 'form-control'}, label: false}) }}
         </div>
      {% else %}
         <p>{{ 'watchdog.when_instock'|trans }}</p>
      {% endif %}

      {% if not this.isUserLoggedIn %}
         <div class="form-group required">
            <label for="watchdog-email">E-mail</label>
            {{ form_row(form.email, {attr: {class: 'form-control'}, label: false}) }}
         </div>
      {% endif %}
      <p>
         {{ 'watchdog.policy.agree'|trans({'%consentUrl%': this.consentUrl, '%privacyPolicyUrl%': this.privacyPolicyUrl})|raw }}
      </p>
      <button class="btn btn-primary btn-block {% if this.submitting %}is-submitting{% endif %}" type="submit"
              data-sitekey="{{ this.siteShareSubModule }}" data-recaptcha="btn">
         {{ 'watchdog.guard'|trans }}
      </button>
   {% endif %}
   {{ form_end(form, {render_rest: false}) }}
</div>
