diff options
author | IT-AlexKor <101557941+IT-AlexKor@users.noreply.github.com> | 2022-05-25 16:33:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 15:33:35 +0200 |
commit | 0692f437b6e9e22399f84adc0f8bad15e9341e09 (patch) | |
tree | ede35ba19962b80801a529d3ae4a528c3e50031e /templates | |
parent | 35d0358c2a5cd71219fc407b08d29159e6084cd0 (diff) | |
download | gitea-0692f437b6e9e22399f84adc0f8bad15e9341e09.tar.gz gitea-0692f437b6e9e22399f84adc0f8bad15e9341e09.zip |
Show source/target branches on PR's list (#19747)
Add ability to show source/target branches for Pull Request's list. It can be useful to see which branches are used in each PR right in the list.
Co-authored-by: Alexey Korobkov <akorobkov@cian.ru>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/shared/issuelist.tmpl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index 23fb76d500..5392365dd1 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -59,6 +59,27 @@ {{else}} {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName | Escape) | Safe}} {{end}} + {{if .IsPull}} + <div class="branches"> + <div class="branch"> + <a class="bold" href="{{.PullRequest.BaseRepo.HTMLURL}}/src/branch/{{PathEscapeSegments .PullRequest.BaseBranch}}"> + {{/* inline to remove the spaces between spans */}} + {{if ne .RepoID .PullRequest.BaseRepoID}}<span class="truncated-name">{{.PullRequest.BaseRepo.OwnerName}}</span>:{{end}}<span class="truncated-name">{{.PullRequest.BaseBranch}}</span> + </a> + </div> + + « + + {{if .PullRequest.HeadRepo}} + <div class="branch"> + <a class="bold" href="{{.PullRequest.HeadRepo.HTMLURL}}/src/branch/{{PathEscapeSegments .PullRequest.HeadBranch}}"> + {{/* inline to remove the spaces between spans */}} + {{if ne .RepoID .PullRequest.HeadRepoID}}<span class="truncated-name">{{.PullRequest.HeadRepo.OwnerName}}</span>:{{end}}<span class="truncated-name">{{.PullRequest.HeadBranch}}</span> + </a> + </div> + {{end}} + </div> + {{end}} {{if and .Milestone (ne $.listType "milestone")}} <a class="milestone" {{if $.RepoLink}}href="{{$.RepoLink}}/milestone/{{.Milestone.ID}}"{{else}}href="{{.Repo.Link}}/milestone/{{.Milestone.ID}}"{{end}}> {{svg "octicon-milestone" 14 "mr-2"}}{{.Milestone.Name}} |