mirror of
https://github.com/bugsink/bugsink.git
synced 2025-12-18 02:54:55 -06:00
Simplify login template
See #236 (for context, not for something that's solved by this): > I did just notice that whatever the form validation error on-login is, the > above message is shown. I will fix that at least to make debugging the above > easier in the future. (i.e.: to make it so that if the form data is missing > entirely, you'd get a "this field is required" for both fields) This also gets rid of the lock/person but I don't care enough for those to keep them around.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{% extends "barest_base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load tailwind_forms %}
|
||||
|
||||
{% block title %}Log in · {{ site_title }}{% endblock %}
|
||||
|
||||
@@ -15,7 +16,9 @@
|
||||
<div class="p-12 md:pt-24 md:pl-24 md:pr-24 md:pb-16">
|
||||
|
||||
{% if form.errors %}
|
||||
<div class="mb-8 text-red-500 dark:text-red-400">{% translate "Your username and password didn't match. Please try again." %}</div>
|
||||
{% for error in form.non_field_errors %}
|
||||
<div class="mb-8 text-red-500 dark:text-red-400">{{ error }}</div>
|
||||
{% endfor %}
|
||||
|
||||
{% elif next %}
|
||||
{% if user.is_authenticated %}
|
||||
@@ -27,18 +30,10 @@
|
||||
|
||||
<form method="post" action="{% url 'login' %}">
|
||||
{% csrf_token %}
|
||||
<div class="flex items-center text-lg mb-6 md:mb-8">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="absolute ml-3" width="24">
|
||||
<path fill-rule="evenodd" d="M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
<input name="username" type="text" class="bg-slate-200 dark:bg-slate-800 pl-12 py-2 md:py-4 focus:outline-none w-full" {% if form.username.value %}value="{{ form.username.value }}"{% endif %} placeholder="{% translate 'Username' %}" />
|
||||
</div>
|
||||
<div class="flex items-center text-lg mb-6 md:mb-8">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="absolute ml-3" width="24">
|
||||
<path fill-rule="evenodd" d="M12 1.5a5.25 5.25 0 0 0-5.25 5.25v3a3 3 0 0 0-3 3v6.75a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3v-6.75a3 3 0 0 0-3-3v-3c0-2.9-2.35-5.25-5.25-5.25Zm3.75 8.25v-3a3.75 3.75 0 1 0-7.5 0v3h7.5Z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
<input name="password" type="password" class="bg-slate-200 dark:bg-slate-800 pl-12 py-2 md:py-4 focus:outline-none w-full" {% if form.password.value %}value="{{ form.password.value }}"{% endif %} placeholder="{% translate 'Password' %}" />
|
||||
</div>
|
||||
|
||||
{% tailwind_formfield_implicit form.username %}
|
||||
{% tailwind_formfield_implicit form.password %}
|
||||
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
<button class="bg-slate-800 font-medium p-2 md:p-4 text-white uppercase w-full">{% translate "Login" %}</button>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user