From 14e124d2ebb81bb6e3f6af0b13326339c48ced4b Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 3 Mar 2014 22:12:09 +0000 Subject: Change HTML views to use htmlviewfunctions.displayheader --- app/acf-util/roles-read-html.lsp | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'app/acf-util/roles-read-html.lsp') diff --git a/app/acf-util/roles-read-html.lsp b/app/acf-util/roles-read-html.lsp index e495473..2f4851d 100644 --- a/app/acf-util/roles-read-html.lsp +++ b/app/acf-util/roles-read-html.lsp @@ -1,4 +1,5 @@ <% local view, viewlibrary, page_info, session = ... %> +<% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> -<% if view.value.userid then %> -

Roles/Permission list for <%= html.html_escape(view.value.userid.value) %>:

-<% elseif view.value.role then %> -

Permission list for <%= html.html_escape(view.value.role.value) %>:

-<% else %> -

Complete permission list:

-<% end %> +<% +local header_level = htmlviewfunctions.displayheader(view, page_info) +%> -<% if view.value.roles then %> -

<%= html.html_escape(view.value.userid.value) %> is valid in these roles

- <% for a,b in pairs(view.value.roles.value) do +<% if view.value.roles then + htmlviewfunctions.displayheader(cfe({label=view.value.userid.value.." is valid in these roles"}), page_info, htmlviewfunctions.incrementheader(header_level)) + for a,b in pairs(view.value.roles.value) do print("

",html.html_escape(b),"

") - end %> -<% end %> + end +end %> -<% if view.value.permissions then %> - <% if view.value.userid then %> -

<%= html.html_escape(view.value.userid.value) %>'s full permissions are

- <% elseif view.value.role then %> -

<%= html.html_escape(view.value.role.value) %>'s full permissions are

- <% end %> +<% if view.value.permissions then + if view.value.userid then + htmlviewfunctions.displayheader(cfe({label=view.value.userid.value.."'s full permissions are"}), page_info, htmlviewfunctions.incrementheader(header_level)) + elseif view.value.role then + htmlviewfunctions.displayheader(cfe({label=view.value.role.value.."'s full permissions are"}), page_info, htmlviewfunctions.incrementheader(header_level)) + end +%> -- cgit v1.2.3
ControllerAction(s)