From eca5a0abf07d6c4a08278bec9c578bdf294929c8 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 27 Apr 2010 00:27:37 +0000 Subject: libs/cbi: - skip client side field validation if corrsponding field was removed due to dependencies - human readable error strings in uci section summary - implement field validation for dnyamic lists - render optional fields when section has tabs --- libs/cbi/luasrc/view/cbi/dynlist.htm | 9 ++++++++- libs/cbi/luasrc/view/cbi/ucisection.htm | 12 +++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'libs/cbi/luasrc/view') diff --git a/libs/cbi/luasrc/view/cbi/dynlist.htm b/libs/cbi/luasrc/view/cbi/dynlist.htm index 8e2bda8f98..826e2e698e 100644 --- a/libs/cbi/luasrc/view/cbi/dynlist.htm +++ b/libs/cbi/luasrc/view/cbi/dynlist.htm @@ -1,7 +1,7 @@ <%# LuCI - Lua Configuration Interface Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich +Copyright 2008-2010 Jo-Philipp Wich Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -42,4 +42,11 @@ $Id$ <% end -%> <% if i <= #vals then %>
<% end end %> +<% if self.datatype then -%> + +<% end -%> <%+cbi/valuefooter%> diff --git a/libs/cbi/luasrc/view/cbi/ucisection.htm b/libs/cbi/luasrc/view/cbi/ucisection.htm index b184908b0b..db32c90439 100644 --- a/libs/cbi/luasrc/view/cbi/ucisection.htm +++ b/libs/cbi/luasrc/view/cbi/ucisection.htm @@ -31,7 +31,17 @@ $Id$ <% if self.error and self.error[section] then -%>
-
    <% for _, e in ipairs(self.error[section]) do %>
  • <%=pcdata(e):gsub("\n","
    ")%>
  • <% end %>
+
    <% for _, e in ipairs(self.error[section]) 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 %>
<%- end %> -- cgit v1.2.3