You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by cu...@apache.org on 2019/05/02 13:07:36 UTC
[whimsy] branch master updated (ca782b5 -> 80d5db8)
This is an automated email from the ASF dual-hosted git repository.
curcuru pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git.
from ca782b5 Display tweaks and code cleanup
new 77bbd9e Select multiple attr must be either present or not at all
new f9b09ab Revert "Select multiple attr must be either present or not at all"
new 80d5db8 Revert "Revert "Select multiple attr must be either present or not at all""
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
lib/whimsy/asf/forms.rb | 8 ++++++-
www/members/mentor-format.rb | 53 +++++++++++++++++++++++++++++++++++++++++++
www/members/mentor-update.cgi | 25 +++++++++++++++-----
3 files changed, 79 insertions(+), 7 deletions(-)
[whimsy] 02/03: Revert "Select multiple attr must be either present
or not at all"
Posted by cu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
curcuru pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
commit f9b09ab67906f96642a4913cb50fe4aa21f2cabb
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Thu May 2 08:56:15 2019 -0400
Revert "Select multiple attr must be either present or not at all"
This reverts commit 77bbd9e77c5a833cf304591689c954d43e8ca591.
---
lib/whimsy/asf/forms.rb | 8 +------
www/members/mentor-format.rb | 53 -------------------------------------------
www/members/mentor-update.cgi | 25 +++++---------------
3 files changed, 7 insertions(+), 79 deletions(-)
diff --git a/lib/whimsy/asf/forms.rb b/lib/whimsy/asf/forms.rb
index e5f8a8d..5e54c3b 100644
--- a/lib/whimsy/asf/forms.rb
+++ b/lib/whimsy/asf/forms.rb
@@ -87,13 +87,7 @@ class Wunderbar::HtmlMarkup
_label.control_label.col_sm_3 label, for: "#{name}"
_div.col_sm_9 do
_div.input_group do
- args = {
- name: "#{name}", id: "#{name}", aria_describedby: "#{aria_describedby}", required: required, readonly: readonly
- }
- if multiple
- args['multiple'] = 'true'
- end
- _select.form_control args do
+ _select.form_control name: "#{name}", id: "#{name}", aria_describedby: "#{aria_describedby}", required: required, readonly: readonly do
if ''.eql?(value)
if ''.eql?(placeholder)
_option '', value: '', selected: 'selected'
diff --git a/www/members/mentor-format.rb b/www/members/mentor-format.rb
index 924a8ec..29eee37 100644
--- a/www/members/mentor-format.rb
+++ b/www/members/mentor-format.rb
@@ -11,59 +11,6 @@ class MentorFormat
ERRORS = 'errors'
TIMEZONE = 'timezone'
TZ = TZInfo::Timezone.all_country_zone_identifiers
- PREFERS_TYPES = [
- 'email',
- 'phone',
- 'Slack',
- 'irc',
- 'Hangouts',
- 'Facebook',
- 'Skype',
- 'other (text chat)',
- 'other (video chat)'
- ]
- LANGUAGES = [ # Wikipedia top list by total speakers, plus EU
- 'Arabic',
- 'Bengali',
- 'Bulgarian',
- 'Chinese',
- 'Croatian',
- 'Czech',
- 'Danish',
- 'Dutch',
- 'English',
- 'Estonian',
- 'Finnish',
- 'French',
- 'German',
- 'Greek',
- 'Hindi',
- 'Hungarian',
- 'Indonesean',
- 'Irish',
- 'Italian',
- 'Japanese',
- 'Korean',
- 'Latvian',
- 'Lithuanian',
- 'Maltese',
- 'Marathi',
- 'Polish',
- 'Portugese',
- 'Punjabi',
- 'Romanian',
- 'Russian',
- 'Slovak',
- 'Slovene',
- 'Spanish',
- 'Swahili',
- 'Swedish',
- 'Tamil',
- 'Telugu',
- 'Thai',
- 'Turkish',
- 'Vietnamese'
- ]
# Read mapping of labels to fields
def self.get_uimap(path)
diff --git a/www/members/mentor-update.cgi b/www/members/mentor-update.cgi
index 51b76c2..af80e33 100755
--- a/www/members/mentor-update.cgi
+++ b/www/members/mentor-update.cgi
@@ -45,20 +45,8 @@ def emit_form(apacheid, mdata, button_help, uimap)
helptext: uimap[field][1]
)
emit_mentor_input('availability', mdata, uimap, 'glyphicon-hourglass')
- field = 'prefers'
- _whimsy_forms_select(label: uimap[field][0], name: field, multiple: true,
- value: (mdata[field] ? mdata[field] : ''),
- options: MentorFormat::PREFERS_TYPES,
- icon: 'glyphicon-ok-sign', iconlabel: 'ok-sign',
- helptext: uimap[field][1]
- )
- field = 'languages'
- _whimsy_forms_select(label: uimap[field][0], name: field, multiple: true,
- value: (mdata[field] ? mdata[field] : ''),
- options: MentorFormat::LANGUAGES,
- icon: 'glyphicon-globe', iconlabel: 'globe',
- helptext: uimap[field][1]
- )
+ emit_mentor_input('prefers', mdata, uimap, 'glyphicon-ok-sign')
+ emit_mentor_input('languages', mdata, uimap, 'glyphicon-globe')
_div.form_group do
_label.col_sm_offset_3.col_sm_9.strong.text_left 'What You Could Help Mentees With'
@@ -213,19 +201,18 @@ _html do
# Display data to the user, depending if we're GET (existing mentor record or just blank data) or POST (show SVN checkin results)
if _.post?
- submission = {
+ submission = { # TODO make this a loop over uimap.keys; TODO check if we want any other fields
"timezone" => "#{@timezone}",
"availability" => "#{@availability}",
"contact" => "#{@contact}",
+ "prefers" => "#{@prefers}",
"available" => "#{@available}",
"mentoring" => "#{@mentoring}",
"experience" => "#{@experience}",
+ "languages" => "#{@languages}",
"pronouns" => "#{@pronouns}",
"aboutme" => "#{@aboutme}",
- "homepage" => "#{@homepage}",
- # Multiple select fields
- "prefers" => _.params['prefers'],
- "languages" => _.params['languages']
+ "homepage" => "#{@homepage}"
}
if @notavailable
submission['notavailable'] = "#{@notavailable}"
[whimsy] 01/03: Select multiple attr must be either present or not
at all
Posted by cu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
curcuru pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
commit 77bbd9e77c5a833cf304591689c954d43e8ca591
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Thu May 2 08:55:35 2019 -0400
Select multiple attr must be either present or not at all
---
lib/whimsy/asf/forms.rb | 8 ++++++-
www/members/mentor-format.rb | 53 +++++++++++++++++++++++++++++++++++++++++++
www/members/mentor-update.cgi | 25 +++++++++++++++-----
3 files changed, 79 insertions(+), 7 deletions(-)
diff --git a/lib/whimsy/asf/forms.rb b/lib/whimsy/asf/forms.rb
index 5e54c3b..e5f8a8d 100644
--- a/lib/whimsy/asf/forms.rb
+++ b/lib/whimsy/asf/forms.rb
@@ -87,7 +87,13 @@ class Wunderbar::HtmlMarkup
_label.control_label.col_sm_3 label, for: "#{name}"
_div.col_sm_9 do
_div.input_group do
- _select.form_control name: "#{name}", id: "#{name}", aria_describedby: "#{aria_describedby}", required: required, readonly: readonly do
+ args = {
+ name: "#{name}", id: "#{name}", aria_describedby: "#{aria_describedby}", required: required, readonly: readonly
+ }
+ if multiple
+ args['multiple'] = 'true'
+ end
+ _select.form_control args do
if ''.eql?(value)
if ''.eql?(placeholder)
_option '', value: '', selected: 'selected'
diff --git a/www/members/mentor-format.rb b/www/members/mentor-format.rb
index 29eee37..924a8ec 100644
--- a/www/members/mentor-format.rb
+++ b/www/members/mentor-format.rb
@@ -11,6 +11,59 @@ class MentorFormat
ERRORS = 'errors'
TIMEZONE = 'timezone'
TZ = TZInfo::Timezone.all_country_zone_identifiers
+ PREFERS_TYPES = [
+ 'email',
+ 'phone',
+ 'Slack',
+ 'irc',
+ 'Hangouts',
+ 'Facebook',
+ 'Skype',
+ 'other (text chat)',
+ 'other (video chat)'
+ ]
+ LANGUAGES = [ # Wikipedia top list by total speakers, plus EU
+ 'Arabic',
+ 'Bengali',
+ 'Bulgarian',
+ 'Chinese',
+ 'Croatian',
+ 'Czech',
+ 'Danish',
+ 'Dutch',
+ 'English',
+ 'Estonian',
+ 'Finnish',
+ 'French',
+ 'German',
+ 'Greek',
+ 'Hindi',
+ 'Hungarian',
+ 'Indonesean',
+ 'Irish',
+ 'Italian',
+ 'Japanese',
+ 'Korean',
+ 'Latvian',
+ 'Lithuanian',
+ 'Maltese',
+ 'Marathi',
+ 'Polish',
+ 'Portugese',
+ 'Punjabi',
+ 'Romanian',
+ 'Russian',
+ 'Slovak',
+ 'Slovene',
+ 'Spanish',
+ 'Swahili',
+ 'Swedish',
+ 'Tamil',
+ 'Telugu',
+ 'Thai',
+ 'Turkish',
+ 'Vietnamese'
+ ]
# Read mapping of labels to fields
def self.get_uimap(path)
diff --git a/www/members/mentor-update.cgi b/www/members/mentor-update.cgi
index af80e33..51b76c2 100755
--- a/www/members/mentor-update.cgi
+++ b/www/members/mentor-update.cgi
@@ -45,8 +45,20 @@ def emit_form(apacheid, mdata, button_help, uimap)
helptext: uimap[field][1]
)
emit_mentor_input('availability', mdata, uimap, 'glyphicon-hourglass')
- emit_mentor_input('prefers', mdata, uimap, 'glyphicon-ok-sign')
- emit_mentor_input('languages', mdata, uimap, 'glyphicon-globe')
+ field = 'prefers'
+ _whimsy_forms_select(label: uimap[field][0], name: field, multiple: true,
+ value: (mdata[field] ? mdata[field] : ''),
+ options: MentorFormat::PREFERS_TYPES,
+ icon: 'glyphicon-ok-sign', iconlabel: 'ok-sign',
+ helptext: uimap[field][1]
+ )
+ field = 'languages'
+ _whimsy_forms_select(label: uimap[field][0], name: field, multiple: true,
+ value: (mdata[field] ? mdata[field] : ''),
+ options: MentorFormat::LANGUAGES,
+ icon: 'glyphicon-globe', iconlabel: 'globe',
+ helptext: uimap[field][1]
+ )
_div.form_group do
_label.col_sm_offset_3.col_sm_9.strong.text_left 'What You Could Help Mentees With'
@@ -201,18 +213,19 @@ _html do
# Display data to the user, depending if we're GET (existing mentor record or just blank data) or POST (show SVN checkin results)
if _.post?
- submission = { # TODO make this a loop over uimap.keys; TODO check if we want any other fields
+ submission = {
"timezone" => "#{@timezone}",
"availability" => "#{@availability}",
"contact" => "#{@contact}",
- "prefers" => "#{@prefers}",
"available" => "#{@available}",
"mentoring" => "#{@mentoring}",
"experience" => "#{@experience}",
- "languages" => "#{@languages}",
"pronouns" => "#{@pronouns}",
"aboutme" => "#{@aboutme}",
- "homepage" => "#{@homepage}"
+ "homepage" => "#{@homepage}",
+ # Multiple select fields
+ "prefers" => _.params['prefers'],
+ "languages" => _.params['languages']
}
if @notavailable
submission['notavailable'] = "#{@notavailable}"
[whimsy] 03/03: Revert "Revert "Select multiple attr must be either
present or not at all""
Posted by cu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
curcuru pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
commit 80d5db8ae8fd8f69baf7ff1fa18d81eb8923f09e
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Thu May 2 09:00:26 2019 -0400
Revert "Revert "Select multiple attr must be either present or not at all""
This reverts commit f9b09ab67906f96642a4913cb50fe4aa21f2cabb.
---
lib/whimsy/asf/forms.rb | 8 ++++++-
www/members/mentor-format.rb | 53 +++++++++++++++++++++++++++++++++++++++++++
www/members/mentor-update.cgi | 25 +++++++++++++++-----
3 files changed, 79 insertions(+), 7 deletions(-)
diff --git a/lib/whimsy/asf/forms.rb b/lib/whimsy/asf/forms.rb
index 5e54c3b..e5f8a8d 100644
--- a/lib/whimsy/asf/forms.rb
+++ b/lib/whimsy/asf/forms.rb
@@ -87,7 +87,13 @@ class Wunderbar::HtmlMarkup
_label.control_label.col_sm_3 label, for: "#{name}"
_div.col_sm_9 do
_div.input_group do
- _select.form_control name: "#{name}", id: "#{name}", aria_describedby: "#{aria_describedby}", required: required, readonly: readonly do
+ args = {
+ name: "#{name}", id: "#{name}", aria_describedby: "#{aria_describedby}", required: required, readonly: readonly
+ }
+ if multiple
+ args['multiple'] = 'true'
+ end
+ _select.form_control args do
if ''.eql?(value)
if ''.eql?(placeholder)
_option '', value: '', selected: 'selected'
diff --git a/www/members/mentor-format.rb b/www/members/mentor-format.rb
index 29eee37..924a8ec 100644
--- a/www/members/mentor-format.rb
+++ b/www/members/mentor-format.rb
@@ -11,6 +11,59 @@ class MentorFormat
ERRORS = 'errors'
TIMEZONE = 'timezone'
TZ = TZInfo::Timezone.all_country_zone_identifiers
+ PREFERS_TYPES = [
+ 'email',
+ 'phone',
+ 'Slack',
+ 'irc',
+ 'Hangouts',
+ 'Facebook',
+ 'Skype',
+ 'other (text chat)',
+ 'other (video chat)'
+ ]
+ LANGUAGES = [ # Wikipedia top list by total speakers, plus EU
+ 'Arabic',
+ 'Bengali',
+ 'Bulgarian',
+ 'Chinese',
+ 'Croatian',
+ 'Czech',
+ 'Danish',
+ 'Dutch',
+ 'English',
+ 'Estonian',
+ 'Finnish',
+ 'French',
+ 'German',
+ 'Greek',
+ 'Hindi',
+ 'Hungarian',
+ 'Indonesean',
+ 'Irish',
+ 'Italian',
+ 'Japanese',
+ 'Korean',
+ 'Latvian',
+ 'Lithuanian',
+ 'Maltese',
+ 'Marathi',
+ 'Polish',
+ 'Portugese',
+ 'Punjabi',
+ 'Romanian',
+ 'Russian',
+ 'Slovak',
+ 'Slovene',
+ 'Spanish',
+ 'Swahili',
+ 'Swedish',
+ 'Tamil',
+ 'Telugu',
+ 'Thai',
+ 'Turkish',
+ 'Vietnamese'
+ ]
# Read mapping of labels to fields
def self.get_uimap(path)
diff --git a/www/members/mentor-update.cgi b/www/members/mentor-update.cgi
index af80e33..51b76c2 100755
--- a/www/members/mentor-update.cgi
+++ b/www/members/mentor-update.cgi
@@ -45,8 +45,20 @@ def emit_form(apacheid, mdata, button_help, uimap)
helptext: uimap[field][1]
)
emit_mentor_input('availability', mdata, uimap, 'glyphicon-hourglass')
- emit_mentor_input('prefers', mdata, uimap, 'glyphicon-ok-sign')
- emit_mentor_input('languages', mdata, uimap, 'glyphicon-globe')
+ field = 'prefers'
+ _whimsy_forms_select(label: uimap[field][0], name: field, multiple: true,
+ value: (mdata[field] ? mdata[field] : ''),
+ options: MentorFormat::PREFERS_TYPES,
+ icon: 'glyphicon-ok-sign', iconlabel: 'ok-sign',
+ helptext: uimap[field][1]
+ )
+ field = 'languages'
+ _whimsy_forms_select(label: uimap[field][0], name: field, multiple: true,
+ value: (mdata[field] ? mdata[field] : ''),
+ options: MentorFormat::LANGUAGES,
+ icon: 'glyphicon-globe', iconlabel: 'globe',
+ helptext: uimap[field][1]
+ )
_div.form_group do
_label.col_sm_offset_3.col_sm_9.strong.text_left 'What You Could Help Mentees With'
@@ -201,18 +213,19 @@ _html do
# Display data to the user, depending if we're GET (existing mentor record or just blank data) or POST (show SVN checkin results)
if _.post?
- submission = { # TODO make this a loop over uimap.keys; TODO check if we want any other fields
+ submission = {
"timezone" => "#{@timezone}",
"availability" => "#{@availability}",
"contact" => "#{@contact}",
- "prefers" => "#{@prefers}",
"available" => "#{@available}",
"mentoring" => "#{@mentoring}",
"experience" => "#{@experience}",
- "languages" => "#{@languages}",
"pronouns" => "#{@pronouns}",
"aboutme" => "#{@aboutme}",
- "homepage" => "#{@homepage}"
+ "homepage" => "#{@homepage}",
+ # Multiple select fields
+ "prefers" => _.params['prefers'],
+ "languages" => _.params['languages']
}
if @notavailable
submission['notavailable'] = "#{@notavailable}"