summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--provisioning-listfiles-html.lsp16
-rw-r--r--provisioning-listtemplates-html.lsp16
-rw-r--r--provisioning-model.lua5
3 files changed, 5 insertions, 32 deletions
diff --git a/provisioning-listfiles-html.lsp b/provisioning-listfiles-html.lsp
index 8269e65..5763912 100644
--- a/provisioning-listfiles-html.lsp
+++ b/provisioning-listfiles-html.lsp
@@ -3,20 +3,6 @@ htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>
-<%
-function convertsize(size)
- if string.find(size, "k$") then
- return tonumber(string.match(size, "[%d.]*")) * 1024.0
- elseif string.find(size, "M$") then
- return tonumber(string.match(size, "[%d.]*")) * 1024.0 * 1024.0
- elseif string.find(size, "G$") then
- return tonumber(string.match(size, "[%d.]*")) + 1024.0 * 1024.0 * 1024.0
- else
- return tonumber(string.match(size, "[%d.]*"))
- end
-end
-%>
-
<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>');
@@ -53,7 +39,7 @@ end
<tr>
<td><% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editfile"}), page_info, -1) %></td>
<td><%= html.html_escape(file.filename) %></td>
- <td><span class="hide"><%= convertsize(file.size) %>b</span><%= html.html_escape(file.size) %></td>
+ <td><span class="hide"><%= html.html_escape(file.orig_size) %>b</span><%= html.html_escape(file.size) %></td>
<td><%= html.html_escape(file.mtime) %></td>
</tr>
<% end %>
diff --git a/provisioning-listtemplates-html.lsp b/provisioning-listtemplates-html.lsp
index a649bec..579119d 100644
--- a/provisioning-listtemplates-html.lsp
+++ b/provisioning-listtemplates-html.lsp
@@ -3,20 +3,6 @@ htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>
-<%
-function convertsize(size)
- if string.find(size, "k$") then
- return tonumber(string.match(size, "[%d.]*")) * 1024.0
- elseif string.find(size, "M$") then
- return tonumber(string.match(size, "[%d.]*")) * 1024.0 * 1024.0
- elseif string.find(size, "G$") then
- return tonumber(string.match(size, "[%d.]*")) + 1024.0 * 1024.0 * 1024.0
- else
- return tonumber(string.match(size, "[%d.]*"))
- end
-end
-%>
-
<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>');
@@ -69,7 +55,7 @@ end
<td><%= html.html_escape(v.filename) %></td>
<td><%= html.html_escape(v.label) %></td>
<td><%= html.html_escape(v.seq) %></td>
- <td><span class="hide"><%= convertsize(v.filesize) %>b</span><%= html.html_escape(v.filesize) %></td>
+ <td><span class="hide"><%= html.html_escape(v.orig_size) %>b</span><%= html.html_escape(v.size) %></td>
<td><%= html.html_escape(v.mtime) %></td>
</tr>
<% end %>
diff --git a/provisioning-model.lua b/provisioning-model.lua
index 560bc42..0468a57 100644
--- a/provisioning-model.lua
+++ b/provisioning-model.lua
@@ -537,8 +537,9 @@ mymodule.list_templates = function()
reversed[file] = #retval
end
local t = retval[reversed[file]]
- t.filesize = details.size
- t.mtime = details.mtime
+ for n,v in pairs(details) do
+ t[n] = v
+ end
end
end