diff options
Diffstat (limited to 'app/acf-util')
-rw-r--r-- | app/acf-util/password-status-html.lsp | 54 | ||||
-rw-r--r-- | app/acf-util/roles-read-html.lsp | 49 | ||||
-rw-r--r-- | app/acf-util/roles-viewroles-html.lsp | 46 | ||||
-rw-r--r-- | app/acf-util/skins-read-html.lsp | 10 | ||||
-rw-r--r-- | app/acf-util/welcome-html.lsp | 2 |
5 files changed, 97 insertions, 64 deletions
diff --git a/app/acf-util/password-status-html.lsp b/app/acf-util/password-status-html.lsp index f322b55..9316bda 100644 --- a/app/acf-util/password-status-html.lsp +++ b/app/acf-util/password-status-html.lsp @@ -4,35 +4,35 @@ <% htmlviewfunctions.displaycommandresults({"newuser", "edituser", "deleteuser"}, session) %> -<H1>User Accounts</H1> -<H2>Create new account</H2> -<form action="<%= page_info.script .. page_info.prefix .. page_info.controller %>/newuser" method="POST"> +<h1>User Accounts</h1> +<h2>Create new account</h2> +<form action="<%= page_info.script .. page_info.prefix .. page_info.controller %>/newuser" method="post"> <input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" > -<dl><dt></dt><dd><input class="submit" type="submit" value="Create"></dd></dl> +<div class='item'><p class='left'></p><div class='right'><input class="submit" type="submit" value="Create"></div></div><!-- end .item --> </form> -<H2>Existing account</H2> -<DL> +<h2>Existing account</h2> <% for i,user in ipairs(form.value) do local name = html.html_escape(user.value.userid.value) %> - <DT><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/apps/system-users.png' HEIGHT='16' WIDTH='16'> <%= name %></DT> - <DD><TABLE> - <TR> - <TD STYLE='border:none;'><B><%= html.html_escape(user.value.userid.label) %></B></TD> - <TD STYLE='border:none;' WIDTH='90%'><%= html.html_escape(user.value.userid.value) %></TD> - </TR><TR> - <TD STYLE='border:none;'><B><%= html.html_escape(user.value.username.label) %></B></TD> - <TD STYLE='border:none;'><%= html.html_escape(user.value.username.value) %></TD> - </TR><TR> - <TD STYLE='border:none;'><B><%= html.html_escape(user.value.roles.label) %></B></TD> - <TD STYLE='border:none;'><%= html.html_escape(table.concat(user.value.roles.value, ", ")) %></TD> - </TR><TR> - <TD STYLE='border:none;'><B>Option</B></TD> - <TD STYLE='border:none;'> - [<A HREF='edituser?userid=<%= name %>&redir=<%= html.html_escape(page_info.orig_action) %>'>Edit this account</A>] - [<A HREF='deleteuser?userid=<%= name %>&submit=true'>Delete this account</A>] - [<A HREF='<%= html.html_escape(page_info.script) %>/acf-util/roles/viewuserroles?userid=<%= name %>'>View roles for this account</A>] - </TD> - </TR> - </TABLE></DD> + <div class='item'><p class='left'><img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/apps/system-users.png' height='16' width='16'> <%= name %></p> + <div class='right'> + <table><tbody> + <tr> + <td style='border:none;'><b><%= html.html_escape(user.value.userid.label) %></b></td> + <td style='border:none;' width='90%'><%= html.html_escape(user.value.userid.value) %></td> + </tr><tr> + <td style='border:none;'><b><%= html.html_escape(user.value.username.label) %></b></td> + <td style='border:none;'><%= html.html_escape(user.value.username.value) %></td> + </tr><tr> + <td style='border:none;'><b><%= html.html_escape(user.value.roles.label) %></b></td> + <td style='border:none;'><%= html.html_escape(table.concat(user.value.roles.value, ", ")) %></td> + </tr><tr> + <td style='border:none;'><b>Option</b></td> + <td style='border:none;'> + [<a href='edituser?userid=<%= name %>&redir=<%= html.html_escape(page_info.orig_action) %>'>Edit this account</a>] + [<a href='deleteuser?userid=<%= name %>&submit=true'>Delete this account</a>] + [<a href='<%= html.html_escape(page_info.script) %>/acf-util/roles/viewuserroles?userid=<%= name %>'>View roles for this account</a>] + </td> + </tr> + </tbody></table> + </div></div><!-- end .item --> <% end %> -</DL> diff --git a/app/acf-util/roles-read-html.lsp b/app/acf-util/roles-read-html.lsp index 9d1a003..c0fbaab 100644 --- a/app/acf-util/roles-read-html.lsp +++ b/app/acf-util/roles-read-html.lsp @@ -1,32 +1,48 @@ -<% local view= ... %> +<% local view, viewlibrary, page_info, session = ... %> <% html = require("acf.html") %> +<script type="text/javascript"> + if (typeof jQuery == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + if (typeof $.tablesorter == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + $(document).ready(function() { + $("#permissions").tablesorter({headers: {1:{sorter: false}}, widgets: ['zebra']}); + }); +</script> + <% if view.value.userid then %> - <H1>Roles/Permission list for <%= html.html_escape(view.value.userid.value) %>:</H1> + <h1>Roles/Permission list for <%= html.html_escape(view.value.userid.value) %>:</h1> <% elseif view.value.role then %> - <H1>Permission list for <%= html.html_escape(view.value.role.value) %>:</H1> + <h1>Permission list for <%= html.html_escape(view.value.role.value) %>:</h1> <% else %> - <H1>Complete permission list:</H1> + <h1>Complete permission list:</h1> <% end %> <% if view.value.roles then %> - <H2><%= html.html_escape(view.value.userid.value) %> is valid in these roles</H2> - <DL> + <h2><%= html.html_escape(view.value.userid.value) %> is valid in these roles</h2> <% for a,b in pairs(view.value.roles.value) do - print("<dt>",html.html_escape(b),"</dt><dd> </dd>") + print("<p>",html.html_escape(b),"</p>") end %> - </DL> <% end %> <% if view.value.permissions then %> <% if view.value.userid then %> - <H2><%= html.html_escape(view.value.userid.value) %>'s full permissions are</H2> + <h2><%= html.html_escape(view.value.userid.value) %>'s full permissions are</h2> <% elseif view.value.role then %> - <H2><%= html.html_escape(view.value.role.value) %>'s full permissions are</H2> + <h2><%= html.html_escape(view.value.role.value) %>'s full permissions are</h2> <% end %> - <DL> - <TABLE> - <TR><TD CLASS='header'>Controller</TD><TD CLASS='header'>Action(s)</TD></TR> + <table id="permissions" class="tablesorter"><thead> + <tr><th>Controller</th><th>Action(s)</th></tr> + </thead><tbody> <% local prefixes = {} -- It's nice to have it in alphabetical order for pref in pairs(view.value.permissions.value) do @@ -41,7 +57,7 @@ end table.sort(controllers) for x,cont in ipairs(controllers) do - print("<TR><TD STYLE='font-weight:bold;'>",html.html_escape(pref..cont),"</TD><TD>") + print("<tr><td style='font-weight:bold;'>",html.html_escape(pref..cont),"</td><td>") -- Again, alphabetical order local actions = {} for act in pairs(view.value.permissions.value[pref][cont]) do @@ -51,10 +67,9 @@ for y,act in pairs(actions) do print((html.html_escape(act))) end - io.write("<TD></TR>") + io.write("</td></tr>") end end %> - </TABLE> - </DL> + </tbody></table> <% end %> diff --git a/app/acf-util/roles-viewroles-html.lsp b/app/acf-util/roles-viewroles-html.lsp index 779d8fc..59aa4e9 100644 --- a/app/acf-util/roles-viewroles-html.lsp +++ b/app/acf-util/roles-viewroles-html.lsp @@ -2,36 +2,54 @@ <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> +<script type="text/javascript"> + if (typeof jQuery == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + if (typeof $.tablesorter == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + $(document).ready(function() { + $("#list").tablesorter({headers: {1:{sorter: false}}, widgets: ['zebra']}); + }); +</script> + <% htmlviewfunctions.displaycommandresults({"newrole", "editrole", "deleterole"}, session) %> -<H1>Roles</H1> -<H2>Create new role</H2> +<h1>Roles</h1> +<h2>Create new role</h2> <form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) %>/newrole" method="POST"> <input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" > -<dl><dt></dt><dd><input class="submit" type="submit" value="Create"></dd></dl> +<div class='item'><p class='left'></p><div class='right'><input class="submit" type="submit" value="Create"></div></div><!-- end .item --> </form> -<H2>Existing roles</H2> -<DL> -<TABLE> +<h2>Existing roles</h2> +<table id="list" class="tablesorter"><thead> + <tr><th>Role</th><th>Action</th></tr> +</thead><tbody> <% if view.value.defined_roles then %> <% for x,role in pairs(view.value.defined_roles.value) do %> - <TR><TD><dt><img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/apps/system-users.png' height='16' width='16'> <%= html.html_escape(role) %></dt> - <dd> + <tr><td><img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/apps/system-users.png' height='16' width='16'> <%= html.html_escape(role) %></td> + <td> [<a href='viewroleperms?role=<%= html.html_escape(role) %>'>View this role</a>] [<a href='editrole?role=<%= html.html_escape(role) %>&redir=<%= html.html_escape(page_info.orig_action) %>'>Edit this role</a>] [<a href='deleterole?role=<%= html.html_escape(role) %>&submit=true'>Delete this role</a>] - </dd></TD></TR> + </td></tr> <% end %> <% end %> <% if view.value.default_roles then %> <% for x,role in pairs(view.value.default_roles.value) do %> - <TR><TD><dt><img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/categories/applications-system.png' height='16' width='16'> <%= html.html_escape(role) %></dt> - <dd> + <tr><td><img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/categories/applications-system.png' height='16' width='16'> <%= html.html_escape(role) %></td> + <td> [<a href='viewroleperms?role=<%= html.html_escape(role) %>'>View this role</a>] [<a href='editrole?role=<%= html.html_escape(role) %>&redir=<%= html.html_escape(page_info.orig_action) %>'>Edit this role</a>] - </dd></TD></TR> + </td></tr> <% end %> <% end %> -</TABLE> -</DL> +</tbody></table> diff --git a/app/acf-util/skins-read-html.lsp b/app/acf-util/skins-read-html.lsp index dff5ae2..c2e0456 100644 --- a/app/acf-util/skins-read-html.lsp +++ b/app/acf-util/skins-read-html.lsp @@ -6,13 +6,13 @@ <h1>Available skins</h1> -<DL> <% for i,skin in ipairs(view.value) do %> - <dt><%= html.html_escape(skin.value) %></dt> + <div class='item'><p class='left'><%= html.html_escape(skin.value) %></p> + <div class='right'> <% if (skin.inuse) then %> - <dd>in use</dd> + in use <% else %> - <dd>[<a href="update?skin=<%= html.html_escape(skin.value) %>&submit=true">use this skin</a>]</dd> + [<a href="update?skin=<%= html.html_escape(skin.value) %>&submit=true">use this skin</a>] <% end %> + </div></div><!-- end .item --> <% end %> -</DL> diff --git a/app/acf-util/welcome-html.lsp b/app/acf-util/welcome-html.lsp index 7540b94..6a22375 100644 --- a/app/acf-util/welcome-html.lsp +++ b/app/acf-util/welcome-html.lsp @@ -1,7 +1,7 @@ <% view = ... %> <% htmlviewfunctions = require("htmlviewfunctions") %> <h1>Alpine Configuration Framework</h1> -<DL><p>Welcome.</p></DL> +<p>Welcome.</p> <% --[[ io.write(htmlviewfunctions.cfe_unpack(view)) |