summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorChristian Schoenebeck <christian.schoenebeck@gmail.com>2016-02-18 19:25:41 +0100
committerChristian Schoenebeck <christian.schoenebeck@gmail.com>2016-02-18 19:25:41 +0100
commit77f53904722d5c693812cd35f9c2fe2bfb31364e (patch)
tree88dcd84a86978d861be73d8d7132933cf9c0a7bd /modules
parent7e60685071cb8d95db4b0e8266d88631b4b2dbc1 (diff)
parent5fdfd903f485c551433ef88222b4739cbc617720 (diff)
Merge pull request #644 from chris5560/master
luci-base: fixed tabbed map when using NamedSection of same type
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-base/luasrc/view/cbi/map.htm24
-rw-r--r--modules/luci-base/po/de/base.po3
-rw-r--r--modules/luci-base/po/templates/base.pot3
3 files changed, 25 insertions, 5 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/map.htm b/modules/luci-base/luasrc/view/cbi/map.htm
index 48403f1c3..e3210add6 100644
--- a/modules/luci-base/luasrc/view/cbi/map.htm
+++ b/modules/luci-base/luasrc/view/cbi/map.htm
@@ -14,20 +14,34 @@
<%- self.selected_tab = luci.http.formvalue("tab.m-" .. self.config) %>
<% for i, section in ipairs(self.children) do %>
<%- if not self.selected_tab then self.selected_tab = section.sectiontype end %>
- <li id="tab.m-<%=self.config%>.<%=section.sectiontype%>" class="cbi-tab<%=(section.sectiontype == self.selected_tab) and '' or '-disabled'%>">
- <a onclick="this.blur(); return cbi_t_switch('m-<%=self.config%>', '<%=section.sectiontype%>')" href="<%=REQUEST_URI%>?tab.m-<%=self.config%>=<%=section.sectiontype%>"><%=section.title or section.sectiontype %></a>
- <% if section.sectiontype == self.selected_tab then %><input type="hidden" id="tab.m-<%=self.config%>" name="tab.m-<%=self.config%>" value="<%=section.sectiontype%>" /><% end %>
+ <li id="tab.m-<%=self.config%>.<%=section.section or section.sectiontype%>" class="cbi-tab<%=(section.sectiontype == self.selected_tab) and '' or '-disabled'%>">
+ <a onclick="this.blur(); return cbi_t_switch('m-<%=self.config%>', '<%=section.section or section.sectiontype%>')" href="<%=REQUEST_URI%>?tab.m-<%=self.config%>=<%=section.section or section.sectiontype%>"><%=section.title or section.section or section.sectiontype %></a>
+ <% if section.sectiontype == self.selected_tab then %><input type="hidden" id="tab.m-<%=self.config%>" name="tab.m-<%=self.config%>" value="<%=section.section or section.sectiontype%>" /><% end %>
</li>
<% end %>
</ul>
+ <br />
<% for i, section in ipairs(self.children) do %>
- <div class="cbi-tabcontainer" id="container.m-<%=self.config%>.<%=section.sectiontype%>"<% if section.sectiontype ~= self.selected_tab then %> style="display:none"<% end %>>
+ <div class="cbi-tabcontainer" id="container.m-<%=self.config%>.<%=section.section or section.sectiontype%>"<% if section.sectiontype ~= self.selected_tab then %> style="display:none"<% end %>>
<% section:render() %>
</div>
- <script type="text/javascript">cbi_t_add('m-<%=self.config%>', '<%=section.sectiontype%>')</script>
+ <script type="text/javascript">cbi_t_add('m-<%=self.config%>', '<%=section.section or section.sectiontype%>')</script>
<% end %>
+
+ <% if not self.save then -%>
+ <div class="cbi-section-error">
+ <% for _, section in ipairs(self.children) do %>
+ <% if section.error and section.error[section.section] then -%>
+ <ul><li>
+ <%:One or more invalid/required values on tab%>:&nbsp;<%=section.title or section.section or section.sectiontype%>
+ </li></ul>
+ <%- end %>
+ <% end %>
+ </div>
+ <%- end %>
<% else %>
<%- self:render_children() %>
<% end %>
+
<br />
</div>
diff --git a/modules/luci-base/po/de/base.po b/modules/luci-base/po/de/base.po
index 0d11e96af..f36d49026 100644
--- a/modules/luci-base/po/de/base.po
+++ b/modules/luci-base/po/de/base.po
@@ -1929,6 +1929,9 @@ msgstr "Es muss entweder ein Hostname oder eine MAC-Adresse angegeben werden!"
msgid "One or more fields contain invalid values!"
msgstr "Ein oder mehrere Felder enthalten ungültige Werte!"
+msgid "One or more invalid/required values on tab"
+msgstr "Ein oder mehrere ungültige/benötigte Werte auf Registerkarte"
+
msgid "One or more required fields have no value!"
msgstr "Ein oder mehr benötigte Felder sind nicht ausgefüllt!"
diff --git a/modules/luci-base/po/templates/base.pot b/modules/luci-base/po/templates/base.pot
index 5d4d1ce9d..e466a9053 100644
--- a/modules/luci-base/po/templates/base.pot
+++ b/modules/luci-base/po/templates/base.pot
@@ -1831,6 +1831,9 @@ msgstr ""
msgid "One or more fields contain invalid values!"
msgstr ""
+msgid "One or more invalid/required values on tab"
+msgstr ""
+
msgid "One or more required fields have no value!"
msgstr ""