summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2019-01-15 15:07:27 +0100
committerFlorian Eckert <fe@dev.tdt.de>2019-03-29 09:27:04 +0100
commitb347bd14620b810e981734c798702ab47774c9db (patch)
tree5535b728bce34ae098aca0ac98917499c2045a4e /modules
parent8e3e502c45f5bdb8e1eb52c5a03c5fdbec9809df (diff)
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) <check if secation could get deleted> if output == nil then self.error_msg = translatef("Unable to remove this section") return nil end end Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-base/luasrc/view/cbi/tsection.htm5
1 files changed, 5 insertions, 0 deletions
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 -%>
<legend><%=self.title%></legend>
<%- end %>
+ <% if self.error_msg and #self.error_msg > 0 then -%>
+ <div class="cbi-section-error">
+ <%=self.error_msg%>
+ </div>
+ <%- end %>
<% if self.description and #self.description > 0 then -%>
<div class="cbi-section-descr"><%=self.description%></div>
<%- end %>