diff --git a/package/gluon-config-mode-contact-info/i18n/de.po b/package/gluon-config-mode-contact-info/i18n/de.po index 35f0ee95..a1ef75fd 100644 --- a/package/gluon-config-mode-contact-info/i18n/de.po +++ b/package/gluon-config-mode-contact-info/i18n/de.po @@ -25,3 +25,17 @@ msgstr "" msgid "e.g. E-mail or phone number" msgstr "z.B. E-Mail oder Telefonnummer" + +msgid "Anonymous node" +msgstr "Anonymer Knoten" + +msgid "" +"We respect your wish to operate the node anonymously. In order to operate a " +"Freifunk network, it is necessary that we can reach the operators of the " +"nodes. So please let us know an alternative way how we could contact you in " +"case there is anything wrong with your node." +msgstr "" +"Wir respektieren deinen Wunsch, den Knoten anonym zu betreiben. Um ein " +"Freifunk Netz zu betreiben, ist es notwendig, dass wir die Betreiber der " +"Knoten erreichen können. Deshalb teile uns bitte auf anderem Wege mit, wie " +"wir dich erreichen können, falls mit deinem Knoten etwas sein sollte." diff --git a/package/gluon-config-mode-contact-info/i18n/fr.po b/package/gluon-config-mode-contact-info/i18n/fr.po index 624b1864..ac340a6b 100644 --- a/package/gluon-config-mode-contact-info/i18n/fr.po +++ b/package/gluon-config-mode-contact-info/i18n/fr.po @@ -18,9 +18,20 @@ msgid "" "you. Note that this information will be visible publicly on " "the internet together with your node's coordinates." msgstr "" -"S'il vous plaît entrez ici des informations publiques pour " -"permettre aux autres de vous contacter. " -"Ces informations seront affichées en ligne, avec les coordonnées du nœud." msgid "e.g. E-mail or phone number" msgstr "Ex : E-mail ou numéro de téléphone" + +msgid "Anonymous node" +msgstr "Nœud anonyme" + +msgid "" +"We respect your wish to operate the node anonymously. In order to operate a " +"Freifunk network, it is necessary that we can reach the operators of the " +"nodes. So please let us know an alternative way how we could contact you in " +"case there is anything wrong with your node." +msgstr "" +"Nous respectons votre désir d'utiliser le nœud anonyme. Afin faire " +"fonctionner un réseau Freifunk, il est nécessaire d'atteindre les opérateurs " +"des nœuds. Donc, veuillez nous informer d'une manière alternative comment " +"nous pourrions vous contacter en cas de problème avec votre nœud." diff --git a/package/gluon-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot b/package/gluon-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot index 9dcaf9ec..452b2055 100644 --- a/package/gluon-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot +++ b/package/gluon-config-mode-contact-info/i18n/gluon-config-mode-contact-info.pot @@ -12,3 +12,13 @@ msgstr "" msgid "e.g. E-mail or phone number" msgstr "" + +msgid "Anonymous node" +msgstr "" + +msgid "" +"We respect your wish to operate the node anonymously. In order to operate a " +"Freifunk network, it is necessary that we can reach the operators of the " +"nodes. So please let us know an alternative way how we could contact you in " +"case there is anything wrong with your node." +msgstr "" diff --git a/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua b/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua index 4a3f3e81..0ce0b066 100644 --- a/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua +++ b/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua @@ -10,13 +10,35 @@ return function(form, uci) .. 'on the internet together with your node\'s coordinates.' )) - local o = s:option(Value, "contact", translate("Contact info"), translate("e.g. E-mail or phone number")) - o.default = uci:get("gluon-node-info", owner, "contact") - o.optional = not site.config_mode.owner.obligatory(false) + local contact_field = s:option(Value, "contact", translate("Contact info"), translate("e.g. E-mail or phone number")) + contact_field.default = uci:get("gluon-node-info", owner, "contact") + contact_field.optional = not ((site.config_mode or {}).owner or {}).obligatory -- without a minimal length, an empty string will be accepted even with "optional = false" - o.datatype = "minlength(1)" - function o:write(data) - uci:set("gluon-node-info", owner, "contact", data) + contact_field.datatype='minlength(1)' + contact_field.maxlen = 140 + + local no_name = s:option(Flag, "no_name", translate("Anonymous node")) + no_name.default = false + + contact_field:depends(no_name, false) + + -- TODO: this should only be shown, if no_name is true + local s = form:section(Section, nil, translate( + "We respect your wish to operate the node anonymously. In order to operate a " + .. "Freifunk network, it is necessary that we can reach the operators of the " + .. "nodes. So please let us know an alternative way how we could contact you in " + .. "case there is anything wrong with your node." + ) + ) + -- TODO: this doesn't work: + -- s:depends(no_name, false) + + function contact_field:write(data) + if data then + uci:set("gluon-node-info", owner, "contact", data) + else + uci:delete("gluon-node-info", owner, "contact") + end end return {'gluon-node-info'}