{% extends "manage/manage_base.html" %}

{% load i18n %}
{% load lfs_tags %}

{% block section %}add-product{% endblock %}

{% block left-slot-wrapper %}{% endblock %}

{% block content %}

    <div id="product">

        <div id="manage-tabs">
            <ul>
                <li class="ui-tabs-nav-item"><a href="#data">{% trans 'Add product' %}</a></li>
            </ul>

            <div id="data">
                <form id="product-data-form"
                      action="{% url lfs.manage.views.add_product %}"
                      method="post">
                    {% csrf_token %}  
                    {% include "manage/lfs_form.html" %}

                    <div class="buttons">
                        <input class="button"
                               type="submit"
                               id="product-add-button"
                               value='{% trans "Add product" %}' />

                        <input type="button"
                               class="button"
                               onclick="window.location='{{ next }}'"
                               value="{% trans 'Cancel' %}" />

                        <input type="hidden"
                               name="next"
                               value="{{ next }}" />
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script>
        $(function() {
            $("#id_name").live("keyup", function() {
                var slug = $("#id_name").val()
                slug = URLify(slug, 200)
                $("#id_slug").val(slug);
            });
        });
    </script>
{% endblock %}
