{% extends "base.html" %}

{% block stylesheets %}
{% endblock %}

{% block content %}
<div class="jumbotron">
	<div class="container">
		<h1>Reset Password</h1>
	</div>
</div>
<div class="container">
	<div class="row">
		<div class="col-md-6 offset-md-3">
			{% for error in errors %}
				<div class="alert alert-info alert-dismissable" role="alert">
				  <span class="sr-only">Error:</span>
				  {{ error }}
				  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
				</div>
			{% endfor %}
			{% if can_send_mail() %}
			<form method="post" accept-charset="utf-8" autocomplete="off" role="form" class="form-horizontal">
				<input name='nonce' type='hidden' value="{{ nonce }}">
				{% if mode %}
				<div class="form-group">
					<label for="password-input">
						Password
					</label>
					<input class="form-control" type="password" name="password" id="password-input" />
				</div>
				{% else %}
				<div class="form-group">
					<label for="email-input">
						Email
					</label>
					<input class="form-control" type="text" name="email" id="email-input" />
				</div>
				{% endif %}
				<div class="row">
					<div class="col-md-6 offset-md-6">
						<button type="submit" tabindex="0" class="btn btn-md btn-primary float-right">Submit</button>
					</div>
				</div>
			</form>
			{% else %}
				<h3 class="text-center">Contact a CTF organizer</h3>
				<p>This CTF is not configured to send email.</p>
				<p>Please contact an organizer to have your password reset</p>
			{% endif %}
		</div>
	</div>
</div>
{% endblock %}

{% block scripts %}
{% endblock %}
