summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-07-12 16:46:10 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-07-12 16:46:10 +0000
commitdfe0287c6fbab70c359f97c4b9d72a53bc5ff0e2 (patch)
tree7335872cddcc4970288c179a8aaaba87c99bc6cf /libs/cbi
parentc026b6ed03d78dc408bbe468c2eda0a9fe85a4d5 (diff)
* luci/themes: lots of fixes in openwrt.org theme
* luci/libs/cbi: use <table> fpr table sections
Diffstat (limited to 'libs/cbi')
-rw-r--r--libs/cbi/luasrc/view/cbi/cell_valuefooter.htm27
-rw-r--r--libs/cbi/luasrc/view/cbi/cell_valueheader.htm15
-rw-r--r--libs/cbi/luasrc/view/cbi/tblsection.htm88
3 files changed, 97 insertions, 33 deletions
diff --git a/libs/cbi/luasrc/view/cbi/cell_valuefooter.htm b/libs/cbi/luasrc/view/cbi/cell_valuefooter.htm
new file mode 100644
index 000000000..045866d7b
--- /dev/null
+++ b/libs/cbi/luasrc/view/cbi/cell_valuefooter.htm
@@ -0,0 +1,27 @@
+<%#
+LuCI - Lua Configuration Interface
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+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$
+
+-%>
+
+ <%- if self.tag_invalid[section] then -%>
+ <div class="cbi-error"><%:cbi_invalid%></div>
+ <%- end -%>
+</td>
+
+<%- if #self.deps > 0 then -%>
+ <script type="text/javascript">
+ <% for j, d in ipairs(self.deps) do -%>
+ cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option%>", "cbid.<%=self.config.."."..section.."."..d.field%>", "<%=d.value%>");
+ <%- end %>
+ </script>
+<%- end -%>
diff --git a/libs/cbi/luasrc/view/cbi/cell_valueheader.htm b/libs/cbi/luasrc/view/cbi/cell_valueheader.htm
new file mode 100644
index 000000000..7b8f0a5d6
--- /dev/null
+++ b/libs/cbi/luasrc/view/cbi/cell_valueheader.htm
@@ -0,0 +1,15 @@
+<%#
+LuCI - Lua Configuration Interface
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+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$
+
+-%>
+<td class="cbi-value-field" id="cbi-<%=self.config.."-"..section.."-"..self.option%>">
diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm
index 2688e7a1b..367af80b8 100644
--- a/libs/cbi/luasrc/view/cbi/tblsection.htm
+++ b/libs/cbi/luasrc/view/cbi/tblsection.htm
@@ -16,38 +16,60 @@ $Id$
<h2><%=self.title%></h2>
<div class="cbi-section-descr"><%=self.description%></div>
<div class="cbi-section-node">
- <div class="cbi-section-row">
-<% for i, k in pairs(self.children) do %>
- <div class="cbi-section-row-head"><%=k.title%></div>
-<% end %>
- </div>
- <div class="cbi-section-row">
-<% for i, k in pairs(self.children) do %>
- <div class="cbi-section-row-descr"><%=k.description%></div>
-<% end %>
- </div>
-<% for i, k in ipairs(self:cfgsections()) do%>
- <% if not self.anonymous then %><h3 class="table-cell"><%=k%></h3><% end %>
-<%
-section = k
-scope = {valueheader = "cbi/tiny_valueheader", valuefooter = "cbi/tiny_valuefooter"}
-%>
-<div class="cbi-section-row" id="cbi-<%=self.config%>-<%=section%>">
-<%+cbi/ucisection%>
- <% if self.addremove then %><div class="cbi-section-remove table-cell">
- <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="X" />
- </div><% end %>
-</div>
-<% 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>
+ <%- local count = 0 -%>
+ <table class="cbi-section-table">
+ <tr class="cbi-section-table-titles">
+ <%- for i, k in pairs(self.children) do -%>
+ <th class="cbi-section-table-cell"><%=k.title%></th>
+ <%- count = count + 1; end; if self.addremove then -%>
+ <th class="cbi-section-table-cell">&nbsp;</th>
+ <%- count = count + 1; end -%>
+ </tr>
+ <tr class="cbi-section-table-descr">
+ <%- for i, k in pairs(self.children) do -%>
+ <th class="cbi-section-table-cell"><%=k.description%></th>
+ <%- end; if self.addremove then -%>
+ <th class="cbi-section-table-cell">&nbsp;</th>
+ <%- end -%>
+ </tr>
+ <%- for i, k in ipairs(self:cfgsections()) do
+ if not self.anonymous then
+ -%>
+ <tr class="cbi-section-table-title">
+ <th colspan="<%=count%>"><h3><%=k%></h3></th>
+ </tr>
+ <%- end
+ section = k
+ scope = { valueheader = "cbi/cell_valueheader", valuefooter = "cbi/cell_valuefooter" }
+ -%>
+ <tr class="cbi-section-table-row" id="cbi-<%=self.config%>-<%=section%>">
+ <%-+cbi/ucisection-%>
+ <%- if self.addremove then -%>
+ <td class="cbi-section-table-cell">
+ <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="X" />
+ </td>
+ <%- end -%>
+ </tr>
+ <%- end -%>
+
+ <%- if self.addremove then -%>
+ <tr class="cbi-section-table-row">
+ <td colspan="<%=count%>" class="cbi-section-table-optionals">
+ <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>
+ </td>
+ </tr>
+ <%- end -%>
+ </table>
</div>
-<% end %>
</div>