Commit 46c84953 authored by Leigh Stoller's avatar Leigh Stoller

Add fancy table sorting.

parent 814588f7
......@@ -102,7 +102,7 @@ $(function ()
$('#nodehistory-table-div').removeClass("hidden");
$('#nodehistory-table-div').html(html);
$('#main-body .control-buttons').removeClass("hidden");
// Format dates with moment before display.
$('.format-date').each(function() {
var date = $.trim($(this).html());
......@@ -116,6 +116,11 @@ $(function ()
placement: 'auto',
html: true,
});
$('#history-table')
.tablesorter({
theme : 'green',
});
}
// Change mode (checkboxes).
......
......@@ -54,6 +54,9 @@ echo "<div class=row>
<div id='main-body'></div>
</div>\n";
echo "<link rel='stylesheet'
href='css/tablesorter.css'>\n";
echo "<script type='text/javascript'>\n";
if (isset($node_id)) {
echo " window.TARGET = '$node_id';\n";
......@@ -67,7 +70,12 @@ echo "</script>\n";
REQUIRE_UNDERSCORE();
REQUIRE_SUP();
REQUIRE_MOMENT();
SPITREQUIRE("js/show-nodehistory.js");
SPITREQUIRE("js/show-nodehistory.js",
"<script src='js/lib/jquery.tablesorter.min.js'></script>".
"<script src='js/lib/jquery.tablesorter.widgets.min.js'></script>".
"<script src='js/lib/sugar.min.js'></script>".
"<script src='js/lib/jquery.tablesorter.parser-date.js'></script>");
AddTemplateList(array("show-nodehistory", "nodehistory-list",
"oops-modal", "waitwait-modal"));
SPITFOOTER();
......
<table id="history-table"
class='table table-condensed table-bordered table-striped'>
class='tablesorter'>
<thead>
<% if (shownodeid) { %>
<th>Node ID</th>
<% } %>
<th>PID</th>
<th>EID</th>
<th><img src="images/slice.png"></th>
<th class="sorter-false"><img src="images/slice.png"></th>
<th>User</th>
<th>Allocated</th>
<th>Released</th>
<th>Duration</th>
<th class="sorter-false">Duration</th>
</thead>
<tbody>
<% _.each(history, function (entry) { %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment