From 8acf5715181a11a9af222efabd2d4b94740c6b58 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 18 Jan 2016 19:08:08 +0000 Subject: Revert changes inadvertently included in "Bump version to 0.8.7" This reverts commit 9ce48686e81f7ace3028a630c91795a8e76ea6a5. --- provisioning-listfiles-html.lsp | 4 ++-- provisioning-listtemplates-html.lsp | 20 ++++++++++---------- provisioning-model.lua | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/provisioning-listfiles-html.lsp b/provisioning-listfiles-html.lsp index e92e43f..5763912 100644 --- a/provisioning-listfiles-html.lsp +++ b/provisioning-listfiles-html.lsp @@ -39,8 +39,8 @@ html = require("acf.html") <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editfile"}), page_info, -1) %> <%= html.html_escape(file.filename) %> - <%= html.html_escape(file.size or 0) %>b<%= format.formatfilesize(file.size) %> - <%= format.formattime(file.mtime) %> + <%= html.html_escape(file.orig_size) %>b<%= html.html_escape(file.size) %> + <%= html.html_escape(file.mtime) %> <% end %> diff --git a/provisioning-listtemplates-html.lsp b/provisioning-listtemplates-html.lsp index 47226d7..579119d 100644 --- a/provisioning-listtemplates-html.lsp +++ b/provisioning-listtemplates-html.lsp @@ -38,25 +38,25 @@ html = require("acf.html") <% local filename = cfe({ type="hidden", value="" }) %> <% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> -<% for i,file in ipairs( view.value ) do %> +<% for k,v in ipairs( view.value ) do %> - <% filename.value = file.filename %> - <% if viewlibrary.check_permission("edittemplate") and file.label then %> + <% filename.value = v.filename %> + <% if viewlibrary.check_permission("edittemplate") and v.label then %> <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="edittemplate"}), page_info, -1) %> <% end %> - <% if viewlibrary.check_permission("deletetemplate") and file.label then %> + <% if viewlibrary.check_permission("deletetemplate") and v.label then %> <% htmlviewfunctions.displayitem(cfe({type="form", value={filename=filename}, label="", option="Delete", action="deletetemplate", class="deletetemplate"}), page_info, -1) %> <% end %> - <% if viewlibrary.check_permission("createtemplate") and not file.label then %> + <% if viewlibrary.check_permission("createtemplate") and not v.label then %> <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Create", action="createtemplate"}), page_info, -1) %> <% end %> - <%= html.html_escape(file.filename) %> - <%= html.html_escape(file.label) %> - <%= html.html_escape(file.seq) %> - <%= html.html_escape(file.size or 0) %>b<%= format.formatfilesize(file.size) %> - <%= format.formattime(file.mtime) %> + <%= html.html_escape(v.filename) %> + <%= html.html_escape(v.label) %> + <%= html.html_escape(v.seq) %> + <%= html.html_escape(v.orig_size) %>b<%= html.html_escape(v.size) %> + <%= html.html_escape(v.mtime) %> <% end %> diff --git a/provisioning-model.lua b/provisioning-model.lua index eac1623..877a2b7 100644 --- a/provisioning-model.lua +++ b/provisioning-model.lua @@ -571,7 +571,7 @@ mymodule.list_templates = function() fs.create_directory(baseurl) for f in posix.files(baseurl) do local file = baseurl..f - local details = posix.stat(file) + local details = fs.stat(file) if details.type == "regular" then if not reversed[file] then retval[#retval+1] = {filename=file} @@ -621,7 +621,7 @@ mymodule.get_template = function(self, clientdata) end end local filedetails = modelfunctions.getfiledetails(retval.filename.value, function(filename) return validator.is_valid_filename(filename, baseurl) end) - for i,n in ipairs({"filecontent", "size", "mtime"}) do + for i,n in ipairs({"filecontent", "filesize", "mtime"}) do retval[n] = filedetails.value[n] end @@ -2020,7 +2020,7 @@ end function mymodule.list_files() local retval = {} for i,file in ipairs(scriptfiles) do - local details = posix.stat(file) or {} + local details = fs.stat(file) or {} details.filename = file table.insert(retval, details) end -- cgit v1.2.3