Skip to content

Commit 134ef7d

Browse files
authored
Merge branch 'main' into lunny/move_accessmode
2 parents 5295ad2 + 24a8d54 commit 134ef7d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Diff for: routers/web/repo/issue.go

-2
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,6 @@ func NewIssuePost(ctx *context.Context) {
955955
ctx.Data["NewIssueChooseTemplate"] = len(ctx.IssueTemplatesFromDefaultBranch()) > 0
956956
ctx.Data["RequireHighlightJS"] = true
957957
ctx.Data["RequireSimpleMDE"] = true
958-
ctx.Data["ReadOnly"] = false
959958
ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes
960959
ctx.Data["IsAttachmentEnabled"] = setting.Attachment.Enabled
961960
upload.AddUploadContext(ctx, "comment")
@@ -1630,7 +1629,6 @@ func ViewIssue(ctx *context.Context) {
16301629
ctx.Data["Participants"] = participants
16311630
ctx.Data["NumParticipants"] = len(participants)
16321631
ctx.Data["Issue"] = issue
1633-
ctx.Data["ReadOnly"] = false
16341632
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/login?redirect_to=" + url.QueryEscape(ctx.Data["Link"].(string))
16351633
ctx.Data["IsIssuePoster"] = ctx.IsSigned && issue.IsPoster(ctx.User.ID)
16361634
ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull)

Diff for: templates/repo/issue/branch_selector_field.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
{{$.CsrfTokenHtml}}
66
</form>
77

8-
<div class="ui {{if .ReadOnly}}disabled{{end}} floating filter select-branch dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
8+
<div class="ui {{if not .HasIssuesOrPullsWritePermission}}disabled{{end}} floating filter select-branch dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
99
<div class="ui basic small button">
1010
<span class="text branch-name">{{if .Issue.Ref}}{{$.RefEndName}}{{else}}{{.i18n.Tr "repo.issues.no_ref"}}{{end}}</span>
11-
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
11+
{{if .HasIssuesOrPullsWritePermission}}{{svg "octicon-triangle-down" 14 "dropdown icon"}}{{end}}
1212
</div>
1313
<div class="menu">
1414
<div class="ui icon search input">

0 commit comments

Comments
 (0)