@@ -53,7 +53,7 @@ func setTemplateIfExists(ctx *context.Context, ctxDataKey string, possibleFiles
53
53
if ok , _ := commit .HasFile (filename ); ! ok {
54
54
continue
55
55
}
56
- template , err := issue_template .UnmarshalFromCommit (commit , filename )
56
+ template , err := issue_template .UnmarshalFromCommit (ctx , commit , filename )
57
57
if err != nil {
58
58
templateErrs [filename ] = err
59
59
continue
@@ -98,7 +98,7 @@ func setTemplateIfExists(ctx *context.Context, ctxDataKey string, possibleFiles
98
98
// NewIssue render creating issue page
99
99
func NewIssue (ctx * context.Context ) {
100
100
issueConfig , _ := issue_service .GetTemplateConfigFromDefaultBranch (ctx .Repo .Repository , ctx .Repo .GitRepo )
101
- hasTemplates := issue_service .HasTemplatesOrContactLinks (ctx .Repo .Repository , ctx .Repo .GitRepo )
101
+ hasTemplates := issue_service .HasTemplatesOrContactLinks (ctx , ctx .Repo .Repository , ctx .Repo .GitRepo )
102
102
103
103
ctx .Data ["Title" ] = ctx .Tr ("repo.issues.new" )
104
104
ctx .Data ["PageIsIssueList" ] = true
@@ -134,7 +134,7 @@ func NewIssue(ctx *context.Context) {
134
134
}
135
135
ctx .Data ["Tags" ] = tags
136
136
137
- ret := issue_service .ParseTemplatesFromDefaultBranch (ctx .Repo .Repository , ctx .Repo .GitRepo )
137
+ ret := issue_service .ParseTemplatesFromDefaultBranch (ctx , ctx .Repo .Repository , ctx .Repo .GitRepo )
138
138
templateLoaded , errs := setTemplateIfExists (ctx , issueTemplateKey , IssueTemplateCandidates , pageMetaData )
139
139
for k , v := range errs {
140
140
ret .TemplateErrors [k ] = v
@@ -187,14 +187,14 @@ func NewIssueChooseTemplate(ctx *context.Context) {
187
187
ctx .Data ["Title" ] = ctx .Tr ("repo.issues.new" )
188
188
ctx .Data ["PageIsIssueList" ] = true
189
189
190
- ret := issue_service .ParseTemplatesFromDefaultBranch (ctx .Repo .Repository , ctx .Repo .GitRepo )
190
+ ret := issue_service .ParseTemplatesFromDefaultBranch (ctx , ctx .Repo .Repository , ctx .Repo .GitRepo )
191
191
ctx .Data ["IssueTemplates" ] = ret .IssueTemplates
192
192
193
193
if len (ret .TemplateErrors ) > 0 {
194
194
ctx .Flash .Warning (renderErrorOfTemplates (ctx , ret .TemplateErrors ), true )
195
195
}
196
196
197
- if ! issue_service .HasTemplatesOrContactLinks (ctx .Repo .Repository , ctx .Repo .GitRepo ) {
197
+ if ! issue_service .HasTemplatesOrContactLinks (ctx , ctx .Repo .Repository , ctx .Repo .GitRepo ) {
198
198
// The "issues/new" and "issues/new/choose" share the same query parameters "project" and "milestone", if no template here, just redirect to the "issues/new" page with these parameters.
199
199
ctx .Redirect (fmt .Sprintf ("%s/issues/new?%s" , ctx .Repo .Repository .Link (), ctx .Req .URL .RawQuery ), http .StatusSeeOther )
200
200
return
@@ -329,7 +329,7 @@ func NewIssuePost(ctx *context.Context) {
329
329
form := web .GetForm (ctx ).(* forms.CreateIssueForm )
330
330
ctx .Data ["Title" ] = ctx .Tr ("repo.issues.new" )
331
331
ctx .Data ["PageIsIssueList" ] = true
332
- ctx .Data ["NewIssueChooseTemplate" ] = issue_service .HasTemplatesOrContactLinks (ctx .Repo .Repository , ctx .Repo .GitRepo )
332
+ ctx .Data ["NewIssueChooseTemplate" ] = issue_service .HasTemplatesOrContactLinks (ctx , ctx .Repo .Repository , ctx .Repo .GitRepo )
333
333
ctx .Data ["PullRequestWorkInProgressPrefixes" ] = setting .Repository .PullRequest .WorkInProgressPrefixes
334
334
ctx .Data ["IsAttachmentEnabled" ] = setting .Attachment .Enabled
335
335
upload .AddUploadContext (ctx , "comment" )
@@ -370,7 +370,7 @@ func NewIssuePost(ctx *context.Context) {
370
370
371
371
content := form .Content
372
372
if filename := ctx .Req .Form .Get ("template-file" ); filename != "" {
373
- if template , err := issue_template .UnmarshalFromRepo (ctx .Repo .GitRepo , ctx .Repo .Repository .DefaultBranch , filename ); err == nil {
373
+ if template , err := issue_template .UnmarshalFromRepo (ctx , ctx .Repo .GitRepo , ctx .Repo .Repository .DefaultBranch , filename ); err == nil {
374
374
content = issue_template .RenderToMarkdown (template , ctx .Req .Form )
375
375
}
376
376
}
0 commit comments