summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-04-10 05:50:59 +0000
committerTed Trask <ttrask01@yahoo.com>2014-04-10 05:50:59 +0000
commit0f1a9c1d7a56b03579091d4b57acdebf8d4f48b1 (patch)
tree9abe1f76b4943967da5f3930fcbd1d550088c38d
parent3cf639c412f6ddee6dd36711e5879f038b2e8668 (diff)
downloadacf-dansguardian-0f1a9c1d7a56b03579091d4b57acdebf8d4f48b1.tar.bz2
acf-dansguardian-0f1a9c1d7a56b03579091d4b57acdebf8d4f48b1.tar.xz
Changes to use new htmlviewfunctions functions
-rw-r--r--dansguardian-general-html.lsp19
-rw-r--r--dansguardian-listfiles-html.lsp22
2 files changed, 25 insertions, 16 deletions
diff --git a/dansguardian-general-html.lsp b/dansguardian-general-html.lsp
index f73473b..6cbaddc 100644
--- a/dansguardian-general-html.lsp
+++ b/dansguardian-general-html.lsp
@@ -1,22 +1,20 @@
-<%
+<% 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) %>
diff --git a/dansguardian-listfiles-html.lsp b/dansguardian-listfiles-html.lsp
index 930f3b3..3479e3c 100644
--- a/dansguardian-listfiles-html.lsp
+++ b/dansguardian-listfiles-html.lsp
@@ -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) %>