Commit 77a0025e authored by Ted Trask's avatar Ted Trask

Changes to use new htmlviewfunctions functions

parent 593eb289
......@@ -8,14 +8,12 @@
viewlibrary.dispatch_component("status")
end %>
<h1>Global Settings</h1>
<div class='item'><p class='left'>Edit global settings</p>
<div class='right'>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/editconfig") %>" method="post">
<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
<input type=submit value="Edit" class="submit">
</form>
</div></div><!-- end .item -->
<%
local redir = cfe({ type="hidden", value=page_info.orig_action })
local header_level = htmlviewfunctions.displaysectionstart(cfe({ label="Global Settings" }), page_info)
htmlviewfunctions.displayitem(cfe({type="link", value={redir=redir}, label="Edit global settings", option="Edit", action="editconfig"}), page_info, 0)
htmlviewfunctions.displaysectionend(header_level)
%>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("listentries")
......
......@@ -23,7 +23,7 @@ html = require("acf.html")
<% htmlviewfunctions.displaycommandresults({"editentry", "deleteentry", "createentry"}, session) %>
<h1>Edit/View Fetchmail Entries</h1>
<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %>
<table id="list" class="tablesorter"><thead>
<tr>
<th>Action</th>
......@@ -33,11 +33,18 @@ html = require("acf.html")
<th>Remote Mailbox / Domain</th>
</tr>
</thead><tbody>
<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %>
<% for i,entry in ipairs(data.value) do %>
<tr>
<td>
<% io.write(html.link{value = "editentry?remotehost=" .. entry.remotehost.."&method="..entry.method.."&remotemailbox="..entry.remotemailbox.."&localdomain="..entry.localdomain.."&redir="..page_info.orig_action, label="Edit " }) %>
<% io.write(html.link{value = "deleteentry?submit=true&remotehost=" .. entry.remotehost.."&method="..entry.method.."&remotemailbox="..entry.remotemailbox.."&localdomain="..entry.localdomain, label="Delete " }) %>
<%
local remotehost = cfe({ type="hidden", value=entry.remotehost })
local entrymethod = cfe({ type="hidden", value=entry.method })
local remotemailbox = cfe({ type="hidden", value=entry.remotemailbox })
local localdomain = cfe({ type="hidden", value=entry.localdomain })
htmlviewfunctions.displayitem(cfe({type="link", value={remotehost=remotehost, method=entrymethod, remotemailbox=remotemailbox, localdomain=localdomain, redir=redir}, label="", option="Edit", action="editentry"}), page_info, -1)
htmlviewfunctions.displayitem(cfe({type="form", value={remotehost=remotehost, method=entrymethod, remotemailbox=remotemailbox, localdomain=localdomain}, label="", option="Delete", action="deleteentry"}), page_info, -1)
%>
</td>
<td><%= html.html_escape(entry.remotehost) %></td>
<td><%= html.html_escape(tostring(entry.enabled)) %></td>
......@@ -47,10 +54,6 @@ html = require("acf.html")
<% end %>
</tbody></table>
<div class='item'><p class='left'>Add new entry</p>
<div class='right'>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/createentry") %>" method="post">
<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
<input type=submit value="New" class="submit">
</form>
</div></div><!-- end .item -->
<% htmlviewfunctions.displayitem(cfe({type="link", value={redir=redir}, label="Add new entry", option="New", action="createentry"}), page_info, 0) %>
<% htmlviewfunctions.displaysectionend(header_level) %>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment