Add summary view to the /activity report.

When you load the activity report, it will just show summary
counts for realms, but if you click on a realm, you will see
details about users in the realms.  You can also click "Show all"
to see an interleaved view of realms and users.

(imported from commit b106557b1fae64d525071afc124b5a8aed319086)
This commit is contained in:
Steve Howell
2013-09-24 17:11:56 -04:00
parent b1ef9a686c
commit 4d5842cdcd
4 changed files with 60 additions and 4 deletions

View File

@@ -0,0 +1,45 @@
$(function () {
function show_realms_only() {
$(".table").each(function () {
var table = $(this);
table.find('tbody tr[data-type="user"]').hide();
table.find('tbody tr[data-type="realm"]').show();
});
}
function filter_to_realm(realm) {
$(".table").each(function () {
var table = $(this);
table.find("tbody tr").hide();
var rows = table.find('tbody tr[data-realm="'+realm+'"]');
rows.show();
});
}
function set_up_realm_links() {
$("a.realm").on("click", function () {
var realm = $(this).attr("data-realm");
filter_to_realm(realm);
});
}
function set_up_summary_link() {
$("a.show-summary").on("click", function () {
show_realms_only();
});
}
function set_up_show_all_link() {
$("a.show-all").on("click", function () {
$(".table tbody tr").show();
});
}
show_realms_only();
set_up_realm_links();
set_up_summary_link();
set_up_show_all_link();
});