gluon-config-mode-contact-info: better message if contact field is empty

This commit is contained in:
rubo77 2017-06-29 23:50:21 +02:00
parent b3762fc61c
commit 17195b7986
4 changed files with 66 additions and 9 deletions

View File

@ -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."

View File

@ -18,9 +18,20 @@ msgid ""
"you. Note that this information will be visible <em>publicly</em> on "
"the internet together with your node's coordinates."
msgstr ""
"S'il vous plaît entrez ici des informations <em>publiques</em> 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."

View File

@ -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 ""

View File

@ -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)
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'}