mirror of
https://github.com/go-gitea/gitea
synced 2025-07-27 04:38:36 +00:00
@@ -637,8 +637,12 @@ func attachmentsHTML(ctx *context.Context, attachments []*repo_model.Attachment,
|
||||
return attachHTML
|
||||
}
|
||||
|
||||
// get all teams that current user can mention
|
||||
func handleTeamMentions(ctx *context.Context) {
|
||||
// handleMentionableAssigneesAndTeams gets all teams that current user can mention, and fills the assignee users to the context data
|
||||
func handleMentionableAssigneesAndTeams(ctx *context.Context, assignees []*user_model.User) {
|
||||
// TODO: need to figure out how many places this is really used, and rename it to "MentionableAssignees"
|
||||
// at the moment it is used on the issue list page, for the markdown editor mention
|
||||
ctx.Data["Assignees"] = assignees
|
||||
|
||||
if ctx.Doer == nil || !ctx.Repo.Owner.IsOrganization() {
|
||||
return
|
||||
}
|
||||
|
@@ -715,9 +715,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption opt
|
||||
ctx.ServerError("GetRepoAssignees", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["Assignees"] = shared_user.MakeSelfOnTop(ctx.Doer, assigneeUsers)
|
||||
|
||||
handleTeamMentions(ctx)
|
||||
handleMentionableAssigneesAndTeams(ctx, shared_user.MakeSelfOnTop(ctx.Doer, assigneeUsers))
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
@@ -148,7 +148,7 @@ func (d *IssuePageMetaData) retrieveAssigneesDataForIssueWriter(ctx *context.Con
|
||||
d.AssigneesData.SelectedAssigneeIDs = strings.Join(ids, ",")
|
||||
}
|
||||
// FIXME: this is a tricky part which writes ctx.Data["Mentionable*"]
|
||||
handleTeamMentions(ctx)
|
||||
handleMentionableAssigneesAndTeams(ctx, d.AssigneesData.CandidateAssignees)
|
||||
}
|
||||
|
||||
func (d *IssuePageMetaData) retrieveProjectsDataForIssueWriter(ctx *context.Context) {
|
||||
|
@@ -840,9 +840,7 @@ func viewPullFiles(ctx *context.Context, specifiedStartCommit, specifiedEndCommi
|
||||
ctx.ServerError("GetRepoAssignees", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["Assignees"] = shared_user.MakeSelfOnTop(ctx.Doer, assigneeUsers)
|
||||
|
||||
handleTeamMentions(ctx)
|
||||
handleMentionableAssigneesAndTeams(ctx, shared_user.MakeSelfOnTop(ctx.Doer, assigneeUsers))
|
||||
if ctx.Written() {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user