diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-02-04 17:02:41 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-02-04 17:02:41 +0000 |
commit | 50b8c1bd4d52e53ab9ce98c67550b995a5682865 (patch) | |
tree | 56edbca0c20eac5ea6b7ea1c3932c344a502ec1f | |
parent | b535cc71e1b2fa53b0ca3a422522d2a8f45287e0 (diff) | |
download | acf-kamailio-50b8c1bd4d52e53ab9ce98c67550b995a5682865.tar.bz2 acf-kamailio-50b8c1bd4d52e53ab9ce98c67550b995a5682865.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-listtables-html.lsp | 12 | ||||
-rw-r--r-- | kamailio-listusers-html.lsp | 56 | ||||
-rw-r--r-- | kamailio-searchdatabase-html.lsp | 2 | ||||
-rw-r--r-- | kamailio-viewtable-html.lsp | 54 |
5 files changed, 108 insertions, 50 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-listtables-html.lsp b/kamailio-listtables-html.lsp index e6f8733..801a433 100644 --- a/kamailio-listtables-html.lsp +++ b/kamailio-listtables-html.lsp @@ -4,8 +4,7 @@ <% htmlviewfunctions.displaycommandresults({"createdatabase"}, session) %> -<H1><%= html.html_escape(form.label) %></H1> -<DL> +<h1><%= html.html_escape(form.label) %></h1> <% for i,table in ipairs(form.value) do %> <li> <% if viewlibrary.check_permission("viewtable") then %> @@ -14,11 +13,12 @@ <%= html.html_escape(table) %> <% end %> <% end %> + <% if #form.value == 0 and viewlibrary.check_permission("createdatabase") then %> -<DT>Create Database</DT><DD> +<div class='item'><p class='left'>Create Database</p> +<div class='right'> <form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/createdatabase") %>"> -<input class="submit" type="submit" name="submit" value="Create"></DD> +<input class="submit" type="submit" name="submit" value="Create"> </form> -</DD> +</div></div><!-- end .item --> <% end %> -</DL> 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" diff --git a/kamailio-viewtable-html.lsp b/kamailio-viewtable-html.lsp index 5e8f83a..41b9b82 100644 --- a/kamailio-viewtable-html.lsp +++ b/kamailio-viewtable-html.lsp @@ -2,53 +2,73 @@ <% 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("deletetableentry") or viewlibrary.check_permission("updatetableentry") then %> + $("#list").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']}); + <% else %> + $("#list").tablesorter({widgets: ['zebra']}); + <% end %> + }); +</script> + <% htmlviewfunctions.displaycommandresults({"deletetableentry", "updatetableentry"}, session) %> <% htmlviewfunctions.displaycommandresults({"createtableentry"}, session, true) %> -<H1><%= html.html_escape(form.label) %> - <%= html.html_escape(form.value.table.value) %></H1> -<DL> -<TABLE> - <TR style="background:#eee;font-weight:bold;"> +<h1><%= html.html_escape(form.label) %> - <%= html.html_escape(form.value.table.value) %></h1> +<table id="list" class="tablesorter"><thead> + <tr> <% if viewlibrary.check_permission("deletetableentry") or viewlibrary.check_permission("updatetableentry") then %> - <TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD> + <th>Action</th> <% end %> <% for i,f in ipairs(form.value.fields.value) do %> - <TD style="padding-right:20px;white-space:nowrap;" class="header"><%= html.html_escape(f) %></TD> + <th><%= html.html_escape(f) %></th> <% end %> - </TR> - + </tr> +</thead><tbody> <% for i,tableentry in ipairs(form.value.entries.value) do %> - <TR> + <tr> <% if viewlibrary.check_permission("deletetableentry") or viewlibrary.check_permission("updatetableentry") then %> - <TD style="padding-right:20px;white-space:nowrap;"> + <td> <% if viewlibrary.check_permission("updatetableentry") then %> - <form action="updatetableentry" method="POST"> + <form action="updatetableentry" method="post"> <input class="hidden" type="hidden" name="table" value="<%= html.html_escape(form.value.table.value) %>"> <input class="hidden" type="hidden" name="id" value="<%= html.html_escape(tableentry.id) %>"> <input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action.."?table="..form.value.table.value) %>"> <input class="submit" type="submit" value="Update"></form> <% end %> <% if viewlibrary.check_permission("deletetableentry") then %> - <form action="deletetableentry" method="POST"> + <form action="deletetableentry" method="post"> <input class="hidden" type="hidden" name="table" value="<%= html.html_escape(form.value.table.value) %>"> <input class="hidden" type="hidden" name="id" value="<%= html.html_escape(tableentry.id) %>"> <input class="submit" type="submit" name="submit" value="Delete"></form> <% end %> - </TD> + </td> <% end %> <% for i,f in ipairs(form.value.fields.value) do %> - <TD><%= html.html_escape(tableentry[f]) %></TD> + <td><%= html.html_escape(tableentry[f]) %></td> <% end %> - </TR> + </tr> <% end %> -</TABLE> +</tbody></table> <% if form.errtxt then %> <p class="error"><%= html.html_escape(form.errtxt) %></p> <% end %> <% if #form.value.entries.value == 0 then %> <p>No entries found</p> <% end %> -</DL> <% if page_info.action == "viewtable" and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createtableentry") then viewlibrary.dispatch_component("createtableentry", {table=form.value.table.value}) |