{% extends "tcms_base.html" %}
{% load static %}
{% block subtitle %}Nitrate{% endblock %}
{% block custom_stylesheet %}
{% endblock %}
{% block custom_javascript %}
<script type="text/javascript" src="{% static "js/index.js" %}"></script>
<script type="text/javascript" src="{% static "js/footer_at_the_end.js" %}"></script>
{% endblock %}

{% block contents %}
<div id="content">
	<div id="index">
		<br clear="all">
		{% if 'USERPWD' in SETTINGS.ENABLED_AUTH_BACKENDS %}
		<div class="login radius">
			<form id="id_login_form" action="{% url "nitrate-login" %}" method="POST">
				{% csrf_token %}
				{% if SETTINGS.MOTD_LOGIN %}
				<div class="cc">{{ SETTINGS.MOTD_LOGIN|safe}}</div>
				{% endif %}
				{% if SETTINGS.WELCOME_MESSAGE %}<h3>{{ SETTINGS.WELCOME_MESSAGE }}</h3>{% endif %}
				<table border="0" cellpadding="10" cellspacing="10" class="login_table">
					{{ form.as_table }}
					<tr style="display:none">
						<td id="login_info" colspan="2"></td>
					</tr>
                    <tr>
                    	<td></td>
						<td ><a href="{% url "password_reset" %}">Forget the password</a></td>
					</tr>
					{% if SETTINGS.ENABLED_AUTH_BACKENDS.USERPWD.ALLOW_REGISTER %}
					<tr>
						<td></td>
						<td><a href="{% url "nitrate-register" %}?next={{ request.path }}">Register a new account</a></td>
					</tr>
					{% endif %}
					<tr>
                    	<td>&nbsp;</td>
						<td class="submit">
							<input type="hidden" name="next" value="{{ next }}" />
							<input type="submit" value="Login" class="loginbutton sprites" />
						</td>
					</tr>
				</table>
			</form>
		</div>
		{% endif %}
		{% if social_auth_backends %}
		<div class="login radius">
			<p style="font-weight: bold; font-size: medium">Sign in with:</p>
			{% for login_url, display_label, title in social_auth_backends %}
				<a href="{{ login_url }}" title="{{ title }}" class="social_auth_login">{{ display_label }}</a>
			{% endfor %}
		</div>
		{% endif %}
	</div>
</div>
{% endblock %}
