forked from jenkinsci/jenkins
-
Notifications
You must be signed in to change notification settings - Fork 1
/
projectView.jelly
130 lines (118 loc) · 5.79 KB
/
projectView.jelly
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!--
The MIT License
Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Stephen Connolly, id:cactusman, Martin Eigenbrodt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout"
xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<st:documentation>
Renders a list of jobs and their key information.
<st:attribute name="jobs" use="required" trim="Collection">
Items to show.
</st:attribute>
<st:attribute name="useFullName" use="optional" type="boolean">
May be interpreted by columns to display the full name of a job.
</st:attribute>
<st:attribute name="jobBaseUrl" type="String">
Deprecated. Using this attribute has no effect.
</st:attribute>
<st:attribute name="showViewTabs" use="optional" type="boolean">
If the caller rendered a view tabes, set this attribute so that CSS is adjusted accordingly.
</st:attribute>
<st:attribute name="views" type="Collection<View>">
If non-null, render nested views.
</st:attribute>
<st:attribute name="indenter" type="hudson.Indenter">
Optional Indenter instance used to indent items.
</st:attribute>
<st:attribute name="columnExtensions" type="Collection<hudson.views.ListViewColumn>">
List view columns to render. If omitted, the default ones from ListView.getDefaultColumns() are used.
</st:attribute>
<st:attribute name="itemGroup" use="optional" type="hudson.model.ItemGroup">
The containing group, for purposes of name calculation.
</st:attribute>
</st:documentation>
<t:setIconSize/>
<div class="dashboard">
<j:if test="${columnExtensions==null}">
<j:invokeStatic var="columnExtensions" className="hudson.model.ListView" method="getDefaultColumns"/>
</j:if>
<j:if test="${!empty(jobs) or !empty(attrs.views)}">
<!-- the caller can inject a tab bar here -->
<div id="projectstatus-tabBar">
<d:invokeBody/>
</div>
<div class="jenkins-mobile-hide">
<table id="projectstatus" class="jenkins-table ${iconSize == '16x16' ? 'jenkins-table--small' : iconSize == '24x24' ? 'jenkins-table--medium' : ''} sortable">
<thead>
<tr>
<j:forEach var="col" items="${columnExtensions}">
<j:if test="${col.class.simpleName.equals('BuildButtonColumn')}">
<j:set var="buildButtonColumn" value="${col}" />
</j:if>
<st:include page="columnHeader.jelly" it="${col}" />
</j:forEach>
</tr>
</thead>
<j:forEach var="job" items="${jobs}">
<j:set var="relativeLinkToJob" value="${h.getRelativeLinkTo(job)}"/>
<t:projectViewRow jobBaseUrl="${relativeLinkToJob.substring(0, relativeLinkToJob.length() - job.shortUrl.length())}"/>
</j:forEach>
</table>
<t:iconSize><t:rssBar/></t:iconSize>
</div>
<div class="jenkins-jobs-list jenkins-mobile-show">
<j:forEach var="job" items="${jobs}">
<j:set var="relativeLinkToJob" value="${h.getRelativeLinkTo(job)}"/>
<div class="jenkins-jobs-list__item">
<a class="jenkins-jobs-list__item__details" href="${jobBaseUrl}${job.shortUrl}">
<div class="jenkins-jobs-list__item__icons">
<j:choose>
<j:when test="${job.iconColor.iconName != null}">
<l:icon src="symbol-status-${job.iconColor.iconName}" tooltip="${job.iconColor.description}" />
</j:when>
<j:otherwise>
<!-- This is for special conditions, such as folders -->
<l:icon src="${job.iconColor.iconClassName}" />
</j:otherwise>
</j:choose>
</div>
<div class="jenkins-jobs-list__item__details__text">
<p class="jenkins-jobs-list__item__label">${job.displayName}</p>
<div class="jenkins-jobs-list__item__description">
<j:set var="lastBuild" value="${job.lastBuild}"/>
<j:if test="${lastBuild != null}">
<span>
${%Description(lastBuild.timestampString, lastBuild.durationString)}
</span>
</j:if>
<j:forEach var="col" items="${columnExtensions}">
<st:include page="compactColumn.jelly" it="${col}" optional="true" />
</j:forEach>
</div>
</div>
</a>
<div class="jenkins-jobs-list__item__actions">
<st:include page="column.jelly" it="${buildButtonColumn}" optional="true" />
</div>
</div>
</j:forEach>
</div>
</j:if>
</div>
</j:jelly>