1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00

Remove incorrect and unnecessary Escape from templates (#29394)

Follow #29165

* some of them are incorrect, which would lead to double escaping (eg:
`(print (Escape $.RepoLink)`)
* other of them are not necessary, because `Tr` handles strings&HTML
automatically

Suggest to review by "unified view":
https://github.com/go-gitea/gitea/pull/29394/files?diff=unified&w=0
This commit is contained in:
wxiaoguang 2024-02-25 22:02:20 +08:00 committed by GitHub
parent ea164aba4b
commit d2f6588b66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 100 additions and 100 deletions

View File

@ -37,7 +37,7 @@ func NewFuncMap() template.FuncMap {
"Eval": Eval, "Eval": Eval,
"SafeHTML": SafeHTML, "SafeHTML": SafeHTML,
"HTMLFormat": HTMLFormat, "HTMLFormat": HTMLFormat,
"Escape": Escape, "HTMLEscape": HTMLEscape,
"QueryEscape": url.QueryEscape, "QueryEscape": url.QueryEscape,
"JSEscape": JSEscapeSafe, "JSEscape": JSEscapeSafe,
"Str2html": Str2html, // TODO: rename it to SanitizeHTML "Str2html": Str2html, // TODO: rename it to SanitizeHTML
@ -218,7 +218,7 @@ func Str2html(s any) template.HTML {
panic(fmt.Sprintf("unexpected type %T", s)) panic(fmt.Sprintf("unexpected type %T", s))
} }
func Escape(s any) template.HTML { func HTMLEscape(s any) template.HTML {
switch v := s.(type) { switch v := s.(type) {
case string: case string:
return template.HTML(html.EscapeString(v)) return template.HTML(html.EscapeString(v))

View File

@ -7,7 +7,7 @@
</div> </div>
{{else if .SearchResults}} {{else if .SearchResults}}
<h3> <h3>
{{ctx.Locale.Tr "explore.code_search_results" (.Keyword|Escape)}} {{ctx.Locale.Tr "explore.code_search_results" .Keyword}}
</h3> </h3>
{{template "code/searchresults" .}} {{template "code/searchresults" .}}
{{else if .Keyword}} {{else if .Keyword}}

View File

@ -36,7 +36,7 @@
</div> </div>
{{if and .PageIsExploreRepositories .OnlyShowRelevant}} {{if and .PageIsExploreRepositories .OnlyShowRelevant}}
<div class="ui message explore-relevancy-note"> <div class="ui message explore-relevancy-note">
<span data-tooltip-content="{{ctx.Locale.Tr "explore.relevant_repositories_tooltip"}}">{{ctx.Locale.Tr "explore.relevant_repositories" ((printf "?only_show_relevant=0&sort=%s&q=%s&language=%s" $.SortType (QueryEscape $.Keyword) (QueryEscape $.Language))|Escape)}}</span> <span data-tooltip-content="{{ctx.Locale.Tr "explore.relevant_repositories_tooltip"}}">{{ctx.Locale.Tr "explore.relevant_repositories" (printf "?only_show_relevant=0&sort=%s&q=%s&language=%s" $.SortType (QueryEscape $.Keyword) (QueryEscape $.Language))}}</span>
</div> </div>
{{end}} {{end}}
<div class="divider"></div> <div class="divider"></div>

View File

@ -11,7 +11,7 @@
<p>{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}</p><br> <p>{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}</p><br>
<p>{{.locale.Tr "mail.register_notify.text_1" AppName}}</p><br> <p>{{.locale.Tr "mail.register_notify.text_1" AppName}}</p><br>
<p>{{.locale.Tr "mail.register_notify.text_2" .Username}}</p><p><a href="{{AppUrl}}user/login">{{AppUrl}}user/login</a></p><br> <p>{{.locale.Tr "mail.register_notify.text_2" .Username}}</p><p><a href="{{AppUrl}}user/login">{{AppUrl}}user/login</a></p><br>
<p>{{.locale.Tr "mail.register_notify.text_3" ($set_pwd_url | Escape)}}</p><br> <p>{{.locale.Tr "mail.register_notify.text_3" $set_pwd_url}}</p><br>
<p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p> <p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p>
</body> </body>

View File

@ -36,26 +36,26 @@
{{end}} {{end}}
<p> <p>
{{if eq .ActionName "close"}} {{if eq .ActionName "close"}}
{{.locale.Tr "mail.issue.action.close" (Escape .Doer.Name) .Issue.Index}} {{.locale.Tr "mail.issue.action.close" .Doer.Name .Issue.Index}}
{{else if eq .ActionName "reopen"}} {{else if eq .ActionName "reopen"}}
{{.locale.Tr "mail.issue.action.reopen" (Escape .Doer.Name) .Issue.Index}} {{.locale.Tr "mail.issue.action.reopen" .Doer.Name .Issue.Index}}
{{else if eq .ActionName "merge"}} {{else if eq .ActionName "merge"}}
{{.locale.Tr "mail.issue.action.merge" (Escape .Doer.Name) .Issue.Index (Escape .Issue.PullRequest.BaseBranch)}} {{.locale.Tr "mail.issue.action.merge" .Doer.Name .Issue.Index .Issue.PullRequest.BaseBranch}}
{{else if eq .ActionName "approve"}} {{else if eq .ActionName "approve"}}
{{.locale.Tr "mail.issue.action.approve" (Escape .Doer.Name)}} {{.locale.Tr "mail.issue.action.approve" .Doer.Name}}
{{else if eq .ActionName "reject"}} {{else if eq .ActionName "reject"}}
{{.locale.Tr "mail.issue.action.reject" (Escape .Doer.Name)}} {{.locale.Tr "mail.issue.action.reject" .Doer.Name}}
{{else if eq .ActionName "review"}} {{else if eq .ActionName "review"}}
{{.locale.Tr "mail.issue.action.review" (Escape .Doer.Name)}} {{.locale.Tr "mail.issue.action.review" .Doer.Name}}
{{else if eq .ActionName "review_dismissed"}} {{else if eq .ActionName "review_dismissed"}}
{{.locale.Tr "mail.issue.action.review_dismissed" (Escape .Doer.Name) (Escape .Comment.Review.Reviewer.Name)}} {{.locale.Tr "mail.issue.action.review_dismissed" .Doer.Name .Comment.Review.Reviewer.Name}}
{{else if eq .ActionName "ready_for_review"}} {{else if eq .ActionName "ready_for_review"}}
{{.locale.Tr "mail.issue.action.ready_for_review" (Escape .Doer.Name)}} {{.locale.Tr "mail.issue.action.ready_for_review" .Doer.Name}}
{{end}} {{end}}
{{- if eq .Body ""}} {{- if eq .Body ""}}
{{if eq .ActionName "new"}} {{if eq .ActionName "new"}}
{{.locale.Tr "mail.issue.action.new" (Escape .Doer.Name) .Issue.Index}} {{.locale.Tr "mail.issue.action.new" .Doer.Name .Issue.Index}}
{{end}} {{end}}
{{else}} {{else}}
{{.Body | Str2html}} {{.Body | Str2html}}

View File

@ -30,9 +30,9 @@
{{$hasRepositoryAccess = index $.RepositoryAccessMap .Repository.ID}} {{$hasRepositoryAccess = index $.RepositoryAccessMap .Repository.ID}}
{{end}} {{end}}
{{if $hasRepositoryAccess}} {{if $hasRepositoryAccess}}
{{ctx.Locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) .Repository.Link (.Repository.FullName | Escape)}} {{ctx.Locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink .Creator.GetDisplayName .Repository.Link .Repository.FullName}}
{{else}} {{else}}
{{ctx.Locale.Tr "packages.published_by" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape)}} {{ctx.Locale.Tr "packages.published_by" $timeStr .Creator.HomeLink .Creator.GetDisplayName}}
{{end}} {{end}}
</div> </div>
</div> </div>

View File

@ -25,7 +25,7 @@
<div class="flex-item-main"> <div class="flex-item-main">
<a class="flex-item-title" href="{{.FullWebLink}}">{{.Version.LowerVersion}}</a> <a class="flex-item-title" href="{{.FullWebLink}}">{{.Version.LowerVersion}}</a>
<div class="flex-item-body"> <div class="flex-item-body">
{{ctx.Locale.Tr "packages.published_by" (TimeSinceUnix .Version.CreatedUnix ctx.Locale) .Creator.HomeLink (.Creator.GetDisplayName | Escape)}} {{ctx.Locale.Tr "packages.published_by" (TimeSinceUnix .Version.CreatedUnix ctx.Locale) .Creator.HomeLink .Creator.GetDisplayName}}
</div> </div>
</div> </div>
</div> </div>

View File

@ -10,9 +10,9 @@
<div> <div>
{{$timeStr := TimeSinceUnix .PackageDescriptor.Version.CreatedUnix ctx.Locale}} {{$timeStr := TimeSinceUnix .PackageDescriptor.Version.CreatedUnix ctx.Locale}}
{{if .HasRepositoryAccess}} {{if .HasRepositoryAccess}}
{{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) .PackageDescriptor.Repository.Link (.PackageDescriptor.Repository.FullName | Escape)}} {{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName .PackageDescriptor.Repository.Link .PackageDescriptor.Repository.FullName}}
{{else}} {{else}}
{{ctx.Locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape)}} {{ctx.Locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink .PackageDescriptor.Creator.GetDisplayName}}
{{end}} {{end}}
</div> </div>
</div> </div>

View File

@ -2,7 +2,7 @@
<div class="ui positive message gt-df gt-ac"> <div class="ui positive message gt-df gt-ac">
<div class="gt-f1"> <div class="gt-f1">
{{$timeSince := TimeSince .CommitTime.AsTime ctx.Locale}} {{$timeSince := TimeSince .CommitTime.AsTime ctx.Locale}}
{{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" (Escape .Name) $timeSince}} {{ctx.Locale.Tr "repo.pulls.recently_pushed_new_branches" .Name $timeSince}}
</div> </div>
<a role="button" class="ui compact positive button gt-m-0" href="{{$.Repository.ComposeBranchCompareURL $.Repository.BaseRepo .Name}}"> <a role="button" class="ui compact positive button gt-m-0" href="{{$.Repository.ComposeBranchCompareURL $.Repository.BaseRepo .Name}}">
{{ctx.Locale.Tr "repo.pulls.compare_changes"}} {{ctx.Locale.Tr "repo.pulls.compare_changes"}}

View File

@ -1,3 +1,3 @@
{{if not $.DisableMigrations}} {{if not $.DisableMigrations}}
<p class="ui center">{{ctx.Locale.Tr "repo.new_repo_helper" ((print AppSubUrl "/repo/migrate")|Escape)}}</p> <p class="ui center">{{ctx.Locale.Tr "repo.new_repo_helper" (print AppSubUrl "/repo/migrate")}}</p>
{{end}} {{end}}

View File

@ -16,17 +16,17 @@
{{.OriginalAuthor}} {{.OriginalAuthor}}
</span> </span>
<span class="text grey muted-links"> <span class="text grey muted-links">
{{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}}
</span> </span>
<span class="text migrate"> <span class="text migrate">
{{if $.root.Repository.OriginalURL}} {{if $.root.Repository.OriginalURL}}
({{ctx.Locale.Tr "repo.migrated_from" ($.root.Repository.OriginalURL | Escape) ($.root.Repository.GetOriginalURLHostname | Escape)}}) ({{ctx.Locale.Tr "repo.migrated_from" $.root.Repository.OriginalURL $.root.Repository.GetOriginalURLHostname}})
{{end}} {{end}}
</span> </span>
{{else}} {{else}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/namelink" .Poster}} {{template "shared/user/namelink" .Poster}}
{{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}}
</span> </span>
{{end}} {{end}}
</div> </div>

View File

@ -194,7 +194,7 @@
{{if .HasPullRequest}} {{if .HasPullRequest}}
<div class="ui segment grid title"> <div class="ui segment grid title">
<div class="twelve wide column issue-title"> <div class="twelve wide column issue-title">
{{ctx.Locale.Tr "repo.pulls.has_pull_request" (print (Escape $.RepoLink) "/pulls/" .PullRequest.Issue.Index) (Escape $.RepoRelPath) .PullRequest.Index}} {{ctx.Locale.Tr "repo.pulls.has_pull_request" (print $.RepoLink "/pulls/" .PullRequest.Issue.Index) $.RepoRelPath .PullRequest.Index}}
<h1> <h1>
<span id="issue-title">{{RenderIssueTitle $.Context .PullRequest.Issue.Title ($.Repository.ComposeMetas ctx)}}</span> <span id="issue-title">{{RenderIssueTitle $.Context .PullRequest.Issue.Title ($.Repository.ComposeMetas ctx)}}</span>
<span class="index">#{{.PullRequest.Issue.Index}}</span> <span class="index">#{{.PullRequest.Issue.Index}}</span>
@ -202,11 +202,11 @@
</div> </div>
<div class="four wide column middle aligned text right"> <div class="four wide column middle aligned text right">
{{- if .PullRequest.HasMerged -}} {{- if .PullRequest.HasMerged -}}
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button purple show-form">{{svg "octicon-git-merge" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a> <a href="{{$.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button purple show-form">{{svg "octicon-git-merge" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a>
{{else if .Issue.IsClosed}} {{else if .Issue.IsClosed}}
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button red show-form">{{svg "octicon-issue-closed" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a> <a href="{{$.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button red show-form">{{svg "octicon-issue-closed" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a>
{{else}} {{else}}
<a href="{{Escape $.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button primary show-form">{{svg "octicon-git-pull-request" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a> <a href="{{$.RepoLink}}/pulls/{{.PullRequest.Issue.Index}}" class="ui button primary show-form">{{svg "octicon-git-pull-request" 16}} {{ctx.Locale.Tr "repo.pulls.view"}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>

View File

@ -26,7 +26,7 @@
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}> <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}>
<label> <label>
{{svg "octicon-git-commit"}} {{svg "octicon-git-commit"}}
{{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" (.BranchName|Escape)}} {{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" .BranchName}}
{{if not .CanCommitToBranch.CanCommitToBranch}} {{if not .CanCommitToBranch.CanCommitToBranch}}
<div class="ui visible small warning message"> <div class="ui visible small warning message">
{{ctx.Locale.Tr "repo.editor.no_commit_to_branch"}} {{ctx.Locale.Tr "repo.editor.no_commit_to_branch"}}

View File

@ -23,11 +23,11 @@
{{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}} {{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}}
{{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}} {{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}}
{{if .OriginalAuthor}} {{if .OriginalAuthor}}
{{ctx.Locale.Tr .GetLastEventLabelFake $timeStr (.OriginalAuthor|Escape)}} {{ctx.Locale.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor}}
{{else if gt .Poster.ID 0}} {{else if gt .Poster.ID 0}}
{{ctx.Locale.Tr .GetLastEventLabel $timeStr (.Poster.HomeLink|Escape) (.Poster.GetDisplayName | Escape)}} {{ctx.Locale.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.GetDisplayName}}
{{else}} {{else}}
{{ctx.Locale.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName | Escape)}} {{ctx.Locale.Tr .GetLastEventLabelFake $timeStr .Poster.GetDisplayName}}
{{end}} {{end}}
</span> </span>
</div> </div>

View File

@ -13,7 +13,7 @@
<div class="field"> <div class="field">
<input name="title" id="issue_title" placeholder="{{ctx.Locale.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" autofocus required maxlength="255" autocomplete="off"> <input name="title" id="issue_title" placeholder="{{ctx.Locale.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" autofocus required maxlength="255" autocomplete="off">
{{if .PageIsComparePull}} {{if .PageIsComparePull}}
<div class="title_wip_desc" data-wip-prefixes="{{JsonUtils.EncodeToString .PullRequestWorkInProgressPrefixes}}">{{ctx.Locale.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0| Escape)}}</div> <div class="title_wip_desc" data-wip-prefixes="{{JsonUtils.EncodeToString .PullRequestWorkInProgressPrefixes}}">{{ctx.Locale.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0)}}</div>
{{end}} {{end}}
</div> </div>
{{if .Fields}} {{if .Fields}}

View File

@ -28,10 +28,10 @@
{{.Issue.OriginalAuthor}} {{.Issue.OriginalAuthor}}
</span> </span>
<span class="text grey muted-links"> <span class="text grey muted-links">
{{ctx.Locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr}}
</span> </span>
<span class="text migrate"> <span class="text migrate">
{{if .Repository.OriginalURL}} ({{ctx.Locale.Tr "repo.migrated_from" (.Repository.OriginalURL|Escape) (.Repository.GetOriginalURLHostname|Escape)}}){{end}} {{if .Repository.OriginalURL}} ({{ctx.Locale.Tr "repo.migrated_from" .Repository.OriginalURL .Repository.GetOriginalURLHostname}}){{end}}
</span> </span>
{{else}} {{else}}
<a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}"> <a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}">
@ -39,7 +39,7 @@
</a> </a>
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Issue.Poster}} {{template "shared/user/authorlink" .Issue.Poster}}
{{ctx.Locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr}}
</span> </span>
{{end}} {{end}}
</div> </div>
@ -133,7 +133,7 @@
</div> </div>
{{else}} {{else}}
<div class="ui warning message"> <div class="ui warning message">
{{ctx.Locale.Tr "repo.issues.sign_in_require_desc" (.SignInLink|Escape)}} {{ctx.Locale.Tr "repo.issues.sign_in_require_desc" .SignInLink}}
</div> </div>
{{end}} {{end}}
{{end}}{{/* end if: .IsSigned */}} {{end}}{{/* end if: .IsSigned */}}

View File

@ -33,10 +33,10 @@
{{.OriginalAuthor}} {{.OriginalAuthor}}
</span> </span>
<span class="text grey muted-links"> <span class="text grey muted-links">
{{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr}} {{if $.Repository.OriginalURL}} {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}} {{if $.Repository.OriginalURL}}
</span> </span>
<span class="text migrate"> <span class="text migrate">
({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape)}}){{end}} ({{ctx.Locale.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname}}){{end}}
</span> </span>
{{else}} {{else}}
{{if gt .Poster.ID 0}} {{if gt .Poster.ID 0}}
@ -46,7 +46,7 @@
{{end}} {{end}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}}
</span> </span>
{{end}} {{end}}
</div> </div>
@ -121,7 +121,7 @@
{{else if eq .Type 3 5 6}} {{else if eq .Type 3 5 6}}
{{$refFrom:= ""}} {{$refFrom:= ""}}
{{if ne .RefRepoID .Issue.RepoID}} {{if ne .RefRepoID .Issue.RepoID}}
{{$refFrom = ctx.Locale.Tr "repo.issues.ref_from" (.RefRepo.FullName|Escape)}} {{$refFrom = ctx.Locale.Tr "repo.issues.ref_from" .RefRepo.FullName}}
{{end}} {{end}}
{{$refTr := "repo.issues.ref_issue_from"}} {{$refTr := "repo.issues.ref_issue_from"}}
{{if .Issue.IsPull}} {{if .Issue.IsPull}}
@ -138,7 +138,7 @@
{{if eq .RefAction 3}}<del>{{end}} {{if eq .RefAction 3}}<del>{{end}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr $refTr (.EventTag|Escape) $createdStr ((.RefCommentLink ctx)|Escape) $refFrom}} {{ctx.Locale.Tr $refTr .EventTag $createdStr (.RefCommentLink ctx) $refFrom}}
</span> </span>
{{if eq .RefAction 3}}</del>{{end}} {{if eq .RefAction 3}}</del>{{end}}
@ -182,7 +182,7 @@
{{template "shared/user/avatarlink" dict "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr}}{{else}}{{ctx.Locale.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr}}{{end}}{{else if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr}}{{end}} {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.change_milestone_at" .OldMilestone.Name .Milestone.Name $createdStr}}{{else}}{{ctx.Locale.Tr "repo.issues.remove_milestone_at" .OldMilestone.Name $createdStr}}{{end}}{{else if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.add_milestone_at" .Milestone.Name $createdStr}}{{end}}
</span> </span>
</div> </div>
{{else if and (eq .Type 9) (gt .AssigneeID 0)}} {{else if and (eq .Type 9) (gt .AssigneeID 0)}}
@ -195,7 +195,7 @@
{{if eq .Poster.ID .Assignee.ID}} {{if eq .Poster.ID .Assignee.ID}}
{{ctx.Locale.Tr "repo.issues.remove_self_assignment" $createdStr}} {{ctx.Locale.Tr "repo.issues.remove_self_assignment" $createdStr}}
{{else}} {{else}}
{{ctx.Locale.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.remove_assignee_at" .Poster.GetDisplayName $createdStr}}
{{end}} {{end}}
</span> </span>
{{else}} {{else}}
@ -205,7 +205,7 @@
{{if eq .Poster.ID .AssigneeID}} {{if eq .Poster.ID .AssigneeID}}
{{ctx.Locale.Tr "repo.issues.self_assign_at" $createdStr}} {{ctx.Locale.Tr "repo.issues.self_assign_at" $createdStr}}
{{else}} {{else}}
{{ctx.Locale.Tr "repo.issues.add_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.add_assignee_at" .Poster.GetDisplayName $createdStr}}
{{end}} {{end}}
</span> </span>
{{end}} {{end}}
@ -225,7 +225,7 @@
{{template "shared/user/avatarlink" dict "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{ctx.Locale.Tr "repo.issues.delete_branch_at" (.OldRef|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.delete_branch_at" .OldRef $createdStr}}
</span> </span>
</div> </div>
{{else if eq .Type 12}} {{else if eq .Type 12}}
@ -418,7 +418,7 @@
{{.OriginalAuthor}} {{.OriginalAuthor}}
</span> </span>
<span class="text grey muted-links"> {{if $.Repository.OriginalURL}}</span> <span class="text grey muted-links"> {{if $.Repository.OriginalURL}}</span>
<span class="text migrate">({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape)}}){{end}}</span> <span class="text migrate">({{ctx.Locale.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname}}){{end}}</span>
{{else}} {{else}}
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{end}} {{end}}
@ -509,7 +509,7 @@
{{else}} {{else}}
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{end}} {{end}}
{{ctx.Locale.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr}} {{ctx.Locale.Tr "repo.pulls.change_target_branch_at" .OldRef .NewRef $createdStr}}
</span> </span>
</div> </div>
{{else if eq .Type 26}} {{else if eq .Type 26}}
@ -542,10 +542,10 @@
{{if eq .PosterID .AssigneeID}} {{if eq .PosterID .AssigneeID}}
{{ctx.Locale.Tr "repo.issues.review.remove_review_request_self" $createdStr}} {{ctx.Locale.Tr "repo.issues.review.remove_review_request_self" $createdStr}}
{{else}} {{else}}
{{ctx.Locale.Tr "repo.issues.review.remove_review_request" (.Assignee.GetDisplayName|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.review.remove_review_request" .Assignee.GetDisplayName $createdStr}}
{{end}} {{end}}
{{else}} {{else}}
{{ctx.Locale.Tr "repo.issues.review.add_review_request" (.Assignee.GetDisplayName|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.review.add_review_request" .Assignee.GetDisplayName $createdStr}}
{{end}} {{end}}
{{else}} {{else}}
<!-- If the assigned team is deleted, just displaying "Ghost Team" in the comment --> <!-- If the assigned team is deleted, just displaying "Ghost Team" in the comment -->
@ -554,9 +554,9 @@
{{$teamName = .AssigneeTeam.Name}} {{$teamName = .AssigneeTeam.Name}}
{{end}} {{end}}
{{if .RemovedAssignee}} {{if .RemovedAssignee}}
{{ctx.Locale.Tr "repo.issues.review.remove_review_request" ($teamName|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.review.remove_review_request" $teamName $createdStr}}
{{else}} {{else}}
{{ctx.Locale.Tr "repo.issues.review.add_review_request" ($teamName|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.review.add_review_request" $teamName $createdStr}}
{{end}} {{end}}
{{end}} {{end}}
</span> </span>
@ -571,7 +571,7 @@
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{if .IsForcePush}} {{if .IsForcePush}}
{{ctx.Locale.Tr "repo.issues.force_push_codes" ($.Issue.PullRequest.HeadBranch|Escape) (ShortSha .OldCommit) (($.Issue.Repo.CommitLink .OldCommit)|Escape) (ShortSha .NewCommit) (($.Issue.Repo.CommitLink .NewCommit)|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.force_push_codes" $.Issue.PullRequest.HeadBranch (ShortSha .OldCommit) ($.Issue.Repo.CommitLink .OldCommit) (ShortSha .NewCommit) ($.Issue.Repo.CommitLink .NewCommit) $createdStr}}
{{else}} {{else}}
{{ctx.Locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr}} {{ctx.Locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr}}
{{end}} {{end}}
@ -663,11 +663,11 @@
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{if and .OldRef .NewRef}} {{if and .OldRef .NewRef}}
{{ctx.Locale.Tr "repo.issues.change_ref_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.change_ref_at" .OldRef .NewRef $createdStr}}
{{else if .OldRef}} {{else if .OldRef}}
{{ctx.Locale.Tr "repo.issues.remove_ref_at" (.OldRef|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.remove_ref_at" .OldRef $createdStr}}
{{else}} {{else}}
{{ctx.Locale.Tr "repo.issues.add_ref_at" (.NewRef|Escape) $createdStr}} {{ctx.Locale.Tr "repo.issues.add_ref_at" .NewRef $createdStr}}
{{end}} {{end}}
</span> </span>
</div> </div>

View File

@ -73,7 +73,7 @@
{{else}} {{else}}
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{end}} {{end}}
{{ctx.Locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdSubStr}} {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdSubStr}}
</span> </span>
</div> </div>
<div class="comment-header-right actions gt-df gt-ac"> <div class="comment-header-right actions gt-df gt-ac">

View File

@ -81,14 +81,14 @@
{{ctx.Locale.Tr "repo.pulls.data_broken"}} {{ctx.Locale.Tr "repo.pulls.data_broken"}}
</div> </div>
{{else if .IsPullWorkInProgress}} {{else if .IsPullWorkInProgress}}
<div class="item toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{(.WorkInProgressPrefix|Escape)}}" data-update-url="{{.Issue.Link}}/title"> <div class="item toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{.WorkInProgressPrefix}}" data-update-url="{{.Issue.Link}}/title">
<div class="item-section-left flex-text-inline gt-f1"> <div class="item-section-left flex-text-inline gt-f1">
{{svg "octicon-x"}} {{svg "octicon-x"}}
{{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}} {{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
</div> </div>
{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}} {{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
<button class="ui compact button"> <button class="ui compact button">
{{ctx.Locale.Tr "repo.pulls.remove_prefix" (.WorkInProgressPrefix|Escape)}} {{ctx.Locale.Tr "repo.pulls.remove_prefix" .WorkInProgressPrefix}}
</button> </button>
{{end}} {{end}}
</div> </div>

View File

@ -101,7 +101,7 @@
{{range .OriginalReviews}} {{range .OriginalReviews}}
<div class="item gt-df gt-ac gt-py-3"> <div class="item gt-df gt-ac gt-py-3">
<div class="gt-df gt-ac gt-f1"> <div class="gt-df gt-ac gt-f1">
<a class="muted" href="{{$.Repository.OriginalURL}}" data-tooltip-content="{{ctx.Locale.Tr "repo.migrated_from_fake" ($.Repository.GetOriginalURLHostname|Escape)}}"> <a class="muted" href="{{$.Repository.OriginalURL}}" data-tooltip-content="{{ctx.Locale.Tr "repo.migrated_from_fake" $.Repository.GetOriginalURLHostname}}">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname) 20 "gt-mr-3"}} {{svg (MigrationIcon $.Repository.GetOriginalURLHostname) 20 "gt-mr-3"}}
{{.OriginalAuthor}} {{.OriginalAuthor}}
</a> </a>
@ -114,9 +114,9 @@
</div> </div>
</div> </div>
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}} {{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
<div class="toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{(index .PullRequestWorkInProgressPrefixes 0| Escape)}}" data-update-url="{{.Issue.Link}}/title"> <div class="toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
<a class="muted"> <a class="muted">
{{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape)}} {{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0)}}
</a> </a>
</div> </div>
{{end}} {{end}}
@ -300,7 +300,7 @@
{{else}} {{else}}
{{if .HasUserStopwatch}} {{if .HasUserStopwatch}}
<div class="ui warning message"> <div class="ui warning message">
{{ctx.Locale.Tr "repo.issues.tracking_already_started" (.OtherStopwatchURL|Escape)}} {{ctx.Locale.Tr "repo.issues.tracking_already_started" .OtherStopwatchURL}}
</div> </div>
{{end}} {{end}}
<button class="ui fluid button issue-start-time" data-tooltip-content='{{ctx.Locale.Tr "repo.issues.start_tracking"}}'> <button class="ui fluid button issue-start-time" data-tooltip-content='{{ctx.Locale.Tr "repo.issues.start_tracking"}}'>

View File

@ -104,11 +104,11 @@
{{$createdStr:= TimeSinceUnix .Issue.CreatedUnix ctx.Locale}} {{$createdStr:= TimeSinceUnix .Issue.CreatedUnix ctx.Locale}}
<span class="time-desc"> <span class="time-desc">
{{if .Issue.OriginalAuthor}} {{if .Issue.OriginalAuthor}}
{{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.OriginalAuthor|Escape)}} {{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr .Issue.OriginalAuthor}}
{{else if gt .Issue.Poster.ID 0}} {{else if gt .Issue.Poster.ID 0}}
{{ctx.Locale.Tr "repo.issues.opened_by" $createdStr (.Issue.Poster.HomeLink|Escape) (.Issue.Poster.GetDisplayName|Escape)}} {{ctx.Locale.Tr "repo.issues.opened_by" $createdStr .Issue.Poster.HomeLink .Issue.Poster.GetDisplayName}}
{{else}} {{else}}
{{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr (.Issue.Poster.GetDisplayName|Escape)}} {{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr .Issue.Poster.GetDisplayName}}
{{end}} {{end}}
· ·
{{ctx.Locale.TrN .Issue.NumComments "repo.issues.num_comments_1" "repo.issues.num_comments" .Issue.NumComments}} {{ctx.Locale.TrN .Issue.NumComments "repo.issues.num_comments_1" "repo.issues.num_comments" .Issue.NumComments}}

View File

@ -24,7 +24,7 @@
</div> </div>
{{else if .Keyword}} {{else if .Keyword}}
<h3> <h3>
{{ctx.Locale.Tr "repo.search.results" (.Keyword|Escape) (.RepoLink|Escape) (.RepoName|Escape)}} {{ctx.Locale.Tr "repo.search.results" .Keyword .RepoLink .RepoName}}
</h3> </h3>
{{if .SearchResults}} {{if .SearchResults}}
<div class="flex-text-block gt-fw"> <div class="flex-text-block gt-fw">

View File

@ -2,7 +2,7 @@
<div class="repo-setting-content"> <div class="repo-setting-content">
<form class="ui form" action="{{.Link}}" method="post"> <form class="ui form" action="{{.Link}}" method="post">
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{ctx.Locale.Tr "repo.settings.branch_protection" (.Rule.RuleName|Escape)}} {{ctx.Locale.Tr "repo.settings.branch_protection" .Rule.RuleName}}
</h4> </h4>
<div class="ui attached segment branch-protection"> <div class="ui attached segment branch-protection">
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.protect_patterns"}}</h5> <h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.protect_patterns"}}</h5>

View File

@ -107,7 +107,7 @@
{{ctx.Locale.Tr "repo.wiki.delete_page_button"}} {{ctx.Locale.Tr "repo.wiki.delete_page_button"}}
</div> </div>
<div class="content"> <div class="content">
<p>{{ctx.Locale.Tr "repo.wiki.delete_page_notice_1" ($title|Escape)}}</p> <p>{{ctx.Locale.Tr "repo.wiki.delete_page_notice_1" $title}}</p>
</div> </div>
{{template "base/modal_actions_confirm" .}} {{template "base/modal_actions_confirm" .}}
</div> </div>

View File

@ -62,11 +62,11 @@
</a> </a>
{{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}} {{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}}
{{if .OriginalAuthor}} {{if .OriginalAuthor}}
{{ctx.Locale.Tr .GetLastEventLabelFake $timeStr (.OriginalAuthor|Escape)}} {{ctx.Locale.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor}}
{{else if gt .Poster.ID 0}} {{else if gt .Poster.ID 0}}
{{ctx.Locale.Tr .GetLastEventLabel $timeStr (.Poster.HomeLink|Escape) (.Poster.GetDisplayName | Escape)}} {{ctx.Locale.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.GetDisplayName}}
{{else}} {{else}}
{{ctx.Locale.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName | Escape)}} {{ctx.Locale.Tr .GetLastEventLabelFake $timeStr .Poster.GetDisplayName}}
{{end}} {{end}}
{{if .IsPull}} {{if .IsPull}}
<div class="branches flex-text-inline"> <div class="branches flex-text-inline">

View File

@ -15,7 +15,7 @@
{{else if .ResendLimited}} {{else if .ResendLimited}}
<p class="center">{{ctx.Locale.Tr "auth.resent_limit_prompt"}}</p> <p class="center">{{ctx.Locale.Tr "auth.resent_limit_prompt"}}</p>
{{else}} {{else}}
<p>{{ctx.Locale.Tr "auth.confirmation_mail_sent_prompt" (.SignedUser.Email|Escape) .ActiveCodeLives}}</p> <p>{{ctx.Locale.Tr "auth.confirmation_mail_sent_prompt" .SignedUser.Email .ActiveCodeLives}}</p>
{{end}} {{end}}
{{else}} {{else}}
{{if .NeedsPassword}} {{if .NeedsPassword}}
@ -29,7 +29,7 @@
</div> </div>
<input id="code" name="code" type="hidden" value="{{.Code}}"> <input id="code" name="code" type="hidden" value="{{.Code}}">
{{else if .IsSendRegisterMail}} {{else if .IsSendRegisterMail}}
<p>{{ctx.Locale.Tr "auth.confirmation_mail_sent_prompt" (.Email|Escape) .ActiveCodeLives}}</p> <p>{{ctx.Locale.Tr "auth.confirmation_mail_sent_prompt" .Email .ActiveCodeLives}}</p>
{{else if .IsCodeInvalid}} {{else if .IsCodeInvalid}}
<p>{{ctx.Locale.Tr "auth.invalid_code"}}</p> <p>{{ctx.Locale.Tr "auth.invalid_code"}}</p>
{{else if .IsPasswordInvalid}} {{else if .IsPasswordInvalid}}
@ -37,7 +37,7 @@
{{else if .ManualActivationOnly}} {{else if .ManualActivationOnly}}
<p class="center">{{ctx.Locale.Tr "auth.manual_activation_only"}}</p> <p class="center">{{ctx.Locale.Tr "auth.manual_activation_only"}}</p>
{{else}} {{else}}
<p>{{ctx.Locale.Tr "auth.has_unconfirmed_mail" (.SignedUser.Name|Escape) (.SignedUser.Email|Escape)}}</p> <p>{{ctx.Locale.Tr "auth.has_unconfirmed_mail" .SignedUser.Name .SignedUser.Email}}</p>
<div class="divider"></div> <div class="divider"></div>
<div class="text right"> <div class="text right">
<button class="ui primary button">{{ctx.Locale.Tr "auth.resend_mail"}}</button> <button class="ui primary button">{{ctx.Locale.Tr "auth.resend_mail"}}</button>

View File

@ -10,7 +10,7 @@
<div class="ui attached segment"> <div class="ui attached segment">
{{template "base/alert" .}} {{template "base/alert" .}}
{{if .IsResetSent}} {{if .IsResetSent}}
<p>{{ctx.Locale.Tr "auth.reset_password_mail_sent_prompt" (Escape .Email) .ResetPwdCodeLives}}</p> <p>{{ctx.Locale.Tr "auth.reset_password_mail_sent_prompt" .Email .ResetPwdCodeLives}}</p>
{{else if .IsResetRequest}} {{else if .IsResetRequest}}
<div class="required inline field {{if .Err_Email}}error{{end}}"> <div class="required inline field {{if .Err_Email}}error{{end}}">
<label for="email">{{ctx.Locale.Tr "email"}}</label> <label for="email">{{ctx.Locale.Tr "email"}}</label>

View File

@ -12,71 +12,71 @@
{{.ShortActUserName ctx}} {{.ShortActUserName ctx}}
{{end}} {{end}}
{{if .GetOpType.InActions "create_repo"}} {{if .GetOpType.InActions "create_repo"}}
{{ctx.Locale.Tr "action.create_repo" ((.GetRepoLink ctx)|Escape) ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.create_repo" (.GetRepoLink ctx) (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "rename_repo"}} {{else if .GetOpType.InActions "rename_repo"}}
{{ctx.Locale.Tr "action.rename_repo" (.GetContent|Escape) ((.GetRepoLink ctx)|Escape) ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.rename_repo" .GetContent (.GetRepoLink ctx) (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "commit_repo"}} {{else if .GetOpType.InActions "commit_repo"}}
{{if .Content}} {{if .Content}}
{{ctx.Locale.Tr "action.commit_repo" ((.GetRepoLink ctx)|Escape) ((.GetRefLink ctx)|Escape) (Escape .GetBranch) ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.commit_repo" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
{{else}} {{else}}
{{ctx.Locale.Tr "action.create_branch" ((.GetRepoLink ctx)|Escape) ((.GetRefLink ctx)|Escape) (Escape .GetBranch) ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.create_branch" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
{{end}} {{end}}
{{else if .GetOpType.InActions "create_issue"}} {{else if .GetOpType.InActions "create_issue"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.create_issue" ((printf "%s/issues/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.create_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "create_pull_request"}} {{else if .GetOpType.InActions "create_pull_request"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.create_pull_request" ((printf "%s/pulls/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.create_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "transfer_repo"}} {{else if .GetOpType.InActions "transfer_repo"}}
{{ctx.Locale.Tr "action.transfer_repo" .GetContent ((.GetRepoLink ctx)|Escape) ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.transfer_repo" .GetContent (.GetRepoLink ctx) (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "push_tag"}} {{else if .GetOpType.InActions "push_tag"}}
{{ctx.Locale.Tr "action.push_tag" ((.GetRepoLink ctx)|Escape) ((.GetRefLink ctx)|Escape) (.GetTag|Escape) ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.push_tag" (.GetRepoLink ctx) (.GetRefLink ctx) .GetTag (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "comment_issue"}} {{else if .GetOpType.InActions "comment_issue"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.comment_issue" ((printf "%s/issues/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.comment_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "merge_pull_request"}} {{else if .GetOpType.InActions "merge_pull_request"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.merge_pull_request" ((printf "%s/pulls/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.merge_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "close_issue"}} {{else if .GetOpType.InActions "close_issue"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.close_issue" ((printf "%s/issues/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.close_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "reopen_issue"}} {{else if .GetOpType.InActions "reopen_issue"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.reopen_issue" ((printf "%s/issues/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.reopen_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "close_pull_request"}} {{else if .GetOpType.InActions "close_pull_request"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.close_pull_request" ((printf "%s/pulls/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.close_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "reopen_pull_request"}} {{else if .GetOpType.InActions "reopen_pull_request"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.reopen_pull_request" ((printf "%s/pulls/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.reopen_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "delete_tag"}} {{else if .GetOpType.InActions "delete_tag"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.delete_tag" ((.GetRepoLink ctx)|Escape) (.GetTag|Escape) ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.delete_tag" (.GetRepoLink ctx) .GetTag (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "delete_branch"}} {{else if .GetOpType.InActions "delete_branch"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.delete_branch" ((.GetRepoLink ctx)|Escape) (.GetBranch|Escape) ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.delete_branch" (.GetRepoLink ctx) .GetBranch (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "mirror_sync_push"}} {{else if .GetOpType.InActions "mirror_sync_push"}}
{{ctx.Locale.Tr "action.mirror_sync_push" ((.GetRepoLink ctx)|Escape) ((.GetRefLink ctx)|Escape) (.GetBranch|Escape) ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.mirror_sync_push" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "mirror_sync_create"}} {{else if .GetOpType.InActions "mirror_sync_create"}}
{{ctx.Locale.Tr "action.mirror_sync_create" ((.GetRepoLink ctx)|Escape) ((.GetRefLink ctx)|Escape) (.GetBranch|Escape) ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.mirror_sync_create" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "mirror_sync_delete"}} {{else if .GetOpType.InActions "mirror_sync_delete"}}
{{ctx.Locale.Tr "action.mirror_sync_delete" ((.GetRepoLink ctx)|Escape) (.GetBranch|Escape) ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.mirror_sync_delete" (.GetRepoLink ctx) .GetBranch (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "approve_pull_request"}} {{else if .GetOpType.InActions "approve_pull_request"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.approve_pull_request" ((printf "%s/pulls/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.approve_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "reject_pull_request"}} {{else if .GetOpType.InActions "reject_pull_request"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.reject_pull_request" ((printf "%s/pulls/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.reject_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "comment_pull"}} {{else if .GetOpType.InActions "comment_pull"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{ctx.Locale.Tr "action.comment_pull" ((printf "%s/pulls/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape)}} {{ctx.Locale.Tr "action.comment_pull" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
{{else if .GetOpType.InActions "publish_release"}} {{else if .GetOpType.InActions "publish_release"}}
{{$linkText := .Content | RenderEmoji $.Context}} {{$linkText := .Content | RenderEmoji $.Context}}
{{ctx.Locale.Tr "action.publish_release" ((.GetRepoLink ctx)|Escape) ((printf "%s/releases/tag/%s" (.GetRepoLink ctx) .GetTag)|Escape) ((.ShortRepoPath ctx)|Escape) $linkText}} {{ctx.Locale.Tr "action.publish_release" (.GetRepoLink ctx) (printf "%s/releases/tag/%s" (.GetRepoLink ctx) .GetTag) (.ShortRepoPath ctx) $linkText}}
{{else if .GetOpType.InActions "review_dismissed"}} {{else if .GetOpType.InActions "review_dismissed"}}
{{$index := index .GetIssueInfos 0}} {{$index := index .GetIssueInfos 0}}
{{$reviewer := index .GetIssueInfos 1}} {{$reviewer := index .GetIssueInfos 1}}
{{ctx.Locale.Tr "action.review_dismissed" ((printf "%s/pulls/%s" (.GetRepoLink ctx) $index) |Escape) $index ((.ShortRepoPath ctx)|Escape) $reviewer}} {{ctx.Locale.Tr "action.review_dismissed" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx) $reviewer}}
{{end}} {{end}}
{{TimeSince .GetCreate ctx.Locale}} {{TimeSince .GetCreate ctx.Locale}}
</div> </div>