forked from kevadesu/forgejo
[PORT] Refactor DateUtils and merge TimeSince (gitea#32409)
Follow #32383 and #32402 --- Conflict resolution: Magic, painful. (cherry picked from commit b068dbd40ee3b4dc7d18cdcf168f0c24cea234c0)
This commit is contained in:
parent
8f6dfe29da
commit
7e1aa8a5cd
74 changed files with 241 additions and 228 deletions
|
@ -14,7 +14,6 @@ import (
|
|||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/templates"
|
||||
"code.gitea.io/gitea/modules/timeutil"
|
||||
"code.gitea.io/gitea/services/context"
|
||||
|
||||
"github.com/sergi/go-diff/diffmatchpatch"
|
||||
|
@ -73,10 +72,10 @@ func GetContentHistoryList(ctx *context.Context) {
|
|||
class := avatars.DefaultAvatarClass + " tw-mr-2"
|
||||
name := html.EscapeString(username)
|
||||
avatarHTML := string(templates.AvatarHTML(src, 28, class, username))
|
||||
timeSinceText := string(timeutil.TimeSinceUnix(item.EditedUnix, ctx.Locale))
|
||||
timeSinceHTML := string(templates.TimeSince(item.EditedUnix))
|
||||
|
||||
results = append(results, map[string]any{
|
||||
"name": avatarHTML + "<strong>" + name + "</strong> " + actionText + " " + timeSinceText,
|
||||
"name": avatarHTML + "<strong>" + name + "</strong> " + actionText + " " + timeSinceHTML,
|
||||
"value": item.HistoryID,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue