From: Jo-Philipp Wich Date: Sun, 8 Nov 2009 02:30:35 +0000 (+0000) Subject: libs/cbi: X-Git-Tag: 0.10.0~985 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=6ba1aef019e891bf10bd4bdcb34cd61cf813f881 libs/cbi: - support hidden fields for SimpleForm, NamedSection and TypedSection instances - add support for on_cancel event in SimpleForm instances --- diff --git a/libs/cbi/luasrc/view/cbi/nullsection.htm b/libs/cbi/luasrc/view/cbi/nullsection.htm index 9520b47ca..f1c715b40 100644 --- a/libs/cbi/luasrc/view/cbi/nullsection.htm +++ b/libs/cbi/luasrc/view/cbi/nullsection.htm @@ -20,4 +20,13 @@ $Id$ <% self:render_children(1, scope or {}) %>
- \ No newline at end of file + + <%- + if type(self.hidden) == "table" then + for k, v in pairs(self.hidden) do + -%> + + <%- + end + end + %> diff --git a/libs/cbi/luasrc/view/cbi/simpleform.htm b/libs/cbi/luasrc/view/cbi/simpleform.htm index d927660da..a0bb0f02b 100644 --- a/libs/cbi/luasrc/view/cbi/simpleform.htm +++ b/libs/cbi/luasrc/view/cbi/simpleform.htm @@ -33,17 +33,31 @@ $Id$ <%- end %> <% if not self.embedded then %>
+<%- + if type(self.hidden) == "table" then + for k, v in pairs(self.hidden) do +-%> + +<%- + end + end +%> <%- if self.flow and self.flow.skip then %> <% end %> <%- if self.submit ~= false then %> - <% end %> <%- if self.reset ~= false then %> - +<% end %> +<%- if self.cancel ~= false and self.on_cancel then %> + <% end %> diff --git a/libs/cbi/luasrc/view/cbi/ucisection.htm b/libs/cbi/luasrc/view/cbi/ucisection.htm index fa083c68f..b184908b0 100644 --- a/libs/cbi/luasrc/view/cbi/ucisection.htm +++ b/libs/cbi/luasrc/view/cbi/ucisection.htm @@ -17,7 +17,7 @@ $Id$ if type(self.hidden) == "table" then for k, v in pairs(self.hidden) do -%> - + <%- end end