]> source.dussan.org Git - gitea.git/commitdiff
Use pulls in commit graph unless pulls are disabled (#15734 & #15740 & #15774) (...
author6543 <6543@obermui.de>
Fri, 7 May 2021 19:12:24 +0000 (21:12 +0200)
committerGitHub <noreply@github.com>
Fri, 7 May 2021 19:12:24 +0000 (15:12 -0400)
* Commit Graph: Pull-Requests should not link to issues (#15734)

Use `/pulls` and simplify code.

* reverse #15734 partial and comment (#15740)

* reverse & comment

* Update templates/repo/graph/commits.tmpl

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
* Use pulls in commit graph unless pulls are disabled

Fix #15370

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: KN4CK3R <KN4CK3R@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
templates/repo/graph/commits.tmpl

index 8f3260ba50e7c64d4ffd73b5336178e386a2b251..3427aed58ca7009f8979c7d623af9f6d56a7d3e6 100644 (file)
                                                {{range $commit.Refs}}
                                                        {{$refGroup := .RefGroup}}
                                                        {{if eq $refGroup "pull"}}
-                                                               {{if $.HidePRRefs}}
-                                                                       {{if (containGeneric $.SelectedBranches .Name) }}
-                                                                               <a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/issues/{{.ShortName|PathEscape}}">
-                                                                                       {{svg "octicon-git-pull-request" 16 "mr-2"}}#{{.ShortName}}
-                                                                               </a>
-                                                                       {{end}}
-                                                               {{else}}
-                                                                       <a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/issues/{{.ShortName|PathEscape}}">
+                                                               {{if or (not $.HidePRRefs) (containGeneric $.SelectedBranches .Name)}}
+                                                                       <!-- it's intended to use issues not pulls, if it's a pull you will get redirected -->
+                                                                       <a class="ui labelled icon button basic tiny" href="{{$.RepoLink}}/{{if $.Repository.UnitEnabled $.UnitTypePullRequests}}pulls{{else}}issues{{end}}/{{.ShortName|PathEscape}}">
                                                                                {{svg "octicon-git-pull-request" 16 "mr-2"}}#{{.ShortName}}
                                                                        </a>
                                                                {{end}}