{% load i18n %}

<h1>{% trans "Add" %}: {% trans name %}</h1>

<form class="lfc-form"
      method="post"
      action="{% url 'lfc_add_object' language id %}">
    {% csrf_token %}
    <table>
        {% include "lfc/manage/lfc_form.html" %}
    </table>
    <input type="hidden" name="type" value="{{ type }}" />
    <input type="hidden" name="referer" value="{{ referer }}" />
    <input class="ajax-submit" type="submit" name="save" value="{% trans 'Save' %}" />
    <input class="overlay-close" type="button" name="cancel" value="{% trans 'Cancel' %}" />
</form>

<script type="text/javascript">

    $(function() {
        $(document).on("keyup", "#id_add-title", function() {
            var slug = $("#id_add-title").val()
            slug = URLify(slug, 200)
            $("#id_add-slug").val(slug);
        });
    })
</script>
