luci-0.8: add missing upload field
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 13 Dec 2008 15:37:17 +0000 (15:37 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 13 Dec 2008 15:37:17 +0000 (15:37 +0000)
libs/cbi/luasrc/view/cbi/upload.htm [new file with mode: 0644]

diff --git a/libs/cbi/luasrc/view/cbi/upload.htm b/libs/cbi/luasrc/view/cbi/upload.htm
new file mode 100644 (file)
index 0000000..b56b84b
--- /dev/null
@@ -0,0 +1,28 @@
+<%#
+LuCI - Lua Configuration Interface
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+$Id: upload.htm 3530 2008-10-07 15:41:15Z jow $
+
+-%>
+
+<%
+       local t = require("luci.tools.webadmin")
+       local v = self:cfgvalue(section)
+-%>
+<%+cbi/valueheader%>
+       <% if v then %>
+               <%:cbi_upload Uploaded File%> (<%=t.byte_format(luci.fs.stat(v).size or 0)%>)
+               <input type="hidden"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> />
+               <input class="cbi-input-image" type="image" value="<%:cbi_replace%>" name="cbi.rlf.<%=section .. "." .. self.option%>" alt="<%:cbi_replace%>" title="<%:cbi_replace%>" src="<%=resource%>/cbi/reload.gif" />
+       <% else %>
+               <input class="cbi-input-file" type="file"<%= attr("name", cbid) .. attr("id", cbid) %> />
+       <% end %>
+<%+cbi/valuefooter%>