Skip to content

Commit

Permalink
hide gear icon for user who can't use them on sidebar (#10750)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
a1012112796 committed Mar 17, 2020
1 parent ca18110 commit 2f92831
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions templates/repo/issue/view_content/sidebar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 2f92831

Please sign in to comment.