From bd8ac05d56d89f0db6a1e06fefa9a8ce8776547d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 13 Jan 2011 20:02:16 +0000 Subject: [PATCH] libs/web: introduce width property for fields in tblsections --- libs/web/luasrc/view/cbi/tblsection.htm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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 -%> -- 2.25.1