Skip to content

Commit 711f6dc

Browse files
Cherrgzeripath
authored andcommitted
Fix 7303 - remove unnessesary buttons on archived repos (#7326)
* archived repo - remove - open/close button on issue list - assigne person on issue list Signed-off-by: Michael Gnehr <[email protected]> * archived repo - remove - comment field on issue view - lock/unlock issue conversation button from sidebar on issue view Signed-off-by: Michael Gnehr <[email protected]> * archived repo - add 'compare commits' button to pull request + remove new pull request button from compare view as the route is still working, and there is no need to be hidden Signed-off-by: Michael Gnehr <[email protected]>
1 parent e005b5f commit 711f6dc

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,6 +1866,7 @@ push_tag = pushed tag <a href="%s/src/tag/%s">%[2]s</a> to <a href="%[1]s">%[3]s
18661866
delete_tag = deleted tag %[2]s from <a href="%[1]s">%[3]s</a>
18671867
delete_branch = deleted branch %[2]s from <a href="%[1]s">%[3]s</a>
18681868
compare_commits = Compare %d commits
1869+
compare_commits_general = Compare commits
18691870
mirror_sync_push = synced commits to <a href="%[1]s/src/%[2]s">%[3]s</a> at <a href="%[1]s">%[4]s</a> from mirror
18701871
mirror_sync_create = synced new reference <a href="%s/src/%s">%[2]s</a> to <a href="%[1]s">%[3]s</a> from mirror
18711872
mirror_sync_delete = synced and deleted reference <code>%[2]s</code> at <a href="%[1]s">%[3]s</a> from mirror

templates/repo/diff/compare.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@
5656
{{.i18n.Tr "repo.pulls.has_pull_request" $.RepoLink $.RepoRelPath .PullRequest.Index | Safe}}
5757
</div>
5858
{{else}}
59+
{{if not .Repository.IsArchived}}
5960
<div class="ui info message show-form-container">
6061
<button class="ui button green show-form">{{.i18n.Tr "repo.pulls.new"}}</button>
6162
</div>
63+
{{end}}
6264
<div class="pullrequest-form" style="display: none">
6365
{{template "repo/issue/new_form" .}}
6466
</div>

templates/repo/issue/list.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | EscapePound}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{.Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | EscapePound}}{{end}}">{{.i18n.Tr "repo.pulls.new"}}</a>
1818
{{end}}
1919
</div>
20+
{{else}}
21+
{{if not .PageIsIssueList}}
22+
<div class="column right aligned">
23+
<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | EscapePound}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{.Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | EscapePound}}{{end}}">{{$.i18n.Tr "action.compare_commits_general"}}</a>
24+
</div>
25+
{{end}}
2026
{{end}}
2127
</div>
2228
<div class="ui divider"></div>
@@ -132,6 +138,7 @@
132138
this one correctly, but not the other one. */}}
133139
<div class="nine wide right aligned right floated column">
134140
<div class="ui secondary filter stackable menu">
141+
{{if not .Repository.IsArchived}}
135142
<!-- Action Button -->
136143
{{if .IsShowClosed}}
137144
<div class="ui green active basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status" style="margin-left: auto">{{.i18n.Tr "repo.issues.action_open"}}</div>
@@ -188,6 +195,7 @@
188195
{{end}}
189196
</div>
190197
</div>
198+
{{end}}
191199
</div>
192200
</div>
193201
</div>

templates/repo/issue/view_content.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
{{ template "repo/issue/view_content/pull". }}
7171
{{end}}
7272
{{if .IsSigned}}
73-
{{ if or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked)) }}
73+
{{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }}
7474
<div class="comment form">
7575
<a class="avatar" href="{{.SignedUser.HomeLink}}">
7676
<img src="{{.SignedUser.RelAvatarLink}}">
@@ -111,6 +111,7 @@
111111
</div>
112112
{{else}}
113113
{{if .IsSigned}}
114+
{{if .Repository.IsArchived}}
114115
<div class="comment form">
115116
<a class="avatar" href="{{.SignedUser.HomeLink}}">
116117
<img src="{{.SignedUser.RelAvatarLink}}">
@@ -139,6 +140,7 @@
139140
</form>
140141
</div>
141142
</div>
143+
{{end}}
142144
{{else}}
143145
<div class="ui warning message">
144146
{{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}}

templates/repo/issue/view_content/sidebar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@
336336
{{end}}
337337
</div>
338338

339-
{{ if .IsRepoAdmin }}
339+
{{ if and .IsRepoAdmin (not .Repository.IsArchived) }}
340340
<div class="ui divider"></div>
341341
<div class="ui watching">
342342
<div>

0 commit comments

Comments
 (0)