提交 21c30499 编写于 作者: K kohsuke

generalized the lock icon by using the badge extension.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5530 71c3de6d-444a-0410-be80-ed276b4c234a
上级 05c4ad7e
......@@ -204,6 +204,11 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
r.add((BuildBadgeAction)a);
}
}
if(isKeepLog()) {
if(r==null)
r = new ArrayList<BuildBadgeAction>();
r.add(new KeepLogBuildBadge());
}
if(r==null) return Collections.emptyList();
else return r;
}
......@@ -925,4 +930,14 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
return entry.getTimestamp();
}
};
/**
* {@link BuildBadgeAction} that shows the logs are being kept.
*/
public final class KeepLogBuildBadge implements BuildBadgeAction {
public String getIconFileName() { return null; }
public String getDisplayName() { return null; }
public String getUrlName() { return null; }
public String getWhyKeepLog() { return Run.this.getWhyKeepLog(); }
}
}
<img width="16" height="16"
title="${it.whyKeepLog}"
src="${imagesURL}/16x16/lock.gif"/>
......@@ -12,11 +12,12 @@
<a class="tip" href="${link}">
<i:formatDate value="${build.timestamp.time}" type="both" dateStyle="medium" timeStyle="medium"/>
</a>
<j:if test="${build.keepLog}">
<j:set var="badges" value="${build.badgeActions}"/>
<j:if test="${!empty(badges)}">
<st:nbsp/>
<img width="16" height="16"
title="${build.whyKeepLog}"
src="${imagesURL}/16x16/lock.gif"/>
<j:forEach var="badge" items="${badges}">
<st:include it="${badge}" page="badge.jelly" />
</j:forEach>
</j:if>
</td>
</tr>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册