libs/web: cbi: support description attribute in nullsection instances
[project/luci.git] / libs / web / luasrc / view / cbi / nullsection.htm
1 <fieldset class="cbi-section">
2         <% if self.title and #self.title > 0 then -%>
3                 <legend><%=self.title%></legend>
4         <%- end %>
5         <% if self.description and #self.description > 0 then -%>
6                 <div class="cbi-section-descr"><%=self.description%></div>
7         <%- end %>
8         <div class="cbi-section-node" id="cbi-<%=self.config%>-<%=tostring(self):sub(8)%>">
9                 <div>
10                         <% self:render_children(1, scope or {}) %>
11                 </div>
12                 <% if self.error and self.error[1] then -%>
13                         <div class="cbi-section-error">
14                                 <ul><% for _, e in ipairs(self.error[1]) do -%>
15                                         <li>
16                                                 <%- if e == "invalid" then -%>
17                                                         <%:One or more fields contain invalid values!%>
18                                                 <%- elseif e == "missing" then -%>
19                                                         <%:One or more required fields have no value!%>
20                                                 <%- else -%>
21                                                         <%=pcdata(e)%>
22                                                 <%- end -%>
23                                         </li>
24                                 <%- end %></ul>
25                         </div>
26                 <%- end %>
27         </div>
28         <br />
29 </fieldset>
30 <%-
31         if type(self.hidden) == "table" then
32                 for k, v in pairs(self.hidden) do
33 -%>
34         <input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
35 <%-
36                 end
37         end
38 %>