Skip to content

Commit c0c8c13

Browse files
committed
Remove Pull request button on repo homepage
We have too many buttons on the repo frontpage and this seems like a obvious candidate to remove as it already exists in the Pull Requests tab where it makes more sense. FWIW, GitHub also no longer shows the button on a repo home page but they do have the recent-pushes flash feature which we lack.
1 parent 4f14c6d commit c0c8c13

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

integrations/pull_create_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
func testPullCreate(t *testing.T, session *TestSession, user, repo, branch, title string) *httptest.ResponseRecorder {
19-
req := NewRequest(t, "GET", path.Join(user, repo))
19+
req := NewRequest(t, "GET", path.Join(user, repo, "pulls"))
2020
resp := session.MakeRequest(t, req, http.StatusOK)
2121

2222
// Click the PR button to create a pull

templates/repo/home.tmpl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,8 @@
6464
{{template "repo/branch_dropdown" dict "root" .}}
6565
{{ $n := len .TreeNames}}
6666
{{ $l := Subtract $n 1}}
67-
<!-- If home page, show new PR. If not, show breadcrumb -->
67+
<!-- If home page, show actions. If not, show breadcrumb -->
6868
{{if eq $n 0}}
69-
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
70-
<div class="fitted item mx-0">
71-
<a href="{{.BaseRepo.Link}}/compare/{{PathEscapeSegments .BaseRepo.DefaultBranch}}...{{if ne .Repository.Owner.Name .BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}{{if .BaseRepo.IsFork}}/{{PathEscape .Repository.Name}}{{end}}:{{end}}{{PathEscapeSegments .BranchName}}">
72-
<button id="new-pull-request" class="ui compact basic button">{{if .PullRequestCtx.Allowed}}{{.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{.locale.Tr "action.compare_branch"}}{{end}}</button>
73-
</a>
74-
</div>
75-
{{end}}
7669
<div class="fitted item mx-0">
7770
<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button">
7871
{{.locale.Tr "repo.find_file.go_to_file"}}

templates/repo/issue/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
{{if .PageIsIssueList}}
1515
<a class="ui green button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
1616
{{else}}
17-
<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.pulls.new"}}</a>
17+
<a id="new-pull-request" class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.pulls.new"}}</a>
1818
{{end}}
1919
</div>
2020
{{else}}

0 commit comments

Comments
 (0)