}
});
});
+ $('button#renewslices').click(function() {
+ var now = new Date();
+ /* In Javascript getMonth() gives month[0] = january, month[1] = february, and so on... */
+ var month = now.getMonth()+2;
+ var one_month_later = now.getFullYear()+"-"+month+"-"+now.getDate()+" "+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds();
+ console.log(one_month_later);
+ $('input:checkbox.slice').each(function (index) {
+ if(this.checked){
+ var record_id = this.id;
+ $.post("/update/slice/",{'filters':{'slice_hrn':this.id},'params':{'expires':one_month_later}}, function(data) {
+ if(data.success){
+ // TODO: highlight row after success
+ //$('tr[id="'+record_id+'"]').highlight();
+ }else{
+ alert("Rest Error for "+record_id+": "+data.error);
+ }
+ });
+
+ }
+ });
+ // TODO: refresh table
+ //window.location="/portal/institution#slices";
+ });
$('button#createslice').click(function() {
window.location="/portal/slice_request/";