diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-02-04 17:00:39 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-02-04 17:00:39 +0000 |
commit | 72d1dfa2786640de2404bd04df78321d18b1f75e (patch) | |
tree | 1dbace4a69e08c3c16ed030db75c06c4c469f813 | |
parent | 716e13a0dfecee4cc8b7743a3c186976f46b0e23 (diff) | |
download | acf-kamailio-72d1dfa2786640de2404bd04df78321d18b1f75e.tar.bz2 acf-kamailio-72d1dfa2786640de2404bd04df78321d18b1f75e.tar.xz |
Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags
-rw-r--r-- | kamailio-listfiles-html.lsp | 34 | ||||
-rw-r--r-- | kamailio-listusers-html.lsp | 56 | ||||
-rw-r--r-- | kamailio-searchdatabase-html.lsp | 2 |
3 files changed, 65 insertions, 27 deletions
diff --git a/kamailio-listfiles-html.lsp b/kamailio-listfiles-html.lsp index d63398c..564dcce 100644 --- a/kamailio-listfiles-html.lsp +++ b/kamailio-listfiles-html.lsp @@ -3,6 +3,24 @@ 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({widgets: ['zebra']}); + }); +</script> + <% htmlviewfunctions.displaycommandresults({"edit"}, session) %> <% if viewlibrary and viewlibrary.dispatch_component then @@ -10,16 +28,16 @@ html = require("acf.html") end %> <h1>Configuration</h1> -<DL><TABLE> - <TR style="background:#eee;font-weight:bold;"> - <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">File</TD> - <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Size</TD> - <TD style="white-space:nowrap;text-align:left;" class="header">Last Modified</TD> - </TR> - +<table id="list" class="tablesorter"><thead> + <tr> + <th>File</th> + <th>Size</th> + <th>Last Modified</th> + </tr> +</thead><tbody> <% for k,v in ipairs( view.value ) do io.write( "<tr><td><a href=\"" .. html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) .. "/edit?filename=" .. html.html_escape(v.filename) .. "&redir=" .. html.html_escape(page_info.orig_action) .. "\">" .. html.html_escape(v.filename) .. "</a></td><td>" .. html.html_escape(v.size) .."</td><td>" .. html.html_escape(v.mtime) .."</td></tr>\n" ) end %> -</TABLE></DL> +</tbody></table> diff --git a/kamailio-listusers-html.lsp b/kamailio-listusers-html.lsp index c631716..0b7183f 100644 --- a/kamailio-listusers-html.lsp +++ b/kamailio-listusers-html.lsp @@ -2,42 +2,62 @@ <% 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() { + <% if viewlibrary.check_permission("deleteuser") or viewlibrary.check_permission("updateuser") then %> + $("#list").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']}); + <% else %> + $("#list").tablesorter({widgets: ['zebra']}); + <% end %> + }); +</script> + <% htmlviewfunctions.displaycommandresults({"deleteuser", "updateuser"}, session) %> <% htmlviewfunctions.displaycommandresults({"createuser"}, session, true) %> -<H1><%= html.html_escape(form.label) %></H1> -<DL> -<TABLE> - <TR style="background:#eee;font-weight:bold;"> +<h1><%= html.html_escape(form.label) %></h1> +<table id="list" class="tablesorter"><thead> + <tr> <% if viewlibrary.check_permission("deleteuser") or viewlibrary.check_permission("updateuser") then %> - <TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD> + <th>Action</th> <% end %> - <TD style="padding-right:20px;white-space:nowrap;" class="header">User Name</TD> - <TD style="white-space:nowrap;" class="header">Password</TD> - </TR> - + <th>User Name</th> + <th>Password</th> + </tr> +</thead><tbody> <% for i,user in ipairs(form.value) do %> - <TR> + <tr> <% if viewlibrary.check_permission("deleteuser") or viewlibrary.check_permission("updateuser") then %> - <TD style="padding-right:20px;white-space:nowrap;"> + <td> <% if viewlibrary.check_permission("updateuser") then %> <%= html.link{value = "updateuser?username=" .. user.username.."&redir="..page_info.orig_action, label="Update "} %> <% end %> <% if viewlibrary.check_permission("deleteuser") then %> <%= html.link{value = "deleteuser?submit=true&username=" .. user.username, label="Delete "} %> <% end %> - </TD> + </td> <% end %> - <TD><%= html.html_escape(user.username) %></TD> + <td><%= html.html_escape(user.username) %></td> <% if viewlibrary.check_permission("updateuser") then %> - <TD><%= html.html_escape(user.password) %></TD> + <td><%= html.html_escape(user.password) %></td> <% else %> - <TD>******</TD> + <td>******</td> <% end %> - </TR> + </tr> <% end %> -</TABLE> -</DL> +</tbody></table> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createuser") then viewlibrary.dispatch_component("createuser") diff --git a/kamailio-searchdatabase-html.lsp b/kamailio-searchdatabase-html.lsp index 8a55f48..257626d 100644 --- a/kamailio-searchdatabase-html.lsp +++ b/kamailio-searchdatabase-html.lsp @@ -21,7 +21,7 @@ html = require("acf.html") form.value.fields = nil end %> -<H1><%= html.html_escape(form.label) %></H1> +<h1><%= html.html_escape(form.label) %></h1> <% form.value.result = nil form.option = "Search" |