aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/issue
diff options
context:
space:
mode:
authorqwerty287 <80460567+qwerty287@users.noreply.github.com>2021-11-28 05:13:13 +0100
committerGitHub <noreply@github.com>2021-11-28 12:13:13 +0800
commit24a8d54bfb908a2371cb808a5243b3290dd0664a (patch)
treeea629e7bfed99f2e21b81b6c3adaf36fa466c4c5 /templates/repo/issue
parentfbadc1a1982f9133ecc8a7f9debe32525703eb27 (diff)
downloadgitea-24a8d54bfb908a2371cb808a5243b3290dd0664a.tar.gz
gitea-24a8d54bfb908a2371cb808a5243b3290dd0664a.zip
Disable ref selection dropdown if you don't have permissions to use it (#17837)
Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'templates/repo/issue')
-rw-r--r--templates/repo/issue/branch_selector_field.tmpl4
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/branch_selector_field.tmpl
index e115b4a3f4..cb7d37fb90 100644
--- a/templates/repo/issue/branch_selector_field.tmpl
+++ b/templates/repo/issue/branch_selector_field.tmpl
@@ -5,10 +5,10 @@
{{$.CsrfTokenHtml}}
</form>
-<div class="ui {{if .ReadOnly}}disabled{{end}} floating filter select-branch dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
+<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating filter select-branch dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
<div class="ui basic small button">
<span class="text branch-name">{{if .Issue.Ref}}{{$.RefEndName}}{{else}}{{.i18n.Tr "repo.issues.no_ref"}}{{end}}</span>
- {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ {{if .HasIssuesOrPullsWritePermission}}{{svg "octicon-triangle-down" 14 "dropdown icon"}}{{end}}
</div>
<div class="menu">
<div class="ui icon search input">