From: Florian Eckert Date: Tue, 15 Jan 2019 14:07:27 +0000 (+0100) Subject: luci-base: add cbi tsection error msg option X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=refs%2Fpull%2F2642%2Fhead;p=oweals%2Fluci.git 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 --- diff --git a/modules/luci-base/luasrc/view/cbi/tsection.htm b/modules/luci-base/luasrc/view/cbi/tsection.htm index 547a79332..8f3b7f0ff 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 %>