Commit bfecb687 authored by Leigh Stoller's avatar Leigh Stoller

Add tooltips and match counts.

parent 7bb7b252
...@@ -17,6 +17,11 @@ $(function () ...@@ -17,6 +17,11 @@ $(function ()
"projects" : projlist, "projects" : projlist,
}); });
$('#main-body').html(html); $('#main-body').html(html);
// This activates the tooltip subsystem.
$('[data-toggle="tooltip"]').tooltip({
delay: {"hide" : 500, "show" : 150},
placement: 'auto',
});
InitTable("users"); InitTable("users");
InitTable("projects"); InitTable("projects");
...@@ -27,6 +32,7 @@ $(function () ...@@ -27,6 +32,7 @@ $(function ()
// initialize zebra // initialize zebra
widgets: ["zebra"], widgets: ["zebra"],
}); });
$('#search_projects_table') $('#search_projects_table')
.tablesorter({ .tablesorter({
theme : 'green', theme : 'green',
...@@ -108,6 +114,11 @@ $(function () ...@@ -108,6 +114,11 @@ $(function ()
// Allows using filter_liveSearch or delayed search & // Allows using filter_liveSearch or delayed search &
// pressing escape to cancel the search // pressing escape to cancel the search
$.tablesorter.filter.bindSearch(table, $(searchname)); $.tablesorter.filter.bindSearch(table, $(searchname));
// Update the count of matches
table.bind('filterEnd', function(e, filter) {
$('#' + name + ' .match-count').text(filter.filteredRows);
});
} }
function UpdateUserSearch(text) function UpdateUserSearch(text)
...@@ -131,6 +142,7 @@ $(function () ...@@ -131,6 +142,7 @@ $(function ()
} }
$('#search_users_table tbody').html(html); $('#search_users_table tbody').html(html);
$('#search_users_table').trigger("update", [false]); $('#search_users_table').trigger("update", [false]);
$('#search-users .match-count').text(json.value.length);
}; };
var xmlthing = sup.CallServerMethod(null, var xmlthing = sup.CallServerMethod(null,
"lists", "SearchUsers", "lists", "SearchUsers",
...@@ -160,6 +172,7 @@ $(function () ...@@ -160,6 +172,7 @@ $(function ()
} }
$('#search_projects_table tbody').html(html); $('#search_projects_table tbody').html(html);
$('#search_projects_table').trigger("update", [false]); $('#search_projects_table').trigger("update", [false]);
$('#search-projects .match-count').text(json.value.length);
}; };
var xmlthing = sup.CallServerMethod(null, var xmlthing = sup.CallServerMethod(null,
"lists", "SearchProjects", "lists", "SearchProjects",
......
...@@ -25,8 +25,20 @@ ...@@ -25,8 +25,20 @@
<div class="tab-content"> <div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="users"> <div role="tabpanel" class="tab-pane active" id="users">
<div class="table-responsive"> <div class="table-responsive">
<input class='form-control search' type='search' data-column='all' <input class='form-control search' type='search'
data-column='all'
id='users_search' placeholder='Search'> id='users_search' placeholder='Search'>
<div class="text-center">
<small>
There are <span class="match-count"></span> matching users.
<span class='glyphicon glyphicon-question-sign'
data-toggle='tooltip'
data-container="body"
data-trigger="hover"
title='Active users are either logged in or have
an experiment running'></span>
</small>
</div>
<table class='tablesorter' id='users_table'> <table class='tablesorter' id='users_table'>
<thead> <thead>
<tr> <tr>
...@@ -54,6 +66,19 @@ ...@@ -54,6 +66,19 @@
<div class="table-responsive"> <div class="table-responsive">
<input class='form-control search' type='search' data-column='all' <input class='form-control search' type='search' data-column='all'
id='projects_search' placeholder='Search'> id='projects_search' placeholder='Search'>
<div class="text-center">
<small>
There are <span class="match-count"></span>
matching projects.
<span class='glyphicon glyphicon-question-sign'
data-toggle='tooltip'
data-container="body"
data-trigger="hover"
title='Active projects are currently running an
an experiment, or have in the last
two months'></span>
</small>
</div>
<table class='tablesorter' id='projects_table'> <table class='tablesorter' id='projects_table'>
<thead> <thead>
<tr> <tr>
...@@ -84,6 +109,11 @@ ...@@ -84,6 +109,11 @@
<div class="table-responsive"> <div class="table-responsive">
<input class='form-control search' type='search' <input class='form-control search' type='search'
id='search_users_search' placeholder='Search'> id='search_users_search' placeholder='Search'>
<div class="text-center">
<small>
There are <span class="match-count">0</span> matching users.
</small>
</div>
<table class='tablesorter' <table class='tablesorter'
id='search_users_table'> id='search_users_table'>
<thead> <thead>
...@@ -102,6 +132,12 @@ ...@@ -102,6 +132,12 @@
<div class="table-responsive"> <div class="table-responsive">
<input class='form-control search' type='search' <input class='form-control search' type='search'
id='search_projects_search' placeholder='Search'> id='search_projects_search' placeholder='Search'>
<div class="text-center">
<small>
There are <span class="match-count">0</span>
matching projects.
</small>
</div>
<table class='tablesorter' <table class='tablesorter'
id='search_projects_table'> id='search_projects_table'>
<thead> <thead>
......
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