gluon-config-mode-contact-info: better message if contact field is empty
This commit is contained in:
parent
b3762fc61c
commit
17195b7986
@ -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."
|
||||
|
@ -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."
|
||||
|
@ -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 ""
|
||||
|
@ -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'}
|
||||
|
Loading…
Reference in New Issue
Block a user