{% extends "telemeta/base.html" %}
{% load i18n %}

{% block content %}
<script>
$(document).ready(function() {
    $(this).keydown(function(e) {
        if (e.keyCode == '13') {
            $("#_loginForm").submit();
        }
    });
});
</script>


<div id="module-set-left" class="row">
{{ block.super }}
<div class="large-4 columns">&nbsp;</div>
<div class="module large-4 columns">
    <span class="module-title">
    <img src="{{ STATIC_URL }}telemeta/images/user_tr.png" width="30px" style="margin: 3px;" alt="rss" style="vertical-align:middle" />
    &nbsp;<h3>{% trans "User authentication" %}</h3></span>

<div style="background-color: white; align: center; padding: 1em;">

<form id="_loginForm" method="post" action="{% url "telemeta-login" %}">{% csrf_token %}

{% if form.errors %}
<p class="login-error">{% trans "Your username and password didn't match. Please try again." %}</p>
{% endif %}

<table>
<tr>
    <td><label>{{ form.username.label_tag }}</label></td>
	<td>{{ form.username }}</td>
</tr>
<tr>
	<td><label>{{ form.password.label_tag }}</label></td>
	<td>{{ form.password }}</td>
</tr>
</table>

<p style="margin-top: 0.5em;">
<a href="#" onclick="$('#_loginForm').submit();" style="float: right;">
  <button type="button" class="btn btn-default">
    <span class="glyphicon glyphicon-log-in"></span> {% trans "Sign in" %}
  </button>
</a>

<input type="hidden" name="next" value="{{ next }}" />
<span><a href="{% url "password_reset" %}">{% trans "Password forgotten" %} ?</a></span>
</p>

</form>
</div>
</div>
<div class="large-4 columns">&nbsp;</div>
</div>
{% endblock %}
