{% extends "oscar/customer/wishlists/wishlists_form.html" %}
{% load i18n %}

{% block tabcontent %}
<form method="post" data-behaviours="lock">
    {% csrf_token %}
    {{ shared_emails_formset.management_form }}
    {% if not wishlist %}
    <p>{% trans "What should your new wish list be called?" %}</p>
    {% endif %}
    {% include "oscar/partials/form_fields.html" %}
    {% if product %}
    <p>
        {% blocktrans with title=product.get_title %}After your wishlist is created, <strong>{{ title }}</strong> will be added.{% endblocktrans %}
    </p>
    {% endif %}
    <div class="wishlist-shared-emails mt-5">
        <h3>{% trans "Share wishlist" %}</h3>
        <small>
            {% trans "If you want to share your wishlist with others, you can add their email addresses below. The visibility must be set to shared in order for this to work." %}
        </small>
        {% for form in shared_emails_formset %}
            {% include "oscar/partials/form_fields.html" with form=form %}
        {% endfor %}
    </div>
    <div class="form-group form-actions">
        <button class="btn btn-primary" type="submit" data-loading-text="{% trans 'Saving...' %}">{% trans "Save" %}</button>
        {% trans "or" %} <a href="#" onclick="history.go(-1);return false" >{% trans "cancel" %}</a>.
    </div>
</form>
{% endblock tabcontent %}