libs/web: add error message printing to nullsection template, fixes server side validation in SimpleForm instances
This commit is contained in:
parent
4e538d09e1
commit
0d4ec2bbba
1 changed files with 34 additions and 17 deletions
|
@ -3,8 +3,25 @@
|
|||
<legend><%=self.title%></legend>
|
||||
<%- end %>
|
||||
<div class="cbi-section-node" id="cbi-<%=self.config%>-<%=tostring(self):sub(8)%>">
|
||||
<div>
|
||||
<% self:render_children(1, scope or {}) %>
|
||||
</div>
|
||||
<% if self.error and self.error[1] then -%>
|
||||
<div class="cbi-section-error">
|
||||
<ul><% for _, e in ipairs(self.error[1]) do -%>
|
||||
<li>
|
||||
<%- if e == "invalid" then -%>
|
||||
<%:One or more fields contain invalid values!%>
|
||||
<%- elseif e == "missing" then -%>
|
||||
<%:One or more required fields have no value!%>
|
||||
<%- else -%>
|
||||
<%=pcdata(e)%>
|
||||
<%- end -%>
|
||||
</li>
|
||||
<%- end %></ul>
|
||||
</div>
|
||||
<%- end %>
|
||||
</div>
|
||||
<br />
|
||||
</fieldset>
|
||||
<%-
|
||||
|
|
Loading…
Reference in a new issue