diff --git a/app/controllers/public/account_controller.rb b/app/controllers/public/account_controller.rb index 4b5483a..c7d8b18 100644 --- a/app/controllers/public/account_controller.rb +++ b/app/controllers/public/account_controller.rb @@ -60,6 +60,10 @@ class AccountController < ApplicationController def signup @invitation_code = params[:invitation_code] begin + if params[:user] + params[:user].delete(:password_confirmation_clear) + params[:user].delete(:password_clear) + end @user = User.new(params[:user]) @user.terms_of_use = environment.terms_of_use @user.environment = environment @@ -209,16 +213,26 @@ class AccountController < ApplicationController @identifier = params[:identifier] valid = Person.is_available?(@identifier, environment) if valid - @status = _('Available!') + @status = _('This login name is available') @status_class = 'available' else - @status = _('Unavailable!') + @status = _('This login name is unavailable') @status_class = 'unavailable' end - @url = environment.top_url + '/' + @identifier render :partial => 'identifier_status' end + def check_email + if User.find_by_email_and_environment_id(params[:address], environment.id).nil? + @status = _('This e-mail address is available') + @status_class = 'available' + else + @status = _('This e-mail address is taken') + @status_class = 'unavailable' + end + render :partial => 'email_status' + end + def user_data user_data = if logged_in? diff --git a/app/controllers/public/home_controller.rb b/app/controllers/public/home_controller.rb index 9f85885..eb58dd9 100644 --- a/app/controllers/public/home_controller.rb +++ b/app/controllers/public/home_controller.rb @@ -14,4 +14,8 @@ class HomeController < PublicController end end + def terms + @no_design_blocks = true + end + end diff --git a/app/helpers/account_helper.rb b/app/helpers/account_helper.rb index 6ebab20..cddc4d3 100644 --- a/app/helpers/account_helper.rb +++ b/app/helpers/account_helper.rb @@ -1,3 +1,15 @@ module AccountHelper + def validation_classes + 'available unavailable valid invalid checking' + end + + def checking_message(key) + case key + when :url + _('Checking availability of login name...') + when :email + _('Checking if e-mail address is already taken...') + end + end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index da9a465..2560ef9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1317,4 +1317,14 @@ module ApplicationHelper ) + content_tag('span', ' | ', :class => 'comment-footer comment-footer-hide') end end + + def render_tabs(tabs) + titles = tabs.inject(''){ |result, tab| result << content_tag(:li, link_to(tab[:title], '#'+tab[:id]), :class => 'tab') } + contents = tabs.inject(''){ |result, tab| result << content_tag(:div, tab[:content], :id => tab[:id]) } + + content_tag :div, :class => 'ui-tabs' do + content_tag(:ul, titles) + contents + end + end + end diff --git a/app/helpers/profile_helper.rb b/app/helpers/profile_helper.rb index 9ec824b..fbfb6dd 100644 --- a/app/helpers/profile_helper.rb +++ b/app/helpers/profile_helper.rb @@ -15,12 +15,4 @@ module ProfileHelper end end - def render_tabs(tabs) - titles = tabs.inject(''){ |result, tab| result << content_tag(:li, link_to(tab[:title], '#'+tab[:id]), :class => 'tab') } - contents = tabs.inject(''){ |result, tab| result << content_tag(:div, tab[:content], :id => tab[:id]) } - - content_tag :div, :class => 'ui-tabs' do - content_tag(:ul, titles) + contents - end - end end diff --git a/app/models/person.rb b/app/models/person.rb index d4c4d1d..5967a81 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -116,6 +116,7 @@ class Person < Profile contact_phone contact_information description + image ] validates_multiparameter_assignments diff --git a/app/models/profile.rb b/app/models/profile.rb index cf7482b..0fc137d 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -148,6 +148,7 @@ class Profile < ActiveRecord::Base doc chat plugin + site ] belongs_to :user diff --git a/app/views/account/_email_status.rhtml b/app/views/account/_email_status.rhtml new file mode 100644 index 0000000..b7f1f24 --- /dev/null +++ b/app/views/account/_email_status.rhtml @@ -0,0 +1,7 @@ +
<%= @status %>
+ +<%= @url %> <%= @status %>
+<%= @status %>
+
#{checking_message(:url)}
');", + :complete => "jQuery('#user_login').removeClass('checking')" + %> -<%= required f.text_field(:login, :onchange => 'this.value = convToValidLogin( this.value )') %> -<%= content_tag(:small,_('Insert your login')) %> - +
#{checking_message(:email)}
');", + :complete => "jQuery('#user_email').removeClass('checking')", + :before => "if (!( jQuery('#user_email').valid() )) { + jQuery('#user_email').removeClass('#{validation_classes}').addClass('unavailable'); + jQuery('#email-check').html('#{_('This e-mail address is not valid')}
'); + return false; + }" + %> -<%= observe_field 'user_login', :url => {:action => 'check_url'}, :with => 'identifier', :update => 'url-check' %> + <%= label :profile_data, :name %> + <%= required text_field(:profile_data, :name, :rel => _('Full name')) %> -+ <%= submit_button('save', _('Create my account')) %> +
+ <% end -%> + + diff --git a/app/views/account/signup.rhtml b/app/views/account/signup.rhtml index 3ddb693..d43da64 100644 --- a/app/views/account/signup.rhtml +++ b/app/views/account/signup.rhtml @@ -1,7 +1,18 @@ -<%= link_to(_('Go to the homepage'), '/') %>
+Firsty, some tips for getting started:
+You should receive a welcome email from us shortly. Please take a second to follow the link within to confirm your account.
+You won't appear as a user until your account is confirmed.
+Customize your profile. Upload an avatar and sign up for activity notifications under Account.
+Learn the guidelines. Read the Documentation for more details on how to use new social network!
+Invite and find your Gmail, Yahoo and Hotmail contacts!
+Start exploring and Have fun!
" % [environment.name, url_for(:controller => :browse, :action => :people, :filter => 'more_recent')]) %> +