aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/issue
diff options
context:
space:
mode:
authorCherrg <michael@gnehr.de>2019-06-29 11:18:49 +0200
committerzeripath <art27@cantab.net>2019-06-29 10:18:49 +0100
commit711f6dc9b0f77b35706bcb31a41b5f6a9e50d401 (patch)
tree24f6aa9c8bfef19e68e1c56bcbd31400f5c0c806 /templates/repo/issue
parente005b5f6e6c96fe0dc70ee9e0a171230b7adf732 (diff)
downloadgitea-711f6dc9b0f77b35706bcb31a41b5f6a9e50d401.tar.gz
gitea-711f6dc9b0f77b35706bcb31a41b5f6a9e50d401.zip
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 <michael@gnehr.de> * archived repo - remove - comment field on issue view - lock/unlock issue conversation button from sidebar on issue view Signed-off-by: Michael Gnehr <michael@gnehr.de> * 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 <michael@gnehr.de>
Diffstat (limited to 'templates/repo/issue')
-rw-r--r--templates/repo/issue/list.tmpl8
-rw-r--r--templates/repo/issue/view_content.tmpl4
-rw-r--r--templates/repo/issue/view_content/sidebar.tmpl2
3 files changed, 12 insertions, 2 deletions
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index 448ab1a757..3007c99106 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -17,6 +17,12 @@
<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>
{{end}}
</div>
+ {{else}}
+ {{if not .PageIsIssueList}}
+ <div class="column right aligned">
+ <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>
+ </div>
+ {{end}}
{{end}}
</div>
<div class="ui divider"></div>
@@ -132,6 +138,7 @@
this one correctly, but not the other one. */}}
<div class="nine wide right aligned right floated column">
<div class="ui secondary filter stackable menu">
+ {{if not .Repository.IsArchived}}
<!-- Action Button -->
{{if .IsShowClosed}}
<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 @@
{{end}}
</div>
</div>
+ {{end}}
</div>
</div>
</div>
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl
index de9ffdb930..cb85c5be97 100644
--- a/templates/repo/issue/view_content.tmpl
+++ b/templates/repo/issue/view_content.tmpl
@@ -70,7 +70,7 @@
{{ template "repo/issue/view_content/pull". }}
{{end}}
{{if .IsSigned}}
- {{ if or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked)) }}
+ {{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }}
<div class="comment form">
<a class="avatar" href="{{.SignedUser.HomeLink}}">
<img src="{{.SignedUser.RelAvatarLink}}">
@@ -111,6 +111,7 @@
</div>
{{else}}
{{if .IsSigned}}
+ {{if .Repository.IsArchived}}
<div class="comment form">
<a class="avatar" href="{{.SignedUser.HomeLink}}">
<img src="{{.SignedUser.RelAvatarLink}}">
@@ -139,6 +140,7 @@
</form>
</div>
</div>
+ {{end}}
{{else}}
<div class="ui warning message">
{{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}}
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl
index 853f681474..e50ac0a4b1 100644
--- a/templates/repo/issue/view_content/sidebar.tmpl
+++ b/templates/repo/issue/view_content/sidebar.tmpl
@@ -336,7 +336,7 @@
{{end}}
</div>
- {{ if .IsRepoAdmin }}
+ {{ if and .IsRepoAdmin (not .Repository.IsArchived) }}
<div class="ui divider"></div>
<div class="ui watching">
<div>