Skip to content

Commit 12f74d2

Browse files
committed
Update
1 parent 6f31288 commit 12f74d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+99
-104
lines changed

modules/templates/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func evalTokens(tokens ...any) (any, error) {
262262
return n.Value, err
263263
}
264264

265-
func userThemeName(ctx context.Context, user *user_model.User) string {
265+
func userThemeName(user *user_model.User) string {
266266
if user == nil || user.Theme == "" {
267267
return setting.UI.DefaultTheme
268268
}

modules/templates/util_date.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package templates
55

66
import (
7-
"context"
87
"fmt"
98
"html"
109
"html/template"
@@ -36,8 +35,8 @@ func (du *DateUtils) FullTime(time any) template.HTML {
3635
return dateTimeFormat("full", time)
3736
}
3837

39-
func (du *DateUtils) TimeSince(ctx context.Context, time any) template.HTML {
40-
return TimeSince(ctx, time)
38+
func (du *DateUtils) TimeSince(time any) template.HTML {
39+
return TimeSince(time)
4140
}
4241

4342
// ParseLegacy parses the datetime in legacy format, eg: "2016-01-02" in server's timezone.
@@ -126,7 +125,7 @@ func timeSinceTo(then any, now time.Time) template.HTML {
126125
}
127126

128127
// TimeSince renders relative time HTML given a time
129-
func TimeSince(ctx context.Context, then any) template.HTML {
128+
func TimeSince(then any) template.HTML {
130129
if setting.UI.PreferredTimestampTense == "absolute" {
131130
return dateTimeFormat("full", then)
132131
}

modules/templates/util_date_legacy.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package templates
55

66
import (
7-
"context"
87
"html/template"
98

109
"code.gitea.io/gitea/modules/translation"
@@ -18,7 +17,7 @@ func dateTimeLegacy(format string, datetime any, _ ...string) template.HTML {
1817
return dateTimeFormat(format, datetime)
1918
}
2019

21-
func timeSinceLegacy(ctx context.Context, time any, _ translation.Locale) template.HTML {
20+
func timeSinceLegacy(time any, _ translation.Locale) template.HTML {
2221
panicIfDevOrTesting()
23-
return TimeSince(ctx, time)
22+
return TimeSince(time)
2423
}

modules/templates/util_date_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ func TestTimeSince(t *testing.T) {
5656
defer test.MockVariableValue(&setting.IsInTesting, false)()
5757

5858
du := NewDateUtils()
59-
assert.EqualValues(t, "-", du.TimeSince(t.Context(), nil))
59+
assert.EqualValues(t, "-", du.TimeSince(nil))
6060

6161
refTimeStr := "2018-01-01T00:00:00Z"
6262
refTime, _ := time.Parse(time.RFC3339, refTimeStr)
6363

64-
actual := du.TimeSince(t.Context(), refTime)
64+
actual := du.TimeSince(refTime)
6565
assert.EqualValues(t, `<relative-time prefix="" tense="past" datetime="2018-01-01T00:00:00Z" data-tooltip-content data-tooltip-interactive="true">2018-01-01 00:00:00 +00:00</relative-time>`, actual)
6666

6767
actual = timeSinceTo(&refTime, time.Time{})
6868
assert.EqualValues(t, `<relative-time prefix="" tense="future" datetime="2018-01-01T00:00:00Z" data-tooltip-content data-tooltip-interactive="true">2018-01-01 00:00:00 +00:00</relative-time>`, actual)
6969

70-
actual = timeSinceLegacy(t.Context(), timeutil.TimeStampNano(refTime.UnixNano()), nil)
70+
actual = timeSinceLegacy(timeutil.TimeStampNano(refTime.UnixNano()), nil)
7171
assert.EqualValues(t, `<relative-time prefix="" tense="past" datetime="2017-12-31T19:00:00-05:00" data-tooltip-content data-tooltip-interactive="true">2017-12-31 19:00:00 -05:00</relative-time>`, actual)
7272
}

routers/api/v1/repo/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ func GetEditorconfig(ctx *context.APIContext) {
384384
// "404":
385385
// "$ref": "#/responses/notFound"
386386

387-
ec, _, err := ctx.Repo.GetEditorconfig(ctx, ctx.Repo.Commit)
387+
ec, _, err := ctx.Repo.GetEditorconfig(ctx.Repo.Commit)
388388
if err != nil {
389389
if git.IsErrNotExist(err) {
390390
ctx.APIErrorNotFound(err)

routers/api/v1/repo/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ func GetIssueTemplates(ctx *context.APIContext) {
12001200
// "$ref": "#/responses/IssueTemplates"
12011201
// "404":
12021202
// "$ref": "#/responses/notFound"
1203-
ret := issue.ParseTemplatesFromDefaultBranch(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo)
1203+
ret := issue.ParseTemplatesFromDefaultBranch(ctx.Repo.Repository, ctx.Repo.GitRepo)
12041204
if cnt := len(ret.TemplateErrors); cnt != 0 {
12051205
ctx.Resp.Header().Add("X-Gitea-Warning", "error occurs when parsing issue template: count="+strconv.Itoa(cnt))
12061206
}

routers/api/v1/user/settings.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func GetUserSettings(ctx *context.APIContext) {
2424
// responses:
2525
// "200":
2626
// "$ref": "#/responses/UserSettings"
27-
ctx.JSON(http.StatusOK, convert.User2UserSettings(ctx, ctx.Doer))
27+
ctx.JSON(http.StatusOK, convert.User2UserSettings(ctx.Doer))
2828
}
2929

3030
// UpdateUserSettings returns user settings
@@ -61,5 +61,5 @@ func UpdateUserSettings(ctx *context.APIContext) {
6161
return
6262
}
6363

64-
ctx.JSON(http.StatusOK, convert.User2UserSettings(ctx, ctx.Doer))
64+
ctx.JSON(http.StatusOK, convert.User2UserSettings(ctx.Doer))
6565
}

routers/common/errpage.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ func RenderPanicErrorPage(w http.ResponseWriter, req *http.Request, err any) {
3939
tmplCtx["Locale"] = middleware.Locale(w, req)
4040
ctxData := middleware.GetContextData(req.Context())
4141

42-
ctxData["Ctx"] = req.Context()
43-
4442
// This recovery handler could be called without Gitea's web context, so we shouldn't touch that context too much.
4543
// Otherwise, the 500-page may cause new panics, eg: cache.GetContextWithData, it makes the developer&users couldn't find the original panic.
4644
user, _ := ctxData[middleware.ContextDataKeySignedUser].(*user_model.User)

routers/web/repo/blame.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ func renderBlame(ctx *context.Context, blameParts []*git.BlamePart, commitNames
278278
commitCnt++
279279

280280
// User avatar image
281-
commitSince := templates.TimeSince(ctx, commit.Author.When)
281+
commitSince := templates.TimeSince(commit.Author.When)
282282

283283
var avatar string
284284
if commit.User != nil {

routers/web/repo/editor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func editFile(ctx *context.Context, isNewFile bool) {
201201

202202
// GetEditorConfig returns a editorconfig JSON string for given treePath or "null"
203203
func GetEditorConfig(ctx *context.Context, treePath string) string {
204-
ec, _, err := ctx.Repo.GetEditorconfig(ctx)
204+
ec, _, err := ctx.Repo.GetEditorconfig()
205205
if err == nil {
206206
def, err := ec.GetDefinitionForFilename(treePath)
207207
if err == nil {

routers/web/repo/issue_content_history.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func GetContentHistoryList(ctx *context.Context) {
7272
class := avatars.DefaultAvatarClass + " tw-mr-2"
7373
name := html.EscapeString(username)
7474
avatarHTML := string(templates.AvatarHTML(src, 28, class, username))
75-
timeSinceHTML := string(templates.TimeSince(ctx, item.EditedUnix))
75+
timeSinceHTML := string(templates.TimeSince(item.EditedUnix))
7676

7777
results = append(results, map[string]any{
7878
"name": avatarHTML + "<strong>" + name + "</strong> " + actionText + " " + timeSinceHTML,

routers/web/repo/issue_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ func Issues(ctx *context.Context) {
765765
}
766766
ctx.Data["Title"] = ctx.Tr("repo.issues")
767767
ctx.Data["PageIsIssueList"] = true
768-
ctx.Data["NewIssueChooseTemplate"] = issue_service.HasTemplatesOrContactLinks(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo)
768+
ctx.Data["NewIssueChooseTemplate"] = issue_service.HasTemplatesOrContactLinks(ctx.Repo.Repository, ctx.Repo.GitRepo)
769769
}
770770

771771
issues(ctx, ctx.FormInt64("milestone"), ctx.FormInt64("project"), optional.Some(isPullList))

routers/web/repo/issue_new.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func setTemplateIfExists(ctx *context.Context, ctxDataKey string, possibleFiles
9898
// NewIssue render creating issue page
9999
func NewIssue(ctx *context.Context) {
100100
issueConfig, _ := issue_service.GetTemplateConfigFromDefaultBranch(ctx.Repo.Repository, ctx.Repo.GitRepo)
101-
hasTemplates := issue_service.HasTemplatesOrContactLinks(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo)
101+
hasTemplates := issue_service.HasTemplatesOrContactLinks(ctx.Repo.Repository, ctx.Repo.GitRepo)
102102

103103
ctx.Data["Title"] = ctx.Tr("repo.issues.new")
104104
ctx.Data["PageIsIssueList"] = true
@@ -134,7 +134,7 @@ func NewIssue(ctx *context.Context) {
134134
}
135135
ctx.Data["Tags"] = tags
136136

137-
ret := issue_service.ParseTemplatesFromDefaultBranch(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo)
137+
ret := issue_service.ParseTemplatesFromDefaultBranch(ctx.Repo.Repository, ctx.Repo.GitRepo)
138138
templateLoaded, errs := setTemplateIfExists(ctx, issueTemplateKey, IssueTemplateCandidates, pageMetaData)
139139
for k, v := range errs {
140140
ret.TemplateErrors[k] = v
@@ -187,14 +187,14 @@ func NewIssueChooseTemplate(ctx *context.Context) {
187187
ctx.Data["Title"] = ctx.Tr("repo.issues.new")
188188
ctx.Data["PageIsIssueList"] = true
189189

190-
ret := issue_service.ParseTemplatesFromDefaultBranch(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo)
190+
ret := issue_service.ParseTemplatesFromDefaultBranch(ctx.Repo.Repository, ctx.Repo.GitRepo)
191191
ctx.Data["IssueTemplates"] = ret.IssueTemplates
192192

193193
if len(ret.TemplateErrors) > 0 {
194194
ctx.Flash.Warning(renderErrorOfTemplates(ctx, ret.TemplateErrors), true)
195195
}
196196

197-
if !issue_service.HasTemplatesOrContactLinks(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo) {
197+
if !issue_service.HasTemplatesOrContactLinks(ctx.Repo.Repository, ctx.Repo.GitRepo) {
198198
// The "issues/new" and "issues/new/choose" share the same query parameters "project" and "milestone", if no template here, just redirect to the "issues/new" page with these parameters.
199199
ctx.Redirect(fmt.Sprintf("%s/issues/new?%s", ctx.Repo.Repository.Link(), ctx.Req.URL.RawQuery), http.StatusSeeOther)
200200
return
@@ -329,7 +329,7 @@ func NewIssuePost(ctx *context.Context) {
329329
form := web.GetForm(ctx).(*forms.CreateIssueForm)
330330
ctx.Data["Title"] = ctx.Tr("repo.issues.new")
331331
ctx.Data["PageIsIssueList"] = true
332-
ctx.Data["NewIssueChooseTemplate"] = issue_service.HasTemplatesOrContactLinks(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo)
332+
ctx.Data["NewIssueChooseTemplate"] = issue_service.HasTemplatesOrContactLinks(ctx.Repo.Repository, ctx.Repo.GitRepo)
333333
ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes
334334
ctx.Data["IsAttachmentEnabled"] = setting.Attachment.Enabled
335335
upload.AddUploadContext(ctx, "comment")

routers/web/repo/issue_view.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func ViewIssue(ctx *context.Context) {
329329
return
330330
}
331331
ctx.Data["PageIsIssueList"] = true
332-
ctx.Data["NewIssueChooseTemplate"] = issue_service.HasTemplatesOrContactLinks(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo)
332+
ctx.Data["NewIssueChooseTemplate"] = issue_service.HasTemplatesOrContactLinks(ctx.Repo.Repository, ctx.Repo.GitRepo)
333333
}
334334

335335
ctx.Data["IsProjectsEnabled"] = ctx.Repo.CanRead(unit.TypeProjects)

routers/web/repo/middlewares.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func SetEditorconfigIfExists(ctx *context.Context) {
1818
return
1919
}
2020

21-
ec, _, err := ctx.Repo.GetEditorconfig(ctx)
21+
ec, _, err := ctx.Repo.GetEditorconfig()
2222
if err != nil {
2323
// it used to check `!git.IsErrNotExist(err)` and create a system notice, but it is quite annoying and useless
2424
// because network errors also happen frequently, so we just ignore it

routers/web/repo/milestone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func MilestoneIssuesAndPulls(ctx *context.Context) {
265265

266266
issues(ctx, milestoneID, projectID, optional.None[bool]())
267267

268-
ret := issue.ParseTemplatesFromDefaultBranch(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo)
268+
ret := issue.ParseTemplatesFromDefaultBranch(ctx.Repo.Repository, ctx.Repo.GitRepo)
269269
ctx.Data["NewIssueChooseTemplate"] = len(ret.IssueTemplates) > 0
270270

271271
ctx.Data["CanWriteIssues"] = ctx.Repo.CanWriteIssuesOrPulls(false)

routers/web/repo/view_file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func prepareToRenderFile(ctx *context.Context, entry *git.TreeEntry) {
5858
}
5959

6060
if ctx.Repo.TreePath == ".editorconfig" {
61-
_, editorconfigWarning, editorconfigErr := ctx.Repo.GetEditorconfig(ctx, ctx.Repo.Commit)
61+
_, editorconfigWarning, editorconfigErr := ctx.Repo.GetEditorconfig(ctx.Repo.Commit)
6262
if editorconfigWarning != nil {
6363
ctx.Data["FileWarning"] = strings.TrimSpace(editorconfigWarning.Error())
6464
}

services/context/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (r *Repository) RefTypeNameSubURL() string {
203203

204204
// GetEditorconfig returns the .editorconfig definition if found in the
205205
// HEAD of the default repo branch.
206-
func (r *Repository) GetEditorconfig(ctx context.Context, optCommit ...*git.Commit) (cfg *editorconfig.Editorconfig, warning, err error) {
206+
func (r *Repository) GetEditorconfig(optCommit ...*git.Commit) (cfg *editorconfig.Editorconfig, warning, err error) {
207207
if r.GitRepo == nil {
208208
return nil, nil, nil
209209
}

services/convert/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func toUser(ctx context.Context, user *user_model.User, signed, authed bool) *ap
8686
}
8787

8888
// User2UserSettings return UserSettings based on a user
89-
func User2UserSettings(ctx context.Context, user *user_model.User) api.UserSettings {
89+
func User2UserSettings(user *user_model.User) api.UserSettings {
9090
return api.UserSettings{
9191
FullName: user.FullName,
9292
Website: user.Website,

services/issue/template.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package issue
55

66
import (
7-
"context"
87
"fmt"
98
"io"
109
"net/url"
@@ -110,7 +109,7 @@ func IsTemplateConfig(path string) bool {
110109

111110
// ParseTemplatesFromDefaultBranch parses the issue templates in the repo's default branch,
112111
// returns valid templates and the errors of invalid template files (the errors map is guaranteed to be non-nil).
113-
func ParseTemplatesFromDefaultBranch(ctx context.Context, repo *repo.Repository, gitRepo *git.Repository) (ret struct {
112+
func ParseTemplatesFromDefaultBranch(repo *repo.Repository, gitRepo *git.Repository) (ret struct {
114113
IssueTemplates []*api.IssueTemplate
115114
TemplateErrors map[string]error
116115
},
@@ -179,8 +178,8 @@ func GetTemplateConfigFromDefaultBranch(repo *repo.Repository, gitRepo *git.Repo
179178
return GetDefaultTemplateConfig(), nil
180179
}
181180

182-
func HasTemplatesOrContactLinks(ctx context.Context, repo *repo.Repository, gitRepo *git.Repository) bool {
183-
ret := ParseTemplatesFromDefaultBranch(ctx, repo, gitRepo)
181+
func HasTemplatesOrContactLinks(repo *repo.Repository, gitRepo *git.Repository) bool {
182+
ret := ParseTemplatesFromDefaultBranch(repo, gitRepo)
184183
if len(ret.IssueTemplates) > 0 {
185184
return true
186185
}

templates/admin/org/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<tr>
5353
<td>{{.ID}}</td>
5454
<td>
55-
<a href="{{.HomeLink}}">{{if and ((DefaultShowFullName ctx) ctx) .FullName}}{{.FullName}} ({{.Name}}){{else}}{{.Name}}{{end}}</a>
55+
<a href="{{.HomeLink}}">{{if and (DefaultShowFullName ctx) .FullName}}{{.FullName}} ({{.Name}}){{else}}{{.Name}}{{end}}</a>
5656
{{if .Visibility.IsPrivate}}
5757
<span class="text gold">{{svg "octicon-lock"}}</span>
5858
{{end}}

templates/admin/stacktrace-row.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</div>
1414
<div class="content tw-flex-1">
1515
<div class="header">{{.Process.Description}}</div>
16-
<div class="description">{{if ne .Process.Type "none"}}{{DateUtils.TimeSince ctx .Process.Start}}{{end}}</div>
16+
<div class="description">{{if ne .Process.Type "none"}}{{DateUtils.TimeSince .Process.Start}}{{end}}</div>
1717
</div>
1818
<div>
1919
{{if or (eq .Process.Type "request") (eq .Process.Type "normal")}}

templates/base/head.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="{{ctx.Locale.Lang}}" data-theme="{{UserThemeName ctx .SignedUser}}">
2+
<html lang="{{ctx.Locale.Lang}}" data-theme="{{UserThemeName .SignedUser}}">
33
<head>
44
<meta name="viewport" content="width=device-width, initial-scale=1">
55
<title>{{if .Title}}{{.Title}} - {{end}}{{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}}</title>

templates/base/head_style.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/index.css?v={{AssetVersion}}">
2-
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{UserThemeName ctx .SignedUser | PathEscape}}.css?v={{AssetVersion}}">
2+
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{UserThemeName .SignedUser | PathEscape}}.css?v={{AssetVersion}}">

templates/devtest/gitea-ui.tmpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@
138138

139139
<div>
140140
<h1>TimeSince</h1>
141-
<div>Now: {{DateUtils.TimeSince ctx .TimeNow}}</div>
142-
<div>5s past: {{DateUtils.TimeSince ctx .TimePast5s}}</div>
143-
<div>5s future: {{DateUtils.TimeSince ctx .TimeFuture5s}}</div>
144-
<div>2m past: {{DateUtils.TimeSince ctx .TimePast2m}}</div>
145-
<div>2m future: {{DateUtils.TimeSince ctx .TimeFuture2m}}</div>
146-
<div>1y past: {{DateUtils.TimeSince ctx .TimePast1y}}</div>
147-
<div>1y future: {{DateUtils.TimeSince ctx .TimeFuture1y}}</div>
141+
<div>Now: {{DateUtils.TimeSince .TimeNow}}</div>
142+
<div>5s past: {{DateUtils.TimeSince .TimePast5s}}</div>
143+
<div>5s future: {{DateUtils.TimeSince .TimeFuture5s}}</div>
144+
<div>2m past: {{DateUtils.TimeSince .TimePast2m}}</div>
145+
<div>2m future: {{DateUtils.TimeSince .TimeFuture2m}}</div>
146+
<div>1y past: {{DateUtils.TimeSince .TimePast1y}}</div>
147+
<div>1y future: {{DateUtils.TimeSince .TimeFuture1y}}</div>
148148
</div>
149149

150150
<div>

templates/explore/repo_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
{{end}}
6161
</div>
6262
{{end}}
63-
<div class="flex-item-body">{{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince ctx .UpdatedUnix}}</div>
63+
<div class="flex-item-body">{{ctx.Locale.Tr "org.repo_updated"}} {{DateUtils.TimeSince .UpdatedUnix}}</div>
6464
</div>
6565
</div>
6666
{{else}}

templates/package/shared/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<span class="ui label">{{svg .Package.Type.SVGName 16}} {{.Package.Type.Name}}</span>
2525
</div>
2626
<div class="flex-item-body">
27-
{{$timeStr := DateUtils.TimeSince ctx .Version.CreatedUnix}}
27+
{{$timeStr := DateUtils.TimeSince .Version.CreatedUnix}}
2828
{{$hasRepositoryAccess := false}}
2929
{{if .Repository}}
3030
{{$hasRepositoryAccess = index $.RepositoryAccessMap .Repository.ID}}

templates/package/shared/versionlist.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<div class="flex-item-main">
2626
<a class="flex-item-title" href="{{.VersionWebLink}}">{{.Version.LowerVersion}}</a>
2727
<div class="flex-item-body">
28-
{{ctx.Locale.Tr "packages.published_by" (DateUtils.TimeSince ctx .Version.CreatedUnix) .Creator.HomeLink .Creator.GetDisplayName ctx}}
28+
{{ctx.Locale.Tr "packages.published_by" (DateUtils.TimeSince .Version.CreatedUnix) .Creator.HomeLink .Creator.GetDisplayName ctx}}
2929
</div>
3030
</div>
3131
</div>

templates/package/view.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="issue-title-header">
77
<h1>{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</h1>
88
<div>
9-
{{$timeStr := DateUtils.TimeSince ctx .PackageDescriptor.Version.CreatedUnix}}
9+
{{$timeStr := DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}}
1010
{{if .HasRepositoryAccess}}
1111
{{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName ctx) .PackageDescriptor.Repository.Link .PackageDescriptor.Repository.FullName}}
1212
{{else}}
@@ -46,7 +46,7 @@
4646
{{if .HasRepositoryAccess}}
4747
<div class="item">{{svg "octicon-repo"}} <a href="{{.PackageDescriptor.Repository.Link}}">{{.PackageDescriptor.Repository.FullName}}</a></div>
4848
{{end}}
49-
<div class="item">{{svg "octicon-calendar"}} {{DateUtils.TimeSince ctx .PackageDescriptor.Version.CreatedUnix}}</div>
49+
<div class="item">{{svg "octicon-calendar"}} {{DateUtils.TimeSince .PackageDescriptor.Version.CreatedUnix}}</div>
5050
<div class="item">{{svg "octicon-download"}} {{.PackageDescriptor.Version.DownloadCount}}</div>
5151
{{template "package/metadata/alpine" .}}
5252
{{template "package/metadata/arch" .}}

templates/repo/actions/runs_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<a class="ui label run-list-ref gt-ellipsis" href="{{.RefLink}}" data-tooltip-content="{{.PrettyRef}}">{{.PrettyRef}}</a>
3434
{{end}}
3535
<div class="run-list-item-right">
36-
<div class="run-list-meta">{{svg "octicon-calendar" 16}}{{DateUtils.TimeSince ctx .Updated}}</div>
36+
<div class="run-list-meta">{{svg "octicon-calendar" 16}}{{DateUtils.TimeSince .Updated}}</div>
3737
<div class="run-list-meta">{{svg "octicon-stopwatch" 16}}{{.Duration}}</div>
3838
</div>
3939
</div>

0 commit comments

Comments
 (0)