Skip to content

Commit

Permalink
WINDUP-758: Sorting the entries in the Migration Issue Report
Browse files Browse the repository at this point in the history
  • Loading branch information
Matej Briskar committed Sep 10, 2015
1 parent 7ce15e6 commit 06e0e79
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
Expand Up @@ -7,6 +7,13 @@ body {
margin:10px;
}

.tablesorter thead tr th {
cursor:pointer;
background-position: left center;
padding-left: 20px;
background: url(../img/styles/table-sort-bg.gif) no-repeat 0%;
}

.btn-xxs {
padding: 2px 8px;
margin: 0 3px 0 0;
Expand Down Expand Up @@ -151,4 +158,4 @@ p.windup-contributors {
.tattletale-nav-logo {
background: url(../img/styles/tattletale-small-white-icon.png);
}
/** /Navigation **/
/** /Navigation **/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -51,10 +51,9 @@
<div class="panel-heading">
<h3 class="panel-title">Potential Issues</h3>
</div>
<table class="table table-hover table-condensed">
<table id="issues_table" class="table table-hover table-condensed tablesorter">
<thead>
<tr>
<th></th>
<th>Issue</th>
<th>Incidents Found</th>
<th>Effort per Incident</th>
Expand All @@ -65,7 +64,6 @@
<tbody>
<#list getProblemSummaries() as problemSummary>
<tr>
<th class="row">${problemSummary?counter}</th>
<td>
<a href="#" class="problem-link">
${problemSummary.issueName}
Expand All @@ -92,6 +90,7 @@

<script src="resources/js/jquery-1.10.1.min.js"></script>
<script src="resources/js/bootstrap.min.js"></script>
<script src="resources/js/jquery.tablesorter.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.problem-link').each(function(index, value) {
Expand All @@ -101,6 +100,28 @@
});
});
});
// we need this parser because we are using comma to separate thousands
$.tablesorter.addParser({
id: 'thousands',
is: function(s) {
return true;
},
format: function(s) {
return s.replace('$','').replace(/,/g,'');
},
type: 'numeric'
});
$(document).ready(function() {
$("#issues_table").tablesorter({
sortList: [[3,1]],
headers: {
// 3rd,4th,5th columns are parsed using thousands parser
2: {sorter:'thousands'},
3: {sorter:'thousands'},
4: {sorter:'thousands'}
}
});
});
</script>
</body>
</html>

0 comments on commit 06e0e79

Please sign in to comment.