<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal">&times;</button>
	<h4 class="modal-title">{% if error_message %}Error trying {% else %}You are about {% endif %}to login to the {{ area }}</h4>
</div>

<div class="modal-body">
	<input type="hidden" id="dialog_cancelled" value="true">
	{% if error_message %}
		<div class="alert alert-danger">
			{{ error_message }}
		</div>
	{% endif %}
	{% if not error_message %}
		<form id="additional_event_parameters" onsubmit="return false">
			<input type="hidden" name="area" value="{{ area.id }}">
			<input type="hidden" id="project_id" name="project_id">
			<div class="form-group">
				{% if projects|length == 1 %}
					You only have one active project. Area access will be billed to: {{ projects.0 }}
					<input type="hidden" name="project" value="{{ projects.0.id }}">
				{% else %}
					<p>Charge area access to which project?</p>
					{% for p in projects %}
						<div class="radio">
							<label><input type="radio" name="project" value="{{ p.id }}" required>{{ p }}</label>
						</div>
					{% endfor %}
				{% endif %}
			</div>
			<div class="form-group">
				<button class="btn btn-default" data-dismiss="modal" onclick="$('#project_id').val({{ project.id }}); $('#dialog_cancelled').val(false)">Log in</button>
			</div>
		</form>
	{% else %}
		<div class="form-group text-center">
			<button class="btn btn-warning" data-dismiss="modal">Ok</button>
		</div>
	{% endif %}
</div>