[FIXED JENKINS-24181] Status icon not showing in the project view when "it" is not a BallColor

This commit is contained in:
tfennelly committed 2014-08-08 19:44:00 +01:00
1 parent 617e55222a
commit 6f87e61ebe
1 file changed
+33 -2
@@ -34,8 +34,39 @@ THE SOFTWARE.
</st:documentation>
<td data="${it.ordinal()}">
<j:if test="${attrs.it!=null}">
<l:icon class="${it.iconClassName} ${iconSizeClass}" alt="${it.description}"
tooltip="${it.description}" style="${attrs.style}" />
<j:set var="iconClassName" value="${it.iconClassName}"/>
<j:if test="${iconClassName == null}">
<j:set var="iconClassName" value="${icons.toNormalizedIconNameClass(it.image)}"/>
</j:if>
<j:choose>
<j:when test="${iconClassName != null}">
<l:icon class="${iconClassName} ${iconSizeClass}" alt="${it.description}"
tooltip="${it.description}" style="${attrs.style}" />
</j:when>
<j:otherwise>
<!-- "it" is not a hudson.model.BallColor. Let's try figure out the icon from its URL. -->
<j:set var="iconUrl" value="${it.getImageOf(iconSize)}"/>
<j:if test="${iconUrl.startsWith(imagesURL)}">
<!-- Normalize the icon URL -->
<j:set var="iconUrl" value="${iconUrl.substring(imagesURL.length() + 1)}"/>
</j:if>
<!-- See if we can get an Icon def from the URL -->
<j:set var="icon" value="${icons.getIconByUrl(iconUrl)}"/>
<j:choose>
<j:when test="${icon != null}">
<!-- We found the Icon def -->
<l:icon class="${icon.classSpec}" alt="${it.description}" tooltip="${it.description}" style="${attrs.style}" />
</j:when>
<j:otherwise>
<!-- We don't seem to have this icon in the IconSet... fallback again... -->
<j:set var="iconUrl" value="${it.getImageOf(iconSize)}"/>
<l:icon src="${iconUrl}" alt="${it.description}" tooltip="${it.description}" style="${attrs.style}" />
</j:otherwise>
</j:choose>
</j:otherwise>
</j:choose>
</j:if>
</td>
</j:jelly>