From fb7ce759c1045daf20e416547e6111f796030b60 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 17 Apr 2014 00:55:44 +0000 Subject: Started changes to use new htmlviewfunctions functions Still work to do to remove styling and long messy links --- weblog-listsources-html.lsp | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) (limited to 'weblog-listsources-html.lsp') 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) %> -

<%= html.html_escape(data.label) %>

+<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %> @@ -33,13 +33,17 @@ html = require("acf.html") - +<% local sourcename = cfe({ type="hidden", value="" }) %> +<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> <% for i,source in ipairs(data.value) do %> @@ -50,25 +54,12 @@ html = require("acf.html")
ActionMethod
- <%= 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) + %> <%= html.html_escape(source.sourcename) %> <%= html.html_escape(tostring(source.enabled)) %>
-<% if data.errtxt then %> -

<%= html.html_escape(data.errtxt) %>

-<% end %> <% if #data.value == 0 then %>

No sources found

<% 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) %> -
"> -

Create New Source

-
- - -
-
- -
"> -

Import Logs

-
- -
-
+<% htmlviewfunctions.displaysectionend(header_level) %> -- cgit v1.2.3