{% extends "base.html" %}

{% block title %} | Create new contribution type{% endblock %}

{% block main %}
		<div class="page-header">
            <div class="container">
                <div class="row">
                    <div class="col-sm-6">
                        <h1 class="smaller"><a href="{% url 'admin:project_overview' project.id %}">{{project.name}}</a></h1>
                        <a href="{% url 'admin:project_overview' project.id %}"><span class="glyphicon glyphicon-arrow-left"></span> Project home page</a>
                    </div>
                    <ul class="header-nav">
                        <li class="active"><a href="{% url 'admin:category_list' project.id %}">Categories <span class="badge">{{ project.categories.count }}</span></a></li>
                        <li><a href="{% url 'admin:usergroup_list' project.id %}">User groups <span class="badge">{{ project.usergroups.count }}</span></a></li>
                    </ul>
                </div>

            </div>
        </div>

		<div class="container">
			<div class="row">
				<form  role="form" class="col-md-8 col-md-offset-2 col-lg-8 col-lg-offset-2" method="POST" action="{% url 'admin:category_create' project.id %}" novalidate>
					<h3 class="header">Create a new category</h3>
					{% csrf_token %}
					<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" name="description" id="description"></textarea>
					</div>

                    <div class="form-group">
                        <label for="default_status" class="control-label">Default status for new contributions</label>
                        <div class="radio">
                            <label>
                                <input type="radio" name="default_status" value="pending" checked> <strong>Pending</strong><br>A new contribution of this category will not appear on the map immediately. A moderate has to approve new contributions first.
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" name="default_status" value="active"> <strong>Active</strong><br>A new contribution will appear on the map immediately.
                            </label>
                        </div>
                    </div>

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

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