libs/web: add error message printing to nullsection template, fixes server side valid...
[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         <div class="cbi-section-node" id="cbi-<%=self.config%>-<%=tostring(self):sub(8)%>">
6                 <div>
7                         <% self:render_children(1, scope or {}) %>
8                 </div>
9                 <% if self.error and self.error[1] then -%>
10                         <div class="cbi-section-error">
11                                 <ul><% for _, e in ipairs(self.error[1]) do -%>
12                                         <li>
13                                                 <%- if e == "invalid" then -%>
14                                                         <%:One or more fields contain invalid values!%>
15                                                 <%- elseif e == "missing" then -%>
16                                                         <%:One or more required fields have no value!%>
17                                                 <%- else -%>
18                                                         <%=pcdata(e)%>
19                                                 <%- end -%>
20                                         </li>
21                                 <%- end %></ul>
22                         </div>
23                 <%- end %>
24         </div>
25         <br />
26 </fieldset>
27 <%-
28         if type(self.hidden) == "table" then
29                 for k, v in pairs(self.hidden) do
30 -%>
31         <input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
32 <%-
33                 end
34         end
35 %>