Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tab if alternate login present #16832

Merged
merged 12 commits into from
Sep 11, 2019
58 changes: 53 additions & 5 deletions core/css/guest.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@ body {
max-width: 100%;
max-height: 200px;
}

.wrapper {
width: 300px;
max-width: 100%;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could lead to issues in other layouts, but we'll have a look later I guess, since we're at the start of 18!

margin-top: 10vh;
}

/* Default FORM */
form {
position: relative;
width: 280px;
margin: auto;
padding: 0;
}
form fieldset {
margin-bottom: 20px;
text-align: left;
width: 260px;
margin: auto auto 20px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down Expand Up @@ -143,14 +143,58 @@ form #datadirField legend {

/* Buttons and input */
#submit-wrapper,
#reset-password-wrapper {
#reset-password-wrapper,
#alternative-logins {
display: flex;
align-items: center;
justify-content: center;
position: relative; /* Make the wrapper the containing block of its
absolutely positioned descendant icons */
}

#alternative-logins {
margin: 30px 15px 20px;
display: block;
min-width: 260px;
max-width: 400px;
overflow: hidden;
}

#alternative-logins a {
margin: 10px 5px;
display: block;
font-size: 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

#alternative-logins a.button::before {
content: "";
background-repeat: no-repeat;
background-size: contain;
width: 0;
margin-right: 0;
height: 18px;
display: inline-block;
vertical-align: bottom;
}

#alternative-logins .button {
color: #0082c9;
padding: 12px 20px;
}

@media only screen and (max-width: 1024px) {
.wrapper {
margin-top: 0;
}
#alternative-logins {
margin: 30px 15px 10px;
}
}


#submit-wrapper .submit-icon,
#reset-password-wrapper .submit-icon {
position: absolute;
Expand All @@ -163,6 +207,10 @@ form #datadirField legend {
applied to the button instead. */
}

#submit-wrapper {
margin: 0 auto;
}

#submit-wrapper input.login:hover ~ .submit-icon.icon-confirm-white,
#submit-wrapper input.login:focus ~ .submit-icon.icon-confirm-white,
#submit-wrapper input.login:active ~ .submit-icon.icon-confirm-white {
Expand Down
19 changes: 9 additions & 10 deletions core/templates/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
?>

<div id="login"></div>

<?php if (!empty($_['alt_login'])) { ?>
<form id="alternative-logins">
<fieldset>
<ul>
<?php foreach($_['alt_login'] as $login): ?>
<li><a class="button" href="<?php print_unescaped($login['href']); ?>" ><?php p($login['name']); ?></a></li>
<?php endforeach; ?>
</ul>
</fieldset>
</form>
<?php }
<div id="alternative-logins">
<?php foreach($_['alt_login'] as $login): ?>
<a class="button <?php p($login['style'] ?? ''); ?>" aria-label="<?php p($login['label'] ?? $login['name']); ?>" href="<?php print_unescaped($login['href']); ?>" >
<?php p($login['name']); ?>
</a>
<?php endforeach; ?>
</div>
<?php } ?>