1 $(document).ready(function() {
2 $('a.home-tab').click(function() {
3 $('ul.nav-tabs li').removeClass('active');
4 $(this).parent().addClass('active');
5 $('div.home-panel').hide();
6 $('div#'+$(this).data('panel')).show();
8 var url = window.location;
11 tab = url.href.split("#")[1];
12 tab_exists = $('div#'+tab).length;
14 $('ul.nav-tabs li').removeClass('active');
15 $('li#'+tab+'-tab').addClass('active');
16 $('div.home-panel').hide();
21 /* TODO: factorize into functions */
22 $('button#deleteusers').click(function() {
23 $('input:checkbox.user').each(function (index) {
25 var record_id = this.id;
26 $.post("/delete/user/",{'filters':{'user_hrn':this.id}}, function(data) {
28 $('tr[id="'+record_id+'"]').fadeOut("slow");
29 $('tr[id="'+record_id+'"]').remove();
31 alert("Rest Error for "+record_id+": "+data.error);
38 $('button#deleteslices').click(function() {
39 $('input:checkbox.slice').each(function (index) {
41 var record_id = this.id;
42 $.post("/delete/slice/",{'filters':{'slice_hrn':this.id}}, function(data) {
44 $('tr[id="'+record_id+'"]').fadeOut("slow");
45 $('tr[id="'+record_id+'"]').remove();
47 alert("Rest Error for "+record_id+": "+data.error);
55 $('button#createslice').click(function() {
56 window.location="/portal/slice_request/";
58 $('button#slicerequestbtn').click(function() {
60 window.location="/portal/slice_request/";