Changement page login
This commit is contained in:
@@ -201,7 +201,10 @@ USE_L10N = False
|
||||
# https://docs.djangoproject.com/en/4.0/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, "static")
|
||||
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, "static"),
|
||||
]
|
||||
|
||||
|
||||
# Default primary key field type
|
||||
@@ -220,7 +223,7 @@ JAZZMIN_SETTINGS = {
|
||||
"site_brand": "ClercNet",
|
||||
|
||||
# Logo to use for your site, must be present in static files, used for brand on top left
|
||||
"site_logo": None,
|
||||
"site_logo": "img/logo_clerc_200.png",
|
||||
|
||||
# CSS classes that are applied to the logo above
|
||||
"site_logo_classes": "img-circle",
|
||||
@@ -229,7 +232,7 @@ JAZZMIN_SETTINGS = {
|
||||
"site_icon": None,
|
||||
|
||||
# Welcome text on the login screen
|
||||
"welcome_sign": "Welcome to the ClercNet admin",
|
||||
"welcome_sign": "Bienvenue sur le ClercNet",
|
||||
|
||||
# Copyright on the footer
|
||||
"copyright": "Ambulance Clerc & Resk-U",
|
||||
@@ -320,7 +323,7 @@ JAZZMIN_SETTINGS = {
|
||||
# UI Tweaks #
|
||||
#############
|
||||
# Relative paths to custom CSS/JS scripts (must be present in static files)
|
||||
"custom_css": None,
|
||||
"custom_css": "css/global.css",
|
||||
"custom_js": None,
|
||||
# Whether to show the UI customizer on the sidebar
|
||||
"show_ui_builder": True,
|
||||
|
10
static/css/global.css
Normal file
10
static/css/global.css
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
.cascading-right {
|
||||
margin-right: -50px;
|
||||
}
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
.cascading-right {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
BIN
static/img/login_bg.jpg
Normal file
BIN
static/img/login_bg.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 320 KiB |
BIN
static/img/login_bg_43.jpg
Normal file
BIN
static/img/login_bg_43.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 287 KiB |
Before Width: | Height: | Size: 311 KiB After Width: | Height: | Size: 311 KiB |
BIN
static/img/logo_clerc_200.png
Normal file
BIN
static/img/logo_clerc_200.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
76
templates/admin/login.html
Normal file
76
templates/admin/login.html
Normal file
@@ -0,0 +1,76 @@
|
||||
{% extends "registration/base.html" %}
|
||||
|
||||
{% load i18n jazzmin %}
|
||||
{% get_jazzmin_settings request as jazzmin_settings %}
|
||||
{% get_jazzmin_ui_tweaks as jazzmin_ui %}
|
||||
|
||||
{% block content %}
|
||||
<p class="login-box-msg">{{ jazzmin_settings.welcome_sign }}</p>
|
||||
<form action="{{ app_path }}" method="post">
|
||||
{% csrf_token %}
|
||||
{% if user.is_authenticated %}
|
||||
<p class="errornote">
|
||||
<div class="callout callout-danger">
|
||||
<p>
|
||||
{% blocktrans trimmed %}
|
||||
You are authenticated as {{ username }}, but are not authorized to
|
||||
access this page. Would you like to login to a different account?
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
</div>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if form.errors %}
|
||||
{% if form.username.errors %}
|
||||
<div class="callout callout-danger">
|
||||
<p>{{ form.username.label }}: {{ form.username.errors|join:', ' }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if form.password.errors %}
|
||||
<div class="callout callout-danger">
|
||||
<p>{{ form.password.label }}: {{ form.password.errors|join:', ' }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if form.non_field_errors %}
|
||||
<div class="callout callout-danger">
|
||||
{% for error in form.non_field_errors %}
|
||||
<p>{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" name="username" class="form-control" placeholder="{{ form.username.label }}" required>
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-user"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-3">
|
||||
<input type="password" name="password" class="form-control" placeholder="{{ form.password.label }}" required>
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% url 'admin_password_reset' as password_reset_url %}
|
||||
{% if password_reset_url %}
|
||||
<div class="mb-3">
|
||||
<div class="password-reset-link" style="text-align: center;">
|
||||
<a href="{{ password_reset_url }}">
|
||||
{% trans 'Forgotten your password or username?' %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn {{ jazzmin_ui.button_classes.primary }} btn-block">
|
||||
{% trans "Log in" %}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
79
templates/admin/login_jazzmin.html
Normal file
79
templates/admin/login_jazzmin.html
Normal file
@@ -0,0 +1,79 @@
|
||||
{% extends "registration/base.html" %}
|
||||
|
||||
{% load i18n jazzmin %}
|
||||
{% get_jazzmin_settings request as jazzmin_settings %}
|
||||
{% get_jazzmin_ui_tweaks as jazzmin_ui %}
|
||||
|
||||
{% block content %}
|
||||
<p class="login-box-msg">{{ jazzmin_settings.welcome_sign }}</p>
|
||||
<form action="{{ app_path }}" method="post">
|
||||
{% csrf_token %}
|
||||
{% if user.is_authenticated %}
|
||||
<p class="errornote">
|
||||
<div class="callout callout-danger">
|
||||
<p>
|
||||
{% blocktrans trimmed %}
|
||||
You are authenticated as {{ username }}, but are not authorized to
|
||||
access this page. Would you like to login to a different account?
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
</div>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if form.errors %}
|
||||
{% if form.username.errors %}
|
||||
<div class="callout callout-danger">
|
||||
<p>{{ form.username.label }}: {{ form.username.errors|join:', ' }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if form.password.errors %}
|
||||
<div class="callout callout-danger">
|
||||
<p>{{ form.password.label }}: {{ form.password.errors|join:', ' }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if form.non_field_errors %}
|
||||
<div class="callout callout-danger">
|
||||
{% for error in form.non_field_errors %}
|
||||
<p>{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" name="username" class="form-control" placeholder="{{ form.username.label }}" required>
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-user"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-3">
|
||||
<input type="password" name="password" class="form-control" placeholder="{{ form.password.label }}" required>
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% url 'admin_password_reset' as password_reset_url %}
|
||||
{% if password_reset_url %}
|
||||
<div class="mb-3">
|
||||
<div class="password-reset-link" style="text-align: center;">
|
||||
<a href="{{ password_reset_url }}">
|
||||
{% trans 'Forgotten your password or username?' %}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn {{ jazzmin_ui.button_classes.primary }} btn-block">
|
||||
{% trans "Log in" %}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
104
templates/registration/base.html
Normal file
104
templates/registration/base.html
Normal file
@@ -0,0 +1,104 @@
|
||||
{% load i18n static jazzmin admin_urls %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
{% get_current_language_bidi as LANGUAGE_BIDI %}
|
||||
{% get_jazzmin_settings request as jazzmin_settings %}
|
||||
{% get_jazzmin_ui_tweaks as jazzmin_ui %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
|
||||
<title>{% block title %}{{ title }} | {{ jazzmin_settings.site_title }}{% endblock %}</title>
|
||||
|
||||
<!-- Font Awesome Icons -->
|
||||
<link rel="stylesheet" href="{% static "vendor/fontawesome-free/css/all.min.css" %}">
|
||||
|
||||
<!-- Bootstrap and adminLTE -->
|
||||
<link rel="stylesheet" href="{% static "vendor/adminlte/css/adminlte.min.css" %}">
|
||||
|
||||
<!-- Bootswatch theme -->
|
||||
{% if jazzmin_ui.theme.name != 'default' %}
|
||||
<link rel="stylesheet" href="{{ jazzmin_ui.theme.src }}" id="jazzmin-theme" />
|
||||
{% endif %}
|
||||
|
||||
{% if jazzmin_ui.dark_mode_theme %}
|
||||
<link rel="stylesheet" href="{{ jazzmin_ui.dark_mode_theme.src }}" id="jazzmin-dark-mode-theme" media="(prefers-color-scheme: dark)"/>
|
||||
{% endif %}
|
||||
|
||||
<!-- Custom fixes for django -->
|
||||
<link rel="stylesheet" href="{% static "jazzmin/css/main.css" %}">
|
||||
|
||||
{% if jazzmin_settings.custom_css %}
|
||||
<!-- Custom CSS -->
|
||||
<link rel="stylesheet" href="{% static jazzmin_settings.custom_css %}">
|
||||
{% endif %}
|
||||
|
||||
<!-- favicons -->
|
||||
<link rel="shortcut icon" href="{% static jazzmin_settings.site_icon %}" type="image/png">
|
||||
<link rel="icon" href="{% static jazzmin_settings.site_icon %}" sizes="32x32" type="image/png">
|
||||
|
||||
{% if jazzmin_settings.use_google_fonts_cdn %}
|
||||
<!-- Google Font: Source Sans Pro -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
|
||||
{% endif %}
|
||||
|
||||
{% block extrastyle %} {% endblock %}
|
||||
{% block extrahead %} {% endblock %}
|
||||
</head>
|
||||
<body class="hold-transition jazzmin-login-page">
|
||||
|
||||
<section class="text-center text-lg-start">
|
||||
<style>
|
||||
.cascading-right {
|
||||
margin-right: -50px;
|
||||
z-index: 100;
|
||||
padding: 15px
|
||||
}
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
.cascading-right {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Jumbotron -->
|
||||
<div class="container py-4" style="">
|
||||
<div class="row g-0 align-items-center">
|
||||
<div class="col-lg-6 mb-5 mb-lg-0">
|
||||
<div class="card cascading-right" style="
|
||||
background: hsla(0, 0%, 100%, 0.55);
|
||||
backdrop-filter: blur(30px);
|
||||
">
|
||||
{% block content %} {% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 mb-5 mb-lg-0">
|
||||
<img src="{% static 'img/login_bg_43.jpg' %}" class="w-100 rounded-4 shadow-4"
|
||||
alt="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Jumbotron -->
|
||||
</section>
|
||||
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="{% static "admin/js/vendor/jquery/jquery.js" %}"></script>
|
||||
<!-- Bootstrap 4 -->
|
||||
<script src="{% static 'vendor/bootstrap/js/bootstrap.min.js' %}"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="{% static 'vendor/adminlte/js/adminlte.min.js' %}"></script>
|
||||
|
||||
{% if jazzmin_settings.custom_js %}
|
||||
<script src="{% static jazzmin_settings.custom_js %}"></script>
|
||||
{% endif %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Reference in New Issue
Block a user