summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-07-20 15:16:13 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-07-20 15:16:13 +0000
commit4e587d53a882be462f32e9e4bf03d87ed216871d (patch)
tree62df868cc4c6f83404bb66cdd37bcb75879e8864 /libs/cbi/luasrc
parent94a968e62fba7c6a8bead83db339e525d6a9d39a (diff)
* luci/themes: several small tweaks in openwrt.org theme
* luci/libs/cbi: some template improvements
Diffstat (limited to 'libs/cbi/luasrc')
-rw-r--r--libs/cbi/luasrc/view/cbi/nsection.htm17
-rw-r--r--libs/cbi/luasrc/view/cbi/tblsection.htm9
-rw-r--r--libs/cbi/luasrc/view/cbi/tsection.htm64
-rw-r--r--libs/cbi/luasrc/view/cbi/ucisection.htm4
-rw-r--r--libs/cbi/luasrc/view/cbi/valuefooter.htm7
-rw-r--r--libs/cbi/luasrc/view/cbi/valueheader.htm7
6 files changed, 59 insertions, 49 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 %>
- <div class="cbi-section" id="cbi-<%=self.config%>-<%=section%>">
- <h2><%=self.title%></h2>
+ <fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=section%>">
+ <% if self.title and #self.title > 0 then -%>
+ <legend><%=self.title%></legend>
+ <%- end %>
<div class="cbi-section-descr"><%=self.description%></div>
<% if self.addremove then -%>
<div class="cbi-section-remove right">
@@ -26,11 +28,14 @@ $Id$
<%+cbi/ucisection%>
</div>
<br />
- </div>
+ </fieldset>
<% elseif self.addremove then %>
- <div class="cbi-section" id="cbi-<%=self.config%>-<%=self.section%>">
- <h2><%=self.title%></h2>
+ <fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.section%>">
+ <% if self.title and #self.title > 0 then -%>
+ <legend><%=self.title%></legend>
+ <%- end %>
<div class="cbi-section-descr"><%=self.description%></div>
<input type="submit" name="cbi.cns.<%=self.config%>.<%=self.section%>" value="<%:cbi_add%>" />
- </div>
+ </fieldset>
<% end %>
+<!-- /nsection -->
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$
-%>
+<!-- tblsection -->
<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
<h2><%=self.title%></h2>
<div class="cbi-section-descr"><%=self.description%></div>
@@ -35,8 +36,6 @@ $Id$
</tr>
<%- local isempty = true
for i, k in ipairs(self:cfgsections()) do
- isempty = false
-
if not self.anonymous then
-%>
<tr class="cbi-section-table-title">
@@ -44,6 +43,7 @@ $Id$
</tr>
<%- end
section = k
+ isempty = false
scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
-%>
<tr class="cbi-section-table-row" id="cbi-<%=self.config%>-<%=section%>">
@@ -55,10 +55,10 @@ $Id$
<%- end -%>
</tr>
<%- end -%>
-
+
<%- if isempty then -%>
<tr class="cbi-section-table-row">
- <td colspan="<%=count%>"><em><%:cbi_sectempty%></em></td>
+ <td colspan="<%=count%>"><em><br /><%:cbi_sectempty%></em></td>
</tr>
<%- end -%>
@@ -83,3 +83,4 @@ $Id$
</table>
</div>
</div>
+<!-- /tblsection -->
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$
-%>
-<div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
- <h2><%=self.title%></h2>
+<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
+ <% if self.title and #self.title > 0 then -%>
+ <legend><%=self.title%></legend>
+ <%- end %>
<div class="cbi-section-descr"><%=self.description%></div>
- <% for i, k in ipairs(self:cfgsections()) do -%>
- <% if self.addremove then -%>
- <div class="cbi-section-remove right">
- <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="<%:cbi_del%>" />
- </div>
- <%- end %>
- <% if not self.anonymous then %><h3><%=k%></h3><% end %>
- <% section = k %>
- <div class="cbi-section-node" id="cbi-<%=self.config%>-<%=section%>">
- <%+cbi/ucisection%>
+ <% local isempty = true for i, k in ipairs(self:cfgsections()) do -%>
+ <% if self.addremove then -%>
+ <div class="cbi-section-remove right">
+ <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="<%:cbi_del%>" />
</div>
- <br />
<%- end %>
+ <% section = k; isempty = false %>
- <% if self.addremove then -%>
- <div class="cbi-section-create">
- <% if self.anonymous then -%>
- <input type="submit" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" value="<%:cbi_add%>" />
- <%- else -%>
- <input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
- <input type="submit" value="<%:cbi_add%>" />
- <%- end %>
-
- <% if self.err_invalid then -%>
- <div class="cbi-error"><%:cbi_invalid%></div>
- <%- end %>
- </div>
+ <% if not self.anonymous then -%>
+ <h3><%=k:upper()%></h3>
<%- end %>
- </div>
+
+ <fieldset class="cbi-section-node" id="cbi-<%=self.config%>-<%=section%>">
+ <%+cbi/ucisection%>
+ </fieldset>
+ <br />
+ <%- end %>
+
+ <% if isempty then -%>
+ <em><%:cbi_sectempty%><br /><br /></em>
+ <%- end %>
+
+ <% if self.addremove then -%>
+ <div class="cbi-section-create">
+ <% if self.anonymous then -%>
+ <input type="submit" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" value="<%:cbi_add%>" />
+ <%- else -%>
+ <input type="text" class="cbi-section-create-name" name="cbi.cts.<%=self.config%>.<%=self.sectiontype%>" />
+ <input type="submit" value="<%:cbi_add%>" />
+ <%- end %>
+
+ <% if self.err_invalid then -%>
+ <div class="cbi-error"><%:cbi_invalid%></div>
+ <%- end %>
+ </div>
+ <%- end %>
+</fieldset>
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 %>
<select name="cbi.opt.<%=self.config%>.<%=section%>">
<option><%:cbi_addopt%></option>
- <% for key, val in pairs(self.optionals[section]) do %>
+ <% for key, val in pairs(self.optionals[section]) do -%>
<option id="cbi-<%=self.config.."-"..section.."-"..val.option%>" value="<%=val.option%>"><%=val.title%></option>
- <% end %>
+ <%- end %>
</select>
<script type="text/javascript"><% for key, val in pairs(self.optionals[section]) do %>
<% if #val.deps > 0 then %><% for j, d in ipairs(val.deps) do %>cbi_d_add("cbi-<%=self.config.."-"..section.."-"..val.option%>", "cbid.<%=self.config.."."..section.."."..d.field%>", "<%=d.value%>");
diff --git a/libs/cbi/luasrc/view/cbi/valuefooter.htm b/libs/cbi/luasrc/view/cbi/valuefooter.htm
index 9572821b64..a65c7a3874 100644
--- a/libs/cbi/luasrc/view/cbi/valuefooter.htm
+++ b/libs/cbi/luasrc/view/cbi/valuefooter.htm
@@ -12,8 +12,5 @@ You may obtain a copy of the License at
$Id$
-%>
-<% if valuefooter then
- include(valuefooter)
-else
- include("cbi/full_valuefooter")
-end %> \ No newline at end of file
+
+<% include( valuefooter or "cbi/full_valuefooter" ) %>
diff --git a/libs/cbi/luasrc/view/cbi/valueheader.htm b/libs/cbi/luasrc/view/cbi/valueheader.htm
index 8adc57afe3..f3da909e66 100644
--- a/libs/cbi/luasrc/view/cbi/valueheader.htm
+++ b/libs/cbi/luasrc/view/cbi/valueheader.htm
@@ -12,8 +12,5 @@ You may obtain a copy of the License at
$Id$
-%>
-<% if valueheader then
- include(valueheader)
-else
- include("cbi/full_valueheader")
-end %> \ No newline at end of file
+
+<% include( valueheader or "cbi/full_valueheader" ) %>