FIX: Remove language dropdown if only one is active
master
Phoenix Eve Aspacio 2018-01-15 22:47:47 +08:00 committed by GitHub
commit 1a2cdbf55c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -110,4 +110,10 @@ legend {
} }
.mailcow-logo img { .mailcow-logo img {
max-width: 250px; max-width: 250px;
} }
.lang-link-disabled a {
pointer-events: none;
}
.lang-link-disabled {
cursor: not-allowed;
}

View File

@ -49,7 +49,7 @@
<?php <?php
if (isset($_SESSION['mailcow_locale'])) { if (isset($_SESSION['mailcow_locale'])) {
?> ?>
<li class="dropdown"> <li class="dropdown<?=(isset($_SESSION['mailcow_locale']) && count($AVAILABLE_LANGUAGES) === 1) ? ' lang-link-disabled"' : '' ?>">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><span class="lang-sm lang-lbl" lang="<?= $_SESSION['mailcow_locale']; ?>"></span><span class="caret"></span></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><span class="lang-sm lang-lbl" lang="<?= $_SESSION['mailcow_locale']; ?>"></span><span class="caret"></span></a>
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<?php <?php

View File

@ -43,7 +43,7 @@ $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
<div class="form-group"> <div class="form-group">
<button type="submit" class="btn btn-success" value="Login"><?= $lang['login']['login']; ?></button> <button type="submit" class="btn btn-success" value="Login"><?= $lang['login']['login']; ?></button>
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button type="button" <?=(isset($_SESSION['mailcow_locale']) && count($AVAILABLE_LANGUAGES) === 1) ? 'disabled="true"' : '' ?> class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="lang-sm lang-lbl" lang="<?= $_SESSION['mailcow_locale']; ?>"></span> <span class="caret"></span> <span class="lang-sm lang-lbl" lang="<?= $_SESSION['mailcow_locale']; ?>"></span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">