X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fweb%2Fluasrc%2Fview%2Fcbi%2Ftblsection.htm;h=c352cda0ca675b87cbe3d4392592ca36c5d895aa;hp=860d54ed76840d50da880a5604eeff82ef0d3b8c;hb=75f849ca583119e510ff41a2ff3579517ee10526;hpb=99bf12fb631b5633e8654123aa9e3a40a168a605 diff --git a/libs/web/luasrc/view/cbi/tblsection.htm b/libs/web/luasrc/view/cbi/tblsection.htm index 860d54ed7..c352cda0c 100644 --- a/libs/web/luasrc/view/cbi/tblsection.htm +++ b/libs/web/luasrc/view/cbi/tblsection.htm @@ -1,23 +1,19 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -$Id$ - --%> <%- local rowcnt = 1 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 -%> @@ -25,6 +21,9 @@ end <% if self.title and #self.title > 0 then -%> <%=self.title%> <%- end %> + <%- if self.sortable then -%> + + <%- end -%>
<%=self.description%>
<%- local count = 0 -%> @@ -38,12 +37,14 @@ 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 -%> - <%- count = count + 1; end; end; if self.extedit or self.addremove then -%> + <%- count = count + 1; end; end; if self.sortable then -%> + <%:Sort%> + <%- end; if self.extedit or self.addremove then -%>   <%- count = count + 1; end -%> @@ -56,8 +57,10 @@ end <%- end -%> <%- end -%> <%- for i, k in pairs(self.children) do if not k.optional then -%> - <%=k.description%> - <%- end; end; if self.extedit or self.addremove then -%> + ><%=k.description%> + <%- end; end; if self.sortable then -%> + + <%- end; if self.extedit or self.addremove then -%> <%- end -%> @@ -81,18 +84,25 @@ end end -%> + <%- if self.sortable then -%> + + + + + <%- end -%> + <%- if self.extedit or self.addremove then -%> - + <%- if self.extedit then -%> - - <%=self.extedit:format(section)%> - <%- elseif type(self.extedit) == "function" then -%> - <%=self:extedit(section)%> - <%- end -%> - " title="<%:Edit%>"><%:Edit%> + onclick="window.location='<%=self.extedit:format(section)%>'" + <%- elseif type(self.extedit) == "function" then + %> onclick="window.location='<%=self:extedit(section)%>'" + <%- end + %> alt="<%:Edit%>" title="<%:Edit%>" style="text-align: center;background-image:url(<%=resource%>/cbi/edit.gif)" /> <%- end; if self.addremove then %> - + <%- end -%> <%- end -%> @@ -118,11 +128,11 @@ end <% if self.template_addremove then include(self.template_addremove) else -%>
<% if self.anonymous then %> - + <% else %> <% if self.invalid_cts then -%>
<% end %> - - + + <% if self.invalid_cts then -%>
<%:Invalid%>