From b068dbd40ee3b4dc7d18cdcf168f0c24cea234c0 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 4 Nov 2024 19:30:00 +0800 Subject: Refactor DateUtils and merge TimeSince (#32409) Follow #32383 and #32402 --- templates/repo/actions/runs_list.tmpl | 2 +- templates/repo/branch/list.tmpl | 6 +++--- templates/repo/code/recently_pushed_new_branches.tmpl | 2 +- templates/repo/commit_page.tmpl | 4 ++-- templates/repo/commits_list.tmpl | 4 ++-- templates/repo/diff/comments.tmpl | 2 +- templates/repo/diff/compare.tmpl | 2 +- templates/repo/empty.tmpl | 2 +- templates/repo/graph/commits.tmpl | 2 +- templates/repo/header.tmpl | 2 +- templates/repo/home.tmpl | 2 +- templates/repo/issue/card.tmpl | 2 +- templates/repo/issue/milestone_issues.tmpl | 4 ++-- templates/repo/issue/milestones.tmpl | 6 +++--- templates/repo/issue/view_content.tmpl | 2 +- templates/repo/issue/view_content/comments.tmpl | 12 ++++++------ templates/repo/issue/view_content/conversation.tmpl | 2 +- templates/repo/issue/view_content/pull.tmpl | 2 +- templates/repo/issue/view_content/sidebar.tmpl | 2 +- templates/repo/issue/view_title.tmpl | 4 ++-- templates/repo/pulse.tmpl | 14 +++++++------- templates/repo/release/list.tmpl | 2 +- templates/repo/settings/deploy_keys.tmpl | 2 +- templates/repo/settings/lfs.tmpl | 2 +- templates/repo/settings/lfs_file_find.tmpl | 2 +- templates/repo/settings/lfs_locks.tmpl | 2 +- templates/repo/settings/options.tmpl | 4 ++-- templates/repo/settings/webhook/history.tmpl | 2 +- templates/repo/tag/list.tmpl | 2 +- templates/repo/user_cards.tmpl | 2 +- templates/repo/view_file.tmpl | 2 +- templates/repo/view_list.tmpl | 4 ++-- templates/repo/wiki/pages.tmpl | 2 +- templates/repo/wiki/revision.tmpl | 2 +- templates/repo/wiki/view.tmpl | 2 +- 35 files changed, 56 insertions(+), 56 deletions(-) (limited to 'templates/repo') diff --git a/templates/repo/actions/runs_list.tmpl b/templates/repo/actions/runs_list.tmpl index 09a25ce8bd..5537e9e617 100644 --- a/templates/repo/actions/runs_list.tmpl +++ b/templates/repo/actions/runs_list.tmpl @@ -33,7 +33,7 @@ {{.PrettyRef}} {{end}}
-
{{svg "octicon-calendar" 16}}{{TimeSinceUnix .Updated ctx.Locale}}
+
{{svg "octicon-calendar" 16}}{{DateUtils.TimeSince .Updated}}
{{svg "octicon-stopwatch" 16}}{{.Duration}}
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index f5d709bb16..6e2a5570c7 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -27,7 +27,7 @@ {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}} -

{{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage (.Repository.ComposeMetas ctx)}} · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

+

{{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage (.Repository.ComposeMetas ctx)}} · {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DefaultBranchBranch.DBBranch.CommitTime}}{{if .DefaultBranchBranch.DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}

{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} @@ -92,7 +92,7 @@ {{.DBBranch.Name}} -

{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix ctx.Locale}}

+

{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{DateUtils.TimeSince .DBBranch.DeletedUnix}}

{{else}}
{{.DBBranch.Name}} @@ -102,7 +102,7 @@ {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}}
-

{{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage ($.Repository.ComposeMetas ctx)}} · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

+

{{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .DBBranch.CommitID}} · {{RenderCommitMessage $.Context .DBBranch.CommitMessage ($.Repository.ComposeMetas ctx)}} · {{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .DBBranch.CommitTime}}{{if .DBBranch.Pusher}}  {{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}}  {{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}

{{end}} diff --git a/templates/repo/code/recently_pushed_new_branches.tmpl b/templates/repo/code/recently_pushed_new_branches.tmpl index 025cc1a403..f0edf6065b 100644 --- a/templates/repo/code/recently_pushed_new_branches.tmpl +++ b/templates/repo/code/recently_pushed_new_branches.tmpl @@ -1,7 +1,7 @@ {{range .RecentlyPushedNewBranches}}
- {{$timeSince := TimeSince .CommitTime.AsTime ctx.Locale}} + {{$timeSince := DateUtils.TimeSince .CommitTime}} {{$branchLink := HTMLFormat `%s` .BranchLink .BranchDisplayName}} {{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" $branchLink $timeSince}}
diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index b8195ac544..975d573245 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -152,7 +152,7 @@ {{ctx.AvatarUtils.AvatarByEmail .Commit.Author.Email .Commit.Author.Email 28 "tw-mr-2"}} {{.Commit.Author.Name}} {{end}} - {{TimeSince .Commit.Author.When ctx.Locale}} + {{DateUtils.TimeSince .Commit.Author.When}} {{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}} {{ctx.Locale.Tr "repo.diff.committed_by"}} {{if ne .Verification.CommittingUser.ID 0}} @@ -273,7 +273,7 @@ {{else}} {{.NoteCommit.Author.Name}} {{end}} - {{TimeSince .NoteCommit.Author.When ctx.Locale}} + {{DateUtils.TimeSince .NoteCommit.Author.When}}
{{.NoteRendered | SanitizeHTML}}
diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index 917a445fde..b8d10eb1aa 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -79,9 +79,9 @@ {{end}} {{if .Committer}} - {{TimeSince .Committer.When ctx.Locale}} + {{DateUtils.TimeSince .Committer.When}} {{else}} - {{TimeSince .Author.When ctx.Locale}} + {{DateUtils.TimeSince .Author.When}} {{end}} diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index 90d6a511bf..0ed231b07e 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -1,6 +1,6 @@ {{range .comments}} -{{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}} +{{$createdStr:= DateUtils.TimeSince .CreatedUnix}}
{{if .OriginalAuthor}} {{ctx.AvatarUtils.Avatar nil}} diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl index 3e00700eb0..5ac6013ed5 100644 --- a/templates/repo/diff/compare.tmpl +++ b/templates/repo/diff/compare.tmpl @@ -204,7 +204,7 @@ {{if .Repository.ArchivedUnix.IsZero}} {{ctx.Locale.Tr "repo.archive.title"}} {{else}} - {{ctx.Locale.Tr "repo.archive.title_date" (ctx.DateUtils.AbsoluteLong .Repository.ArchivedUnix)}} + {{ctx.Locale.Tr "repo.archive.title_date" (DateUtils.AbsoluteLong .Repository.ArchivedUnix)}} {{end}}
{{end}} diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl index d7f05223af..d3a81bc51d 100644 --- a/templates/repo/empty.tmpl +++ b/templates/repo/empty.tmpl @@ -10,7 +10,7 @@ {{if .Repository.ArchivedUnix.IsZero}} {{ctx.Locale.Tr "repo.archive.title"}} {{else}} - {{ctx.Locale.Tr "repo.archive.title_date" (ctx.DateUtils.AbsoluteLong .Repository.ArchivedUnix)}} + {{ctx.Locale.Tr "repo.archive.title_date" (DateUtils.AbsoluteLong .Repository.ArchivedUnix)}} {{end}}
{{end}} diff --git a/templates/repo/graph/commits.tmpl b/templates/repo/graph/commits.tmpl index 15443dec06..1691fb8d45 100644 --- a/templates/repo/graph/commits.tmpl +++ b/templates/repo/graph/commits.tmpl @@ -69,7 +69,7 @@ {{$userName}} {{end}} - {{ctx.DateUtils.FullTime $commit.Date}} + {{DateUtils.FullTime $commit.Date}} {{end}} {{end}} diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index d52891b02a..b023b28b62 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -121,7 +121,7 @@
{{ctx.Locale.Tr "repo.mirror_from"}} {{$.PullMirror.RemoteAddress}} - {{if $.PullMirror.UpdatedUnix}}{{ctx.Locale.Tr "repo.mirror_sync"}} {{TimeSinceUnix $.PullMirror.UpdatedUnix ctx.Locale}}{{end}} + {{if $.PullMirror.UpdatedUnix}}{{ctx.Locale.Tr "repo.mirror_sync"}} {{DateUtils.TimeSince $.PullMirror.UpdatedUnix}}{{end}}
{{end}} {{if .IsFork}}
{{ctx.Locale.Tr "repo.forked_from"}} {{.BaseRepo.FullName}}
{{end}} diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index f33a230c4b..7a6cbbc4e2 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -37,7 +37,7 @@ {{if .Repository.ArchivedUnix.IsZero}} {{ctx.Locale.Tr "repo.archive.title"}} {{else}} - {{ctx.Locale.Tr "repo.archive.title_date" (ctx.DateUtils.AbsoluteLong .Repository.ArchivedUnix)}} + {{ctx.Locale.Tr "repo.archive.title_date" (DateUtils.AbsoluteLong .Repository.ArchivedUnix)}} {{end}} {{end}} diff --git a/templates/repo/issue/card.tmpl b/templates/repo/issue/card.tmpl index 4c22c28329..916d52446b 100644 --- a/templates/repo/issue/card.tmpl +++ b/templates/repo/issue/card.tmpl @@ -24,7 +24,7 @@
{{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}} - {{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}} + {{$timeStr := DateUtils.TimeSince .GetLastEventTimestamp}} {{if .OriginalAuthor}} {{ctx.Locale.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor}} {{else if gt .Poster.ID 0}} diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl index 01bd944f46..4fc6057117 100644 --- a/templates/repo/issue/milestone_issues.tmpl +++ b/templates/repo/issue/milestone_issues.tmpl @@ -30,7 +30,7 @@
- {{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix ctx.Locale}} + {{$closedDate:= DateUtils.TimeSince .Milestone.ClosedDateUnix}} {{if .IsClosed}} {{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}} {{else}} @@ -38,7 +38,7 @@ {{if .Milestone.DeadlineString}} {{svg "octicon-calendar"}} - {{ctx.DateUtils.AbsoluteShort (.Milestone.DeadlineString|ctx.DateUtils.ParseLegacy)}} + {{DateUtils.AbsoluteShort (.Milestone.DeadlineString|DateUtils.ParseLegacy)}} {{else}} {{svg "octicon-calendar"}} diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index 8b84659d10..9515acfb8e 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -47,19 +47,19 @@ {{if .UpdatedUnix}}
{{svg "octicon-clock"}} - {{ctx.Locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix ctx.Locale)}} + {{ctx.Locale.Tr "repo.milestones.update_ago" (DateUtils.TimeSince .UpdatedUnix)}}
{{end}}
{{if .IsClosed}} - {{$closedDate:= TimeSinceUnix .ClosedDateUnix ctx.Locale}} + {{$closedDate:= DateUtils.TimeSince .ClosedDateUnix}} {{svg "octicon-clock" 14}} {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}} {{else}} {{if .DeadlineString}} {{svg "octicon-calendar" 14}} - {{ctx.DateUtils.AbsoluteShort (.DeadlineString|ctx.DateUtils.ParseLegacy)}} + {{DateUtils.AbsoluteShort (.DeadlineString|DateUtils.ParseLegacy)}} {{else}} {{svg "octicon-calendar" 14}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index e4213b8fcd..74440c5ef2 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -6,7 +6,7 @@ - {{$createdStr:= TimeSinceUnix .Issue.CreatedUnix ctx.Locale}} + {{$createdStr:= DateUtils.TimeSince .Issue.CreatedUnix}}
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 9324959bed..f42968ca92 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -1,7 +1,7 @@ {{template "base/alert"}} {{range .Issue.Comments}} {{if call $.ShouldShowCommentType .Type}} - {{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}} + {{$createdStr:= DateUtils.TimeSince .CreatedUnix}} @@ -165,7 +165,7 @@

{{ctx.Locale.Tr "repo.activity.opened_prs_label"}} #{{.Index}} {{.Issue.Title | RenderEmoji $.Context | RenderCodeBlock}} - {{TimeSinceUnix .Issue.CreatedUnix ctx.Locale}} + {{DateUtils.TimeSince .Issue.CreatedUnix}}

{{end}}
@@ -184,7 +184,7 @@

{{ctx.Locale.Tr "repo.activity.closed_issue_label"}} #{{.Index}} {{.Title | RenderEmoji $.Context | RenderCodeBlock}} - {{TimeSinceUnix .ClosedUnix ctx.Locale}} + {{DateUtils.TimeSince .ClosedUnix}}

{{end}}
@@ -203,7 +203,7 @@

{{ctx.Locale.Tr "repo.activity.new_issue_label"}} #{{.Index}} {{.Title | RenderEmoji $.Context | RenderCodeBlock}} - {{TimeSinceUnix .CreatedUnix ctx.Locale}} + {{DateUtils.TimeSince .CreatedUnix}}

{{end}}
@@ -224,7 +224,7 @@ {{else}} {{.Title | RenderEmoji $.Context | RenderCodeBlock}} {{end}} - {{TimeSinceUnix .UpdatedUnix ctx.Locale}} + {{DateUtils.TimeSince .UpdatedUnix}}

{{end}}
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index e5bf23faac..7e13dac0dc 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -51,7 +51,7 @@ {{ctx.Locale.Tr "repo.released_this"}} {{if $release.CreatedUnix}} - {{TimeSinceUnix $release.CreatedUnix ctx.Locale}} + {{DateUtils.TimeSince $release.CreatedUnix}} {{end}} {{if and (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}} | {{ctx.Locale.Tr "repo.release.ahead.commits" $release.NumCommitsBehind}} {{ctx.Locale.Tr "repo.release.ahead.target" $release.TargetBehind}} diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl index 8ab2adb60f..5eb2a47e5a 100644 --- a/templates/repo/settings/deploy_keys.tmpl +++ b/templates/repo/settings/deploy_keys.tmpl @@ -55,7 +55,7 @@ {{.Fingerprint}}
- {{ctx.Locale.Tr "settings.added_on" (ctx.DateUtils.AbsoluteShort .CreatedUnix)}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} {{ctx.DateUtils.AbsoluteShort .UpdatedUnix}}{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}} - {{ctx.Locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{ctx.Locale.Tr "settings.can_write_info"}} {{end}} + {{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .CreatedUnix)}} — {{svg "octicon-info"}} {{if .HasUsed}}{{ctx.Locale.Tr "settings.last_used"}} {{DateUtils.AbsoluteShort .UpdatedUnix}}{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}} - {{ctx.Locale.Tr "settings.can_read_info"}}{{if not .IsReadOnly}} / {{ctx.Locale.Tr "settings.can_write_info"}} {{end}}
diff --git a/templates/repo/settings/lfs.tmpl b/templates/repo/settings/lfs.tmpl index bc92b4828b..c1878d2853 100644 --- a/templates/repo/settings/lfs.tmpl +++ b/templates/repo/settings/lfs.tmpl @@ -17,7 +17,7 @@ {{FileSize .Size}} - {{TimeSince .CreatedUnix.AsTime ctx.Locale}} + {{DateUtils.TimeSince .CreatedUnix}} {{ctx.Locale.Tr "repo.settings.lfs_findcommits"}}
- {{TimeSince .Delivered.AsTime ctx.Locale}} + {{DateUtils.TimeSince .Delivered}}
diff --git a/templates/repo/tag/list.tmpl b/templates/repo/tag/list.tmpl index eac846da7d..9789943b49 100644 --- a/templates/repo/tag/list.tmpl +++ b/templates/repo/tag/list.tmpl @@ -32,7 +32,7 @@
{{if $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}} {{if .CreatedUnix}} - {{svg "octicon-clock" 16 "tw-mr-1"}}{{TimeSinceUnix .CreatedUnix ctx.Locale}} + {{svg "octicon-clock" 16 "tw-mr-1"}}{{DateUtils.TimeSince .CreatedUnix}} {{end}} {{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha .Sha1}} diff --git a/templates/repo/user_cards.tmpl b/templates/repo/user_cards.tmpl index a0f4bf26d4..7cd3d4517a 100644 --- a/templates/repo/user_cards.tmpl +++ b/templates/repo/user_cards.tmpl @@ -18,7 +18,7 @@ {{else if .Location}} {{svg "octicon-location"}} {{.Location}} {{else}} - {{svg "octicon-calendar"}} {{ctx.Locale.Tr "user.joined_on" (ctx.DateUtils.AbsoluteShort .CreatedUnix)}} + {{svg "octicon-calendar"}} {{ctx.Locale.Tr "user.joined_on" (DateUtils.AbsoluteShort .CreatedUnix)}} {{end}}
diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 0ec400cfe9..fb5bc14fe2 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -18,7 +18,7 @@ {{if .LatestCommit}} {{if .LatestCommit.Committer}}
- {{TimeSince .LatestCommit.Committer.When ctx.Locale}} + {{DateUtils.TimeSince .LatestCommit.Committer.When}}
{{end}} {{end}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 7ec9acc84e..c87a86585b 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -8,7 +8,7 @@
- {{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When ctx.Locale}}{{end}}{{end}} + {{if .LatestCommit}}{{if .LatestCommit.Committer}}{{DateUtils.TimeSince .LatestCommit.Committer.When}}{{end}}{{end}} @@ -63,7 +63,7 @@ {{end}} - {{if $commit}}{{TimeSince $commit.Committer.When ctx.Locale}}{{end}} + {{if $commit}}{{DateUtils.TimeSince $commit.Committer.When}}{{end}} {{end}} diff --git a/templates/repo/wiki/pages.tmpl b/templates/repo/wiki/pages.tmpl index 52bf165e38..38d6d6f944 100644 --- a/templates/repo/wiki/pages.tmpl +++ b/templates/repo/wiki/pages.tmpl @@ -20,7 +20,7 @@ {{.Name}} {{svg "octicon-chevron-right"}} - {{$timeSince := TimeSinceUnix .UpdatedUnix ctx.Locale}} + {{$timeSince := DateUtils.TimeSince .UpdatedUnix}} {{ctx.Locale.Tr "repo.wiki.last_updated" $timeSince}} {{end}} diff --git a/templates/repo/wiki/revision.tmpl b/templates/repo/wiki/revision.tmpl index 7fca703843..045cc41d81 100644 --- a/templates/repo/wiki/revision.tmpl +++ b/templates/repo/wiki/revision.tmpl @@ -9,7 +9,7 @@ {{.revision}} {{svg "octicon-home"}} {{$title}}
- {{$timeSince := TimeSince .Author.When ctx.Locale}} + {{$timeSince := DateUtils.TimeSince .Author.When}} {{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince}}
diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl index 409de3ff08..781c9326ad 100644 --- a/templates/repo/wiki/view.tmpl +++ b/templates/repo/wiki/view.tmpl @@ -39,7 +39,7 @@ {{.CommitCount}} {{svg "octicon-history"}} {{$title}}
- {{$timeSince := TimeSince .Author.When ctx.Locale}} + {{$timeSince := DateUtils.TimeSince .Author.When}} {{ctx.Locale.Tr "repo.wiki.last_commit_info" .Author.Name $timeSince}}
-- cgit v1.2.3