 {% extends "base.html" %}

{% block stylesheets %}
{% endblock %}

{% block content %}
<div class="jumbotron">
	<div class="container">
		<h1>Profile</h1>
	</div>
</div>
<div class="container">
	<div class="row">
		<div class="col-md-6 offset-md-3">
			{% if success %}
				<div class="alert alert-success alert-dismissable submit-row" role="alert">
					<strong>Success!</strong>
					Your profile has been updated
					<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
				</div>
			{% else %}
				{% for error in errors %}
				<div class="submit-row">
					<div class="alert alert-danger 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>
				</div>
				{% endfor %}
			{% endif %}
			{% if confirm_email %}
				<div class="alert alert-info alert-dismissable submit-row" role="alert">
					Your email address isn't confirmed!
					Please check your email to confirm your email address.
					<br>
					<br>
					To have the confirmation email resent please <a href="{{ request.script_root }}/confirm">click
					here.</a>
					<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
							aria-hidden="true">×</span></button>
				</div>
			{% endif %}
			<form method="post" accept-charset="utf-8" autocomplete="off" role="form" class="form-horizontal">
				<div class="form-group">
					<label for="name-input">
						Team Name
					</label>
					<input class="form-control" type="text" name="name" id="name-input" value="{{name}}"/>
				</div>
				<div class="form-group">
					<label for="email-input">
						Email
					</label>
					<input class="form-control" type="email" name="email" id="email-input" value="{{email}}"/>
				</div>
				<div class="form-group">
					<label for="confirm-input">
						Current Password
					</label>
					<input class="form-control" type="password" name="confirm" id="confirm-input" />
				</div>
				<div class="form-group">
					<label for="password-input">
						New Password
					</label>
					<input class="form-control" type="password" name="password" id="password-input" />
				</div>

				<hr>

				<div class="form-group">
					<label for="affiliation-input">
						Affiliation
					</label>
					<input class="form-control" type="text" name="affiliation" id="affiliation-input" value="{% if affiliation %}{{affiliation}}{% endif %}" />
				</div>
				<div class="form-group">
					<label for="website-input">
						Website
					</label>
					<input class="form-control" type="text" name="website" id="website-input" value="{% if website %}{{website}}{% endif %}" />
				</div>
				<div class="form-group">
					<label for="country-input">
						Country
					</label>
					<input class="form-control" type="text" name="country" id="country-input" value="{% if country %}{{country}}{% endif %}" />
				</div>
				<div class="form-group">
					<button type="submit" id="submit" tabindex="5" class="btn btn-md btn-primary btn-outlined float-right">Submit</button>
				</div>
				<input type="hidden" name="nonce" value="{{ nonce }}">
			</form>
		</div>
	</div>
</div>
{% endblock %}

{% block scripts %}
	<script src="{{ request.script_root }}/themes/{{ ctf_theme() }}/static/js/style.js"></script>
{% endblock %}
