-
Notifications
You must be signed in to change notification settings - Fork 175
/
jobMain.groovy
44 lines (39 loc) · 1.57 KB
/
jobMain.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package hudson.plugins.parameterizedtrigger.SubProjectsAction
import hudson.Functions
import static hudson.plugins.parameterizedtrigger.ParameterizedTriggerUtils.DISABLE_ACTION_VIEWS_KEY
if (System.getProperty(DISABLE_ACTION_VIEWS_KEY) != null) {
return
}
def j=namespace(lib.JenkinsTagLib)
def actions = my.subProjectActions
if (!actions.empty) {
h2(_("Subprojects"))
my.subProjectActions.each { action ->
ul(style:"list-style-type: none;") {
action.configs.each { config ->
def projectInfo = config.getProjectInfo(my.project)
[projectInfo.fixed, projectInfo.dynamic, projectInfo.triggered].eachWithIndex { projectSet, i ->
if (!projectSet.empty) {
h3(_(["Static","Dynamic","Other executed recently"][i]))
projectSet.each { project ->
if (Functions.hasPermission(project, project.READ)) {
li {
j.jobLink(job:project)
text(_("(${config.block == null ? 'non-blocking' : 'blocking'})"))
}
}
}
}
}
if (!projectInfo.unresolved.empty) {
h3(_("Unresolved"))
projectInfo.unresolved.each { project ->
li {
text(project)
}
}
}
}
}
}
}