diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-09-22 14:40:50 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-09-22 14:40:50 +0000 |
commit | 6ae4331b704a41bad8cdf2e807bb3f6c63eecded (patch) | |
tree | b9fba3bb3fb47ff52cf7dcc237d3a10500c67205 | |
parent | 00e58e451fbfe8d197dbacaabd4cf5216dfe4dd0 (diff) | |
download | acf-freeradius3-6ae4331b704a41bad8cdf2e807bb3f6c63eecded.tar.bz2 acf-freeradius3-6ae4331b704a41bad8cdf2e807bb3f6c63eecded.tar.xz |
Convert listmacauthfiles and editmacauthfile HTML views back to older style to match acf-core-0.17
-rw-r--r-- | freeradius3-editmacauthfile-html.lsp | 15 | ||||
-rw-r--r-- | freeradius3-listmacauthfiles-html.lsp | 28 |
2 files changed, 15 insertions, 28 deletions
diff --git a/freeradius3-editmacauthfile-html.lsp b/freeradius3-editmacauthfile-html.lsp index fc59628..c604d82 100644 --- a/freeradius3-editmacauthfile-html.lsp +++ b/freeradius3-editmacauthfile-html.lsp @@ -71,12 +71,17 @@ }); </script> +<h1>Edit MAC Authentication File</h1> +<dl> <% -local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Edit MAC Authentication File"}), page_info) htmlviewfunctions.displayitem(form.value.filename) htmlviewfunctions.displayitem(form.value.filesize) htmlviewfunctions.displayitem(form.value.mtime) -local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Entries"}), page_info, htmlviewfunctions.incrementheader(header_level)) +%> +</dl> +<h2>Entries</h2> +<dl> +<% htmlviewfunctions.displayformstart(form, page_info) form.value.filename.type = "hidden" htmlviewfunctions.displayformitem(form.value.filename, "filename") @@ -89,8 +94,8 @@ local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="Entries" <% end %> </table> <% - htmlviewfunctions.displayinfo(form.value.filecontent) + if form.descr then io.write('<p class="descr">' .. string.gsub(html.html_escape(form.descr), "\n", "<br/>") .. '</p>') end + if form.errtxt then io.write('<p class="error">' .. string.gsub(html.html_escape(form.errtxt), "\n", "<br/>") .. '</p>') end htmlviewfunctions.displayformend(form) -htmlviewfunctions.displaysectionend(header_level2) -htmlviewfunctions.displaysectionend(header_level) %> +</dl> diff --git a/freeradius3-listmacauthfiles-html.lsp b/freeradius3-listmacauthfiles-html.lsp index fcb1363..516d0c9 100644 --- a/freeradius3-listmacauthfiles-html.lsp +++ b/freeradius3-listmacauthfiles-html.lsp @@ -3,20 +3,6 @@ htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> -<% -function convertsize(size) - if string.find(size, "k$") then - return tonumber(string.match(size, "[%d.]*")) * 1024.0 - elseif string.find(size, "M$") then - return tonumber(string.match(size, "[%d.]*")) * 1024.0 * 1024.0 - elseif string.find(size, "G$") then - return tonumber(string.match(size, "[%d.]*")) + 1024.0 * 1024.0 * 1024.0 - else - return tonumber(string.match(size, "[%d.]*")) - end -end -%> - <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>'); @@ -37,8 +23,8 @@ end <% htmlviewfunctions.displaycommandresults({"editmacauthfile"}, session) %> -<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="MAC Authentication Configuration"}), page_info) %> -<table id="list" class="tablesorter"><thead> +<h1>MAC Authentication Configuration</h1> +<dl><table id="list" class="tablesorter"><thead> <tr> <th>Action</th> <th>File</th> @@ -46,20 +32,16 @@ end <th>Last Modified</th> </tr> </thead><tbody> -<% local filename = cfe({ type="hidden", value="" }) %> -<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> <% for k,v in ipairs( view.value ) do %> <tr> <td> - <% filename.value = v.filename %> <% if viewlibrary.check_permission("editmacauthfile") then %> - <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editmacauthfile"}), page_info, -1) %> + <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editmacauthfile?filename="..v.filename.."&redir="..html.url_encode(page_info.orig_action), label="Edit "} %> <% end %> </td> <td><%= html.html_escape(v.filename) %></td> - <td><span class="hide"><%= convertsize(v.size) %>b</span><%= html.html_escape(v.size) %></td> + <td><span class="hide"><%= html.html_escape(v.orig_size) %>b</span><%= html.html_escape(v.size) %></td> <td><%= html.html_escape(v.mtime) %></td> </tr> <% end %> -</tbody></table> -<% htmlviewfunctions.displaysectionend(header_level) %> +</tbody></table></dl> |