diff options
author | JakobDev <jakobdev@gmx.de> | 2023-09-29 14:12:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-29 12:12:54 +0000 |
commit | cf0df023be06c8acec4fc8fb05eab1d1c2e52fd1 (patch) | |
tree | 4fd233354202942b597f3591a22e5ea14fe7d0eb /templates/repo | |
parent | 3945c26722dececf2433107c47821238dae7e3c2 (diff) | |
download | gitea-cf0df023be06c8acec4fc8fb05eab1d1c2e52fd1.tar.gz gitea-cf0df023be06c8acec4fc8fb05eab1d1c2e52fd1.zip |
More `db.DefaultContext` refactor (#27265)
Part of #27065
This PR touches functions used in templates. As templates are not static
typed, errors are harder to find, but I hope I catch it all. I think
some tests from other persons do not hurt.
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/actions/list.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/view_content/comments.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/issue/view_content/sidebar.tmpl | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/templates/repo/actions/list.tmpl b/templates/repo/actions/list.tmpl index aa6d66fa68..b4e1113986 100644 --- a/templates/repo/actions/list.tmpl +++ b/templates/repo/actions/list.tmpl @@ -39,7 +39,7 @@ </a> {{range .Actors}} <a class="item{{if eq .ID $.CurActor}} active{{end}}" href="{{$.Link}}?workflow={{$.CurWorkflow}}&actor={{.ID}}&status={{$.CurStatus}}"> - {{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName}} + {{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName ctx}} </a> {{end}} </div> diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index d417371272..714701939f 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -137,12 +137,12 @@ {{if eq .RefAction 3}}<del>{{end}} <span class="text grey muted-links"> {{template "shared/user/authorlink" .Poster}} - {{ctx.Locale.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentLink|Escape) $refFrom | Safe}} + {{ctx.Locale.Tr $refTr (.EventTag|Escape) $createdStr ((.RefCommentLink ctx)|Escape) $refFrom | Safe}} </span> {{if eq .RefAction 3}}</del>{{end}} <div class="detail"> - <span class="text grey muted-links"><a href="{{.RefIssueLink}}"><b>{{.RefIssueTitle}}</b> {{.RefIssueIdent}}</a></span> + <span class="text grey muted-links"><a href="{{.RefIssueLink ctx}}"><b>{{.RefIssueTitle ctx}}</b> {{.RefIssueIdent ctx}}</a></span> </div> </div> {{else if eq .Type 4}} @@ -468,7 +468,7 @@ {{$resolveDoer := (index $comms 0).ResolveDoer}} {{$isNotPending := (not (eq (index $comms 0).Review.Type 0))}} <div class="gt-df gt-ac"> - <a href="{{(index $comms 0).CodeCommentLink}}" class="file-comment gt-ml-3 gt-word-break">{{$filename}}</a> + <a href="{{(index $comms 0).CodeCommentLink ctx}}" class="file-comment gt-ml-3 gt-word-break">{{$filename}}</a> {{if $invalid}} <span class="ui label basic small gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}"> {{ctx.Locale.Tr "repo.issues.review.outdated"}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 6692330cbe..c3ba15390b 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -173,7 +173,7 @@ {{ctx.Locale.Tr "repo.issues.new.open_projects"}} </div> {{range .OpenProjects}} - <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}"> + <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}"> {{svg .IconName 18 "gt-mr-3"}}{{.Title}} </a> {{end}} @@ -184,7 +184,7 @@ {{ctx.Locale.Tr "repo.issues.new.closed_projects"}} </div> {{range .ClosedProjects}} - <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}"> + <a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}"> {{svg .IconName 18 "gt-mr-3"}}{{.Title}} </a> {{end}} @@ -195,7 +195,7 @@ <span class="no-select item {{if .Issue.Project}}gt-hidden{{end}}">{{ctx.Locale.Tr "repo.issues.new.no_projects"}}</span> <div class="selected"> {{if .Issue.Project}} - <a class="item muted sidebar-item-link" href="{{.Issue.Project.Link}}"> + <a class="item muted sidebar-item-link" href="{{.Issue.Project.Link ctx}}"> {{svg .Issue.Project.IconName 18 "gt-mr-3"}}{{.Issue.Project.Title}} </a> {{end}} |