{#**
 * 2007-2017 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2017 PrestaShop SA
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *#}
<div class="col-md-12">

  <h2>{{ 'Search Engine Optimization'|trans({}, 'Admin.Catalog.Feature') }}</h2>
  <p class="subtitle">{{ 'Improve your ranking and how your product page will appear in search engines results.'|trans({}, 'Admin.Catalog.Feature') }}</p>

  <div class="row">
    <div class="col-md-9">
      <fieldset class="form-group">
        <label class="form-control-label">
          {{ form.meta_title.vars.label }}
          <span class="help-box" data-toggle="popover"
            data-content="{{ "Public title for the product's page, and for search engines. Leave blank to use the product name. The number of remaining characters is displayed to the left of the field."|trans({}, 'Admin.Catalog.Help') }}" ></span>
        </label>
        {{ form_errors(form.meta_title) }}
        {{ form_widget(form.meta_title) }}
      </fieldset>
    </div>
  </div>

  <div class="row">
    <div class="col-md-9">
      <fieldset class="form-group">
        <label class="form-control-label">
          {{ form.meta_description.vars.label }}
          <span class="help-box" data-toggle="popover"
            data-content="{{ "This description will appear in search engines. You need a single sentence, shorter than 160 characters (including spaces)."|trans({}, 'Admin.Catalog.Help') }}" ></span>
        </label>
        {{ form_errors(form.meta_description) }}
        {{ form_widget(form.meta_description) }}
      </fieldset>
    </div>
  </div>
  <fieldset class="form-group">
    <label class="form-control-label">
      {{ form.link_rewrite.vars.label }}
      <span class="help-box" data-toggle="popover"
        data-content="{{ "This is the human-readable URL, as generated from the product's name. You can change it if you want."|trans({}, 'Admin.Catalog.Help') }}" ></span>
    </label>
    {{ form_errors(form.link_rewrite) }}
    <div class="row">
      <div class="col-md-7">
        {{ form_widget(form.link_rewrite) }}
      </div>
      <div class="col-md-2">
        <button type="button" class="btn-action btn btn-action btn-block text-uppercase" id="seo-url-regenerate">{{ 'Reset URL'|trans({}, 'Admin.Catalog.Feature') }}</button>
      </div>
    </div>
  </fieldset>

  <div class="row">
    <div class="col-md-9">
      <div class="alert alert-info" role="alert">
        <i class="material-icons">help</i>
        <p class="alert-text">
          {% if 'PS_REWRITING_SETTINGS'|configuration == 0 %}
            <strong>{{ 'Friendly URLs are currently disabled.'|trans({}, 'Admin.Catalog.Notification') }}</strong>
            {{ 'To enable it, go to [1]SEO and URLs[/1]'|trans({}, 'Admin.Catalog.Notification')|replace({'[1]': '<a href="' ~ getAdminLink("AdminMeta") ~ '#meta_fieldset_general">', '[/1]': '</a>'})|raw }}
          {% else %}
            <strong>{{ 'Friendly URLs are currently enabled.'|trans({}, 'Admin.Catalog.Notification') }}</strong>
            {{ 'To disable it, go to [1]SEO and URLs[/1]'|trans({}, 'Admin.Catalog.Notification')|replace({'[1]': '<a href="' ~ getAdminLink("AdminMeta") ~ '#meta_fieldset_general">', '[/1]': '</a>'})|raw }}
          {% endif %}
        </p>
        <p class="alert-text">
          {% if 'PS_FORCE_FRIENDLY_PRODUCT'|configuration == 1 %}
            <strong>{{ 'The "Force update of friendly URL" option is currently enabled.'|trans({}, 'Admin.Catalog.Notification') }}</strong>
            {# "It" refers to the option "Force update of friendly URL" #}
            {{ 'To disable it, go to [1]Product Settings[/1]'|trans({}, 'Admin.Catalog.Notification')|replace({'[1]': '<a href="' ~ getAdminLink("AdminPPreferences") ~ '#configuration_fieldset_products">', '[/1]': '</a>'})|raw }}
          {% endif %}
        </p>
      </div>
    </div>
  </div>

  <h2>
    {{ 'Redirection page'|trans({}, 'Admin.Catalog.Feature') }}
    <span class="help-box" data-toggle="popover"
      data-content="{{ "When your product is disabled, choose to which page you’d like to redirect the customers visiting its page."|trans({}, 'Admin.Catalog.Help') }}" ></span>
  </h2>

  <div class="row">

    <div class="col-md-4">
      <fieldset class="form-group">
        <label class="form-control-label">{{ form.redirect_type.vars.label }}</label>
        {{ form_errors(form.redirect_type) }}
        {{ form_widget(form.redirect_type) }}
      </fieldset>
    </div>

    <div class="col-md-5" id="id-product-redirected">
      <fieldset class="form-group">
        <label class="form-control-label">{{ form.id_type_redirected.vars.label }}</label>
        {{ form_errors(form.id_type_redirected) }}
        {{ form_widget(form.id_type_redirected) }}
      </fieldset>

    </div>
  </div>
  <div class="row">
    <div class="col-md-9">
      <div class="alert alert-info" role="alert">
        <i class="material-icons">help</i>
        <p class="alert-text">
          {{ 'No redirection (404) = Do not redirect anywhere and display a 404 "Not Found" page.'|trans({}, 'Admin.Catalog.Help') }}<br>
          {{ 'Permanent redirection (301) = Permanently display another product or category instead.'|trans({}, 'Admin.Catalog.Help') }}<br>
          {{ 'Temporary redirection (302) = Temporarily display another product or category instead.'|trans({}, 'Admin.Catalog.Help') }}
        </p>
      </div>
    </div>
  </div>
</div>
