* luci/libs/cbi: print a notice in empty tblsections
[oweals/luci.git] / libs / cbi / luasrc / view / cbi / tblsection.htm
index 6f2029e3bb07c85b0dd01de7addb7f3d0732ba26..44ff589d7c27bfa4153dccd30f7664f698eb5bed 100644 (file)
@@ -33,7 +33,10 @@ $Id$
                                <th class="cbi-section-table-cell">&nbsp;</th>
                        <%- end -%>
                        </tr>
-                       <%- for i, k in ipairs(self:cfgsections()) do
+                       <%- local isempty = true
+                           for i, k in ipairs(self:cfgsections()) do
+                                       isempty = false
+
                                        if not self.anonymous then
                        -%>
                        <tr class="cbi-section-table-title">
@@ -47,11 +50,17 @@ $Id$
                                <%-+cbi/ucisection-%>
                                <%- if self.addremove then -%>
                                        <td class="cbi-section-table-cell">
-                                               <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="X" />
+                                               <input type="submit" name="cbi.rts.<%=self.config%>.<%=k%>" value="X" title="<%:delete%>" />
                                        </td>
                                <%- end -%>
                        </tr>
                        <%- end -%>
+                       
+                       <%- if isempty then -%>
+                       <tr class="cbi-section-table-row">
+                               <td colspan="<%=count%>"><em><%:cbi_sectempty%></em></td>
+                       </tr>
+                       <%- end -%>
 
                        <%- if self.addremove then -%>
                        <tr class="cbi-section-table-row">