summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author赵智超 <1012112796@qq.com>2020-03-18 00:19:03 +0800
committerGitHub <noreply@github.com>2020-03-17 12:19:03 -0400
commit2f928316dbc2bb71137e857d97039d4f51f7d405 (patch)
tree186a3d39f302ac8d7d3e341a6f8259e24d539f7d
parentca181100ca353bb3541186f7589786f193143800 (diff)
downloadgitea-2f928316dbc2bb71137e857d97039d4f51f7d405.tar.gz
gitea-2f928316dbc2bb71137e857d97039d4f51f7d405.zip
hide gear icon for user who can't use them on sidebar (#10750)
reason: If user can't choose the Assignees labels and Milestone It's not usefull to show a gear label , and it It will mislead the user into thinking that it's a BUG rather than thy don't have permission to chosse them. Signed-off-by: a1012112796 <1012112796@qq.com>
-rw-r--r--templates/repo/issue/view_content/sidebar.tmpl12
1 files changed, 9 insertions, 3 deletions
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl
index d6fe28a074..1d1f1916da 100644
--- a/templates/repo/issue/view_content/sidebar.tmpl
+++ b/templates/repo/issue/view_content/sidebar.tmpl
@@ -5,7 +5,9 @@
<div class="ui {{if or (not .IsIssueWriter) .Repository.IsArchived}}disabled{{end}} floating jump select-label dropdown">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong>
- {{svg "octicon-gear" 16}}
+ {{if and .IsIssueWriter (not .Repository.IsArchived)}}
+ {{svg "octicon-gear" 16}}
+ {{end}}
</span>
<div class="filter menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/labels">
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div>
@@ -30,7 +32,9 @@
<div class="ui {{if or (not .IsIssueWriter) .Repository.IsArchived}}disabled{{end}} floating jump select-milestone dropdown">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.milestone"}}</strong>
- {{svg "octicon-gear" 16}}
+ {{if and .IsIssueWriter (not .Repository.IsArchived)}}
+ {{svg "octicon-gear" 16}}
+ {{end}}
</span>
<div class="menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/milestone">
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_milestone"}}</div>
@@ -71,7 +75,9 @@
<div class="ui {{if or (not .IsIssueWriter) .Repository.IsArchived}}disabled{{end}} floating jump select-assignees-modify dropdown">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.assignees"}}</strong>
- {{svg "octicon-gear" 16}}
+ {{if and .IsIssueWriter (not .Repository.IsArchived)}}
+ {{svg "octicon-gear" 16}}
+ {{end}}
</span>
<div class="filter menu" data-action="" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/assignee">
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignees"}}</div>