summaryrefslogtreecommitdiffstats
path: root/interfaces-read-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-03-08 23:49:47 +0000
committerTed Trask <ttrask01@yahoo.com>2014-03-08 23:49:47 +0000
commit4c0e9b17d5bbcfb7e7a704c6a57af2cfe327c308 (patch)
treee7cc751f7ec4e48c12d2d3aa2c7beb062f9b66cd /interfaces-read-html.lsp
parentcecb1d586d237c74cd9ef6d05e305726a3072ad0 (diff)
downloadacf-alpine-baselayout-4c0e9b17d5bbcfb7e7a704c6a57af2cfe327c308.tar.bz2
acf-alpine-baselayout-4c0e9b17d5bbcfb7e7a704c6a57af2cfe327c308.tar.xz
Modified HTML views to use new htmlviewfunctions functions and replace links with forms created by displayitem
Use htmlviewfunctions.displayheader .incrementheader .displayitemstart/middle/end
Diffstat (limited to 'interfaces-read-html.lsp')
-rw-r--r--interfaces-read-html.lsp36
1 files changed, 20 insertions, 16 deletions
diff --git a/interfaces-read-html.lsp b/interfaces-read-html.lsp
index ae84b44..a9150e6 100644
--- a/interfaces-read-html.lsp
+++ b/interfaces-read-html.lsp
@@ -19,27 +19,31 @@ html = require("acf.html")
viewlibrary.dispatch_component("status")
end %>
+<% local redir = cfe({type="hidden", value=page_info.orig_action}) %>
<% htmlviewfunctions.displayheader(view, page_info) %>
<% for i,entry in ipairs(view.value) do
- local interface = entry.value %>
- <div class='item'><div class='left'><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/devices/network-wired.png' width='16' height='16'> <%= html.html_escape(interface.name.value) %></div>
- <div class='right'>
+ local interface = entry.value
+ htmlviewfunctions.displayitemstart()
+ %>
+ <img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/devices/network-wired.png' width='16' height='16'> <%= html.html_escape(interface.name.value) %>
+ <% htmlviewfunctions.displayitemmiddle() %>
<table style='margin-bottom:10px'>
<% if viewlibrary.check_permission("update") or viewlibrary.check_permission("delete") or viewlibrary.check_permission("ifup") or viewlibrary.check_permission("ifdown") then %>
+ <% local name = cfe({type="hidden", value=interface.name.value}) %>
<tr><td colspan=2 style='border:none;'>
- <% if viewlibrary.check_permission("update") then %>
- <a href='update?name=<%= html.html_escape(interface.name.value) %>&redir=read'>Edit </a>
- <% end
- if viewlibrary.check_permission("delete") then %>
- <a href='delete?name=<%= html.html_escape(interface.name.value) %>&submit=true&redir=read'>Delete </a>
- <% end
- if viewlibrary.check_permission("ifup") then %>
- <a href='ifup?name=<%= html.html_escape(interface.name.value) %>&submit=true&redir=read'>ifup </a>
- <% end
- if viewlibrary.check_permission("ifdown") then %>
- <a href='ifdown?name=<%= html.html_escape(interface.name.value) %>&submit=true&redir=read'>ifdown </a>
- <% end %>
+ <% if viewlibrary.check_permission("update") then
+ htmlviewfunctions.displayitem(cfe({type="link", value={name=name, redir=redir}, label="", option="Edit", action="update" }), -1, page_info)
+ end
+ if viewlibrary.check_permission("delete") then
+ htmlviewfunctions.displayitem(cfe({type="form", value={name=name}, label="", option="Delete", action="delete" }), -1, page_info)
+ end
+ if viewlibrary.check_permission("ifup") then
+ htmlviewfunctions.displayitem(cfe({type="form", value={name=name}, label="", option="ifup", action="ifup" }), -1, page_info)
+ end
+ if viewlibrary.check_permission("ifdown") then
+ htmlviewfunctions.displayitem(cfe({type="form", value={name=name}, label="", option="ifdown", action="ifdown" }), -1, page_info)
+ end %>
</td></tr>
<% end %>
@@ -52,7 +56,7 @@ end %>
end
end %>
</table>
- </div></div><!-- end .item -->
+ <% htmlviewfunctions.displayitemend() %>
<% end %>
<% if viewlibrary and viewlibrary.dispatch_component then