mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 18:26:32 +01:00
Fixes failure to display error messages and display form as standalone.
This commit is contained in:
parent
a0e3afd9a4
commit
63c8ae5bd5
1 changed files with 39 additions and 34 deletions
|
|
@ -4,44 +4,49 @@
|
|||
Login
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% block body %}
|
||||
|
||||
{% load addclass %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h1 class="card-title">Login</h1>
|
||||
<hr />
|
||||
{% if user.is_authenticated %}
|
||||
<p>You are already logged in!</p>
|
||||
{% else %}
|
||||
{% if form.has_errors %}
|
||||
<p>Your username and password didn't match. Please try again.</p>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action=".">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_username">Username:</label>
|
||||
{{ form.username | addclass:"form-control" }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_password">Password:</label>
|
||||
{{ form.password | addclass:"form-control" }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="submit" value="Login" />
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
</div>
|
||||
</form>
|
||||
<div class="container main-content mt-4" id="main-copy">
|
||||
<div class="row">
|
||||
<div class="col-lg-5 offset-lg-3 col-sm-12">
|
||||
<div class="card mt-3">
|
||||
<div class="card-body">
|
||||
<h1 class="card-title">Login</h1>
|
||||
<hr />
|
||||
{% if user.is_authenticated %}
|
||||
<div class="alert alert-info" role="alert">You are already logged in!</div>
|
||||
{% else %}
|
||||
{% if form.errors %}
|
||||
<div class="alert alert-danger" role="alert">Your username and password are incorrect. Please try again.</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if not user.is_authenticated %}
|
||||
<form method="post" action=".">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_username">Username:</label>
|
||||
{{ form.username | addclass:"form-control" }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_password">Password:</label>
|
||||
{{ form.password | addclass:"form-control" }}
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
<div class="form-group">
|
||||
<input class="form-control btn btn-outline-secondary" type="submit" value="Login" />
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue