diff --git a/app/controllers/my_profile/memberships_controller.rb b/app/controllers/my_profile/memberships_controller.rb index 1bfe8c0..a93480f 100644 --- a/app/controllers/my_profile/memberships_controller.rb +++ b/app/controllers/my_profile/memberships_controller.rb @@ -7,21 +7,12 @@ class MembershipsController < MyProfileController end def new_community - @wizard = params[:wizard].blank? ? false : params[:wizard] @community = Community.new(params[:community]) @community.environment = environment if request.post? && @community.valid? @community = Community.create_after_moderation(user, {:environment => environment}.merge(params[:community])) - if @wizard - redirect_to :controller => 'search', :action => 'assets', :asset => 'communities', :wizard => true - return - else - redirect_to :action => 'index' - return - end - end - if @wizard - render :layout => 'wizard' + redirect_to :action => 'index' + return end end end diff --git a/app/controllers/public/account_controller.rb b/app/controllers/public/account_controller.rb index c39e703..75607c4 100644 --- a/app/controllers/public/account_controller.rb +++ b/app/controllers/public/account_controller.rb @@ -4,7 +4,7 @@ class AccountController < ApplicationController inverse_captcha :field => 'e_mail' - require_ssl :except => [ :login_popup, :logout_popup, :wizard, :profile_details ] + require_ssl :except => [ :login_popup, :logout_popup, :profile_details ] before_filter :login_required, :only => [:activation_question, :accept_terms, :activate_enterprise] before_filter :redirect_if_logged_in, :only => [:login, :signup] @@ -50,8 +50,6 @@ class AccountController < ApplicationController # action to register an user to the application def signup @invitation_code = params[:invitation_code] - @wizard = params[:wizard].blank? ? false : params[:wizard] - @step = 1 begin @user = User.new(params[:user]) @user.terms_of_use = environment.terms_of_use @@ -71,37 +69,16 @@ class AccountController < ApplicationController invitation.finish end session[:notice] = _("Thanks for signing up!") - if @wizard - redirect_to :controller => 'search', :action => 'assets', :asset => 'communities', :wizard => true - return - else - go_to_initial_page if redirect? - end + go_to_initial_page if redirect? end - if @wizard - render :layout => 'wizard' - end rescue ActiveRecord::RecordInvalid @person.valid? @person.errors.delete(:identifier) @person.errors.delete(:user_id) - if @wizard - render :action => 'signup', :layout => 'wizard' - else - render :action => 'signup' - end + render :action => 'signup' end end - def wizard - render :layout => false - end - - def profile_details - @profile = Profile.find_by_identifier(params[:profile]) - render :partial => 'profile_details', :layout => 'wizard' - end - # action to perform logout from the application def logout if logged_in? diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb index dfd2981..094ae07 100644 --- a/app/controllers/public/search_controller.rb +++ b/app/controllers/public/search_controller.rb @@ -148,8 +148,6 @@ class SearchController < PublicController end def index - @wizard = params[:wizard].blank? ? false : params[:wizard] - @step = 2 @query = params[:query] || '' @filtered_query = remove_stop_words(@query) @product_category = ProductCategory.find(params[:product_category]) if params[:product_category] @@ -174,20 +172,12 @@ class SearchController < PublicController if respond_to?(specific_action) @asset_name = getterm(@names[@results.keys.first]) send(specific_action) - if @wizard - render :action => specific_action, :layout => 'wizard' - else - render :action => specific_action - end + render :action => specific_action return end end - if @wizard - render :action => 'index', :layout => 'wizard' - else - render :action => 'index' - end + render :action => 'index' end alias :assets :index diff --git a/app/helpers/account_helper.rb b/app/helpers/account_helper.rb index 7ec71e9..6ebab20 100644 --- a/app/helpers/account_helper.rb +++ b/app/helpers/account_helper.rb @@ -1,55 +1,3 @@ module AccountHelper - - def button_to_step(type, step, current_step, html_options = {}) - if current_step == step - the_class = 'active' - if html_options.has_key?(:class) - html_options[:class] << " #{the_class}" - else - html_options[:class] = the_class - end - end - if step == 1 - url = '#' - else - url = send('url_step_' + step.to_s) - end - button(type, step.to_s, url, html_options) - end - - def button_to_step_without_text(type, step, html_options = {}) - url = 'url_step_' + step - button_without_text(type, step, send(url), html_options) - end - - def button_to_previous_step(step, html_options = {}) - step = step - 1 - if step > 1 - button_to_step_without_text(:left, step.to_s, html_options) - end - end - - def button_to_next_step(step, html_options = {}) - step = step + 1 - if step < 4 - button_to_step_without_text(:forward, step.to_s, html_options) - end - end - - def url_step_1 - options = {:controller => 'account', :action => 'signup', :wizard => true} - Noosfero.url_options.merge(options) - end - - def url_step_2 - options = {:controller => 'search', :action => 'assets', :asset => 'communities', :wizard => true} - Noosfero.url_options.merge(options) - end - - def url_step_3 - options = {:controller => 'friends', :action => 'invite', :profile => user.identifier, :wizard => true} - Noosfero.url_options.merge(options) - end - end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 10d02a2..3099b55 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -487,30 +487,6 @@ module ApplicationHelper end end - # displays a link to add the profile with its image (as generated by - # #profile_image) or only its name below. - def profile_add_link( profile, image=false, size=:portrait, tag='li') - the_class = profile.members.include?(user) ? 'profile_member' : '' - name = h(profile.short_name) - if image - display = content_tag( 'span', profile_image( profile, size ), :class => 'profile-image' ) + - content_tag( 'span', name, :class => 'org' ) + - profile_cat_icons( profile ) - the_class << ' vcard' - else - display = content_tag( 'span', name, :class => 'org' ) - end - content_tag tag, - link_to_remote( display, - :update => 'search-results-and-pages', - :url => {:controller => 'account', :action => 'profile_details', :profile => profile.identifier}, - :onclick => 'document.location.href = this.href', # work-arround for ie. - :class => 'profile_link url', - :help => _('Click on this icon to add %s to your network') % profile.name, - :title => profile.name ), - :class => the_class - end - def links_for_balloon(profile) if environment.enabled?(:show_balloon_with_profile_links_when_clicked) if profile.kind_of?(Person) diff --git a/app/helpers/friends_helper.rb b/app/helpers/friends_helper.rb index 1b01380..a0d4f38 100644 --- a/app/helpers/friends_helper.rb +++ b/app/helpers/friends_helper.rb @@ -1,8 +1,3 @@ module FriendsHelper - def link_to_import(text, options = {}) - options.merge!({:action => 'invite', :import => 1, :wizard => true}) - link_to text, options - end - end diff --git a/app/models/environment.rb b/app/models/environment.rb index 48edec5..2c54c16 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -96,7 +96,6 @@ class Environment < ActiveRecord::Base 'wysiwyg_editor_for_environment_home' => _('Use WYSIWYG editor to edit environment home page'), 'media_panel' => _('Media panel in WYSIWYG editor'), 'select_preferred_domain' => _('Select preferred domains per profile'), - 'display_wizard_signup' => _('Display wizard signup'), 'use_portal_community' => _('Use the portal as news source for front page'), 'user_themes' => _('Allow users to create their own themes'), 'search_in_home' => _("Display search form in home page"), diff --git a/app/views/account/_profile_details.rhtml b/app/views/account/_profile_details.rhtml deleted file mode 100644 index bd6dff2..0000000 --- a/app/views/account/_profile_details.rhtml +++ /dev/null @@ -1,21 +0,0 @@ -
- <%= image_tag(profile_icon(@profile, :portrait)) %> - - <%= @profile.short_name %>
- <%= _('Type: %s') % getterm(@profile.class.name) %>
- <%= _('Description: %s') % @profile.description %>
- <%= _('Members: %s') % @profile.members.size.to_s %>
- <%= _('Created at: %s') % show_date(@profile.created_at) %>
- -<% form_tag(@profile.join_url) do %> - <%= hidden_field_tag(:confirmation, 1) %> - <%= hidden_field_tag(:wizard, true) %> - <% if @profile.members.include?(user) %> - <%= link_to( _('Leave'), @profile.leave_url.merge(:confirmation => 1, :wizard => true ), :method => 'post') %> - <% else %> - <%= submit_button(:ok, _("Join now")) %> - <% end %> - <%= button(:back, _('Back'), {:controller => 'search', :action => 'assets', :asset => 'communities', :wizard => true}) %> -<% end %> - -
diff --git a/app/views/account/_signup_form.rhtml b/app/views/account/_signup_form.rhtml index 8532dd7..edaff05 100644 --- a/app/views/account/_signup_form.rhtml +++ b/app/views/account/_signup_form.rhtml @@ -1,12 +1,10 @@ <%= error_messages_for :user, :person %> -<% if !@wizard %> - <% if ! defined? hidden_atention || ! hidden_atention %> -

-

- <%= _('Dear user, welcome to the %s network. To start your participation in this space, fill in the fields below. After this operation, your login and password will be registered, allowing you to create %s and %s in this environment.') % [environment.name, __('communities'), __('enterprises')] %> -
- <% end %> +<% if ! defined? hidden_atention || ! hidden_atention %> +

+

+<%= _('Dear user, welcome to the %s network. To start your participation in this space, fill in the fields below. After this operation, your login and password will be registered, allowing you to create %s and %s in this environment.') % [environment.name, __('communities'), __('enterprises')] %> +
<% end %> <% labelled_form_for :user, @user do |f| %> @@ -14,8 +12,6 @@ <%= hidden_field_tag :invitation_code, @invitation_code %> -<%= hidden_field_tag :wizard, @wizard %> - <%= required_fields_message %>
@@ -66,10 +62,6 @@ <% end %> <% button_bar do %> - <% if @wizard %> - <%= submit_button('save', _('Sign up'), :class => 'icon-menu-login') %> - <% else %> - <%= submit_button('save', _('Sign up'), :cancel => {:action => 'index'}, :class => 'icon-menu-login') %> - <% end %> + <%= submit_button('save', _('Sign up'), :cancel => {:action => 'index'}, :class => 'icon-menu-login') %> <% end %> <% end -%> diff --git a/app/views/account/_wizard_steps.rhtml b/app/views/account/_wizard_steps.rhtml deleted file mode 100644 index 59ee4dc..0000000 --- a/app/views/account/_wizard_steps.rhtml +++ /dev/null @@ -1,12 +0,0 @@ -
- <% button_bar do %> - <%= button_to_previous_step(@step) if @step %> - <%= button_to_step(:step, 1, @step, :class => (logged_in? ? 'logged' : 'not-logged')) %> - <% if logged_in? %> - <%= button_to_step(:step, 2, @step) %> - <%= button_to_step(:step, 3, @step) %> - <%= button_to_next_step(@step) if @step %> - <% end %> - <%= button(:ok, _('Finish'), user.url, :target => '_top') if @step == 3 %> - <% end %> -
diff --git a/app/views/account/signup.rhtml b/app/views/account/signup.rhtml index ee20dbb..91dc999 100644 --- a/app/views/account/signup.rhtml +++ b/app/views/account/signup.rhtml @@ -1,6 +1,2 @@

<%= _('Signup') %>

<%= render :partial => 'signup_form' %> - -<% if @wizard %> - <%= render :partial => 'wizard_steps' %> -<% end %> diff --git a/app/views/account/wizard.rhtml b/app/views/account/wizard.rhtml deleted file mode 100644 index 2772619..0000000 --- a/app/views/account/wizard.rhtml +++ /dev/null @@ -1,5 +0,0 @@ -<%= lightbox_close_button _('Close') %> - - diff --git a/app/views/home/index.rhtml b/app/views/home/index.rhtml index cb6b80b..748d226 100644 --- a/app/views/home/index.rhtml +++ b/app/views/home/index.rhtml @@ -1,7 +1,3 @@ -<% if environment.enabled?('display_wizard_signup') && !logged_in? %> - <%= lightbox_button(:new, _('Signup'), { :controller => 'account', :action => 'wizard' }, :class => 'wizard', :id => 'signup-wizard') %> -<% end %> - <% if @has_news %>

<%= _('News') %>

<% cache @news_cache_key do %> diff --git a/app/views/layouts/wizard.rhtml b/app/views/layouts/wizard.rhtml deleted file mode 100644 index e125d98..0000000 --- a/app/views/layouts/wizard.rhtml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - <%= javascript_include_tag :defaults %> - <%= stylesheet_link_tag '/designs/icons/default/style.css' %> - <%= javascript_include_tag 'jquery-latest.js' %> - - - <%= - # Load the principal css files: - stylesheet_import( %w( common button search forms profiles) - ) + "\n" + - stylesheet_import( %w( common button search forms profiles wizard), - :themed_source => true ) + "\n" + - # Load the boxes's css file if each exists: - import_blocks_stylesheets + - stylesheet_import( "controller_"+ @controller.controller_name() ) + "\n" + - stylesheet_import( "controller_"+ @controller.controller_name(), :themed_source => true ) - %> - - -
- <%= yield %> -
- - diff --git a/app/views/memberships/new_community.rhtml b/app/views/memberships/new_community.rhtml index 3492b79..6f6329c 100644 --- a/app/views/memberships/new_community.rhtml +++ b/app/views/memberships/new_community.rhtml @@ -1,7 +1,3 @@ -<% if @wizard %> - <%= render :partial => 'account/wizard_steps' %> -<% end %> -

<%= __('Creating new community') %>

<% if environment.enabled?('admin_must_approve_new_communities') %> @@ -20,8 +16,6 @@ <%= required f.text_field(:name) %> - <%= hidden_field_tag :wizard, params[:wizard] %> - <%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => 'community', :profile => @community } %> <% f.fields_for :image_builder, @community.image do |i| %> @@ -46,11 +40,7 @@ <% button_bar do %> <%= submit_button(:save, _('Create')) %> - <% if @wizard %> - <%= button(:back, _('Back'), {:controller => 'search', :action => 'assets', :asset => 'communities', :wizard => true}) %> - <% else %> - <%= button(:cancel, _('Cancel'), :action => 'index') %> - <% end %> + <%= button(:cancel, _('Cancel'), :action => 'index') %> <% end %> <% end %> diff --git a/app/views/search/_display_results.rhtml b/app/views/search/_display_results.rhtml index 7ba45e4..d015e11 100644 --- a/app/views/search/_display_results.rhtml +++ b/app/views/search/_display_results.rhtml @@ -1,12 +1,5 @@
-<% if @wizard %> -
- <%= button_without_text('product', _('View as icons'), params.merge(:visualization_mode => 'icons')) %> - <%= button_without_text('todo', _('View as list'), params.merge(:visualization_mode => 'list')) %> -
-<% end %> - <% pos2 = :odd # allow to format in a two columns layout pos3 = 3 # allow to format in a thre columns layout diff --git a/app/views/search/_profile.rhtml b/app/views/search/_profile.rhtml index 53a528b..b6a43c7 100644 --- a/app/views/search/_profile.rhtml +++ b/app/views/search/_profile.rhtml @@ -1,8 +1 @@ -<%# FIXME add more information %> -<% if (params[:visualization_mode] == 'list') && params[:wizard] %> - <%= profile_add_link profile %> -<% elsif params[:wizard].blank? %> - <%= profile_image_link profile, :portrait %> -<% else %> - <%= profile_add_link profile, true, :portrait %> -<% end %> +<%= profile_image_link profile, :portrait %> diff --git a/app/views/search/_search_form.rhtml b/app/views/search/_search_form.rhtml index 81d299d..d84b5d4 100644 --- a/app/views/search/_search_form.rhtml +++ b/app/views/search/_search_form.rhtml @@ -7,8 +7,6 @@ <%= hidden_field_tag :display, params[:display] %> - <%= hidden_field_tag :wizard, @wizard %> - <%= hidden_field_tag :asset, params[:asset] %>
@@ -22,7 +20,6 @@ <% end %>
- <% if !@wizard %>

<%= _('Search within:') %>

@@ -57,7 +54,6 @@ page['advanced-search-options'].toggle end %> <% end %> - <% end %> <% if lightbox?; button_bar do %> <%= lightbox_close_button _('Close') %> diff --git a/app/views/search/communities.rhtml b/app/views/search/communities.rhtml index cff7582..f1674f8 100644 --- a/app/views/search/communities.rhtml +++ b/app/views/search/communities.rhtml @@ -1,27 +1,17 @@ -<% if @wizard && user %> -

<%= _('Hello %s, now you can choose yours groups') % user.identifier %>

- <%= render :partial => 'account/wizard_steps' %> -<% else %> - <%= search_page_title( __('Communities'), { :query => @query, :category => @category ? @category.name : nil, :total_results => @total_results, :region => @region ? @region.name : nil, :distance => @radius } ) %> -<% end %> <%= search_page_link_to_all( { :asset => params[:asset], :category => @category }) %> <%= render :partial => 'search_form', :locals => { :form_title => @query.blank? ? _('Search') : _("Refine your search"), :simple_search => true } %> -<% if @wizard %> -
<%= __('Choose the communities you want to join and/or create your own.') %>
-<% end %> - <% if logged_in? %> <% button_bar do %> <%# FIXME shouldn't the user create the community in the current environment instead of going to its home environment? %> - <%= button(:add, __('New community'), user.url.merge(:controller => 'memberships', :action => 'new_community', :wizard => @wizard)) %> + <%= button(:add, __('New community'), user.url.merge(:controller => 'memberships', :action => 'new_community')) %> <% end %> <% end %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 3b5caea..d14a02d 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -484,19 +484,7 @@ div.pending-tasks { margin-bottom: 0px; } -/**** Signup wizard ****/ - -#wizard-iframe { - border: none; -} - -#wizard-content { - font-size: 13px; -} - -#wizard-content h1 { - font-size: 22px; -} +/**** portal news ****/ #portal-news { font-size: 11px; diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index d193b6b..a7134d6 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -296,21 +296,6 @@ class AccountControllerTest < Test::Unit::TestCase end end - should 'signup from wizard' do - assert_difference User, :count do - post :signup, :user => { :login => 'mylogin', :password => 'mypassword', :password_confirmation => 'mypassword', :email => 'mylogin@example.com' }, :wizard => true - end - assert_redirected_to :controller => 'search', :action => 'assets', :asset => 'communities', :wizard => true - end - - should 'not have layout when fail signup from wizard' do - user = create_user('mylogin').person - post :signup, :user => { :login => 'mylogin', :password => 'mypassword', :password_confirmation => 'mypassword', :email => 'mylogin@example.com' }, :wizard => true - assert_response :success - assert_template 'signup' - assert_equal 'layouts/wizard', @response.layout - end - ################################ # # # Enterprise activation tests # diff --git a/test/functional/memberships_controller_test.rb b/test/functional/memberships_controller_test.rb index c705fbd..140ee01 100644 --- a/test/functional/memberships_controller_test.rb +++ b/test/functional/memberships_controller_test.rb @@ -50,16 +50,6 @@ class MembershipsControllerTest < Test::Unit::TestCase end end - should 'be able to create a new community on wizard' do - assert_difference Community, :count do - post :new_community, :profile => profile.identifier, :community => { :name => 'My shiny new community', :description => 'This is a community devoted to anything interesting we find in the internet '}, :wizard => true - assert_response :redirect - assert_redirected_to :controller => 'search', :action => 'assets', :asset => 'communities', :wizard => true - - assert Community.find_by_identifier('my-shiny-new-community').members.include?(profile), "Creator user should be added as member of the community just created" - end - end - should 'link to new community creation in index' do get :index, :profile => profile.identifier assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/memberships/new_community" } diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index 1f40280..1f31bcf 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -242,13 +242,6 @@ class SearchControllerTest < Test::Unit::TestCase assert_equivalent [c3, c1], assigns(:results)[:communities] end - should 'find communities in signup wizard' do - c1 = create_profile_with_optional_category(Community, 'a beautiful community') - get :index, :query => 'beautiful', :find_in => [ 'communities' ], :wizard => true - assert_includes assigns(:results)[:communities], c1 - assert_equal 'layouts/wizard', @response.layout - end - should 'find products' do ent = create_profile_with_optional_category(Enterprise, 'teste') prod = ent.products.create!(:name => 'a beautiful product', :product_category => @product_category) @@ -980,21 +973,6 @@ class SearchControllerTest < Test::Unit::TestCase end end - should 'display steps when searching on wizard' do - c1 = create_profile_with_optional_category(Community, 'a beautiful community') - login_as('ze') - get :index, :query => 'beautiful', :find_in => [ 'communities' ], :wizard => true - assert_equal 'layouts/wizard', @response.layout - assert_tag :tag => 'div', :attributes => {:id => 'wizard-steps'} - end - - should 'not display steps when searching not on wizard' do - c1 = create_profile_with_optional_category(Community, 'a beautiful community') - get :index, :query => 'beautiful', :find_in => [ 'communities' ] - assert_match 'layouts/application', @response.layout - assert_no_tag :tag => 'div', :attributes => {:id => 'wizard-steps'} - end - should 'find products when enterprises has own hostname' do ent = create_profile_with_optional_category(Enterprise, 'teste') ent.domains << Domain.new(:name => 'testent.com'); ent.save! -- libgit2 0.21.2