{% extends 'base.html' %}

{% block bodydata %}
data-project-id="{{ project.id }}"
data-project-locked="{{ project.islocked }}"
{% endblock %}

{% block title %} | Project: {{ project.name }} - Create new subset{% endblock %}

{% block main %}
<div class="page-header">
    <div class="container">
        <h1 class="smaller">
            {% if project.islocked %}<span class="glyphicon glyphicon-lock" aria-hidden="true"></span>{% endif %}
            <a href="{% url 'admin:project_overview' project.id %}">{{ project.name }}</a>
        </h1>

        {% include 'projects/navigation.html' %}
    </div>
</div>

<div class="container">
    {% include 'snippets/messages.html' %}

    <div class="row">
        <form class="col-md-8 col-md-offset-2" method="POST" action="{% url 'admin:subset_create' project.id %}" novalidate>
            {% csrf_token %}

            <h3 class="header">
                {% if project.islocked %}<span class="glyphicon glyphicon-lock" aria-hidden="true"></span>{% endif %}
                <span>Create new subset</span>
            </h3>

            <div class="form-group">
                <label for="name" class="control-label">Name (required)</label>
                <input type="text" class="form-control input-lg" id="name" name="name" maxlength="100" required />
            </div>

            <div class="form-group">
                <label for="description" class="control-label">Description</label>
                <textarea class="form-control input-lg" rows="5" id="description" name="description"></textarea>
            </div>

            <div class="form-group">
                <button type="submit" class="btn btn-primary">Save</button>
                <a role="button" href="{% url 'admin:subset_list' project.id %}" class="btn btn-link">Cancel</a>
            </div>
        </form>
    </div>
</div>
{% endblock %}

{% block libraries %}
<script src="/static/js/admin.ui.forms.validate.js"></script>
{% endblock %}
