From afdc349ab4ff6bc89b0527f36d5197b7896d86f4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 10 Feb 2016 19:33:01 +0100 Subject: luci-base: cbi: rework ListValue and MultiValue templates Signed-off-by: Jo-Philipp Wich --- modules/luci-base/luasrc/view/cbi/mvalue.htm | 51 ++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 14 deletions(-) (limited to 'modules/luci-base/luasrc/view/cbi/mvalue.htm') diff --git a/modules/luci-base/luasrc/view/cbi/mvalue.htm b/modules/luci-base/luasrc/view/cbi/mvalue.htm index 79950cee2b..ccdd6fcab3 100644 --- a/modules/luci-base/luasrc/view/cbi/mvalue.htm +++ b/modules/luci-base/luasrc/view/cbi/mvalue.htm @@ -1,19 +1,42 @@ -<% local v = self:valuelist(section) or {} -%> +<% + local i, key + local v = self:valuelist(section) or {} +-%> + <%+cbi/valueheader%> <% if self.widget == "select" then %> - > + <% for i, key in pairs(self.keylist) do -%> + ><%=pcdata(self.vallist[i])%> + <%- end %> -<% elseif self.widget == "checkbox" then - local c = 0; - for i, key in pairs(self.keylist) do - c = c + 1 -%> - /> - ><%=self.vallist[i]%>
-<% if c == self.size then c = 0 %>
-<% end end %> +<% elseif self.widget == "checkbox" then %> + > + <% for i, key in pairs(self.keylist) do %> + > + /> + <%=pcdata(self.vallist[i])%> + + <% if i == self.size then write('
') end %> + <% end %> + <% end %> <%+cbi/valuefooter%> -- cgit v1.2.3