Fix #29028 Fix #29163 Md-theme - Login is on other icons

This commit is contained in:
Laurent Destailleur 2024-04-08 02:54:01 +02:00
parent 8e6674ff6f
commit 330d20813e
4 changed files with 29 additions and 12 deletions

View file

@ -2524,8 +2524,8 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$btnUser = '<!-- div for user link -->
<div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu inline-block">
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="dropdown-toggle login-dropdown-a" data-toggle="dropdown">
'.$userImage.(empty($user->photo) ? '<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone paddingleft">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>' : '').'
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="dropdown-toggle login-dropdown-a valignmiddle" data-toggle="dropdown">
'.$userImage.(empty($user->photo) ? '<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone paddingleft valignmiddle small">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>' : '').'
</a>
<div class="dropdown-menu">
<!-- User image -->
@ -2571,10 +2571,9 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
} else {
$btnUser = '<!-- div for user link -->
<div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu inline-block">
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'">
'.$userImage.'
<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>
</a>
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="valignmiddle">
'.$userImage.(empty($user->photo) ? '<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone paddingleft small">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>' : '').'
</a>
</div>';
}
@ -2597,7 +2596,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
';
if ($conf->theme != 'md') {
//if ($conf->theme != 'md') {
$btnUser .= '
jQuery("#topmenu-login-dropdown .dropdown-toggle").on("click", function(event) {
console.log("Click on #topmenu-login-dropdown .dropdown-toggle");
@ -2614,7 +2613,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
console.log("Clik on #topmenuloginmoreinfo-btn");
jQuery("#topmenuloginmoreinfo").slideToggle();
});';
}
//}
$btnUser .= '
});

View file

@ -3081,6 +3081,12 @@ div.login_block a {
color: var(--colortextbackhmenu);
display: inline-block;
}
div.login_block a .atoploginusername {
display: inline-block;
overflow: hidden;
max-width: 60px;
text-overflow: ellipsis;
}
div.login_block span.aversion {
color: var(--colortextbackhmenu);
filter: contrast(0.7);

View file

@ -1,7 +1,12 @@
<?php
if (!defined('ISLOADEDBYSTEELSHEET')) {
die('Must be call by steelsheet');
} ?>
}
// When no photo, we show the login name, so we need an offset to output picto at a fixed position.
$atoploginusername = empty($user->photo) ? 52 : 0;
?>
/* <style type="text/css" > dont remove this line it's an ide hack */
/*
* Dropdown of user popup
@ -27,17 +32,17 @@ button.dropdown-item.global-search-item {
div#topmenu-global-search-dropdown {
position: fixed;
<?php echo $right; ?>: 125px;
<?php echo $right; ?>: <?php echo (125 + $atoploginusername); ?>px;
top: 0px;
}
div#topmenu-quickadd-dropdown {
position: fixed;
<?php echo $right; ?>: 90px;
<?php echo $right; ?>: <?php echo (90 + $atoploginusername); ?>px;
top: 0px;
}
div#topmenu-bookmark-dropdown {
position: fixed;
<?php echo $right; ?>: 55px;
<?php echo $right; ?>: <?php echo (55 + $atoploginusername); ?>px;
top: 0px;
}
div#topmenu-login-dropdown {

View file

@ -3245,6 +3245,13 @@ div.login_block a {
color: var(--colortexthmenu);
display: inline-block;
}
div.login_block a .atoploginusername {
color: var(--colortextbackhmenu);
display: inline-block;
overflow: hidden;
max-width: 50px;
text-overflow: ellipsis;
}
div.login_block span.aversion {
color: var(--colortexthmenu);
filter: contrast(0.7);