diff --git a/modules/luci-base/luasrc/view/cbi/lvalue.htm b/modules/luci-base/luasrc/view/cbi/lvalue.htm index ac63e9efd4..61759fdd41 100644 --- a/modules/luci-base/luasrc/view/cbi/lvalue.htm +++ b/modules/luci-base/luasrc/view/cbi/lvalue.htm @@ -1,18 +1,42 @@ +<% + local i, key + local br = self.orientation == "horizontal" and ' ' or '
' +%> + <%+cbi/valueheader%> <% if self.widget == "select" then %> - > + <% for i, key in pairs(self.keylist) do -%> + ><%=pcdata(self.vallist[i])%> + <%- end %> -<% elseif self.widget == "radio" 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 %><% if self.orientation == "horizontal" then %> <% else %>
<% end %> -<% end end %> +<% elseif self.widget == "radio" then %> + > + <% for i, key in pairs(self.keylist) do %> + > + /> + <%=pcdata(self.vallist[i])%> + + <% if i == self.size then write(br) end %> + <% end %> + <% end %> <%+cbi/valuefooter%> 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%>