Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug:fix add assignees permission bug on New PR from forked repo #10848

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions routers/repo/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ func CompareDiff(ctx *context.Context) {
return
}

ctx.Data["IsIssueWriter"] = ctx.Repo.CanWriteIssuesOrPulls(true)

ctx.Data["Title"] = "Comparing " + base.ShortSha(beforeCommitID) + "..." + base.ShortSha(afterCommitID)

ctx.Data["IsRepoToolbarCommits"] = true
Expand Down
36 changes: 10 additions & 26 deletions templates/repo/issue/new_form.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
<div class="ui {{if not .Labels}}disabled{{end}} floating jump select-label dropdown">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong>
{{svg "octicon-gear" 16}}
{{if .Labels}}
{{svg "octicon-gear" 16}}
{{end}}
</span>
<div class="filter menu" data-id="#label_ids">
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div>
Expand All @@ -64,7 +66,9 @@
<div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} floating jump select-milestone dropdown">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.milestone"}}</strong>
{{svg "octicon-gear" 16}}
{{if or .OpenMilestones .ClosedMilestones}}
{{svg "octicon-gear" 16}}
{{end}}
</span>
<div class="menu">
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_milestone"}}</div>
Expand Down Expand Up @@ -102,10 +106,12 @@
<div class="ui divider"></div>

<input id="assignee_ids" name="assignee_ids" type="hidden" value="{{.assignee_ids}}">
<div class="ui {{if not .Assignees}}disabled{{end}} floating jump select-assignees dropdown">
<div class="ui {{if or (not .IsIssueWriter) (not .Assignees)}}disabled{{end}} floating jump select-assignees dropdown">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.assignees"}}</strong>
{{svg "octicon-gear" 16}}
{{if and .IsIssueWriter .Assignees}}
{{svg "octicon-gear" 16}}
{{end}}
</span>
<div class="filter menu" data-id="#assignee_ids">
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignees"}}</div>
Expand All @@ -129,28 +135,6 @@
</a>
{{end}}
</div>

<!-- input id="assignee_ids" name="assignee_ids" type="hidden" value="{{.assignee_id}}">
<div class="ui {{if not .Assignees}}disabled{{end}} floating jump select-assignee dropdown">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.assignees"}}</strong>
<span class="octicon octicon-gear"></span>
</span>
<div class="filter menu">
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_assignees"}}</div>
{{range .Assignees}}
<div class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?assignee={{.ID}}" data-avatar="{{.RelAvatarLink}}"><img src="{{.RelAvatarLink}}"> {{.Name}}</div>
{{end}}
</div>
</div>
<div class="ui select-assignee list">
<span class="no-select item {{if .Assignee}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_assignees"}}</span>
<div class="selected">
{{if .Assignee}}
<a class="item" href="{{.RepoLink}}/issues?assignee={{.Assignee.ID}}"><img class="ui avatar image" src="{{.Assignee.RelAvatarLink}}"> {{.Assignee.Name}}</a>
{{end}}
</div>
</div>-->
Comment on lines -132 to -153
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I don't think these comments are usefull, so I suggest to remove them, If it have some special reason that should be kept. please tell me, I will recover them. thanks

</div>
</div>
</form>
Expand Down