{% if messages %}
<ul class="messages">
    {% for message in messages %}
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
    {% endfor %}
</ul>
{% endif %}

<form method="post" id="login-form" class="jvFloatForm">
  {% csrf_token %}
  {% if form.errors %}<p class="error">Username and password did not match.</p>{% endif %}
  <div class="form-group">
    {% if not form.this_is_the_login_form.errors %}{{ form.username.errors }}{% endif %}
    <input id="id_username" maxlength="254" name="username" type="text" {% if form.username.value %}
           value="{{ form.username.value }}"{% endif %} placeholder="username or email" 
           class="form-control" />
  </div>
  <div class="form-group">
    {% if not form.this_is_the_login_form.errors %}{{ form.password.errors }}{% endif %}
    <input id="id_password" name="password" type="password" placeholder="password" class="form-control">
    <input type="hidden" name="this_is_the_login_form" value="1" />
    <input type="hidden" name="next" value="{% if request.GET.next %}{{ request.GET.next }}{% else %}/{% endif %}" />
  </div>
  {% if bad_password %}
  <div class="form-group">
    Incorrect username/password, try again.
  </div>
  {% endif %}
  <div class="form-group">
    <input type="submit" value="Log in" class="btn btn-block btn-success">
  </div>
  <a class="blue" href="{% url "password_reset" %}">Forgot Password?</a>
</form>
<div>
  <center> - OR -</center>
  <a class="btn btn-block btn-success" href="/accounts/register/">Register</a>
  <a class="btn btn-block btn-google" href="{% url 'social:begin' 'google-oauth2' %}">
    <i class="fa fa-google-plus"></i> Google+</a>
  <a class="btn btn-block btn-twitter" href="{% url 'social:begin' 'google-oauth2' %}">
    <i class="fa fa-twitter"></i> Twitter</a>
</div>
