fixes #2283 reduce font-size for initials

...and add no wrap for username
This commit is contained in:
Linty 2024-11-25 11:27:32 +01:00
parent 24293ef7c8
commit 1525f9ced2
2 changed files with 26 additions and 4 deletions

View file

@ -1330,7 +1330,14 @@ function fill_container_user_info(container, user_index) {
kingToDisplay.tipTip();
container.find(".user-container-username").append(kingToDisplay);
}
container.find(".user-container-initials span").html(get_initials(user.username)).addClass(color_icons[user.id % 5]);
const initial_to_fill = get_initials(user.username);
const initialSpan = container.find(".user-container-initials span");
initialSpan.html(initial_to_fill).addClass(color_icons[user.id % 5]);
if (initial_to_fill.length > 1) {
initialSpan.addClass('small');
} else {
initialSpan.removeClass('small');
}
container.find(".user-container-status span").html(status_to_str[user.status]);
container.find(".user-container-email span").html(user.email);
generate_groups(container, user.groups);
@ -1397,10 +1404,16 @@ function fill_user_edit_summary(user_to_edit, pop_in, isGuest) {
if (isGuest) {
pop_in.find('.user-property-initials span').removeClass(color_icons.join(' ')).addClass(color_icons[user_to_edit.id % 5]);
} else {
pop_in.find('.user-property-initials span').html(get_initials(user_to_edit.username)).removeClass(color_icons.join(' ')).addClass(color_icons[user_to_edit.id % 5]);
const initial_to_fill = get_initials(user_to_edit.username);
const initialSpan = pop_in.find('.user-property-initials span');
initialSpan.html(initial_to_fill).removeClass(color_icons.join(' ')).addClass(color_icons[user_to_edit.id % 5]);
if (initial_to_fill.length > 1) {
initialSpan.addClass('small');
} else {
initialSpan.removeClass('small');
}
}
pop_in.find('.user-property-username span:first').html(user_to_edit.username);
pop_in.find('.user-property-username span:first').html(user_to_edit.username).tipTip({content: user_to_edit.username});
if (user_to_edit.id === connected_user || user_to_edit.id === 1) {
pop_in.find('.user-property-username .edit-username-specifier').show();

View file

@ -1413,6 +1413,10 @@ $(document).ready(function() {
width:70px;
}
.user-container-initials .small {
font-size: 1em !important;
}
.user-header-username{
width: 20%;
max-width: 195px;
@ -1966,6 +1970,10 @@ $(document).ready(function() {
font-weight:bold;
}
.user-property-initials .small {
font-size: 3em !important;
}
.user-property-username {
font-weight:bold;
margin-bottom:45px;
@ -2223,6 +2231,7 @@ $(document).ready(function() {
max-width: 200px;
overflow-x: hidden;
text-overflow: ellipsis;
text-wrap: nowrap;
}
.edit-username-specifier {