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:
parent
e039b76a6f
commit
a387636b9a
4 changed files with 16 additions and 6 deletions
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue