-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gluon-config-mode-contact-info: better message if contact field is empty #909
Conversation
Die Frage ist, wie man die Warnung bearbeiten kann, ist so etwas vorgesehen in Lua? |
@@ -20,6 +20,13 @@ function M.section(form) | |||
o.datatype = "string" | |||
o.description = i18n.translate("e.g. E-mail or phone number") | |||
o.maxlen = 140 | |||
if uci:get_first("gluon-node-info", "owner", "contact", "") == "" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kann mir jemand einen Tipp geben, wie man das formulieren muss um abzufragen ob das formular schon einmal übertragen wurde? Nur dann soll die zusatz warning erscheinen. Im moment erscheint die immer
@TobleMiner hat da was geschrieben: freifunk-kiel/ffki-packages#7 |
Scheint zu funktionieren, zumindest, wenn man die Änderung so direkt auf enem Router im Config Mode in der Datei Werde nachher mal eine 2016.2.x Firmware damit bauen. Der Branch ist rebased und kann gemerged werden. |
@rubo77 ich fänd es gut, wenn der Default-Text vorsieht dass anonymer Betrieb ok ist und schlage vor Außerdem möchte ich anregen, dass die Reihenfolge der Punkte vom Allgemeinen zum Besonderen gehen sollte, konkret "Ein oder mehr benötigte Felder sind nicht ausgefüllt" sollte m.M.n. oben stehen. |
Über die Reihenfolge der Punkte habe ich keinen Einfluss, der Punkt "Ein oder mehr benötigte Felder sind nicht ausgefüllt" ist eine Standard-Message, die direkt aus LUA kommt und ist hier leider nicht weiter individualisierbar, sonst würde ich die ganz weglassen. Zumindest habe ich keine Idee, wie man die Reihenfolge ändern könnte. Ich glaube, das "wirklich" wegzulassen spricht gegen den eigendtlichen Zweck der Option contact Das "wirklich" in dem Satz macht noch mal deutlich, dass es in der Community ungewöhnlich ist, wenn jemand einen Knoten anonym betreibt. Wenn eine Community gerne anonyme Knotenbetreiber unterstützen will, dann müssen sie die Option contact |
o.validate = function(self, val) | ||
if val == nil then | ||
self.section.error = { | ||
[1] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The [1] =
is redundant, as you assign a single table element, it will have the key 1
by default.
i18n.translate( | ||
'You didn\'t provide any contact information! If you really want to run your ' | ||
.. 'node anonymously, you can enter a blank here. Please tell us an alternative ' | ||
.. 'how we could contact you in case there is anything wrong with your node.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I like this text. The exclamation mark seems a bit over the top; I'm not sure how common the word "blank" is, and recommending a way around our own restrictions is somewhat weird.
"alternative how we could contact you" -> "alternative way to contact you"
Also, using "
quotation marks instead of '
would be better here, as you wouldn't need to escape the '
in the text. In contrast to other languages, "
and '
strings aren't interpreted differently in Lua, the only difference is which quotationn marks need to be escaped in the text.
it's not about showing a way to circumvent our own restrictions but more an effect of psychology: users tend to just skip this step of entering a contact informations with the thought that they will do it later. But then they forget about how important it is for our community. this is the main reason for adding the option to make the contact field obligatory . on the other hand we don't want to urge people To not being Anonimus anymore, if they really want this |
but you are right, maybe some Community don't want to allow anonymous Nodes, then we have to add a third option for obligatory showing this warning.d |
I would like this "you did not fill out the contact field"-notification, even though our community doesn't plan on forcing users to publish a way of contact for everyone to see. Using the solution with a space would lead to unnecessary "owner" entries in the nodes.json. |
i implemented something similar, a javascript message "are you sure to leave this blank?": |
I don't like popup questions, and I know many others don't either. so an inbound warning is more suiting. I like it like this PR is now. only one change would enhance it, if it would be possible to get rid of the sentence "Ein oder mehr benötigte Felder sind nicht korrekt ausgefüllt!". I could think of hide it with javascript if that is an ok solution? |
Maybe here is a solution, how to just change the error message instead of adding a second: http://luci.subsignal.org/trac/wiki/Documentation/LuCI-0.10#TranslationFileFormat
the question is, how do I connect this code to the variable |
fbaf6fa
to
7f5404d
Compare
I solved it with that new function, so there is only one message now with this code: https://github.com/freifunk-gluon/gluon/pull/909/files#diff-3e120acf3433fa3168afa4f9995f2c5eR25 |
Still, this is telling people to enter a space, which is really ugly and cluttering the respondd data. I really don't like it. |
It is not complete "clutter". It is an extra information about the node-user, that he wants to be anonymous. Maybe we should not tell to enter a space, but crreate a checkbox:
And when clicked, the box hides the input field with javascript and enters the string in the hidden field (We would have to find out, how to use the value of a checkbox to manipulate the input value before the save action) |
I like the idea of adding a checkbox. Edit: The checkbox would just remove the text field and allow submitting the form. |
We have to keep in mind, that making it too easy to circumvent adding a contact will annullate the effect of the I like the way it is now, with a red warning, that draws the attention. Can we keep this while also adding a checkbox? hmm – Maybe the checkbox has to be inside the html code of the warning message. I think a checkbox will need a completely new kind of validation. the built-in validation can only handle required or not, but it cannot be changed from required to not on the fly, can it? |
A hidden field will be extempt from validation. We can even add a warning that is shown as soon as the user checks the box (thus replace the text field with the warning). |
Ok. I will add a message then: "Wir respektieren deinen Wunsch, den Knoten anonym zu betreiben. Um einen 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." Und eine zweite checkBox, die erst dann auftaucht, die man ankreuzen muss mit dieserm Label: |
@rubo77 do you still plan to work on this, as there was no activity for 3 months now? |
Yes. But I wait for the final gluon-web specification |
I would appreciate a scaled level selection for the PPA checkbox and the contact fields. |
You can remove the flag blocked. I pushed an untested version now, will continue tomorrow... |
|
||
contact_field:depends(no_name, false) | ||
|
||
-- TODO: this should only be shown, if no_name is true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should only be shown, if no_name is true. Someone has an idea how to solve this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, one option would be to use a value with a custom template instead of a section, but I guess it's a better idea to add dependency support for sections to gluon-web.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: #1349
do you plan to work on this significantly, soon? otherwise i would rather close this PR and you open a new one as soon as you want to work on it again... |
I am waiting for @NeoRaider to add dependency support for sections to gluon-web. |
I created an issue: #1349 |
yes, corrected 1408 to 1403. but 1403 is still rejected, so this doesn't change? |
I think it would be worth, adding some comments, if someone leaves the contact field empty. I don't suggest to make it mandatory again, but just an info, that a contact would serve the ppa. With the new sections functionality, this would be possible now |
If you don't enter a contact in config mode and
obligatory
is set totrue
you get this warning:siehe freifunk-kiel/ffki-packages#2
Klingt sehr harsch. und erweckt den Eindruck, dass man Freifunk nicht anonym beitreten dürfe. Besser wäre hier