From: Christian Schoenebeck Date: Mon, 8 Feb 2016 20:04:23 +0000 (+0100) Subject: luci-base: fixed tabbed map when using NamedSection of same type X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=refs%2Fpull%2F644%2Fhead;p=project%2Fluci.git luci-base: fixed tabbed map when using NamedSection of same type * fixed tabbed map when using NamedSection of same sectiontype * add error message on which tab(s) the invalid/required fields are located Signed-off-by: Christian Schoenebeck --- diff --git a/modules/luci-base/luasrc/view/cbi/map.htm b/modules/luci-base/luasrc/view/cbi/map.htm index 48403f1c33..e3210add63 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 %> -
  • - <%=section.title or section.sectiontype %> - <% if section.sectiontype == self.selected_tab then %><% end %> +
  • + <%=section.title or section.section or section.sectiontype %> + <% if section.sectiontype == self.selected_tab then %><% end %>
  • <% end %> +
    <% for i, section in ipairs(self.children) do %> -
    style="display:none"<% end %>> +
    style="display:none"<% end %>> <% section:render() %>
    - + <% end %> + + <% if not self.save then -%> +
    + <% for _, section in ipairs(self.children) do %> + <% if section.error and section.error[section.section] then -%> +
    • + <%:One or more invalid/required values on tab%>: <%=section.title or section.section or section.sectiontype%> +
    + <%- end %> + <% end %> +
    + <%- end %> <% else %> <%- self:render_children() %> <% end %> +
    diff --git a/modules/luci-base/po/de/base.po b/modules/luci-base/po/de/base.po index 0d11e96af0..f36d490267 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 5d4d1ce9de..e466a90539 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 ""