summaryrefslogtreecommitdiffstats
path: root/opennhrp-listinterfaces-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-02-03 21:35:45 +0000
committerTed Trask <ttrask01@yahoo.com>2014-02-03 21:35:45 +0000
commita3b838873fd04b83285fe3f955d012d5a0da71c5 (patch)
tree35816864b6c6021edbf3cc601a353fbfe243461b /opennhrp-listinterfaces-html.lsp
parent846180f940ae14b8c827b69108083f04bfcb4d8b (diff)
downloadacf-opennhrp-a3b838873fd04b83285fe3f955d012d5a0da71c5.tar.bz2
acf-opennhrp-a3b838873fd04b83285fe3f955d012d5a0da71c5.tar.xz
Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags
Diffstat (limited to 'opennhrp-listinterfaces-html.lsp')
-rw-r--r--opennhrp-listinterfaces-html.lsp49
1 files changed, 34 insertions, 15 deletions
diff --git a/opennhrp-listinterfaces-html.lsp b/opennhrp-listinterfaces-html.lsp
index 044de2e..a684c2d 100644
--- a/opennhrp-listinterfaces-html.lsp
+++ b/opennhrp-listinterfaces-html.lsp
@@ -3,24 +3,43 @@ htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>
+<script type="text/javascript">
+ if (typeof jQuery == 'undefined') {
+ document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>');
+ }
+</script>
+
+<script type="text/javascript">
+ if (typeof $.tablesorter == 'undefined') {
+ document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>');
+ }
+</script>
+
+<script type="text/javascript">
+ $(document).ready(function() {
+ $("#list").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']});
+ });
+</script>
+
<% htmlviewfunctions.displaycommandresults({"editinterface"}, session) %>
<h1><%= html.html_escape(view.label) %></h1>
-<DL><TABLE>
- <TR style="background:#eee;font-weight:bold;">
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD>
- <TD style="padding-right:20px;white-space:nowrap;text-align:right;" class="header">Interface</TD>
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Type</TD>
- <TD style="white-space:nowrap;text-align:left;" class="header">Comment</TD>
- </TR>
+<table id="list" class="tablesorter"><thead>
+ <tr>
+ <th>Action</th>
+ <th>Interface</th>
+ <th>Type</th>
+ <th>Comment</th>
+ </tr>
+</thead><tbody>
<% for i,intf in ipairs(view.value) do %>
- <TR>
- <TD style="padding-right:20px;white-space:nowrap;">
+ <tr>
+ <td>
<% io.write(html.link{value = "editinterface?interface="..intf.interface.."&redir="..page_info.orig_action, label="Edit " }) %>
- </TD>
- <TD style="padding-right:20px;white-space:nowrap;text-align:right;"><%= html.html_escape(intf.interface) %></TD>
- <TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(intf.type) %></TD>
- <TD style="white-space:nowrap;" width="90%"><P class="error"><%= string.gsub(html.html_escape(intf.errtxt), "\n", "<BR>") %></P></TD>
- </TR>
+ </td>
+ <td><%= html.html_escape(intf.interface) %></td>
+ <td><%= html.html_escape(intf.type) %></td>
+ <td><P class="error"><%= string.gsub(html.html_escape(intf.errtxt), "\n", "<br/>") %></P></td>
+ </tr>
<% end %>
-</TABLE></DL>
+</tbody></table>