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

{% block section %}add-category{% endblock %}
{% block left-slot-wrapper %}{% endblock %}

{% block content %}
    <div id="manage-tabs">
        <ul>
            <li class="ui-tabs-nav-item"><a href="#data">{% trans 'Add category' %}</a></li>
        </ul>
        <div id="data">
            <h2>{% trans "Add category" %}</h2>
            <form action="{% url lfs_manage_add_category category.id %}"
                  method="post">
                {% csrf_token %}  
                <table>
                    {% include "manage/lfs_form.html" %}
                </table>
                
                <div class="buttons">                    
                    <input type="submit" 
                           class="button"
                           value="{% trans 'Add category' %}" />

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