Commit e3f13f68 authored by Leigh B Stoller's avatar Leigh B Stoller

UI tweaks; do not show empty tables, link to profile version when jus

one version in the list.
parent 928b0163
......@@ -75,6 +75,8 @@ $(function ()
});
var TableInit = function(tablename) {
$('#' + name + ' #' + tablename).removeClass("hidden");
var table =
$('#' + name + ' #' + tablename)
.tablesorter({
......@@ -164,9 +166,16 @@ $(function ()
return false;
});
};
TableInit('images-table-no-profiles');
TableInit('images-table-one-profile');
TableInit('images-table-multi-profile');
// Only init/show tables that have something in them.
if ($('#images-table-no-profiles tbody').children().length) {
TableInit('images-table-no-profiles');
}
if ($('#images-table-one-profile tbody').children().length) {
TableInit('images-table-one-profile');
}
if ($('#images-table-multi-profile tbody').children().length) {
TableInit('images-table-multi-profile');
}
// This activates the popover subsystem.
$('#' + name + ' [data-toggle="popover"]').popover({
......
......@@ -31,7 +31,7 @@
</h5>
</div>
<div class='panel-body panel-body-dashboard'>
<table class='tablesorter' id='images-table-no-profiles'>
<table class='tablesorter hidden' id='images-table-no-profiles'>
<caption>
<center>Images not used by any of your profiles
<a href='#' class='btn btn-xs'
......@@ -93,7 +93,7 @@
<% }); %>
</tbody>
</table>
<table class='tablesorter' id='images-table-one-profile'>
<table class='tablesorter hidden' id='images-table-one-profile'>
<caption>
<center>Images used by only a single profile
<a href='#' class='btn btn-xs'
......@@ -163,13 +163,21 @@
href="show-profile.php?uuid=<%- version.using[0].uuid %>">
<%- version.using[0].name %>
</a>
(<%- version.using[0].versions.length %> versions)
<% if (version.using[0].versions.length == 1) { %>
(Version
<a target="_blank"
href="show-profile.php?uuid=<%- version.using[0].versions[0].uuid %>">
<%- version.using[0].versions[0].version %>
</a>)
<% } else { %>
(<%- version.using[0].versions.length %> versions)
<% } %>
</tr>
<% }); %>
<% }); %>
</tbody>
</table>
<table class='tablesorter' id='images-table-multi-profile'>
<table class='tablesorter hidden' id='images-table-multi-profile'>
<caption>
<center>Images used by more then one profile
<a href='#' class='btn btn-xs'
......
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