diff options
Diffstat (limited to 'weblog-listsources-html.lsp')
-rw-r--r-- | weblog-listsources-html.lsp | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/weblog-listsources-html.lsp b/weblog-listsources-html.lsp index 11682a3..090962b 100644 --- a/weblog-listsources-html.lsp +++ b/weblog-listsources-html.lsp @@ -23,7 +23,7 @@ html = require("acf.html") <% htmlviewfunctions.displaycommandresults({"deletesource", "editsource", "testsource", "createsource", "importlogs"}, session) %> -<h1><%= html.html_escape(data.label) %></h1> +<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %> <table id="sources" class="tablesorter"><thead> <tr> <th>Action</th> @@ -33,13 +33,17 @@ html = require("acf.html") <th>Method</th> </tr> </thead><tbody> - +<% local sourcename = cfe({ type="hidden", value="" }) %> +<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> <% for i,source in ipairs(data.value) do %> <tr> <td> - <%= html.link{value = "editsource?sourcename=" .. source.sourcename.."&redir="..page_info.orig_action, label="Edit "} %> - <%= html.link{value = "deletesource?submit=true&sourcename=" .. source.sourcename, label="Delete "} %> - <%= html.link{value = "testsource?submit=true&sourcename=" .. source.sourcename, label="Test "} %> + <% + sourcename.value = source.sourcename + htmlviewfunctions.displayitem(cfe({type="link", value={sourcename=sourcename, redir=redir}, label="", option="Edit", action="editsource"}), page_info, -1) + htmlviewfunctions.displayitem(cfe({type="form", value={sourcename=sourcename}, label="", option="Delete", action="deletesource" }), page_info, -1) + htmlviewfunctions.displayitem(cfe({type="form", value={sourcename=sourcename}, label="", option="Test", action="testsource" }), page_info, -1) + %> </td> <td><%= html.html_escape(source.sourcename) %></td> <td><%= html.html_escape(tostring(source.enabled)) %></td> @@ -50,25 +54,12 @@ html = require("acf.html") </tbody> </table> -<% if data.errtxt then %> -<p class='error'><%= html.html_escape(data.errtxt) %></p> -<% end %> <% if #data.value == 0 then %> <p>No sources found</p> <% end %> +<% htmlviewfunctions.displayinfo(data) %> +<% htmlviewfunctions.displayitem(cfe({type="link", value={redir=redir}, label="Create New Source", option="Create", action="createsource"}), page_info, 0) %> +<% htmlviewfunctions.displayitem(cfe({type="form", value={}, label="Import Logs", option="Import", action="importlogs" }), page_info, 0) %> -<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/createsource") %>"> -<div class='item'><p class='left'>Create New Source</p> -<div class='right'> -<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" > -<input class="submit" type="submit" value="Create"> -</div></div><!-- end .item --> -</form> - -<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/importlogs") %>"> -<div class='item'><p class='left'>Import Logs</p> -<div class='right'> -<input class="submit" type="submit" name="submit" value="Import"> -</div></div><!-- end .item --> -</form> +<% htmlviewfunctions.displaysectionend(header_level) %> |