From: Jo-Philipp Wich Date: Sun, 20 Jul 2008 01:34:05 +0000 (+0000) Subject: * luci/libs/cbi: print a notice in empty tblsections X-Git-Tag: 0.8.0~601 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=94a968e62fba7c6a8bead83db339e525d6a9d39a * luci/libs/cbi: print a notice in empty tblsections * luci/i18n: added new string to cbi translations --- diff --git a/i18n/english/luasrc/i18n/cbi.en.lua b/i18n/english/luasrc/i18n/cbi.en.lua index ca3dcce57..14153989f 100644 --- a/i18n/english/luasrc/i18n/cbi.en.lua +++ b/i18n/english/luasrc/i18n/cbi.en.lua @@ -2,4 +2,5 @@ cbi_add = "Add entry" cbi_del = "Remove entry" cbi_invalid = "Error: Invalid input value" cbi_addopt = "-- Additional Field --" -cbi_optional = " (optional)" \ No newline at end of file +cbi_optional = " (optional)" +cbi_sectempty = "This section contains no values yet" diff --git a/i18n/german/luasrc/i18n/cbi.de.lua b/i18n/german/luasrc/i18n/cbi.de.lua index baa3a80da..f3ed31900 100644 --- a/i18n/german/luasrc/i18n/cbi.de.lua +++ b/i18n/german/luasrc/i18n/cbi.de.lua @@ -1,4 +1,5 @@ cbi_add = "Eintrag hinzufügen" cbi_del = "Eintrag entfernen" cbi_invalid = "Error: Ungültige Eingabe" -cbi_addopt = "-- Zusätzliches Feld --" \ No newline at end of file +cbi_addopt = "-- Zusätzliches Feld --" +cbi_sectempty = "Diese Sektion enthält noch keine Einträge" diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm index 6f2029e3b..44ff589d7 100644 --- a/libs/cbi/luasrc/view/cbi/tblsection.htm +++ b/libs/cbi/luasrc/view/cbi/tblsection.htm @@ -33,7 +33,10 @@ $Id$   <%- end -%> - <%- for i, k in ipairs(self:cfgsections()) do + <%- local isempty = true + for i, k in ipairs(self:cfgsections()) do + isempty = false + if not self.anonymous then -%> @@ -47,11 +50,17 @@ $Id$ <%-+cbi/ucisection-%> <%- if self.addremove then -%> - + <%- end -%> <%- end -%> + + <%- if isempty then -%> + + <%:cbi_sectempty%> + + <%- end -%> <%- if self.addremove then -%>