From b347bd14620b810e981734c798702ab47774c9db Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 15 Jan 2019 15:07:27 +0100 Subject: luci-base: add cbi tsection error msg option In some situation it is usefull to inform the use that this section could not get delete, because this config is referenced or is in use. Example pseudo code: function s.remove(self, sid) if output == nil then self.error_msg = translatef("Unable to remove this section") return nil end end Signed-off-by: Florian Eckert --- modules/luci-base/luasrc/view/cbi/tsection.htm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules') diff --git a/modules/luci-base/luasrc/view/cbi/tsection.htm b/modules/luci-base/luasrc/view/cbi/tsection.htm index 547a793329..8f3b7f0ffb 100644 --- a/modules/luci-base/luasrc/view/cbi/tsection.htm +++ b/modules/luci-base/luasrc/view/cbi/tsection.htm @@ -2,6 +2,11 @@ <% if self.title and #self.title > 0 then -%> <%=self.title%> <%- end %> + <% if self.error_msg and #self.error_msg > 0 then -%> +
+ <%=self.error_msg%> +
+ <%- end %> <% if self.description and #self.description > 0 then -%>
<%=self.description%>
<%- end %> -- cgit v1.2.3