{% extends "diet_optimizer_website/layout.html" %}

{% block content %}

{% if validlink %}
<main class="container signup-section">
		<div class="section-content">
			<h2>Reset your password</h2>

			<form method="POST" action="">
				{% csrf_token %}
				
				<div class="form-group">
					<b>{{ form.new_password1.label }}</b>
	
					{% if form.new_password1.errors %}
						{% for error in form.new_password1.errors %}
							<p class='error-message'>{{ error }}</p>
						{% endfor %}
					{% endif %}
	
					{{ form.new_password1 }}
				</div>

                <div class="form-group">
					<b>{{ form.new_password2.label }}</b>
	
					{% if form.new_password2.errors %}
						{% for error in form.new_password2.errors %}
							<p class='error-message'>{{ error }}</p>
						{% endfor %}
					{% endif %}
	
					{{ form.new_password2 }}
				</div>

				<input class="btn-primary" id="submit" type="submit" name="submit" value="Reset password" />

			</form>

		</div>
	</main>

	{% else %}

	<p>The password reset link was invalid, possibly because it has already been used.  Please request a new password reset.</p>

{% endif %}

{% endblock %}