mirror of
https://github.com/jointakahe/takahe.git
synced 2025-01-11 06:35:26 +00:00
parent
1a7ffb4bff
commit
bce7add2b4
3 changed files with 20 additions and 0 deletions
|
@ -221,6 +221,10 @@ header menu a.identity {
|
||||||
width: 250px;
|
width: 250px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.no-sidebar header menu a.identity {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
header menu a.identity i {
|
header menu a.identity i {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
@ -289,11 +293,13 @@ nav a i {
|
||||||
.columns {
|
.columns {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.left-column {
|
.left-column {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
|
max-width: 700px;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,6 +321,10 @@ nav a i {
|
||||||
border-radius: 0 0 5px 0;
|
border-radius: 0 0 5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.no-sidebar .right-column {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.right-column h2 {
|
.right-column h2 {
|
||||||
background: var(--color-highlight);
|
background: var(--color-highlight);
|
||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
|
|
|
@ -2,11 +2,14 @@
|
||||||
|
|
||||||
{% block title %}Login{% endblock %}
|
{% block title %}Login{% endblock %}
|
||||||
|
|
||||||
|
{% block body_class %}no-sidebar{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form action="." method="POST">
|
<form action="." method="POST">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Login</legend>
|
<legend>Login</legend>
|
||||||
|
{{ form.non_field_errors }}
|
||||||
{% for field in form %}
|
{% for field in form %}
|
||||||
{% include "forms/_field.html" %}
|
{% include "forms/_field.html" %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.contrib.auth.forms import AuthenticationForm
|
||||||
from django.contrib.auth.password_validation import validate_password
|
from django.contrib.auth.password_validation import validate_password
|
||||||
from django.contrib.auth.views import LoginView, LogoutView
|
from django.contrib.auth.views import LoginView, LogoutView
|
||||||
from django.shortcuts import get_object_or_404, render
|
from django.shortcuts import get_object_or_404, render
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
from django.views.generic import FormView
|
from django.views.generic import FormView
|
||||||
|
|
||||||
from core.models import Config
|
from core.models import Config
|
||||||
|
@ -10,6 +12,11 @@ from users.models import Invite, PasswordReset, User
|
||||||
|
|
||||||
|
|
||||||
class Login(LoginView):
|
class Login(LoginView):
|
||||||
|
class form_class(AuthenticationForm):
|
||||||
|
error_messages = {
|
||||||
|
"invalid_login": _("No account was found with that email and password."),
|
||||||
|
"inactive": _("This account is inactive."),
|
||||||
|
}
|
||||||
|
|
||||||
template_name = "auth/login.html"
|
template_name = "auth/login.html"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue