--- /dev/null
+function createCookie(name,value,days) {
+ if (days) {
+ var date = new Date();
+ date.setTime(date.getTime()+(days*24*60*60*1000));
+ var expires = "; expires="+date.toGMTString();
+ }
+ else var expires = "";
+ document.cookie = name+"="+value+expires+"; path=/";
+}
+
+function readCookie(name) {
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+ for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+ }
+ return null;
+}
+
+function eraseCookie(name) {
+ createCookie(name,"",-1);
+}
\ No newline at end of file
<link rel="stylesheet" type="text/css" href="/static/css/smoothness/jquery-ui-1.8.13.custom.css">
<script type="text/javascript" src="/static/js/jquery-ui-1.8.12.custom.min.js"></script>
<script type="text/javascript" src="/static/js/jquery.tooltip.min.js"></script>
+<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript">
function setlang(lang){
$("#langform").submit();
}
-//function highlight(elemId){
-// var elem = $(elemId);
-// elem.css("background-color", "#ffffbb");
-// setTimeout(function() { $(elemId).animate({ backgroundColor: "white" }, 2000)}, 1500);
-//}
-//
-//
-//$(document).ready( function(){
-// if (document.location.hash) {
-// highlight(document.location.hash);
-// }
-// $('a[href*=#]').click(function(){
-// var elemId = '#' + $(this).attr('href').split('#')[1];
-// highlight(elemId);
-// });
-//});
-
</script>
{% block extrahead %}{% endblock %}
</head>
<script type="text/javascript" src="/static/js/jquery.dataTables.js"></script>
<script type="text/javascript">
$(document).ready( function(){
+ var noaction = readCookie('noaction');
+ if (noaction == 'true'){
+ $('#hide_noaction').attr('checked','checked');
+ }
$("#hid_mid").val('');
$('#dialog').dialog({
height: 220,
}
});
- $('#routes_table').dataTable( {
+ $('#routes_table').dataTable({
"bJQueryUI": true,
"aoColumns": [
{"bVisible": false, "bSearchable": false,"bSortable": false },
"sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> rules'
},
"iDisplayLength": 25,
- } );
+ });
+ $.fn.dataTableExt.afnFiltering = new Array();
+ $.fn.dataTableExt.afnFiltering.push(
+ function( oSettings, aData, iDataIndex ) {
+ // 4 here is the column where my statuses are.
+ var status_middle = $(aData[4]);
+ var status = $(status_middle[0]).text();
+ if (( status == "EXPIRED" || status == "ADMININACTIVE" || status == "ERROR") && ($('#hide_noaction').attr('checked'))) {
+ return false;
+ }
+ else {
+ return true;
+ }
+
+ });
+ var oTable = $('#routes_table').dataTable();
+ oTable.fnDraw();
+ $('#hide_noaction').change( function(){
+ var noaction = $('#hide_noaction').attr('checked');
+ createCookie("noaction", noaction, 30);
+ oTable.fnDraw();
+ });
+
$( ".button_place #routebutton" ).button({
icons: {
primary: "ui-icon-circle-plus"
<div class='button_place' style="float:right">
<button id="consolebutton">Console</button> <a href="{% url add-route %}" id="routebutton">Add Rule</a>
</div>
+<br><br>
+<table cellpadding="0" cellspacing="0" border="0" style="width:220px; clear:both;">
+ <tbody>
+ <tr>
+ <td align="left">Hide Expired, AdminInactive, Error</td>
+ <td align="left">
+ <input type="checkbox" id="hide_noaction" name="hide_noaction" value="Hide" />
+ </td>
+ </tr>
+ </tbody>
+</table>
+<br>
<table class="display" width="100%" id="routes_table">
<thead>
<tr>
class="expiresclass"
style="border-bottom:2px dashed red;"
title="Expires {% ifequal route.days_to_expire '0' %}today{% else%}in {{route.days_to_expire}} day{{ route.days_to_expire|pluralize }}{% endifequal %}"
- {% endif %}>{{route.status}}
- </span>
+ {% endif %}>{{route.status}}</span>
</td>
{% comment %}<td style="text-align: center;">{{ route.response }}</td>{% endcomment %}
<td style="text-align: center;">{{ route.applier }}</td>