mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Improve user search display name (#29002)
I tripped over this strange method and I don't think we need that workaround to fix the value. old:  new:  --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -196,10 +196,14 @@ a.label,
|
||||
.ui.search > .results {
|
||||
background: var(--color-body);
|
||||
border-color: var(--color-secondary);
|
||||
overflow-wrap: anywhere; /* allow text to wrap as fomantic limits this to 18em width */
|
||||
}
|
||||
|
||||
.ui.search > .results .result {
|
||||
background: var(--color-body);
|
||||
border-color: var(--color-secondary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.ui.search > .results .result .title {
|
||||
|
@@ -2128,14 +2128,16 @@
|
||||
}
|
||||
|
||||
#search-user-box .results .result .image {
|
||||
float: left;
|
||||
margin-right: 8px;
|
||||
order: 0;
|
||||
margin-right: 12px;
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
min-width: 2em;
|
||||
min-height: 2em;
|
||||
}
|
||||
|
||||
#search-user-box .results .result .content {
|
||||
margin: 6px 0; /* this trick is used to align with the sibling avatar image */
|
||||
margin: 0; /* remove margin reserved for avatar because we move it to left via `order: 0` */
|
||||
}
|
||||
|
||||
.ui.menu .item > img:not(.ui) {
|
||||
|
@@ -17,14 +17,13 @@ export function initCompSearchUserBox() {
|
||||
const searchQuery = $searchUserBox.find('input').val();
|
||||
const searchQueryUppercase = searchQuery.toUpperCase();
|
||||
$.each(response.data, (_i, item) => {
|
||||
let title = item.login;
|
||||
if (item.full_name && item.full_name.length > 0) {
|
||||
title += ` (${htmlEscape(item.full_name)})`;
|
||||
}
|
||||
const resultItem = {
|
||||
title,
|
||||
title: item.login,
|
||||
image: item.avatar_url
|
||||
};
|
||||
if (item.full_name) {
|
||||
resultItem.description = htmlEscape(item.full_name);
|
||||
}
|
||||
if (searchQueryUppercase === item.login.toUpperCase()) {
|
||||
items.unshift(resultItem);
|
||||
} else {
|
||||
|
@@ -52,9 +52,9 @@ export function initRepoSettingSearchTeamBox() {
|
||||
onResponse(response) {
|
||||
const items = [];
|
||||
$.each(response.data, (_i, item) => {
|
||||
const title = `${item.name} (${item.permission} access)`;
|
||||
items.push({
|
||||
title,
|
||||
title: item.name,
|
||||
description: `${item.permission} access` // TODO: translate this string
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user