Skip to content
Snippets Groups Projects
Commit 52e6b564 authored by Ron Lucke's avatar Ron Lucke
Browse files

Fix Login Page Issues

Closes #5006, #5010, and #5007

Merge request studip/studip!3759
parent 2c58cec9
No related branches found
No related tags found
No related merge requests found
...@@ -90,9 +90,10 @@ class LoginController extends AuthenticatedController ...@@ -90,9 +90,10 @@ class LoginController extends AuthenticatedController
} }
} }
$this->has_login_error = false;
if ($this->error_msg) { if ($this->error_msg) {
PageLayout::postException(_('Bei der Anmeldung trat ein Fehler auf!'), $this->error_msg); PageLayout::postException(_('Bei der Anmeldung trat ein Fehler auf!'), $this->error_msg);
$this->has_login_error = true;
} }
$this->uname = (isset($this->auth["uname"]) ? $this->auth["uname"] : Request::username('loginname')); $this->uname = (isset($this->auth["uname"]) ? $this->auth["uname"] : Request::username('loginname'));
$this->self_registration_activated = Config::get()->ENABLE_SELF_REGISTRATION; $this->self_registration_activated = Config::get()->ENABLE_SELF_REGISTRATION;
......
...@@ -11,8 +11,7 @@ $password_tooltip_text = (string) Config::get()->PASSWORD_TOOLTIP_TEXT; ...@@ -11,8 +11,7 @@ $password_tooltip_text = (string) Config::get()->PASSWORD_TOOLTIP_TEXT;
?> ?>
<form class="default <?= $hidden ? 'hide' : '' ?> <?= $login_form_class ?>" name="login_form" id="login-form" method="post" <form class="default <?= $hidden ? 'hide' : '' ?> <?= $login_form_class ?>" name="login_form" id="login-form" method="post"
action="<?= URLHelper::getLink(Request::url(), ['cancel_login' => null]) ?>" <? if ($hidden) action="<?= URLHelper::getLink(Request::url(), ['cancel_login' => null]) ?>">
echo 'hidden'; ?>>
<section> <section>
<? $withTooltip = $username_tooltip_text !== '' || $password_tooltip_text !== ''; ?> <? $withTooltip = $username_tooltip_text !== '' || $password_tooltip_text !== ''; ?>
<label class="<?= $withTooltip ? 'with-tooltip' : ''?>"> <label class="<?= $withTooltip ? 'with-tooltip' : ''?>">
......
<?php <?php
/** /**
* @var array $loginerror * @var bool $has_login_error
* @var string $error_msg * @var string $error_msg
*/ */
...@@ -76,7 +76,7 @@ $enable_news = Config::get()->LOGIN_NEWS_VISIBILITY && count($news_entries) > 0; ...@@ -76,7 +76,7 @@ $enable_news = Config::get()->LOGIN_NEWS_VISIBILITY && count($news_entries) > 0;
<? if ($show_hidden_login): ?> <? if ($show_hidden_login): ?>
<?= $this->render_partial('login/_standard_loginform', [ <?= $this->render_partial('login/_standard_loginform', [
'hidden' => empty($loginerror), 'hidden' => !$has_login_error,
'login_form_class' => 'login-bottom' 'login_form_class' => 'login-bottom'
]) ?> ]) ?>
<? endif ?> <? endif ?>
......
...@@ -380,30 +380,14 @@ STUDIP.domReady(function () { ...@@ -380,30 +380,14 @@ STUDIP.domReady(function () {
const toggleLogin = document.getElementById('toggle-login'); const toggleLogin = document.getElementById('toggle-login');
if (toggleLogin) { if (toggleLogin) {
loginForm.addEventListener('transitionend', (event) => { toggleLogin.addEventListener('click', (event) => {
if (event.propertyName !== 'max-height') { loginForm.classList.toggle('hide');
return;
}
if (!loginForm.classList.contains('hide')) { if (!loginForm.classList.contains('hide')) {
usernameInput.scrollIntoView({ usernameInput.scrollIntoView({
behavior: 'smooth' behavior: 'smooth'
}); });
usernameInput.focus(); usernameInput.focus();
} else {
loginForm.setAttribute('hidden', '');
} }
});
toggleLogin.addEventListener('click', (event) => {
if (loginForm.classList.contains('hide')) {
loginForm.removeAttribute('hidden');
}
setTimeout(() => {
loginForm.classList.toggle('hide');
}, 0);
event.preventDefault(); event.preventDefault();
}); });
} }
......
...@@ -17,6 +17,7 @@ $gap-between-boxes: calc($login-page-margin / 2); ...@@ -17,6 +17,7 @@ $gap-between-boxes: calc($login-page-margin / 2);
row-gap: 20px; row-gap: 20px;
align-items: flex-start; align-items: flex-start;
flex-basis: 450px; flex-basis: 450px;
height: 100%;
} }
} }
...@@ -75,10 +76,6 @@ $gap-between-boxes: calc($login-page-margin / 2); ...@@ -75,10 +76,6 @@ $gap-between-boxes: calc($login-page-margin / 2);
padding: 32px; padding: 32px;
} }
&.hide {
display: none;
}
#login-infobox-button-wrapper { #login-infobox-button-wrapper {
position: absolute; position: absolute;
right: 24px; right: 24px;
...@@ -104,13 +101,6 @@ $gap-between-boxes: calc($login-page-margin / 2); ...@@ -104,13 +101,6 @@ $gap-between-boxes: calc($login-page-margin / 2);
} }
} }
} }
.hidden {
visibility: hidden;
height: 0;
padding: 0;
overflow: hidden;
}
} }
} }
...@@ -257,10 +247,20 @@ $gap-between-boxes: calc($login-page-margin / 2); ...@@ -257,10 +247,20 @@ $gap-between-boxes: calc($login-page-margin / 2);
border-top: none; border-top: none;
border-bottom: solid thin var(--content-color-40); border-bottom: solid thin var(--content-color-40);
&.login-bottom { &.login-bottom {
border-top: solid thin var(--content-color-40); border-top: solid thin var(--content-color-40);
border-bottom: none; border-bottom: none;
padding-top: 1em; padding-top: 20px;
max-height: 180px;
overflow: hidden;
clip-path: inset(0 0 0 0);
transition: clip-path var(--transition-duration) ease-out;
&.hide {
clip-path: inset(0 0 100% 0);
}
} }
section { section {
...@@ -336,6 +336,7 @@ $gap-between-boxes: calc($login-page-margin / 2); ...@@ -336,6 +336,7 @@ $gap-between-boxes: calc($login-page-margin / 2);
&.login-bottom { &.login-bottom {
justify-content: flex-start; justify-content: flex-start;
margin: 0 1em 1em 1em;
} }
} }
...@@ -418,6 +419,7 @@ html:not(.size-large) { ...@@ -418,6 +419,7 @@ html:not(.size-large) {
width: 100%; width: 100%;
top: 0; top: 0;
#login-content-wrapper { #login-content-wrapper {
margin-top: 0;
#login-infobox { #login-infobox {
max-width: unset; max-width: unset;
min-width: unset; min-width: unset;
...@@ -427,11 +429,26 @@ html:not(.size-large) { ...@@ -427,11 +429,26 @@ html:not(.size-large) {
} }
} }
html:not(.size-medium) { html:not(.size-medium) {
&.responsive-display {
body#login {
#content-wrapper {
margin: 0;
padding: 0;
width: 100%;
}
}
body:not(#login) {
#content-wrapper {
padding: 15px;
}
}
}
#login-wrapper { #login-wrapper {
margin: 0; margin: 0;
#login-content-wrapper { #login-content-wrapper {
height: unset; height: unset;
margin-top: 0;
flex-wrap: wrap; flex-wrap: wrap;
#loginbox { #loginbox {
...@@ -439,6 +456,7 @@ html:not(.size-medium) { ...@@ -439,6 +456,7 @@ html:not(.size-medium) {
width: unset; width: unset;
min-height: unset; min-height: unset;
flex-grow: 1; flex-grow: 1;
padding: 16px;
} }
#login-infobox { #login-infobox {
...@@ -446,12 +464,19 @@ html:not(.size-medium) { ...@@ -446,12 +464,19 @@ html:not(.size-medium) {
padding: 16px 56px 16px 16px; padding: 16px 56px 16px 16px;
&.no-toggle { &.no-toggle {
width: 100%; width: 100%;
padding: 16px; padding: 16px 0 0 0;
} }
#login-infobox-button-wrapper { #login-infobox-button-wrapper {
top: 16px; top: 16px;
right: 16px; right: 16px;
} }
#login-faq-box {
height: unset;
#login-faq-content-wrapper {
max-height: unset;
}
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment