{% extends "base.html" %}

{% block title %} | Create new project{% endblock %}

{% block main %}
		<div class="page-header">
			<div class="container">
				<h1>Create new project</h1>
			</div>
		</div>

		<div class="container">
			{% include 'snippets/messages.html' %}
			<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:project_create' %}" novalidate>
					{% 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="isprivate" class="control-label">Project visibilty</label>
						<div class="radio">
							<label>
								<input type="radio" id="private" name="isprivate" value="true" checked> <strong>Private</strong><br>The project will only be visible to project administrators and members of any user group assigned to this project.
							</label>
						</div>
						<div class="radio">
							<label>
								<input type="radio" id="public" name="isprivate" value="false"> <strong>Public</strong><br>The project will be visible to the general public.
							</label>
						</div>
					</div>

					<div class="form-group">
						<label for="everyone_contributes" class="control-label">Project permissions</label>
						<div class="radio public hidden">
							<label>
								<input type="radio" name="everyone_contributes" value="true"> <strong>All users</strong><br>All users can contribute. This includes anonymous contributions from users, who are not logged in.
							</label>
						</div>
						<div class="radio">
							<label>
								<input type="radio" name="everyone_contributes" value="auth" checked>
								<span class="private"><strong>All users</strong><br>All users that have access to the project can contribute.</span>
								<span class="public hidden"><strong>All authenticated users</strong><br>Users have to be logged in to contribute.</span>
							</label>
						</div>
						<div class="radio">
							<label>
								<input type="radio" name="everyone_contributes" value="false"> <strong>Only members of contributor groups can contribute</strong><br>Only users, who are member of a user groups that has been granted contribute permissions, can contribute.
							</label>
						</div>
                    </div>

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

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