Enhancement: use custom logo on login page
This commit is contained in:
parent
3061c59c06
commit
af5fc7775f
@ -1,11 +1,19 @@
|
|||||||
from django.conf import settings as django_settings
|
from django.conf import settings as django_settings
|
||||||
|
|
||||||
|
from paperless.config import GeneralConfig
|
||||||
|
|
||||||
|
|
||||||
def settings(request):
|
def settings(request):
|
||||||
|
general_config = GeneralConfig()
|
||||||
|
app_logo = django_settings.APP_LOGO
|
||||||
|
if general_config.app_logo is not None and len(general_config.app_logo) > 0:
|
||||||
|
app_logo = general_config.app_logo
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"EMAIL_ENABLED": django_settings.EMAIL_HOST != "localhost"
|
"EMAIL_ENABLED": django_settings.EMAIL_HOST != "localhost"
|
||||||
or django_settings.EMAIL_HOST_USER != "",
|
or django_settings.EMAIL_HOST_USER != "",
|
||||||
"DISABLE_REGULAR_LOGIN": django_settings.DISABLE_REGULAR_LOGIN,
|
"DISABLE_REGULAR_LOGIN": django_settings.DISABLE_REGULAR_LOGIN,
|
||||||
"ACCOUNT_ALLOW_SIGNUPS": django_settings.ACCOUNT_ALLOW_SIGNUPS,
|
"ACCOUNT_ALLOW_SIGNUPS": django_settings.ACCOUNT_ALLOW_SIGNUPS,
|
||||||
"domain": getattr(django_settings, "PAPERLESS_URL", request.get_host()),
|
"domain": getattr(django_settings, "PAPERLESS_URL", request.get_host()),
|
||||||
|
"APP_LOGO": app_logo,
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,15 @@ body {
|
|||||||
--pngx-primary-active: #0c2c10;
|
--pngx-primary-active: #0c2c10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.byline {
|
||||||
|
font-size: 0.6rem;
|
||||||
|
letter-spacing: 0.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.form-control {
|
.form-control {
|
||||||
--bs-body-bg: #fff;
|
--bs-body-bg: #fff;
|
||||||
}
|
}
|
@ -13,14 +13,21 @@
|
|||||||
{% endblock head_title %}
|
{% endblock head_title %}
|
||||||
</title>
|
</title>
|
||||||
<link href="{% static 'bootstrap.min.css' %}" rel="stylesheet">
|
<link href="{% static 'bootstrap.min.css' %}" rel="stylesheet">
|
||||||
<link href="{% static 'accounts.css' %}" rel="stylesheet">
|
<link href="{% static 'base.css' %}" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="text-center">
|
<body class="text-center">
|
||||||
<div class="position-absolute top-50 start-50 translate-middle">
|
<div class="position-absolute top-50 start-50 translate-middle">
|
||||||
<form class="form-accounts" method="post">
|
<form class="form-accounts" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
{% if not APP_LOGO %}
|
||||||
{% include "paperless-ngx/snippets/svg_logo.html" with extra_attrs="width='300' class='logo mb-4'" %}
|
{% include "paperless-ngx/snippets/svg_logo.html" with extra_attrs="width='300' class='logo mb-4'" %}
|
||||||
|
{% else %}
|
||||||
|
<img src="{{APP_LOGO}}" width="300" class="logo mb-1" />
|
||||||
|
<div class="d-flex flex-column align-items-end mb-4">
|
||||||
|
<span class="byline text-uppercase font-monospace">by Paperless-ngx</span>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
<div class="alert alert-{{ message.level_tag }}" role="alert">
|
<div class="alert alert-{{ message.level_tag }}" role="alert">
|
||||||
{{ message }}
|
{{ message }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user