Skip to content

Commit

Permalink
Fix JENKINS-22933
Browse files Browse the repository at this point in the history
Fixed logic that loads the templates for saved jobs.
  • Loading branch information
slide committed Nov 16, 2014
1 parent adc5aa9 commit 292b9a0
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ t = namespace("/lib/hudson")
f = namespace("/lib/form") f = namespace("/lib/form")
d = namespace("jelly:define") d = namespace("jelly:define")



def configured = instance != null def configured = instance != null


f.entry(title: _("Templates"), description: _("The templates to use for sending emails")) { f.entry(title: _("Templates"), description: _("The templates to use for sending emails")) {
f.repeatable(var: "template", noAddButton: true, minimum:1, name:"templateIds") { f.repeatable(items: instance?.templateIds, var: "template", noAddButton: true, minimum:1, name:"templateIds") {
table(width: "100%") { table(width: "100%") {
f.entry { f.entry {
select(name:"templateId") { select(name:"templateId") {
descriptor.templates.each { aTemplate -> descriptor.templates.each { aTemplate ->
if(template != null && template.templateId==aTemplate.id) { f.option(value: aTemplate.id, selected: (template != null && template.templateId==aTemplate.id), "${aTemplate.name} - ${aTemplate.description}")
option(value: aTemplate.id, selected: "selected", "${aTemplate.name} - ${aTemplate.description}")
} else {
option(value: aTemplate.id, "${aTemplate.name} - ${aTemplate.description}")
}
} }
} }
} }
Expand Down

0 comments on commit 292b9a0

Please sign in to comment.