Skip to content

Commit

Permalink
Implemented different display modes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ialbors-pfc committed Jun 24, 2014
1 parent 1e6b966 commit c59b7ff
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Expand Up @@ -83,5 +83,11 @@ public String getWidgetId() {
public boolean showWidget() {
return true;
}

public int getDisplayMode() {
DescriptorImpl d =
(DescriptorImpl)(Hudson.getInstance().getDescriptorOrDie(NextBuilds.class));
return d.getDisplayMode();
}

}
@@ -1,9 +1,29 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<j:if test="${it.showWidget()}">
<style>
<j:if test="${it.displayMode==1}">
#${it.widgetId}.pane {
table-layout: fixed;
}
#${it.widgetId} td {
text-overflow: ellipsis;
overflow: hidden;
}
</j:if>
<j:if test="${it.displayMode==2}">
#${it.widgetId}.pane {
table-layout: fixed;
}
#${it.widgetId} td {
word-wrap: break-word;
white-space: normal;
}
</j:if>
</style>
<l:pane width="2" title="${it.widgetName}" id="${it.widgetId}">
<j:forEach var="w" items="${it.builds}">
<tr>
<td><a tooltip="${w.name}" href="${w.url}">${w.shortName}</a></td>
<td><a tooltip="${w.name}" href="${w.url}">${w.name}</a></td>
<td tooltip="${w.timeToGo}">${w.date}</td>
</tr>
</j:forEach>
Expand Down

0 comments on commit c59b7ff

Please sign in to comment.