summaryrefslogtreecommitdiffstats
path: root/weblog-listsources-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'weblog-listsources-html.lsp')
-rw-r--r--weblog-listsources-html.lsp54
1 files changed, 54 insertions, 0 deletions
diff --git a/weblog-listsources-html.lsp b/weblog-listsources-html.lsp
new file mode 100644
index 0000000..53a571f
--- /dev/null
+++ b/weblog-listsources-html.lsp
@@ -0,0 +1,54 @@
+<% local data, viewlibrary, page_info, session = ...
+require("viewfunctions")
+%>
+
+<% displaycommandresults({"deletesource", "editsource", "testsource", "createsource", "importlogs"}, session) %>
+
+<h1><%= html.html_escape(data.label) %></h1>
+
+<TABLE>
+ <TR style="background:#eee;font-weight:bold;">
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD>
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Name</TD>
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Enabled</TD>
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Source</TD>
+ <TD style="white-space:nowrap;text-align:left;" class="header">Method</TD>
+ </TR>
+
+
+<% for i,source in ipairs(data.value) do %>
+ <TR>
+ <TD style="padding-right:20px;white-space:nowrap;">
+ <%= html.link{value = "editsource?sourcename=" .. source.sourcename.."&redir="..page_info.orig_action, label="Edit "} %>
+ <%= html.link{value = "deletesource?sourcename=" .. source.sourcename, label="Delete "} %>
+ <%= html.link{value = "testsource?sourcename=" .. source.sourcename, label="Test "} %>
+ </TD>
+ <TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(source.sourcename) %></TD>
+ <TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(tostring(source.enabled)) %></TD>
+ <TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(source.source) %></TD>
+ <TD style="white-space:nowrap;" width="90%"><%= html.html_escape(source.method) %></TD>
+ </TR>
+<% end %>
+</TABLE>
+
+<% if data.errtxt then %>
+<p class='error'><%= html.html_escape(data.errtxt) %></p>
+<% end %>
+<% if #data.value == 0 then %>
+<p>No sources found</p>
+<% end %>
+
+<DL>
+<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/createsource") %>">
+<DT>Create New Source</DT>
+<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
+<DD><input class="submit" type="submit" value="Create"></DD>
+</form>
+</DL>
+
+<DL>
+<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/importlogs") %>">
+<DT>Import Logs</DT>
+<DD><input class="submit" type="submit" value="Import"></DD>
+</form>
+</DL>