summaryrefslogtreecommitdiffstats
path: root/acfupdate-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'acfupdate-html.lsp')
-rw-r--r--acfupdate-html.lsp82
1 files changed, 64 insertions, 18 deletions
diff --git a/acfupdate-html.lsp b/acfupdate-html.lsp
index 60e8ceb..967dae7 100644
--- a/acfupdate-html.lsp
+++ b/acfupdate-html.lsp
@@ -1,23 +1,69 @@
-<% local view = ... %>
+<% local data, viewlibrary, page_info, session = ...
+require("viewfunctions")
+%>
-<h1>Fetch ACF updates</h1>
+<H1>System Info</H1>
+<DL>
+<%
+displayitem(data.value.version)
+displayitem(data.value.repository)
+%>
+</DL>
-<p>Click on the tab <B>update</B> to fetch/update all available projects.</p>
-<p>The 'sandbox' project is not automatically fetched/checked out!<BR>
-But if you have manually checked it out, you will get a update on it by pressing the <B>update</B> tab.</p>
+<% displaycommandresults({"log"}, session) %>
+<%
+ local cmdresult = {}
+ for i,cmd in ipairs({"status", "update", "diff"}) do
+ if session[cmd.."result"] then
+ cmdresult[#cmdresult + 1] = session[cmd.."result"]
+ session[cmd.."result"] = nil
+ end
+ end
+ if #cmdresult > 0 then
+ for i,result in ipairs(cmdresult) do
+ io.write("<H1>"..result.label.."</H1>\n<DL>\n")
+ for i,value in ipairs(result.value) do
+ if value.updates ~= "" then %>
+<H3><%= value.name %></H3>
+<pre><%= html.html_escape(value.updates) %></pre>
+ <% end
+ end
+ io.write("</DL>\n")
+ end
+ end
+%>
-<h2>Available projects</h2>
-<pre><%= view.projects %></pre>
-
-<% if (view.updates) then %>
- <h2>Summary</h2>
- <% for i = 1, table.maxn(view["updates"]["cmdresult"]) do %>
- <% if (view["updates"]["cmdresult"][i]["updates"] ~= "") then %>
- <h3><%= view["updates"]["cmdresult"][i]["name"] %></h3>
- <pre><%= view["updates"]["cmdresult"][i]["updates"] %></pre>
- <% end %>
- <% end %>
- <h3>-- End of updates --</h3>
+<% if not data.value.repository.errtxt then %>
+<H1>Actions</H1>
+<DL>
+<DT>View Status</DT>
+<DD>
+<form action="<%= page_info.script .. page_info.prefix .. page_info.controller .. "/status" %>" method="POST">
+<input type=hidden value="<%= data.value.repository.value %>" name="repository">
+<input type=submit class=submit value="View Status">
+</form>
+</DD>
+<DT>View Diff</DT>
+<DD>
+<form action="<%= page_info.script .. page_info.prefix .. page_info.controller .. "/diff" %>" method="POST">
+<input type=hidden value="<%= data.value.repository.value %>" name="repository">
+<input type=submit class=submit value="View Diff">
+</form>
+</DD>
+<DT>View Log</DT>
+<DD>
+<form action="<%= page_info.script .. page_info.prefix .. page_info.controller .. "/log" %>" method="POST">
+<input type=hidden value="<%= data.value.repository.value %>" name="repository">
+<input type=submit class=submit value="View Log">
+</form>
+</DD>
+<DT>Update</DT>
+<DD>
+<form action="<%= page_info.script .. page_info.prefix .. page_info.controller .. "/update" %>" method="POST">
+<input type=hidden value="<%= data.value.repository.value %>" name="repository">
+<input type=submit class=submit value="Update">
+</form>
+</DD>
+</DL>
<% end %>
-