Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{% extends '@AdminLTE/FOSUserBundle/Security/login.html.twig' %}
|
||||
{% extends '@theme/security/login.html.twig' %}
|
||||
|
||||
{% block logo_login %}{% include 'partials/logo_login.html.twig' %}{% endblock %}
|
||||
{% block title %}{{- get_title() -}}{% endblock %}
|
||||
@@ -11,6 +11,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('app') }}
|
||||
{% set event = trigger(constant('App\\Event\\ThemeEvent::STYLESHEET')) %}
|
||||
{{ event.content|raw }}
|
||||
@@ -19,19 +20,57 @@
|
||||
{% block javascripts %}
|
||||
{{ encore_entry_script_tags('app') }}
|
||||
{% set event = trigger(constant('App\\Event\\ThemeEvent::JAVASCRIPT')) %}
|
||||
<script>
|
||||
let profile = localStorage.getItem('kimai_profile');
|
||||
if (profile === null) {
|
||||
{#
|
||||
screen.width = real screen width
|
||||
screen.availWidth = screen minus e.g. OS elements
|
||||
window.screen.width * window.devicePixelRatio = screen resolution is not relevant
|
||||
window.innerWidth = browser screen width minus browser elements (doesn’t include scroll bars and borders)
|
||||
window.visualViewport.width = window.innerWidth - border(?) => only a couple of pixels smaller
|
||||
|
||||
See https://getbootstrap.com/docs/5.0/layout/breakpoints/ for the min width, as of v5 this is 576px
|
||||
#}
|
||||
profile = '{{ constant('\\App\\Utils\\ProfileManager::PROFILE_DESKTOP') }}'
|
||||
const size = window.visualViewport !== undefined ? window.visualViewport.width : window.innerWidth;
|
||||
if (size < 576) {
|
||||
profile = '{{ constant('\\App\\Utils\\ProfileManager::PROFILE_MOBILE') }}';
|
||||
}
|
||||
localStorage.setItem('kimai_profile', profile);
|
||||
}
|
||||
document.cookie = "{{ constant('\\App\\Utils\\ProfileManager::COOKIE_PROFILE') }}="+profile+"; path=/; expires=; SameSite=Strict; Secure";
|
||||
</script>
|
||||
{{ event.content|raw }}
|
||||
{% endblock %}
|
||||
|
||||
{% block login_social_auth %}
|
||||
{% if saml_config.isActivated() %}
|
||||
{% set class = 'btn-primary' %}
|
||||
{% if kimai_config.loginFormActive %}
|
||||
{% set class = 'btn-google' %}
|
||||
<div class="hr-text">{{ 'or'|trans({}, 'TablerBundle') }}</div>
|
||||
{% endif %}
|
||||
<a href="{{ path('saml_login') }}" class="btn btn-block {{ class }}">
|
||||
<span>{{ saml_config.getTitle()|trans }}</span>
|
||||
</a>
|
||||
<br>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
{% if not kimai_config.loginFormActive %}
|
||||
<h2 class="card-title text-center mb-4">{{ block('login_box_msg') }}</h2>
|
||||
{% endif %}
|
||||
<div class="col text-center">
|
||||
<a href="{{ path('saml_login') }}" id="social-login-button" tabindex="50" class="btn btn-white w-50">
|
||||
{% set provider = saml_config.getProvider() %}
|
||||
{% if provider is not null %}
|
||||
<i class="icon fab fa-{{ provider}} text-{{ provider }}"></i>
|
||||
{% endif %}
|
||||
{{ saml_config.getTitle()|trans }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block login_box %}
|
||||
{% if kimai_config.loginFormActive %}
|
||||
{{ parent() }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -41,17 +80,16 @@
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block login_actions %}
|
||||
<div class="login-actions">
|
||||
{% block password_forgotten %}
|
||||
{% if kimai_config.passwordResetActive %}
|
||||
<a class="text-muted action-register" href="{{ path('fos_user_resetting_request') }}">
|
||||
{{ 'I forgot my password'|trans({}, 'AdminLTEBundle') }}
|
||||
</a>
|
||||
{{ parent() }}
|
||||
{% endif %}
|
||||
{% if kimai_config.selfRegistrationActive %}
|
||||
<a class="text-muted action-password" href="{{ path('fos_user_registration_register') }}">
|
||||
{{ 'Register a new account'|trans({}, 'AdminLTEBundle') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block registration %}
|
||||
{% if kimai_config.selfRegistrationActive %}
|
||||
{{ parent() }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block remember_me %}{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user