From: Jo-Philipp Wich Date: Sun, 9 Oct 2011 18:43:11 +0000 (+0000) Subject: libs/web: add error message printing to nullsection template, fixes server side valid... X-Git-Tag: 0.11.0~1594 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0d4ec2bbba8479154e63824e5315a0e0e01087a2;p=oweals%2Fluci.git libs/web: add error message printing to nullsection template, fixes server side validation in SimpleForm instances --- diff --git a/libs/web/luasrc/view/cbi/nullsection.htm b/libs/web/luasrc/view/cbi/nullsection.htm index 063e7e6e6..9a91432ad 100644 --- a/libs/web/luasrc/view/cbi/nullsection.htm +++ b/libs/web/luasrc/view/cbi/nullsection.htm @@ -1,18 +1,35 @@ -
- <% if self.title and #self.title > 0 then -%> - <%=self.title%> - <%- end %> -
- <% self:render_children(1, scope or {}) %> +
+ <% if self.title and #self.title > 0 then -%> + <%=self.title%> + <%- end %> +
+
+ <% self:render_children(1, scope or {}) %> +
+ <% if self.error and self.error[1] then -%> +
+
    <% for _, e in ipairs(self.error[1]) do -%> +
  • + <%- 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 -%> +
  • + <%- end %>
-
-
- <%- - if type(self.hidden) == "table" then - for k, v in pairs(self.hidden) do - -%> - - <%- - end - end - %> + <%- end %> +
+
+
+<%- + if type(self.hidden) == "table" then + for k, v in pairs(self.hidden) do +-%> + +<%- + end + end +%>