From: Jo-Philipp Wich Date: Thu, 13 Jan 2011 20:02:16 +0000 (+0000) Subject: libs/web: introduce width property for fields in tblsections X-Git-Tag: 0.11.0~2391 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=bd8ac05d56d89f0db6a1e06fefa9a8ce8776547d;ds=sidebyside libs/web: introduce width property for fields in tblsections --- diff --git a/libs/web/luasrc/view/cbi/tblsection.htm b/libs/web/luasrc/view/cbi/tblsection.htm index 860d54ed7..742817583 100644 --- a/libs/web/luasrc/view/cbi/tblsection.htm +++ b/libs/web/luasrc/view/cbi/tblsection.htm @@ -18,6 +18,16 @@ function rowstyle() rowcnt = rowcnt + 1 return (rowcnt % 2) + 1 end + +function width(o) + if o.width then + if type(o.width) == 'number' then + return ' style="width:%dpx"' % o.width + end + return ' style="width:%s"' % o.width + end + return '' +end -%> @@ -38,7 +48,7 @@ end <%- end -%> <%- end -%> <%- for i, k in pairs(self.children) do if not k.optional then -%> - + > <%- if k.titleref then -%><%- end -%> <%-=k.title-%> <%- if k.titleref then -%><%- end -%> @@ -56,7 +66,7 @@ end <%- end -%> <%- end -%> <%- for i, k in pairs(self.children) do if not k.optional then -%> - <%=k.description%> + ><%=k.description%> <%- end; end; if self.extedit or self.addremove then -%> <%- end -%> @@ -82,7 +92,7 @@ end -%> <%- if self.extedit or self.addremove then -%> - + <%- if self.extedit then -%>