mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-05-17 22:12:47 +00:00
Compare commits
No commits in common. "af9dcebca9f93082e1ebf5e4ed20f9b06a124e54" and "14878fce86e7ac890e4be85b9bfda8edaf1c29a1" have entirely different histories.
af9dcebca9
...
14878fce86
@ -190,7 +190,7 @@ function redrawMessages() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let fetchMoreButton = document.getElementById('fetch-previous-messages')
|
let fetchMoreButton = document.getElementById('fetch-previous-messages')
|
||||||
if (!messages[selected_channel_id].size || messages[selected_channel_id].size % MAX_MESSAGES !== 0)
|
if (!messages[selected_channel_id] || messages[selected_channel_id].size % MAX_MESSAGES !== 0)
|
||||||
fetchMoreButton.classList.add('d-none')
|
fetchMoreButton.classList.add('d-none')
|
||||||
else
|
else
|
||||||
fetchMoreButton.classList.remove('d-none')
|
fetchMoreButton.classList.remove('d-none')
|
||||||
@ -260,56 +260,26 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupSwipeOffscreen() {
|
|
||||||
const offcanvas = new bootstrap.Offcanvas(document.getElementById('channelSelector'))
|
|
||||||
|
|
||||||
let lastX = null
|
|
||||||
document.addEventListener('touchstart', (event) => {
|
|
||||||
if (event.touches.length === 1)
|
|
||||||
lastX = event.touches[0].clientX
|
|
||||||
})
|
|
||||||
document.addEventListener('touchmove', (event) => {
|
|
||||||
if (event.touches.length === 1 && lastX !== null) {
|
|
||||||
const diff = event.touches[0].clientX - lastX
|
|
||||||
if (diff > window.innerWidth / 10 && lastX < window.innerWidth / 4) {
|
|
||||||
offcanvas.show()
|
|
||||||
lastX = null
|
|
||||||
}
|
|
||||||
else if (diff < -window.innerWidth / 10) {
|
|
||||||
offcanvas.hide()
|
|
||||||
lastX = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
document.addEventListener('touchend', () => {
|
|
||||||
lastX = null
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function setupPWAPrompt() {
|
|
||||||
let deferredPrompt = null
|
|
||||||
|
|
||||||
window.addEventListener("beforeinstallprompt", (e) => {
|
|
||||||
e.preventDefault()
|
|
||||||
deferredPrompt = e
|
|
||||||
let btn = document.getElementById('install-app-home-screen')
|
|
||||||
let alert = document.getElementById('alert-download-chat-app')
|
|
||||||
btn.classList.remove('d-none')
|
|
||||||
alert.classList.remove('d-none')
|
|
||||||
btn.onclick = function () {
|
|
||||||
deferredPrompt.prompt()
|
|
||||||
deferredPrompt.userChoice.then((choiceResult) => {
|
|
||||||
if (choiceResult.outcome === 'accepted') {
|
|
||||||
deferredPrompt = null
|
|
||||||
btn.classList.add('d-none')
|
|
||||||
alert.classList.add('d-none')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
setupSocket()
|
setupSocket()
|
||||||
setupSwipeOffscreen()
|
|
||||||
setupPWAPrompt()
|
let deferredPrompt = null
|
||||||
|
|
||||||
|
window.addEventListener("beforeinstallprompt", (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
deferredPrompt = e
|
||||||
|
let btn = document.getElementById('install-app-home-screen')
|
||||||
|
let alert = document.getElementById('alert-download-chat-app')
|
||||||
|
btn.classList.remove('d-none')
|
||||||
|
alert.classList.remove('d-none')
|
||||||
|
btn.onclick = function () {
|
||||||
|
deferredPrompt.prompt()
|
||||||
|
deferredPrompt.userChoice.then((choiceResult) => {
|
||||||
|
if (choiceResult.outcome === 'accepted') {
|
||||||
|
deferredPrompt = null
|
||||||
|
btn.classList.add('d-none')
|
||||||
|
alert.classList.add('d-none')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
@ -21,11 +21,6 @@
|
|||||||
style="height: 95vh" id="chat-container">
|
style="height: 95vh" id="chat-container">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3>
|
<h3>
|
||||||
{% if fullscreen %}
|
|
||||||
{# Logout button must be present in a form. The form must includes the whole line. #}
|
|
||||||
<form action="{% url 'chat:logout' %}" method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
{% endif %}
|
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#channelSelector"
|
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#channelSelector"
|
||||||
aria-controls="channelSelector" aria-expanded="false" aria-label="Toggle channel selector">
|
aria-controls="channelSelector" aria-expanded="false" aria-label="Toggle channel selector">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
@ -35,27 +30,20 @@
|
|||||||
<button class="btn float-end" type="button" onclick="toggleFullscreen()" title="{% trans "Toggle fullscreen mode" %}">
|
<button class="btn float-end" type="button" onclick="toggleFullscreen()" title="{% trans "Toggle fullscreen mode" %}">
|
||||||
<i class="fas fa-expand"></i>
|
<i class="fas fa-expand"></i>
|
||||||
</button>
|
</button>
|
||||||
{% else %}
|
|
||||||
<button class="btn float-end" title="{% trans "Log out" %}">
|
|
||||||
<i class="fas fa-sign-out-alt"></i>
|
|
||||||
</button>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<button class="btn float-end d-none" type="button" id="install-app-home-screen" title="{% trans "Install app on home screen" %}">
|
<button class="btn float-end d-none" type="button" id="install-app-home-screen" title="{% trans "Install app on home screen" %}">
|
||||||
<i class="fas fa-download"></i>
|
<i class="fas fa-download"></i>
|
||||||
</button>
|
</button>
|
||||||
{% if fullscreen %}
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body d-flex flex-column-reverse flex-grow-0 overflow-y-scroll" id="chat-messages">
|
<div class="card-body d-flex flex-column-reverse flex-grow-0 overflow-y-scroll" id="chat-messages">
|
||||||
<ul class="list-group list-group-flush" id="message-list"></ul>
|
|
||||||
<div class="text-center d-none" id="fetch-previous-messages">
|
<div class="text-center d-none" id="fetch-previous-messages">
|
||||||
<a href="#" class="nav-link" onclick="event.preventDefault(); fetchPreviousMessages()">
|
<a href="#" class="nav-link" onclick="event.preventDefault(); fetchPreviousMessages()">
|
||||||
{% trans "Fetch previous messages…" %}
|
{% trans "Fetch previous messages…" %}
|
||||||
</a>
|
</a>
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
|
<ul class="list-group list-group-flush" id="message-list"></ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer mt-auto">
|
<div class="card-footer mt-auto">
|
||||||
<form onsubmit="event.preventDefault(); sendMessage()">
|
<form onsubmit="event.preventDefault(); sendMessage()">
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
{% load i18n static %}
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
|
|
||||||
<html lang="{{ LANGUAGE_CODE|default:"fr" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
||||||
<title>
|
|
||||||
Chat du TFJM² - {% trans "Log in" %}
|
|
||||||
</title>
|
|
||||||
<meta name="description" content="Chat du TFJM²">
|
|
||||||
|
|
||||||
{# Favicon #}
|
|
||||||
<link rel="shortcut icon" href="{% static "favicon.ico" %}">
|
|
||||||
<meta name="theme-color" content="#ffffff">
|
|
||||||
|
|
||||||
{# Bootstrap CSS #}
|
|
||||||
<link rel="stylesheet" href="{% static 'bootstrap/css/bootstrap.min.css' %}">
|
|
||||||
<link rel="stylesheet" href="{% static 'fontawesome/css/all.css' %}">
|
|
||||||
<link rel="stylesheet" href="{% static 'fontawesome/css/v4-shims.css' %}">
|
|
||||||
|
|
||||||
{# Bootstrap JavaScript #}
|
|
||||||
<script src="{% static 'bootstrap/js/bootstrap.bundle.min.js' %}"></script>
|
|
||||||
|
|
||||||
<link rel="manifest" href="{% static "chat.webmanifest" %}">
|
|
||||||
</head>
|
|
||||||
<body class="d-flex w-100 h-100 flex-column">
|
|
||||||
<div class="container">
|
|
||||||
<h1>{% trans "Log in" %}</h1>
|
|
||||||
{% include "registration/includes/login.html" %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="{% static 'theme.js' %}"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,7 +1,6 @@
|
|||||||
# Copyright (C) 2024 by Animath
|
# Copyright (C) 2024 by Animath
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
from django.contrib.auth.views import LoginView, LogoutView
|
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
from tfjm.views import LoginRequiredTemplateView
|
from tfjm.views import LoginRequiredTemplateView
|
||||||
@ -11,8 +10,5 @@ app_name = 'chat'
|
|||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', LoginRequiredTemplateView.as_view(template_name="chat/chat.html",
|
path('', LoginRequiredTemplateView.as_view(template_name="chat/chat.html",
|
||||||
extra_context={'title': _("Chat")}), name='chat'),
|
extra_context={'title': _("Chat")}), name='chat'),
|
||||||
path('fullscreen/', LoginRequiredTemplateView.as_view(template_name="chat/fullscreen.html", login_url='chat:login'),
|
path('fullscreen/', LoginRequiredTemplateView.as_view(template_name="chat/fullscreen.html"), name='fullscreen'),
|
||||||
name='fullscreen'),
|
|
||||||
path('login/', LoginView.as_view(template_name="chat/login.html"), name='login'),
|
|
||||||
path('logout/', LogoutView.as_view(next_page='chat:fullscreen'), name='logout'),
|
|
||||||
]
|
]
|
||||||
|
@ -7,7 +7,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: TFJM\n"
|
"Project-Id-Version: TFJM\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-04-28 11:56+0200\n"
|
"POT-Creation-Date: 2024-04-27 18:49+0200\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: Emmy D'Anello <emmy.danello@animath.fr>\n"
|
"Last-Translator: Emmy D'Anello <emmy.danello@animath.fr>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@ -143,15 +143,15 @@ msgstr "message"
|
|||||||
msgid "messages"
|
msgid "messages"
|
||||||
msgstr "messages"
|
msgstr "messages"
|
||||||
|
|
||||||
#: chat/templates/chat/content.html:4
|
#: chat/templates/chat/chat.html:14
|
||||||
msgid "JavaScript must be enabled on your browser to access chat."
|
msgid "JavaScript must be enabled on your browser to access chat."
|
||||||
msgstr "JavaScript doit être activé sur votre navigateur pour accéder au chat."
|
msgstr "JavaScript doit être activé sur votre navigateur pour accéder au chat."
|
||||||
|
|
||||||
#: chat/templates/chat/content.html:8
|
#: chat/templates/chat/chat.html:18
|
||||||
msgid "Chat channels"
|
msgid "Chat channels"
|
||||||
msgstr "Canaux de chat"
|
msgstr "Canaux de chat"
|
||||||
|
|
||||||
#: chat/templates/chat/content.html:17
|
#: chat/templates/chat/chat.html:27
|
||||||
msgid ""
|
msgid ""
|
||||||
"You can install a shortcut to the chat on your home screen using the "
|
"You can install a shortcut to the chat on your home screen using the "
|
||||||
"download button on the header."
|
"download button on the header."
|
||||||
@ -159,37 +159,23 @@ msgstr ""
|
|||||||
"Vous pouvez installer un raccourci vers le chat sur votre écran d'accueil en "
|
"Vous pouvez installer un raccourci vers le chat sur votre écran d'accueil en "
|
||||||
"utilisant le bouton de téléchargement dans l'en-tête."
|
"utilisant le bouton de téléchargement dans l'en-tête."
|
||||||
|
|
||||||
#: chat/templates/chat/content.html:35
|
#: chat/templates/chat/chat.html:40
|
||||||
msgid "Toggle fullscreen mode"
|
msgid "Toggle fullscreen mode"
|
||||||
msgstr "Inverse le mode plein écran"
|
msgstr "Inverse le mode plein écran"
|
||||||
|
|
||||||
#: chat/templates/chat/content.html:39 tfjm/templates/navbar.html:117
|
#: chat/templates/chat/chat.html:44
|
||||||
msgid "Log out"
|
|
||||||
msgstr "Déconnexion"
|
|
||||||
|
|
||||||
#: chat/templates/chat/content.html:43
|
|
||||||
msgid "Install app on home screen"
|
msgid "Install app on home screen"
|
||||||
msgstr "Installer l'application sur l'écran d'accueil"
|
msgstr "Installer l'application sur l'écran d'accueil"
|
||||||
|
|
||||||
#: chat/templates/chat/content.html:54
|
#: chat/templates/chat/chat.html:52
|
||||||
msgid "Fetch previous messages…"
|
msgid "Fetch previous messages…"
|
||||||
msgstr "Récupérer les messages précédents…"
|
msgstr "Récupérer les messages précédents…"
|
||||||
|
|
||||||
#: chat/templates/chat/content.html:66
|
#: chat/templates/chat/chat.html:64
|
||||||
msgid "Send message…"
|
msgid "Send message…"
|
||||||
msgstr "Envoyer un message…"
|
msgstr "Envoyer un message…"
|
||||||
|
|
||||||
#: chat/templates/chat/login.html:10 chat/templates/chat/login.html:30
|
#: chat/views.py:15 tfjm/templates/navbar.html:67
|
||||||
#: registration/templates/registration/password_reset_complete.html:10
|
|
||||||
#: tfjm/templates/base.html:84 tfjm/templates/base.html:85
|
|
||||||
#: tfjm/templates/navbar.html:98
|
|
||||||
#: tfjm/templates/registration/includes/login.html:22
|
|
||||||
#: tfjm/templates/registration/login.html:7
|
|
||||||
#: tfjm/templates/registration/login.html:8
|
|
||||||
msgid "Log in"
|
|
||||||
msgstr "Connexion"
|
|
||||||
|
|
||||||
#: chat/urls.py:13 tfjm/templates/navbar.html:66
|
|
||||||
msgid "Chat"
|
msgid "Chat"
|
||||||
msgstr "Chat"
|
msgstr "Chat"
|
||||||
|
|
||||||
@ -3032,6 +3018,14 @@ msgstr "Changer mon mot de passe"
|
|||||||
msgid "Your password has been set. You may go ahead and log in now."
|
msgid "Your password has been set. You may go ahead and log in now."
|
||||||
msgstr "Votre mot de passe a été changé. Vous pouvez désormais vous connecter."
|
msgstr "Votre mot de passe a été changé. Vous pouvez désormais vous connecter."
|
||||||
|
|
||||||
|
#: registration/templates/registration/password_reset_complete.html:10
|
||||||
|
#: tfjm/templates/base.html:84 tfjm/templates/base.html:85
|
||||||
|
#: tfjm/templates/navbar.html:98 tfjm/templates/registration/login.html:7
|
||||||
|
#: tfjm/templates/registration/login.html:8
|
||||||
|
#: tfjm/templates/registration/login.html:30
|
||||||
|
msgid "Log in"
|
||||||
|
msgstr "Connexion"
|
||||||
|
|
||||||
#: registration/templates/registration/password_reset_confirm.html:9
|
#: registration/templates/registration/password_reset_confirm.html:9
|
||||||
msgid ""
|
msgid ""
|
||||||
"Please enter your new password twice so we can verify you typed it in "
|
"Please enter your new password twice so we can verify you typed it in "
|
||||||
@ -3653,11 +3647,11 @@ msgstr "Privé, réservé aux utilisateur⋅rices explicitement autorisé⋅es"
|
|||||||
msgid "Admin users"
|
msgid "Admin users"
|
||||||
msgstr "Administrateur⋅rices"
|
msgstr "Administrateur⋅rices"
|
||||||
|
|
||||||
#: tfjm/settings.py:169
|
#: tfjm/settings.py:168
|
||||||
msgid "English"
|
msgid "English"
|
||||||
msgstr "Anglais"
|
msgstr "Anglais"
|
||||||
|
|
||||||
#: tfjm/settings.py:170
|
#: tfjm/settings.py:169
|
||||||
msgid "French"
|
msgid "French"
|
||||||
msgstr "Français"
|
msgstr "Français"
|
||||||
|
|
||||||
@ -3766,22 +3760,9 @@ msgstr "S'inscrire"
|
|||||||
msgid "My account"
|
msgid "My account"
|
||||||
msgstr "Mon compte"
|
msgstr "Mon compte"
|
||||||
|
|
||||||
#: tfjm/templates/registration/includes/login.html:5
|
#: tfjm/templates/navbar.html:117
|
||||||
#, python-format
|
msgid "Log out"
|
||||||
msgid ""
|
msgstr "Déconnexion"
|
||||||
"You are authenticated as %(user)s, but are not authorized to access this "
|
|
||||||
"page. Would you like to login to a different account?"
|
|
||||||
msgstr ""
|
|
||||||
"Vous êtes connecté⋅e en tant que %(user)s, mais n'êtes pas autorisé⋅e à "
|
|
||||||
"accéder à cette page. Voulez-vous vous reconnecter avec un autre compte ?"
|
|
||||||
|
|
||||||
#: tfjm/templates/registration/includes/login.html:17
|
|
||||||
msgid "Your username is your e-mail address."
|
|
||||||
msgstr "Votre identifiant est votre adresse e-mail."
|
|
||||||
|
|
||||||
#: tfjm/templates/registration/includes/login.html:20
|
|
||||||
msgid "Forgotten your password?"
|
|
||||||
msgstr "Mot de passe oublié ?"
|
|
||||||
|
|
||||||
#: tfjm/templates/registration/logged_out.html:8
|
#: tfjm/templates/registration/logged_out.html:8
|
||||||
msgid "Thanks for spending some quality time with the Web site today."
|
msgid "Thanks for spending some quality time with the Web site today."
|
||||||
@ -3791,6 +3772,23 @@ msgstr "Merci d'avoir utilisé la plateforme du TFJM²."
|
|||||||
msgid "Log in again"
|
msgid "Log in again"
|
||||||
msgstr "Se reconnecter"
|
msgstr "Se reconnecter"
|
||||||
|
|
||||||
|
#: tfjm/templates/registration/login.html:13
|
||||||
|
#, python-format
|
||||||
|
msgid ""
|
||||||
|
"You are authenticated as %(user)s, but are not authorized to access this "
|
||||||
|
"page. Would you like to login to a different account?"
|
||||||
|
msgstr ""
|
||||||
|
"Vous êtes connecté⋅e en tant que %(user)s, mais n'êtes pas autorisé⋅e à "
|
||||||
|
"accéder à cette page. Voulez-vous vous reconnecter avec un autre compte ?"
|
||||||
|
|
||||||
|
#: tfjm/templates/registration/login.html:25
|
||||||
|
msgid "Your username is your e-mail address."
|
||||||
|
msgstr "Votre identifiant est votre adresse e-mail."
|
||||||
|
|
||||||
|
#: tfjm/templates/registration/login.html:28
|
||||||
|
msgid "Forgotten your password?"
|
||||||
|
msgstr "Mot de passe oublié ?"
|
||||||
|
|
||||||
#: tfjm/templates/search/search.html:6 tfjm/templates/search/search.html:10
|
#: tfjm/templates/search/search.html:6 tfjm/templates/search/search.html:10
|
||||||
msgid "Search"
|
msgid "Search"
|
||||||
msgstr "Chercher"
|
msgstr "Chercher"
|
||||||
|
@ -102,7 +102,6 @@ MIDDLEWARE = [
|
|||||||
ROOT_URLCONF = 'tfjm.urls'
|
ROOT_URLCONF = 'tfjm.urls'
|
||||||
|
|
||||||
LOGIN_REDIRECT_URL = "index"
|
LOGIN_REDIRECT_URL = "index"
|
||||||
LOGOUT_REDIRECT_URL = "login"
|
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
{% load i18n crispy_forms_filters %}
|
|
||||||
|
|
||||||
{% if user.is_authenticated %}
|
|
||||||
<p class="errornote">
|
|
||||||
{% blocktrans trimmed %}
|
|
||||||
You are authenticated as {{ user }}, but are not authorized to
|
|
||||||
access this page. Would you like to login to a different account?
|
|
||||||
{% endblocktrans %}
|
|
||||||
</p>
|
|
||||||
{% endif %}
|
|
||||||
<form method="post" id="login-form">
|
|
||||||
<div id="form-content">
|
|
||||||
{{ form|as_crispy_errors }}
|
|
||||||
{% csrf_token %}
|
|
||||||
{{ form.username|as_crispy_field }}
|
|
||||||
<div class="form-text mb-3">
|
|
||||||
<i class="fas fa-info-circle"></i> {% trans "Your username is your e-mail address." %}
|
|
||||||
</div>
|
|
||||||
{{ form.password|as_crispy_field }}
|
|
||||||
<a href="{% url 'password_reset' %}" class="badge text-bg-warning">{% trans 'Forgotten your password?' %}</a>
|
|
||||||
</div>
|
|
||||||
<input type="submit" value="{% trans 'Log in' %}" class="btn btn-primary">
|
|
||||||
</form>
|
|
@ -2,11 +2,31 @@
|
|||||||
{% comment %}
|
{% comment %}
|
||||||
SPDX-License-Identifier: GPL-2.0-or-later
|
SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
{% load i18n %}
|
{% load i18n crispy_forms_filters %}
|
||||||
|
|
||||||
{% block title %}{% trans "Log in" %}{% endblock %}
|
{% block title %}{% trans "Log in" %}{% endblock %}
|
||||||
{% block content-title %}<h1>{% trans "Log in" %}</h1>{% endblock %}
|
{% block content-title %}<h1>{% trans "Log in" %}</h1>{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% include "registration/includes/login.html" %}
|
{% if user.is_authenticated %}
|
||||||
|
<p class="errornote">
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
You are authenticated as {{ user }}, but are not authorized to
|
||||||
|
access this page. Would you like to login to a different account?
|
||||||
|
{% endblocktrans %}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
<form method="post" id="login-form">
|
||||||
|
<div id="form-content">
|
||||||
|
{{ form|as_crispy_errors }}
|
||||||
|
{% csrf_token %}
|
||||||
|
{{ form.username|as_crispy_field }}
|
||||||
|
<div class="form-text mb-3">
|
||||||
|
<i class="fas fa-info-circle"></i> {% trans "Your username is your e-mail address." %}
|
||||||
|
</div>
|
||||||
|
{{ form.password|as_crispy_field }}
|
||||||
|
<a href="{% url 'password_reset' %}" class="badge text-bg-warning">{% trans 'Forgotten your password?' %}</a>
|
||||||
|
</div>
|
||||||
|
<input type="submit" value="{% trans 'Log in' %}" class="btn btn-primary">
|
||||||
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user