mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Show fullname on issue edits and gpg/ssh signing info (#18827)
Show missing full names when configured to do so Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"fmt"
|
||||
"html"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/models/db"
|
||||
@@ -16,6 +17,7 @@ import (
|
||||
"code.gitea.io/gitea/models/unit"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
|
||||
"github.com/sergi/go-diff/diffmatchpatch"
|
||||
@@ -68,9 +70,15 @@ func GetContentHistoryList(ctx *context.Context) {
|
||||
actionText = ctx.Locale.Tr("repo.issues.content_history.edited")
|
||||
}
|
||||
timeSinceText := timeutil.TimeSinceUnix(item.EditedUnix, lang)
|
||||
|
||||
username := item.UserName
|
||||
if setting.UI.DefaultShowFullName && strings.TrimSpace(item.UserFullName) != "" {
|
||||
username = strings.TrimSpace(item.UserFullName)
|
||||
}
|
||||
|
||||
results = append(results, map[string]interface{}{
|
||||
"name": fmt.Sprintf("<img class='ui avatar image' src='%s'><strong>%s</strong> %s %s",
|
||||
html.EscapeString(item.UserAvatarLink), html.EscapeString(item.UserName), actionText, timeSinceText),
|
||||
html.EscapeString(item.UserAvatarLink), html.EscapeString(username), actionText, timeSinceText),
|
||||
"value": item.HistoryID,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user