Commit ad887e182d4faceb404c1c7d05ecffa340deb0b0
Committed by
Daniela Feitosa
1 parent
19ece8ee
Exists in
master
and in
29 other branches
Small refactoring on code for signup
Removing unused code
Showing
5 changed files
with
25 additions
and
48 deletions
Show diff stats
app/views/account/_signup_form.rhtml
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | <span id="signup-domain"><%= environment.default_hostname %>/</span> | 11 | <span id="signup-domain"><%= environment.default_hostname %>/</span> |
| 12 | <div id='signup-login'> | 12 | <div id='signup-login'> |
| 13 | <div id='signup-login-field' class='formfield'> | 13 | <div id='signup-login-field' class='formfield'> |
| 14 | - <%= required text_field(:profile_data, :login, :id => 'user_login', :onchange => 'this.value = convToValidLogin(this.value);') %> | 14 | + <%= required text_field(:user, :login, :id => 'user_login', :onchange => 'this.value = convToValidLogin(this.value);') %> |
| 15 | <div id='url-check'><p> </p></div> | 15 | <div id='url-check'><p> </p></div> |
| 16 | </div> | 16 | </div> |
| 17 | <%= content_tag(:small, _('Choose your login name carefully! It will be your network access and you will not be able to change it later.'), :id => 'signup-balloon') %> | 17 | <%= content_tag(:small, _('Choose your login name carefully! It will be your network access and you will not be able to change it later.'), :id => 'signup-balloon') %> |
| @@ -107,28 +107,14 @@ jQuery(function($) { | @@ -107,28 +107,14 @@ jQuery(function($) { | ||
| 107 | $('#signup-form #user_login').css('width', 335 - $('#signup-domain').outerWidth()); | 107 | $('#signup-form #user_login').css('width', 335 - $('#signup-domain').outerWidth()); |
| 108 | 108 | ||
| 109 | $('#signup-form input[type=text], #signup-form textarea').each(function() { | 109 | $('#signup-form input[type=text], #signup-form textarea').each(function() { |
| 110 | - if ($(this).attr('rel')) var default_value = $(this).attr('rel').toLowerCase(); | ||
| 111 | - if ($(this).val() == '') $(this).val(default_value); | ||
| 112 | - $(this).bind('focus', function() { | ||
| 113 | - if ($(this).val() == default_value) $(this).val(''); | ||
| 114 | - }); | ||
| 115 | $(this).bind('blur', function() { | 110 | $(this).bind('blur', function() { |
| 116 | if ($(this).val() == '') { | 111 | if ($(this).val() == '') { |
| 117 | - $(this).val(default_value); | ||
| 118 | $(this).removeClass('filled-in'); | 112 | $(this).removeClass('filled-in'); |
| 119 | } | 113 | } |
| 120 | else $(this).addClass('filled-in'); | 114 | else $(this).addClass('filled-in'); |
| 121 | }); | 115 | }); |
| 122 | }); | 116 | }); |
| 123 | 117 | ||
| 124 | - $('#signup-form').bind('submit', function() { | ||
| 125 | - $('#signup-form input[type=text], #signup-form textarea').each(function() { | ||
| 126 | - if ($(this).attr('rel')) var default_value = $(this).attr('rel').toLowerCase(); | ||
| 127 | - if ($(this).val() == default_value) $(this).val(''); | ||
| 128 | - }); | ||
| 129 | - return true; | ||
| 130 | - }); | ||
| 131 | - | ||
| 132 | $('#user_pw').focus(function() { | 118 | $('#user_pw').focus(function() { |
| 133 | $('#password-balloon').fadeIn('slow'); | 119 | $('#password-balloon').fadeIn('slow'); |
| 134 | }); | 120 | }); |
plugins/stoa/lib/stoa_plugin.rb
| @@ -20,7 +20,8 @@ class StoaPlugin < Noosfero::Plugin | @@ -20,7 +20,8 @@ class StoaPlugin < Noosfero::Plugin | ||
| 20 | def signup_extra_contents | 20 | def signup_extra_contents |
| 21 | lambda { | 21 | lambda { |
| 22 | content_tag(:div, labelled_form_field(_('USP number'), text_field_tag('profile_data[usp_id]', '', :id => 'usp_id_field')) + | 22 | content_tag(:div, labelled_form_field(_('USP number'), text_field_tag('profile_data[usp_id]', '', :id => 'usp_id_field')) + |
| 23 | - content_tag(:small, _('The usp id grants you special powers in the network. Don\'t forget to fill it wth a valid number if you have one.'), :id => 'usp-id-balloon'), :id => 'signup-usp-id') + | 23 | + content_tag(:small, _('The usp id grants you special powers in the network. Don\'t forget to fill it with a valid number if you have one.'), :id => 'usp-id-balloon') + |
| 24 | + content_tag('div', '', :id => 'usp-id-check'), :id => 'signup-usp-id') + | ||
| 24 | content_tag('div', required(labelled_form_field(_('Birth date (yyyy-mm-dd)'), text_field_tag('birth_date', ''))) + | 25 | content_tag('div', required(labelled_form_field(_('Birth date (yyyy-mm-dd)'), text_field_tag('birth_date', ''))) + |
| 25 | content_tag(:small, _('Confirm your birth date. Pay attention to the format: yyyy-mm-dd.'), :id => 'usp-birth-date-balloon'), :id => 'signup-birth-date', :style => 'display: none') + | 26 | content_tag(:small, _('Confirm your birth date. Pay attention to the format: yyyy-mm-dd.'), :id => 'usp-birth-date-balloon'), :id => 'signup-birth-date', :style => 'display: none') + |
| 26 | content_tag('div', required(labelled_form_field(_('CPF'), text_field_tag('cpf', ''))) + | 27 | content_tag('div', required(labelled_form_field(_('CPF'), text_field_tag('cpf', ''))) + |
plugins/stoa/public/javascripts/signup_complement.js
| 1 | jQuery("#usp_id_field").observe_field(1, function(){ | 1 | jQuery("#usp_id_field").observe_field(1, function(){ |
| 2 | var me=this; | 2 | var me=this; |
| 3 | jQuery(this).addClass('checking').removeClass('validated'); | 3 | jQuery(this).addClass('checking').removeClass('validated'); |
| 4 | -// jQuery(this.parentNode).addClass('checking') | ||
| 5 | jQuery.getJSON('/plugin/stoa/check_usp_id?usp_id='+me.value, | 4 | jQuery.getJSON('/plugin/stoa/check_usp_id?usp_id='+me.value, |
| 6 | function(data){ | 5 | function(data){ |
| 7 | if(data.exists) { | 6 | if(data.exists) { |
| @@ -21,12 +20,10 @@ jQuery("#usp_id_field").observe_field(1, function(){ | @@ -21,12 +20,10 @@ jQuery("#usp_id_field").observe_field(1, function(){ | ||
| 21 | } | 20 | } |
| 22 | jQuery('#signup-form .submit').attr('disabled', false); | 21 | jQuery('#signup-form .submit').attr('disabled', false); |
| 23 | jQuery(me).removeClass('checking').addClass('validated'); | 22 | jQuery(me).removeClass('checking').addClass('validated'); |
| 24 | - // jQuery(me.parentNode).removeClass('checking') | ||
| 25 | }); | 23 | }); |
| 26 | } | 24 | } |
| 27 | else { | 25 | else { |
| 28 | jQuery(me).removeClass('checking'); | 26 | jQuery(me).removeClass('checking'); |
| 29 | -// jQuery(me.parentNode).removeClass('checking') | ||
| 30 | if(me.value) { | 27 | if(me.value) { |
| 31 | jQuery('#signup-form .submit').attr('disabled', true); | 28 | jQuery('#signup-form .submit').attr('disabled', true); |
| 32 | jQuery(me).addClass('invalid'); | 29 | jQuery(me).addClass('invalid'); |
plugins/stoa/public/style.css
| @@ -34,8 +34,8 @@ | @@ -34,8 +34,8 @@ | ||
| 34 | background: transparent url(/images/orange-balloon.png) bottom center no-repeat; | 34 | background: transparent url(/images/orange-balloon.png) bottom center no-repeat; |
| 35 | position: absolute; | 35 | position: absolute; |
| 36 | z-index: 2; | 36 | z-index: 2; |
| 37 | - right: 20px; | ||
| 38 | - top: -75px; | 37 | + right: 10px; |
| 38 | + top: -80px; | ||
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | .controller-profile_editor input.checking { | 41 | .controller-profile_editor input.checking { |
| @@ -45,3 +45,13 @@ | @@ -45,3 +45,13 @@ | ||
| 45 | .controller-profile_editor div.checking { | 45 | .controller-profile_editor div.checking { |
| 46 | background: transparent url(/images/loading-small.gif) 153px center no-repeat; | 46 | background: transparent url(/images/loading-small.gif) 153px center no-repeat; |
| 47 | } | 47 | } |
| 48 | + | ||
| 49 | +#signup-form .invalid.valid.filled-in { | ||
| 50 | + background-image: url("/images/passwords_nomatch.png"); | ||
| 51 | + border-color: #FFA000; | ||
| 52 | +} | ||
| 53 | + | ||
| 54 | +#signup-form .invalid.valid.filled-in.validated { | ||
| 55 | + background-image: url("/images/passwords_match.png"); | ||
| 56 | + border-color: #88BD00; | ||
| 57 | +} |
public/stylesheets/application.css
| @@ -5597,7 +5597,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | @@ -5597,7 +5597,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | ||
| 5597 | #email-check, | 5597 | #email-check, |
| 5598 | #fake-check, | 5598 | #fake-check, |
| 5599 | #password-check { | 5599 | #password-check { |
| 5600 | - margin: -2px 171px -5px 0; | 5600 | + margin: -2px 176px -5px 13px; |
| 5601 | text-align: right; | 5601 | text-align: right; |
| 5602 | clear: both; | 5602 | clear: both; |
| 5603 | } | 5603 | } |
| @@ -5674,7 +5674,6 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | @@ -5674,7 +5674,6 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | ||
| 5674 | 5674 | ||
| 5675 | #signup-form select, | 5675 | #signup-form select, |
| 5676 | #signup-form textarea, | 5676 | #signup-form textarea, |
| 5677 | -#signup-form #profile_data_name, | ||
| 5678 | #signup-form input { | 5677 | #signup-form input { |
| 5679 | padding: 7px 30px 10px 7px; | 5678 | padding: 7px 30px 10px 7px; |
| 5680 | height: 20px; | 5679 | height: 20px; |
| @@ -5690,7 +5689,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | @@ -5690,7 +5689,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | ||
| 5690 | 5689 | ||
| 5691 | #signup-form .filled-in, | 5690 | #signup-form .filled-in, |
| 5692 | #signup-form .invalid, | 5691 | #signup-form .invalid, |
| 5693 | -#signup-form .validated, | 5692 | +#signup-form input.validated, |
| 5694 | #signup-form .checking { | 5693 | #signup-form .checking { |
| 5695 | border-width: 2px; | 5694 | border-width: 2px; |
| 5696 | border-style: solid; | 5695 | border-style: solid; |
| @@ -5765,10 +5764,6 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | @@ -5765,10 +5764,6 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | ||
| 5765 | display: block; | 5764 | display: block; |
| 5766 | } | 5765 | } |
| 5767 | 5766 | ||
| 5768 | -#signup-form #profile_data_name { | ||
| 5769 | - padding-left: 10px; | ||
| 5770 | -} | ||
| 5771 | - | ||
| 5772 | #signup-form .invalid { | 5767 | #signup-form .invalid { |
| 5773 | border-color: #FFA000; | 5768 | border-color: #FFA000; |
| 5774 | background-image: url(/images/passwords_nomatch.png); | 5769 | background-image: url(/images/passwords_nomatch.png); |
| @@ -5793,7 +5788,8 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | @@ -5793,7 +5788,8 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | ||
| 5793 | color: #4A4A4A; | 5788 | color: #4A4A4A; |
| 5794 | } | 5789 | } |
| 5795 | 5790 | ||
| 5796 | -#signup-form .validated { | 5791 | +#signup-form .validated, |
| 5792 | +#signup-form .valid.filled-in { | ||
| 5797 | border-color: #88BD00; | 5793 | border-color: #88BD00; |
| 5798 | background-image: url(/images/passwords_match.png); | 5794 | background-image: url(/images/passwords_match.png); |
| 5799 | } | 5795 | } |
| @@ -5809,7 +5805,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | @@ -5809,7 +5805,7 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | ||
| 5809 | vertical-align: middle; | 5805 | vertical-align: middle; |
| 5810 | background: #EEE; | 5806 | background: #EEE; |
| 5811 | border: 1px solid #CFCFCF; | 5807 | border: 1px solid #CFCFCF; |
| 5812 | - line-height: 37px; | 5808 | + line-height: 35px; |
| 5813 | padding: 0px 7px; | 5809 | padding: 0px 7px; |
| 5814 | color: #4A4A4A; | 5810 | color: #4A4A4A; |
| 5815 | font-size: 20px; | 5811 | font-size: 20px; |
| @@ -5822,10 +5818,6 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | @@ -5822,10 +5818,6 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | ||
| 5822 | padding-right: 30px; | 5818 | padding-right: 30px; |
| 5823 | } | 5819 | } |
| 5824 | 5820 | ||
| 5825 | -#url-check { | ||
| 5826 | - width: 239px; | ||
| 5827 | -} | ||
| 5828 | - | ||
| 5829 | #signup-login-field { | 5821 | #signup-login-field { |
| 5830 | float: left; | 5822 | float: left; |
| 5831 | } | 5823 | } |
| @@ -5855,27 +5847,18 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | @@ -5855,27 +5847,18 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { | ||
| 5855 | background: transparent url(/images/orange-balloon.png) bottom center no-repeat; | 5847 | background: transparent url(/images/orange-balloon.png) bottom center no-repeat; |
| 5856 | position: absolute; | 5848 | position: absolute; |
| 5857 | z-index: 2; | 5849 | z-index: 2; |
| 5858 | - right: 30px; | 5850 | + right: 10px; |
| 5859 | } | 5851 | } |
| 5860 | 5852 | ||
| 5861 | #signup-form small#signup-balloon { | 5853 | #signup-form small#signup-balloon { |
| 5862 | top: -110px; | 5854 | top: -110px; |
| 5863 | } | 5855 | } |
| 5864 | 5856 | ||
| 5865 | -#signup-form small#password-balloon { | ||
| 5866 | - top: -85px; | ||
| 5867 | -} | ||
| 5868 | - | ||
| 5869 | -#signup-form small#password-confirmation-balloon { | ||
| 5870 | - top: -85px; | ||
| 5871 | -} | ||
| 5872 | - | ||
| 5873 | -#signup-form small#email-balloon { | ||
| 5874 | - top: -85px; | ||
| 5875 | -} | ||
| 5876 | - | 5857 | +#signup-form small#password-balloon, |
| 5858 | +#signup-form small#password-confirmation-balloon, | ||
| 5859 | +#signup-form small#email-balloon, | ||
| 5877 | #signup-form small#name-balloon { | 5860 | #signup-form small#name-balloon { |
| 5878 | - top: -85px; | 5861 | + top: -80px; |
| 5879 | } | 5862 | } |
| 5880 | 5863 | ||
| 5881 | #signup-form .required-field label, | 5864 | #signup-form .required-field label, |