diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-11-05 14:04:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-05 14:04:26 +0800 |
commit | 4a469c8e1b3c1d153316aec9fd8cbdd3e1dd54e8 (patch) | |
tree | 3fc7eae5668299c7dbd5933cd14839bbccacefdd /templates/user/dashboard | |
parent | b068dbd40ee3b4dc7d18cdcf168f0c24cea234c0 (diff) | |
download | gitea-4a469c8e1b3c1d153316aec9fd8cbdd3e1dd54e8.tar.gz gitea-4a469c8e1b3c1d153316aec9fd8cbdd3e1dd54e8.zip |
Refactor template ctx and render utils (#32422)
Clean up the templates
Diffstat (limited to 'templates/user/dashboard')
-rw-r--r-- | templates/user/dashboard/feeds.tmpl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index 73698abc71..d3e2f7a06c 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -71,7 +71,7 @@ {{$index := index .GetIssueInfos 0}} {{ctx.Locale.Tr "action.comment_pull" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}} {{else if .GetOpType.InActions "publish_release"}} - {{$linkText := .Content | RenderEmoji $.Context}} + {{$linkText := .Content | ctx.RenderUtils.RenderEmoji}} {{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"}} {{$index := index .GetIssueInfos 0}} @@ -88,10 +88,10 @@ {{range $push.Commits}} {{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}} <div class="flex-text-block"> - <img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16"> + <img class="ui avatar" src="{{$push.AvatarLink ctx .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16"> <a class="ui sha label" href="{{$commitLink}}">{{ShortSha .Sha1}}</a> <span class="text truncate"> - {{RenderCommitMessage $.Context .Message ($repo.ComposeMetas ctx)}} + {{ctx.RenderUtils.RenderCommitMessage .Message ($repo.ComposeMetas ctx)}} </span> </div> {{end}} @@ -100,22 +100,22 @@ <a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{ctx.Locale.Tr "action.compare_commits" $push.Len}} ยป</a> {{end}} {{else if .GetOpType.InActions "create_issue"}} - <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji $.Context | RenderCodeBlock}}</span> + <span class="text truncate issue title">{{index .GetIssueInfos 1 | ctx.RenderUtils.RenderEmoji | RenderCodeBlock}}</span> {{else if .GetOpType.InActions "create_pull_request"}} - <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji $.Context | RenderCodeBlock}}</span> + <span class="text truncate issue title">{{index .GetIssueInfos 1 | ctx.RenderUtils.RenderEmoji | RenderCodeBlock}}</span> {{else if .GetOpType.InActions "comment_issue" "approve_pull_request" "reject_pull_request" "comment_pull"}} - <a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}}</a> + <a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{(.GetIssueTitle ctx) | ctx.RenderUtils.RenderEmoji | RenderCodeBlock}}</a> {{$comment := index .GetIssueInfos 1}} {{if $comment}} - <div class="markup tw-text-14">{{RenderMarkdownToHtml ctx $comment}}</div> + <div class="markup tw-text-14">{{ctx.RenderUtils.MarkdownToHtml $comment}}</div> {{end}} {{else if .GetOpType.InActions "merge_pull_request"}} <div class="flex-item-body text black">{{index .GetIssueInfos 1}}</div> {{else if .GetOpType.InActions "close_issue" "reopen_issue" "close_pull_request" "reopen_pull_request"}} - <span class="text truncate issue title">{{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}}</span> + <span class="text truncate issue title">{{(.GetIssueTitle ctx) | ctx.RenderUtils.RenderEmoji | RenderCodeBlock}}</span> {{else if .GetOpType.InActions "pull_review_dismissed"}} <div class="flex-item-body text black">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</div> - <div class="flex-item-body text black">{{index .GetIssueInfos 2 | RenderEmoji $.Context}}</div> + <div class="flex-item-body text black">{{index .GetIssueInfos 2 | ctx.RenderUtils.RenderEmoji}}</div> {{end}} </div> <div class="flex-item-trailing"> |