From 4e587d53a882be462f32e9e4bf03d87ed216871d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 20 Jul 2008 15:16:13 +0000 Subject: [PATCH] * luci/themes: several small tweaks in openwrt.org theme * luci/libs/cbi: some template improvements --- libs/cbi/luasrc/view/cbi/nsection.htm | 17 +++-- libs/cbi/luasrc/view/cbi/tblsection.htm | 9 +-- libs/cbi/luasrc/view/cbi/tsection.htm | 64 +++++++++++-------- libs/cbi/luasrc/view/cbi/ucisection.htm | 4 +- libs/cbi/luasrc/view/cbi/valuefooter.htm | 7 +- libs/cbi/luasrc/view/cbi/valueheader.htm | 7 +- .../luci-static/openwrt.org/cascade.css | 25 ++++++-- 7 files changed, 80 insertions(+), 53 deletions(-) diff --git a/libs/cbi/luasrc/view/cbi/nsection.htm b/libs/cbi/luasrc/view/cbi/nsection.htm index a999e47b57..3f86531097 100644 --- a/libs/cbi/luasrc/view/cbi/nsection.htm +++ b/libs/cbi/luasrc/view/cbi/nsection.htm @@ -14,8 +14,10 @@ $Id$ -%> <% if self:cfgvalue(self.section) then section = self.section %> -
-

<%=self.title%>

+
+ <% if self.title and #self.title > 0 then -%> + <%=self.title%> + <%- end %>
<%=self.description%>
<% if self.addremove then -%>
@@ -26,11 +28,14 @@ $Id$ <%+cbi/ucisection%>

-
+ <% elseif self.addremove then %> -
-

<%=self.title%>

+
+ <% if self.title and #self.title > 0 then -%> + <%=self.title%> + <%- end %>
<%=self.description%>
-
+ <% end %> + diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm index 44ff589d7c..acaf6693ef 100644 --- a/libs/cbi/luasrc/view/cbi/tblsection.htm +++ b/libs/cbi/luasrc/view/cbi/tblsection.htm @@ -13,6 +13,7 @@ $Id$ -%> +

<%=self.title%>

<%=self.description%>
@@ -35,8 +36,6 @@ $Id$ <%- local isempty = true for i, k in ipairs(self:cfgsections()) do - isempty = false - if not self.anonymous then -%> @@ -44,6 +43,7 @@ $Id$ <%- end section = k + isempty = false scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" } -%> @@ -55,10 +55,10 @@ $Id$ <%- end -%> <%- end -%> - + <%- if isempty then -%> - <%:cbi_sectempty%> +
<%:cbi_sectempty%>
<%- end -%> @@ -83,3 +83,4 @@ $Id$
+ diff --git a/libs/cbi/luasrc/view/cbi/tsection.htm b/libs/cbi/luasrc/view/cbi/tsection.htm index 9f4f2a50d7..da44cdc132 100644 --- a/libs/cbi/luasrc/view/cbi/tsection.htm +++ b/libs/cbi/luasrc/view/cbi/tsection.htm @@ -13,35 +13,45 @@ $Id$ -%> -
-

<%=self.title%>

+
+ <% if self.title and #self.title > 0 then -%> + <%=self.title%> + <%- end %>
<%=self.description%>
- <% for i, k in ipairs(self:cfgsections()) do -%> - <% if self.addremove then -%> -
- -
- <%- end %> - <% if not self.anonymous then %>

<%=k%>

<% end %> - <% section = k %> -
- <%+cbi/ucisection%> + <% local isempty = true for i, k in ipairs(self:cfgsections()) do -%> + <% if self.addremove then -%> +
+
-
<%- end %> + <% section = k; isempty = false %> - <% if self.addremove then -%> -
- <% if self.anonymous then -%> - - <%- else -%> - - - <%- end %> - - <% if self.err_invalid then -%> -
<%:cbi_invalid%>
- <%- end %> -
+ <% if not self.anonymous then -%> +

<%=k:upper()%>

<%- end %> -
+ +
+ <%+cbi/ucisection%> +
+
+ <%- end %> + + <% if isempty then -%> + <%:cbi_sectempty%>

+ <%- end %> + + <% if self.addremove then -%> +
+ <% if self.anonymous then -%> + + <%- else -%> + + + <%- end %> + + <% if self.err_invalid then -%> +
<%:cbi_invalid%>
+ <%- end %> +
+ <%- end %> +
diff --git a/libs/cbi/luasrc/view/cbi/ucisection.htm b/libs/cbi/luasrc/view/cbi/ucisection.htm index eb581cab78..e06cb5392b 100644 --- a/libs/cbi/luasrc/view/cbi/ucisection.htm +++ b/libs/cbi/luasrc/view/cbi/ucisection.htm @@ -22,9 +22,9 @@ $Id$ <% else %>