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

{% block content %}
	<main class="container signup-section">
		<div class="section-content">
			<h2>Log In</h2>

			<form method="POST" action="{% url 'login' %}">
				{% csrf_token %}

				<div class="form-group">
					<b>{{ form.username.label }}</b>

					{% if form.username.errors %}
						{% for error in form.nick_name.errors %}
							<p class='error-message'>{{ error }}</p>
						{% endfor %}
					{% endif %}

					{{ form.username }}
				</div>

				<div class="form-group">
					<b>{{ form.password.label }}</b>

					{% if form.password.errors %}
						{% for error in form.password.errors %}
							<p class='error-message'>{{ error }}</p>
						{% endfor %}
					{% endif %}

					{{ form.password }}
				</div>

				<input class="btn-primary" type="submit" value="login" />
				<input class="btn-primary" type="hidden" name="next" value="{{ next }}" />

				<!--input class="btn-primary" id="submit" type="submit" name="submit" value="Sign in" /-->

			</form>
			<p>Forgot your password? <a href="{% url 'password_reset' %}">Click here to reset it</a>.</p>
      		<p>New user? <a href="{% url 'signup' %}">Click here to register</a>.</p>
		</div>
	</main>
{% endblock %}
