Skip to content

Commit

Permalink
[JENKINS-21230] Broken HTML code on results page
Browse files Browse the repository at this point in the history
- Element <tfoot> should not be inside <tbody>, optional <thead> is missing.
- <tfoot> moved from <tbody> directly to <table>.
- <thead> element added.
- Total number of lines in the footer extended by total number of files and total number of folders.
- Total number of languages can't be added because sorting using this column would stop working. String sorting is probably incorrectly changed to numeric sorting in such case.
  • Loading branch information
mixalturek committed Jan 5, 2014
1 parent 22fe900 commit 710599c
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 42 deletions.
Expand Up @@ -83,6 +83,10 @@ public int getFolderCount(){
return this.folders.size();
}

public String getFolderCountString(){
return StringUtil.grouping(this.folders.size());
}

public Language getLanguage(String name){
return this.languages.get(name);
}
Expand Down
Expand Up @@ -3,12 +3,14 @@
xmlns:i="jelly:fmt" xmlns:local="local">
<st:header name="Content-Type" value="text/html;charset=UTF-8" />
<table class="pane sortable" id="files">
<tr>
<td class="pane-header">${%File}</td>
<td class="pane-header" style="width:2em">${%Language}</td>
<td class="pane-header" style="width:2em">${%Lines}</td>
<td class="pane-header" style="width:60%">${%Distribution}</td>
</tr>
<thead>
<tr>
<td class="pane-header">${%File}</td>
<td class="pane-header" style="width:2em">${%Language}</td>
<td class="pane-header" style="width:2em">${%Lines}</td>
<td class="pane-header" style="width:60%">${%Distribution}</td>
</tr>
</thead>
<tbody>
<j:set var="cachedReport" value="${it.report}"/>
<j:set var="max" value="${cachedReport.longestFile.lineCount}"/>
Expand All @@ -20,15 +22,15 @@
<td class="pane"><st:include page="/tabview/distribution-graph.jelly" /></td>
</tr>
</j:forEach>
<tfoot>
<tr class="sortbottom">
<td class="pane-header">${%Total}</td>
<td class="pane-header"> </td>
<td class="pane-header number" data="${cachedReport.lineCount}">${cachedReport.lineCountString}</td>
<td class="pane-header"> </td>
</tr>
</tfoot>
</tbody>
<tfoot>
<tr class="sortbottom">
<td class="pane-header">${%Total} ${cachedReport.fileCountString}</td>
<td class="pane-header"> </td>
<td class="pane-header number" data="${cachedReport.lineCount}">${cachedReport.lineCountString}</td>
<td class="pane-header"> </td>
</tr>
</tfoot>
</table>

<script type="text/javascript">
Expand Down
Expand Up @@ -3,12 +3,14 @@
xmlns:i="jelly:fmt" xmlns:local="local">
<st:header name="Content-Type" value="text/html;charset=UTF-8" />
<table class="pane sortable" id="files">
<tr>
<td class="pane-header">${%Folder}</td>
<td class="pane-header" style="width:2em">${%Files}</td>
<td class="pane-header" style="width:2em">${%Lines}</td>
<td class="pane-header" style="width:60%">${%Distribution}</td>
</tr>
<thead>
<tr>
<td class="pane-header">${%Folder}</td>
<td class="pane-header" style="width:2em">${%Files}</td>
<td class="pane-header" style="width:2em">${%Lines}</td>
<td class="pane-header" style="width:60%">${%Distribution}</td>
</tr>
</thead>
<tbody>
<j:set var="cachedReport" value="${it.report}"/>
<j:set var="max" value="${cachedReport.longestFolder.lineCount}"/>
Expand All @@ -20,15 +22,15 @@
<td class="pane"><st:include page="/tabview/distribution-graph.jelly" /></td>
</tr>
</j:forEach>
<tfoot>
<tr class="sortbottom">
<td class="pane-header">${%Total}</td>
<td class="pane-header"> </td>
<td class="pane-header number" data="${cachedReport.lineCount}">${cachedReport.lineCountString}</td>
<td class="pane-header"> </td>
</tr>
</tfoot>
</tbody>
<tfoot>
<tr class="sortbottom">
<td class="pane-header">${%Total} ${cachedReport.folderCountString}</td>
<td class="pane-header number" data="${cachedReport.fileCount}">${cachedReport.fileCountString}</td>
<td class="pane-header number" data="${cachedReport.lineCount}">${cachedReport.lineCountString}</td>
<td class="pane-header"> </td>
</tr>
</tfoot>
</table>

<script type="text/javascript">
Expand Down
Expand Up @@ -3,12 +3,14 @@
xmlns:i="jelly:fmt" xmlns:local="local">
<st:header name="Content-Type" value="text/html;charset=UTF-8" />
<table class="pane sortable" id="files">
<tr>
<td class="pane-header">${%Language}</td>
<td class="pane-header" style="width:2em">${%Files}</td>
<td class="pane-header" style="width:2em">${%Lines}</td>
<td class="pane-header" style="width:60%">${%Distribution}</td>
</tr>
<thead>
<tr>
<td class="pane-header">${%Language}</td>
<td class="pane-header" style="width:2em">${%Files}</td>
<td class="pane-header" style="width:2em">${%Lines}</td>
<td class="pane-header" style="width:60%">${%Distribution}</td>
</tr>
</thead>
<tbody>
<j:set var="cachedReport" value="${it.report}"/>
<j:set var="max" value="${cachedReport.longestLanguage.lineCount}"/>
Expand All @@ -20,15 +22,15 @@
<td class="pane"><st:include page="/tabview/distribution-graph.jelly" /></td>
</tr>
</j:forEach>
<tfoot>
<tr class="sortbottom">
<td class="pane-header">${%Total}</td>
<td class="pane-header"> </td>
<td class="pane-header number" data="${cachedReport.lineCount}">${cachedReport.lineCountString}</td>
<td class="pane-header"> </td>
</tr>
</tfoot>
</tbody>
<tfoot>
<tr class="sortbottom">
<td class="pane-header">${%Total} ${cachedReport.languageCountString}</td>
<td class="pane-header number" data="${cachedReport.fileCount}">${cachedReport.fileCountString}</td>
<td class="pane-header number" data="${cachedReport.lineCount}">${cachedReport.lineCountString}</td>
<td class="pane-header"> </td>
</tr>
</tfoot>
</table>

<script type="text/javascript">
Expand Down

0 comments on commit 710599c

Please sign in to comment.