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: http://git.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=0d4ec2bbba8479154e63824e5315a0e0e01087a2 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 063e7e6e61..9a91432ad8 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 +%>