Commit 0f1a9c1d authored by Ted Trask's avatar Ted Trask

Changes to use new htmlviewfunctions functions

parent 3cf639c4
<%
<% local form, viewlibrary, page_info, session = ...
htmlviewfunctions = require("htmlviewfunctions")
local form, viewlibrary, page_info, session = ...
%>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("status")
end %>
<h1>Configuration</h1>
<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Configuration"}), page_info) %>
<%
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
htmlviewfunctions.displayformstart(form)
htmlviewfunctions.displayformstart(form, page_info)
for field,val in pairs(form.value) do
val.name = field
end
%>
<h2>General</h2>
<% local header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="General"}), page_info, htmlviewfunctions.incrementheader(header_level)) %>
<p>
These parameters define the interface and port that Dansguardian uses to accept connections.
</p>
......@@ -26,7 +24,8 @@ These parameters define the interface and port that Dansguardian uses to accept
htmlviewfunctions.displayformitem(form.value.filterport)
%>
<h2>Proxy service</h2>
<% htmlviewfunctions.displaysectionend(header_level2) %>
<% htmlviewfunctions.displaysectionstart(cfe({label="Proxy service"}), page_info, header_level2) %>
<p>
These parameters define the ip address and port that Dansguardian should forward requests on to.
</p>
......@@ -36,7 +35,8 @@ These parameters define the ip address and port that Dansguardian should forward
htmlviewfunctions.displayformitem(form.value.proxyport)
%>
<h2>Filter Actions</h2>
<% htmlviewfunctions.displaysectionend(header_level2) %>
<% htmlviewfunctions.displaysectionstart(cfe({label="Filter Actions"}), page_info, header_level2) %>
<p>
These parameters define how sensitive the filter is, and where to redirect requests if the content filter
determines that the content is inappropriate. The "naughtynesslimit" is more sensitive the lower it is set.
......@@ -48,5 +48,6 @@ The author recommends 50 for "young children", 100 for "older children" and 160
htmlviewfunctions.displayformitem(form.value.naughtynesslimit)
%>
<h2>Save Changes</h2>
<% htmlviewfunctions.displaysectionend(header_level2) %>
<% htmlviewfunctions.displayformend(form) %>
<% htmlviewfunctions.displaysectionend(header_level) %>
......@@ -31,7 +31,7 @@ end
<script type="text/javascript">
$(document).ready(function() {
$("#list").tablesorter({widgets: ['zebra']});
$("#list").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']});
});
</script>
......@@ -41,17 +41,25 @@ end
viewlibrary.dispatch_component("status")
end %>
<h1>Configuration</h1>
<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Configuration"}), page_info) %>
<table id="list" class="tablesorter"><thead>
<tr>
<th>Action</th>
<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><span style="display:none">'..convertsize(v.size).."b</span>" .. html.html_escape(v.size) .."</td><td>" .. html.html_escape(v.mtime) .."</td></tr>\n" )
end
%>
<% local filename = cfe({ type="hidden", value="" }) %>
<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %>
<% for i,file in ipairs( view.value ) do %>
<% filename.value = file.filename %>
<tr>
<td><% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="edit"}), page_info, -1) %></td>
<td><%= html.html_escape(file.filename) %></td>
<td><span style="display:none"><%= convertsize(file.size) %>b</span><%= html.html_escape(file.size) %></td>
<td><%= html.html_escape(file.mtime) %></td>
<tr>
<% end %>
</tbody></table>
<% 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