noc.main.templatetags.noctags

Module Contents

noc.main.templatetags.noctags.register
noc.main.templatetags.noctags.NOCTableTemplate =

<link rel=”stylesheet” type=”text/css” href=”/ui/web/css/tablesorter.css” /> <script type=”text/javascript” src=”/ui/pkg/jquery.tablesorter/jquery.tablesorter.js”></script> <script type=”text/javascript”> $(document).ready(function() {

$.tablesorter.addParser({

id: “switchPort”, is: function (s) {

return /^d{1,2}:d{1,2}$/.test(s);

}, format: function (s) {

var a = s.split(“:”),
r = “”, l = a.length;
for (var i = 0; i < l; i++) {

var item = a[i]; if (item.length == 2) {

r += “0” + item;
} else {
r += item;

}

} return $.tablesorter.formatFloat(r);

}, type: “numeric”

}); $(“#%(id)s”).tablesorter({

widgets: [“zebra”],

}); $(“#tablesorter-search”).focus(); $(“#%(id)s tbody td”).hover(

function () {
$(this).parents(“tr”).children(“td”).addClass(“highlight”);

}, function () {

$(this).parents(“tr”).children(“td”).removeClass(“highlight”);

}

);

});

function startswith(s, ss) {
s.substr(0, ss.length) == ss;

}

var ts_last_search = “”; function ts_on_search(s) {

var search = s.value; if(search == ts_last_search)

return;

var all_seen = search == “”; var $tbody = $(s).parents(“.tablesorter-container”).find(“tbody”); var scope = “tr”; if(startswith(search, ts_last_search)) {

scope = “tr:visible”;
} else if (startswith(ts_last_search, search)) {
scope = “tr:hidden”;

} $tbody.find(scope).each(function (i, r) {

var $r = $(r); var seen = all_seen; if(!seen) {

$r.children(“td”).each(function (j, d) {
seen |= $(d).text().indexOf(search) >= 0;

});

} if(seen) {

$r.show();
} else {
$r.hide();

}

}); ts_last_search = search;

} </script> <div class=”tablesorter-container”> <div class=”tablesorter-search-row”>

<label for=”tablesorter-search”><img src=”/ui/pkg/django-media/admin/img/icon_searchbox.png” alt=”Search” /></label> <input type=”text” id=”tablesorter-search” onkeyup=”ts_on_search(this);”/>

</div>

noc.main.templatetags.noctags.rx_table
class noc.main.templatetags.noctags.NOCTableNode(nodelist)

Bases: django.template.Node

render(self, context)
noc.main.templatetags.noctags.do_noctable(parser)
noc.main.templatetags.noctags.object_name(value)
noc.main.templatetags.noctags.bool_icon(value)