From c2dc5fde0853817f365ac71d3e0fd5bda99567f6 Mon Sep 17 00:00:00 2001 From: Ilyaaaaaaaaaaaaa Zhitomirskiy Date: Mon, 1 Aug 2011 18:53:29 -0700 Subject: [PATCH 01/14] dg iz reworked the getting started into a tab, need to remove the getting started steps --- app/views/aspects/index.html.haml | 68 +----------- app/views/shared/_right_sections.html.haml | 47 +++++++++ app/views/users/getting_started.html.haml | 117 ++++++++++++++++----- public/stylesheets/sass/application.sass | 75 +++++++++++++ 4 files changed, 216 insertions(+), 91 deletions(-) create mode 100644 app/views/shared/_right_sections.html.haml diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 388b08023..29d3dcd6e 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -12,6 +12,9 @@ %h3 = current_user.first_name + .section + = link_to "Get Started", getting_started_path + .section = render 'aspects/aspect_listings' @@ -28,67 +31,4 @@ .span-5.rightBar.last = render 'selected_contacts', :people => @selected_people.sample(20), :count => @contact_count - .section - .title - = image_tag('/images/icons/bookmark.png') - %h5 - = t(".diaspora_id.heading") - .content - = t(".diaspora_id.content_1") - %b - = current_user.diaspora_handle - %br - = t(".diaspora_id.content_2") - - - unless AppConfig[:invites_off] - .section - .title - - = image_tag('/images/icons/plus.png') - %h5 - - unless AppConfig[:open_invitations] - .right - = t('shared.invitations.invitations_left', :count => @invites) - = t('shared.invitations.invite_your_friends') - .content - = render "shared/invitations", :invites => @invites - - .section - .title - = image_tag('/images/icons/cubbies.png') - %h5 - = t('.cubbies.heading') - .content - = t('.cubbies.explanation') - = link_to t('.cubbies.learn_more'), token_path - - - unless AppConfig.configured_services.blank? - .section - .title - = image_tag('/images/icons/monotone_wrench_settings.png') - %h5 - = t('.services.heading') - .content - = t('.services.content') - - AppConfig.configured_services.each do |service| - - unless current_user.services.any?{|x| x.provider == service} - %br= link_to service.titleize, "/auth/#{service}" - - .section - .title - = image_tag('/images/icons/bookmark.png') - %h5 - = t('bookmarklet.heading') - .content - != t('bookmarklet.explanation', :link => link_to(t('bookmarklet.explanation_link_text'), bookmarklet)) - - - unless AppConfig[:paypal_hosted_button_id].blank? - .section - .title - = image_tag('/images/icons/coffee.png') - %h5 - = t('.donate') - .content - = t('.keep_us_running', :pod => URI.parse(AppConfig[:pod_url]).host) - %br - = render 'shared/donate' + = render 'shared/right_sections' diff --git a/app/views/shared/_right_sections.html.haml b/app/views/shared/_right_sections.html.haml new file mode 100644 index 000000000..6f1641e78 --- /dev/null +++ b/app/views/shared/_right_sections.html.haml @@ -0,0 +1,47 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + + +.section + .title + = image_tag('/images/icons/cubbies.png') + %h5 + = t('aspects.index.cubbies.heading') + .content + = t('aspects.index.cubbies.explanation') + = link_to t('aspects.index.cubbies.learn_more'), token_path + +- unless AppConfig.configured_services.blank? + .section + .title + = image_tag('/images/icons/monotone_wrench_settings.png') + %h5 + = t('aspects.index.services.heading') + .content + %div + = t('aspects.index.services.content') + + #right_service_icons + - AppConfig.configured_services.each do |service| + - unless current_user.services.any?{|x| x.provider == service} + = link_to(image_tag("social_media_logos/#{service.downcase}-24x24.png", :title => service.titleize), "/auth/#{service}") + +.section + .title + = image_tag('/images/icons/bookmark.png') + %h5 + = t('bookmarklet.heading') + .content + != t('bookmarklet.explanation', :link => link_to(t('bookmarklet.explanation_link_text'), bookmarklet)) + +- unless AppConfig[:paypal_hosted_button_id].blank? + .section + .title + = image_tag('/images/icons/coffee.png') + %h5 + = t('aspects.index.donate') + .content + = t('aspects.index.keep_us_running', :pod => URI.parse(AppConfig[:pod_url]).host) + %br + = render 'shared/donate' diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 551c2c403..e628bdf7d 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -2,36 +2,99 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +- content_for :head do + = include_javascripts :home -= content_for :head do - :css - header{ display:none; } +.span-5.leftNavBar + #home_user_badge + = owner_image_link + %h3 + = current_user.first_name - #getting_started_logo.start{ - -webkit-animation-name: fadeUp; - -webkit-animation-delay: 0s; - -webkit-animation-duration: 0.35s; - } + .section + = link_to "Get Started", getting_started_path - @media only screen { - #getting_started_logo { -webkit-transform: translateZ(0); } - } - @-webkit-keyframes fadeUp { - 0% { opacity: 0; -webkit-transform: translate3d(0, 40px, 0); -webkit-animation-timing-function: ease-out; } - 70% { opacity: 0; -webkit-transform: translate3d(0, 35px, 0); } - 100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); -webkit-animation-timing-function: ease-out; } - } +//.section +// = render 'aspects/aspect_listings' -.span-15.prepend-4.last{:style => 'position:relative;'} - = image_tag 'logo_caps.png', :id => 'getting_started_logo', :width => 143, :height => 21, :class => ('start' if @step == 1) - %br - %br - .floating{:style=>"min-height:300px;"} - = render "users/getting_started/step_#{@step}", :current_user => current_user +//.section +// = render 'tags/followed_tags_listings' - - if @step > 1 - = link_to t('back'), getting_started_path(:step => @step-1), :class => "button", :id => "previous_step" +.span-13.append-1 + .stream_container + %h3 + = "Welcome, #{current_user.first_name}!" -- if @user.getting_started - .bottom_notification - = link_to "#{t('.skip')} →", getting_started_completed_path + %ul#getting_started + %li.profile + #getting_started_profile_photo + = person_image_link(current_user.person, :size => :thumb_medium) + %h4 + %span.getting_started_number + 1 + Fill Out Your Profile + %p + Description of why you'd want to do this (or checks like g+) + .span-8 + - ["Name", "Birthday", "Gender", "Bio", "Location", "Tags"].each do |attr| + .span-4.last + = attr + + #edit_profile_button_div + = link_to "Edit Profile", edit_profile_path, :class => "button" + + %li.services + %h4 + %span.getting_started_number + 2 + Connect to your other social networks + #getting_started_service_icons + - AppConfig.configured_services.each do |service| + - unless current_user.services.any?{|x| x.provider == service} + = link_to(image_tag("social_media_logos/#{service.downcase}-48x48.png", :title => service.titleize), "/auth/#{service}") + + %li + %h4 + %span.getting_started_number + 3 + Connect with people + + #diaspora_hq_pane + - person = Person.first + = person_image_link(Person.first) + .add_to_aspect + = render :partial => 'people/relationship_action', + :locals => { :person => Person.first, + :contact => current_user.contact_for(Person.first), + :current_user => current_user } + + .name + = person_link(person) + + .info + Get updates about the project. + + %li + %h4 + %span.getting_started_number + 4 + Follow your interests + %p + popular/curated tags? person's tags? + + %li + %h4 + %span.getting_started_number + 5 + Connect to + = link_to "Cubbi.es", "http://cubbi.es/" + %p + = t('tokens.show.what_is_cubbies') + + .cubbies_images + = image_tag '/images/cubbies_collage.png', :width => 422, :height => 159, :class => "cubbies_collage_small" + = image_tag '/images/cubbies_screenshot2.png', :height => 151, :width => 200, :class => "cubbies_user_page_small" + +.span-5.rightBar.last + /= render 'selected_contacts', :people => @selected_people.sample(20), :count => @contact_count + /= render 'shared/right_sections' diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index ed3721bf7..ae7b07fe0 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -3183,3 +3183,78 @@ ul.left_nav :bottom 12px :right 5px :position absolute + +ul#getting_started + :padding 0 + :margin 0 + + li + :position relative + :border + :bottom 1px solid #ddd + :padding + :top 25px + :bottom 5px + + .profile + :min-height 170px + +#getting_started_profile_photo + :float right + .avatar + :height 150px + :width 150px + +#edit_profile_button_div + :padding + :top 70px + +#getting_started_service_icons + :text-align center + + img + :margin + :right 48px + + :padding + :bottom 20px + :top 10px + +#right_service_icons + :text-align center + :padding 10px + :bottom 0 + +#diaspora_hq_pane + :padding + :top 10px + :min-height 70px + + .add_to_aspect + :float right + + .avatar + :float left + :margin + :right 10px + + .name + :font + :weight bold + +.cubbies_images + :margin-left 50px + +.cubbies_user_page_small + :position absolute + :left 250px + + +.getting_started_number + :background + :color #eee + :padding 4px + :left 8px + + :margin + :right 8px From c9eeeb6150a103bca94d20a1c048b4506654a792 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 2 Aug 2011 12:18:12 -0700 Subject: [PATCH 02/14] ms dg; profile (step 1) finished --- app/helpers/profiles_helper.rb | 34 ++++++++ app/views/users/getting_started.html.haml | 101 ++++++++++++---------- public/stylesheets/sass/application.sass | 34 ++++++-- spec/helpers/profiles_helper.rb | 27 ++++++ 4 files changed, 143 insertions(+), 53 deletions(-) create mode 100644 app/helpers/profiles_helper.rb create mode 100644 spec/helpers/profiles_helper.rb diff --git a/app/helpers/profiles_helper.rb b/app/helpers/profiles_helper.rb new file mode 100644 index 000000000..41ac2a2d1 --- /dev/null +++ b/app/helpers/profiles_helper.rb @@ -0,0 +1,34 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3 or later. See +# the COPYRIGHT file. + +module ProfilesHelper + + # Creates a profile field with a checked class if set + # + # @param [Profile, Symbol] Profile and field in question + # @return [String] A span element + def profile_field_tag(profile, field) + klass = field_filled_out?(profile, field) ? 'completed' : '' + klass += " profile_field" + field = case field + when :tag_string + :tags + when :full_name + :name + when :image_url + :photo + else + field + end + content_tag(:span, field.to_s.titleize, :class => klass) + end + + private + + # @param [Profile, Symbol] Profile and field in question + # @return [Boolean] The field in question is set? + def field_filled_out?(profile, field) + profile.send("#{field}".to_sym).present? + end +end diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index e628bdf7d..6d2021e16 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -27,73 +27,84 @@ %ul#getting_started %li.profile - #getting_started_profile_photo - = person_image_link(current_user.person, :size => :thumb_medium) - %h4 - %span.getting_started_number + .getting_started_number + %h4 1 - Fill Out Your Profile - %p - Description of why you'd want to do this (or checks like g+) - .span-8 - - ["Name", "Birthday", "Gender", "Bio", "Location", "Tags"].each do |attr| - .span-4.last - = attr + .content + #getting_started_profile_photo + = person_image_link(current_user.person, :size => :thumb_medium) + %h4 + Fill Out Your Profile + %p + Description of why you'd want to do this (or checks like g+) + .span-8.fields + - [:full_name, :image_url, :birthday, :gender, :bio, :location, :tag_string].each do |attr| + .span-4.last + = profile_field_tag(current_user.person.profile, attr) - #edit_profile_button_div - = link_to "Edit Profile", edit_profile_path, :class => "button" + #edit_profile_button_div + = link_to "Edit Profile", edit_profile_path, :class => "button" %li.services - %h4 - %span.getting_started_number + .getting_started_number + %h4 2 - Connect to your other social networks + .content + %h4 + Connect to your other social networks #getting_started_service_icons - AppConfig.configured_services.each do |service| - unless current_user.services.any?{|x| x.provider == service} = link_to(image_tag("social_media_logos/#{service.downcase}-48x48.png", :title => service.titleize), "/auth/#{service}") %li - %h4 - %span.getting_started_number + .getting_started_number + %h4 3 - Connect with people + .content + %h4 + Connect with people - #diaspora_hq_pane - - person = Person.first - = person_image_link(Person.first) - .add_to_aspect - = render :partial => 'people/relationship_action', - :locals => { :person => Person.first, - :contact => current_user.contact_for(Person.first), - :current_user => current_user } + #diaspora_hq_pane + - person = Person.first + = person_image_link(Person.first) + .add_to_aspect + = render :partial => 'people/relationship_action', + :locals => { :person => Person.first, + :contact => current_user.contact_for(Person.first), + :current_user => current_user } - .name - = person_link(person) + .name + = person_link(person) - .info - Get updates about the project. + .info + Get updates about the project. %li - %h4 - %span.getting_started_number + .getting_started_number + %h4 4 - Follow your interests - %p - popular/curated tags? person's tags? + .content + %h4 + Follow your interests + + %p + popular/curated tags? person's tags? %li - %h4 - %span.getting_started_number + .getting_started_number + %h4 5 - Connect to - = link_to "Cubbi.es", "http://cubbi.es/" - %p - = t('tokens.show.what_is_cubbies') + .content + %h4 + Connect to + = link_to "Cubbi.es", "http://cubbi.es/" + %p + = t('tokens.show.what_is_cubbies') - .cubbies_images - = image_tag '/images/cubbies_collage.png', :width => 422, :height => 159, :class => "cubbies_collage_small" - = image_tag '/images/cubbies_screenshot2.png', :height => 151, :width => 200, :class => "cubbies_user_page_small" + .cubbies_images + = image_tag '/images/cubbies_collage.png', :width => 422, :height => 159, :class => "cubbies_collage_small" + = image_tag '/images/cubbies_screenshot2.png', :height => 151, :width => 200, :class => "cubbies_user_page_small" .span-5.rightBar.last /= render 'selected_contacts', :people => @selected_people.sample(20), :count => @contact_count diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index ae7b07fe0..2d0b6856b 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -3196,6 +3196,10 @@ ul#getting_started :top 25px :bottom 5px + .content + :padding + :left 30px + .profile :min-height 170px @@ -3207,7 +3211,8 @@ ul#getting_started #edit_profile_button_div :padding - :top 70px + :top 90px + :bottom 20px #getting_started_service_icons :text-align center @@ -3249,12 +3254,25 @@ ul#getting_started :position absolute :left 250px - .getting_started_number - :background - :color #eee - :padding 4px - :left 8px + :position absolute + :left 0 - :margin - :right 8px + h4 + :display inline + :background + :color #eee + :padding 3px 7px + + :margin + :right 8px + +.completed + :background + :image url('/images/icons/check_yes_ok.png') + :position center right + :repeat no-repeat + +.profile .profile_field + :padding + :right 20px diff --git a/spec/helpers/profiles_helper.rb b/spec/helpers/profiles_helper.rb new file mode 100644 index 000000000..27f59ae3a --- /dev/null +++ b/spec/helpers/profiles_helper.rb @@ -0,0 +1,27 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3 or later. See +# the COPYRIGHT file. +require 'spec_helper' + +describe ProfilesHelper do + before do + @profile = Factory(:person).profile + end + + describe '#field_filled_out?' do + it 'returns false if not set' do + field_filled_out?(@profile, :bio).should be_false + end + + it 'returns true if field is set' do + @profile.bio = "abc" + field_filled_out?(@profile, :bio).should be_true + end + end + + describe '#profile_field_tag' do + it 'returns' do + profile_field_tag(@profile, :bio).should_not be_blank + end + end +end From 6369eefdbed419e601893c0d84fe12cfaac78731 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 2 Aug 2011 12:35:34 -0700 Subject: [PATCH 03/14] added translations to getting started --- app/helpers/profiles_helper.rb | 2 +- app/views/users/getting_started.html.haml | 12 ++++++------ config/locales/diaspora/en.yml | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/app/helpers/profiles_helper.rb b/app/helpers/profiles_helper.rb index 41ac2a2d1..941c8058e 100644 --- a/app/helpers/profiles_helper.rb +++ b/app/helpers/profiles_helper.rb @@ -21,7 +21,7 @@ module ProfilesHelper else field end - content_tag(:span, field.to_s.titleize, :class => klass) + content_tag(:span, t(".profile_fields.#{field.to_s}"), :class => klass) end private diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 6d2021e16..6f20e56b1 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -34,9 +34,9 @@ #getting_started_profile_photo = person_image_link(current_user.person, :size => :thumb_medium) %h4 - Fill Out Your Profile + = t(".fill_out_your_profile") %p - Description of why you'd want to do this (or checks like g+) + = t(".profile_description") .span-8.fields - [:full_name, :image_url, :birthday, :gender, :bio, :location, :tag_string].each do |attr| .span-4.last @@ -51,7 +51,7 @@ 2 .content %h4 - Connect to your other social networks + = t('.connect_to_your_other_social_networks') #getting_started_service_icons - AppConfig.configured_services.each do |service| - unless current_user.services.any?{|x| x.provider == service} @@ -63,7 +63,7 @@ 3 .content %h4 - Connect with people + = t(".connect_with_people") #diaspora_hq_pane - person = Person.first @@ -86,7 +86,7 @@ 4 .content %h4 - Follow your interests + = t(".follow_your_interests") %p popular/curated tags? person's tags? @@ -97,7 +97,7 @@ 5 .content %h4 - Connect to + = t(".connect_to") = link_to "Cubbi.es", "http://cubbi.es/" %p = t('tokens.show.what_is_cubbies') diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 02334a613..15f8eb55f 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -786,6 +786,23 @@ en: skip: "skip getting started" save_and_continue: "Save and continue" could_not_find_anyone: "Could not find any friends on Diaspora*. Use the friend finder to invite them." + + fill_out_your_profile: "Fill Out Your Profile" + profile_description: "Description of why you'd want to do this" + connect_to_your_other_social_networks: "Connect to your other social networks" + connect_with_people: "Connect with people" + follow_your_interests: "Follow your interests" + connect_to: "Connect to" + + profile_fields: + name: "Name" + birthday: "Birthday" + bio: "Bio" + tags: "Tags" + photo: "Photo" + gender: "Gender" + location: "Location" + step_3: finish: "Finish" people_already_on_diaspora: "People already on Diaspora" From d51e495925666b86b5206759d13de900affdfffc Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 2 Aug 2011 14:36:59 -0700 Subject: [PATCH 04/14] fetch featured users from remote servers on app init unless already in the db --- app/controllers/contacts_controller.rb | 8 +------- app/models/person.rb | 6 ++++++ config/initializers/fetch_featured_users.rb | 7 +++++++ spec/models/person_spec.rb | 3 +++ 4 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 config/initializers/fetch_featured_users.rb diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index 0ced97b09..96c33807c 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -39,13 +39,7 @@ class ContactsController < ApplicationController def featured @featured = true - @people = [] - if diaspora_ids = AppConfig[:featured_users] - @people = diaspora_ids.inject [] do |people, id| - person = Webfinger.new(id).fetch - people << person unless person.blank? - end - end + @people = Person.featured_users end private diff --git a/app/models/person.rb b/app/models/person.rb index 73334daef..2204c2e59 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -46,6 +46,12 @@ class Person < ActiveRecord::Base scope :remote, where('people.owner_id IS NULL') scope :local, where('people.owner_id IS NOT NULL') + def self.featured_users + if AppConfig[:featured_users].present? + Person.where(:diaspora_handle => AppConfig[:featured_users]) + end + end + def self.search_query_string(query) query = query.downcase diff --git a/config/initializers/fetch_featured_users.rb b/config/initializers/fetch_featured_users.rb new file mode 100644 index 000000000..eba98d1cc --- /dev/null +++ b/config/initializers/fetch_featured_users.rb @@ -0,0 +1,7 @@ +unless AppConfig[:featured_users].count == Person.featured_users.count + puts "Fetching featured users from remote servers..." + AppConfig[:featured_users].each do |x| + Webfinger.new(x).fetch + end + puts "Done fetching!" +end diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index faa3b238c..18818097a 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -390,4 +390,7 @@ describe Person do should == @person.as_json.merge(:tags => @person.profile.tags.map{|t| "##{t.name}"}) end end + + describe '.featured_users' do + end end From 303b23883dec8bb029da12937d46cd6db616dc6f Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 2 Aug 2011 16:40:46 -0700 Subject: [PATCH 05/14] added featured users, left nav, and search boxes into getting started --- app/helpers/application_helper.rb | 6 +- .../_aspect_dropdown.html.haml | 2 +- app/views/aspects/index.html.haml | 4 +- app/views/users/getting_started.html.haml | 104 +++++++++++++----- config/locales/diaspora/en.yml | 4 +- public/stylesheets/sass/application.sass | 60 ++++++++-- 6 files changed, 138 insertions(+), 42 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f565770b5..ce4532274 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -111,7 +111,11 @@ module ApplicationHelper end def controller_index_path - self.send((request.filtered_parameters["controller"] + "_path").to_sym) + kontroller = request.filtered_parameters["controller"] + if kontroller.downcase != "contacts" + kontroller = "aspects" + end + self.send((kontroller + "_path").to_sym) end def left_nav_root diff --git a/app/views/aspect_memberships/_aspect_dropdown.html.haml b/app/views/aspect_memberships/_aspect_dropdown.html.haml index e72d2f172..2be491c2d 100644 --- a/app/views/aspect_memberships/_aspect_dropdown.html.haml +++ b/app/views/aspect_memberships/_aspect_dropdown.html.haml @@ -15,7 +15,7 @@ - for aspect in all_aspects = aspect_dropdown_list_item(aspect, contact, person) - - if defined?(@aspect) && ( @aspect == :profile || @aspect == :tag || @aspect == :search || @aspect == :notification) + - if defined?(@aspect) && ( @aspect == :profile || @aspect == :getting_started || @aspect == :tag || @aspect == :search || @aspect == :notification) %li.newItem .add_aspect = link_to t('contacts.index.add_a_new_aspect'), new_aspect_path(:person_id => person.id), :rel => 'facebox', :class => 'new_aspect' diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 29d3dcd6e..e9c6bf482 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -13,7 +13,9 @@ = current_user.first_name .section - = link_to "Get Started", getting_started_path + %ul.left_nav + %li + = link_to "Welcome", getting_started_path, :class => "home_selector" .section = render 'aspects/aspect_listings' diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 6f20e56b1..6b9896132 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -12,28 +12,30 @@ = current_user.first_name .section - = link_to "Get Started", getting_started_path + %ul.left_nav + %li + = link_to "Welcome", getting_started_path, :class => "home_selector active" -//.section -// = render 'aspects/aspect_listings' + .section + = render 'aspects/aspect_listings' -//.section -// = render 'tags/followed_tags_listings' + .section + = render 'tags/followed_tags_listings' .span-13.append-1 .stream_container - %h3 + %h2 = "Welcome, #{current_user.first_name}!" %ul#getting_started %li.profile .getting_started_number - %h4 + %h3 1 .content #getting_started_profile_photo = person_image_link(current_user.person, :size => :thumb_medium) - %h4 + %h3 = t(".fill_out_your_profile") %p = t(".profile_description") @@ -47,10 +49,10 @@ %li.services .getting_started_number - %h4 + %h3 2 .content - %h4 + %h3 = t('.connect_to_your_other_social_networks') #getting_started_service_icons - AppConfig.configured_services.each do |service| @@ -59,44 +61,96 @@ %li .getting_started_number - %h4 + %h3 3 .content - %h4 + %h3 = t(".connect_with_people") + %p + Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily. + #diaspora_hq_pane - - person = Person.first - = person_image_link(Person.first) - .add_to_aspect - = render :partial => 'people/relationship_action', - :locals => { :person => Person.first, - :contact => current_user.contact_for(Person.first), - :current_user => current_user } + - person = Person.find_by_diaspora_handle("diasporahq@joindiaspora.com") + = person_image_link(person, :size => :thumb_medium) .name = person_link(person) .info - Get updates about the project. + Get updates about the project from the core team. + + .add_to_aspect + = render :partial => 'people/relationship_action', + :locals => { :person => person, + :contact => current_user.contact_for(person), + :current_user => current_user } + + #featured_users_pane + %h4 + Featured users + + %div + - Person.featured_users[0..5].each do |person| + .featured_user_card_small + = person_image_link(person) + = link_to person.name, person_path(person) + - person.profile.tags[0..2].each do |tg| + = "##{tg}" + + = link_to "See all featured users ->", "#" + + %br + #find_friends_pane + %h4 + Find friends + .span-5.append-1 + #global_search + = form_tag(people_path, :method => 'get', :id => "global_search_form") do + = text_field_tag 'q', nil, :placeholder => "Search for people", :type => 'search', :results => 5 + .span-5.last + %p + or + = link_to "find friends from Facebook", "#" + .clearfix + %br %li .getting_started_number - %h4 + %h3 4 .content - %h4 + %h3 = t(".follow_your_interests") %p - popular/curated tags? person's tags? + Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora. + + .span-5.append-1 + #global_search + = form_tag(people_path, :method => 'get', :id => "global_search_form") do + = text_field_tag 'q', nil, :placeholder => "Search for #hashtags", :type => 'search', :results => 5 + .span-5.last + %h4 + Featured tags + %p + = link_to "#diaspora", "#" + %br + = link_to "#kittens", "#" + %br + = link_to "#puppies", "#" + %br + = link_to "#maddog", "#" + .clearfix + %br + %br %li .getting_started_number - %h4 + %h3 5 .content - %h4 + %h3 = t(".connect_to") = link_to "Cubbi.es", "http://cubbi.es/" %p diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 15f8eb55f..72514cea1 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -787,10 +787,10 @@ en: save_and_continue: "Save and continue" could_not_find_anyone: "Could not find any friends on Diaspora*. Use the friend finder to invite them." - fill_out_your_profile: "Fill Out Your Profile" + fill_out_your_profile: "Fill out your profile" profile_description: "Description of why you'd want to do this" connect_to_your_other_social_networks: "Connect to your other social networks" - connect_with_people: "Connect with people" + connect_with_people: "Connect with cool people" follow_your_interests: "Follow your interests" connect_to: "Connect to" diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 2d0b6856b..d44288b36 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1109,7 +1109,7 @@ img.scaled_full img :height 140px -#global_search +header #global_search :display inline :position relative @@ -3188,7 +3188,7 @@ ul#getting_started :padding 0 :margin 0 - li + > li :position relative :border :bottom 1px solid #ddd @@ -3200,6 +3200,9 @@ ul#getting_started :padding :left 30px + input[type='search'] + :width 210px + .profile :min-height 170px @@ -3232,33 +3235,36 @@ ul#getting_started #diaspora_hq_pane :padding - :top 10px + :bottom 20px :min-height 70px .add_to_aspect - :float right + :padding 10px 0 .avatar :float left :margin :right 10px + :height 70px + :width 70px + .name :font :weight bold .cubbies_images - :margin-left 50px + :margin-left 15px .cubbies_user_page_small :position absolute - :left 250px + :left 270px .getting_started_number :position absolute :left 0 - h4 + h3 :display inline :background :color #eee @@ -3267,12 +3273,42 @@ ul#getting_started :margin :right 8px -.completed +.profile .profile_field :background - :image url('/images/icons/check_yes_ok.png') - :position center right + :image url('/images/icons/monotone_question.png') + :position center left :repeat no-repeat -.profile .profile_field :padding - :right 20px + :left 20px + +.completed + :background + :image url('/images/icons/check_yes_ok.png') !important + +#featured_users_pane + :padding 10px 0 + + .featured_user_card_small + :display inline-block + + :width 140px + :height 30px + + :vertical-align top + :position relative + + :padding 5px + :margin + :bottom 10px + + a + :font + :weight bold + + .avatar + :height 30px + :width 30px + :margin + :right 5px + :float left From b8b4ad3d84a6a750aa59d70c8f41ac0988f7f052 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 3 Aug 2011 11:57:50 -0700 Subject: [PATCH 06/14] added helpers for each of the getting started steps; make step sections dull if completed --- app/controllers/users_controller.rb | 22 +--- app/helpers/users_helper.rb | 38 ++++++- app/views/aspects/index.html.haml | 9 +- app/views/users/getting_started.html.haml | 66 ++++++------ .../users/getting_started/_step_1.html.haml | 22 ---- .../users/getting_started/_step_2.html.haml | 19 ---- .../users/getting_started/_step_3.html.haml | 21 ---- config/initializers/fetch_featured_users.rb | 2 +- config/locales/diaspora/en.yml | 2 + public/images/icons/check_box_checked.svg | 11 ++ public/stylesheets/sass/application.sass | 18 +++- spec/factories.rb | 1 - spec/helpers/users_helper_spec.rb | 101 ++++++++++++++++-- 13 files changed, 197 insertions(+), 135 deletions(-) delete mode 100644 app/views/users/getting_started/_step_1.html.haml delete mode 100644 app/views/users/getting_started/_step_2.html.haml delete mode 100644 app/views/users/getting_started/_step_3.html.haml create mode 100755 public/images/icons/check_box_checked.svg diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9692cc778..ac0c983e2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -98,27 +98,9 @@ class UsersController < ApplicationController @person = @user.person @profile = @user.profile @services = @user.services - service = current_user.services.where(:type => "Services::Facebook").first + @step = 0 - @step = ((params[:step].to_i>0)&&(params[:step].to_i<4)) ? params[:step].to_i : 1 - @step ||= 1 - - if @step == 2 && SERVICES['facebook']['app_id'] == "" - @step = 3 - end - - if @step == 3 - @friends = service ? service.finder(:local => true) : [] - @friends ||= [] - end - - if @step == 3 && @friends.length == 0 - @user.update_attributes(:getting_started => false) - flash[:notice] = I18n.t('users.getting_started.could_not_find_anyone') - redirect_to root_path - else - render "users/getting_started" - end + render "users/getting_started" end def getting_started_completed diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index df5646212..003b89a37 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -3,8 +3,40 @@ # the COPYRIGHT file. module UsersHelper - def first_name_or_username (user) - set_name = user.person.profile.first_name - (set_name.nil? || set_name.empty?) ? user.username : user.person.profile.first_name + + # @return [Boolean] The user has filled out all profile fields + def has_completed_profile? + profile = current_user.person.profile + [:full_name, :image_url, + :birthday, :gender, + :bio, :location, + :tag_string].map! do |attr| + return false if profile.send(attr).blank? + end + true + end + + # @return [Boolean] The user has connected at least one service + def has_connected_services? + AppConfig[:connected_services].blank? || current_user.services.size > 0 + end + + # @return [Boolean] The user has at least 3 contacts + def has_few_contacts? + current_user.contacts.receiving.size > 2 + end + + # @return [Boolean] The user has followed at least 3 tags + def has_few_followed_tags? + current_user.followed_tags.size > 2 + end + + # @return [Boolean] The user has connected to cubbi.es + def has_connected_cubbies? + end + + # @return [Boolean] The user has completed all steps in getting started + def has_completed_getting_started? + current_user.getting_started == false end end diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index e9c6bf482..ddd0e747a 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -12,10 +12,11 @@ %h3 = current_user.first_name - .section - %ul.left_nav - %li - = link_to "Welcome", getting_started_path, :class => "home_selector" + - unless has_completed_getting_started? + .section + %ul.left_nav + %li + = link_to "Welcome", getting_started_path, :class => "home_selector" .section = render 'aspects/aspect_listings' diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 6b9896132..1339841d3 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -2,19 +2,17 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -- content_for :head do - = include_javascripts :home - .span-5.leftNavBar #home_user_badge = owner_image_link %h3 = current_user.first_name - .section - %ul.left_nav - %li - = link_to "Welcome", getting_started_path, :class => "home_selector active" + - unless has_completed_getting_started? + .section + %ul.left_nav + %li + = link_to "Welcome", getting_started_path, :class => "home_selector active" .section = render 'aspects/aspect_listings' @@ -28,10 +26,10 @@ = "Welcome, #{current_user.first_name}!" %ul#getting_started - %li.profile + %li.profile{:class => ("completed" if has_completed_profile?)} .getting_started_number %h3 - 1 + = @step += 1 .content #getting_started_profile_photo = person_image_link(current_user.person, :size => :thumb_medium) @@ -47,22 +45,23 @@ #edit_profile_button_div = link_to "Edit Profile", edit_profile_path, :class => "button" - %li.services - .getting_started_number - %h3 - 2 - .content - %h3 - = t('.connect_to_your_other_social_networks') - #getting_started_service_icons - - AppConfig.configured_services.each do |service| - - unless current_user.services.any?{|x| x.provider == service} - = link_to(image_tag("social_media_logos/#{service.downcase}-48x48.png", :title => service.titleize), "/auth/#{service}") + - unless AppConfig[:configured_services].blank? + %li.services{:class => ("completed" if has_connected_services?)} + .getting_started_number + %h3 + = @step += 1 + .content + %h3 + = t('.connect_to_your_other_social_networks') + #getting_started_service_icons + - AppConfig.configured_services.each do |service| + - unless current_user.services.any?{|x| x.provider == service} + = link_to(image_tag("social_media_logos/#{service.downcase}-48x48.png", :title => service.titleize), "/auth/#{service}") - %li + %li.connect_with_people{:class => ("completed" if has_few_contacts?)} .getting_started_number %h3 - 3 + = @step += 1 .content %h3 = t(".connect_with_people") @@ -108,17 +107,16 @@ #global_search = form_tag(people_path, :method => 'get', :id => "global_search_form") do = text_field_tag 'q', nil, :placeholder => "Search for people", :type => 'search', :results => 5 - .span-5.last - %p - or - = link_to "find friends from Facebook", "#" + .span-5.last{:style => "height:30px;"} + or + = link_to t('.find_friends_from_facebook'), friend_finder_path('facebook'), :rel => 'facebox' .clearfix %br - %li + %li.follow_interests{:class => ("completed" if has_few_followed_tags?)} .getting_started_number %h3 - 4 + = @step += 1 .content %h3 = t(".follow_your_interests") @@ -134,21 +132,21 @@ %h4 Featured tags %p - = link_to "#diaspora", "#" + = link_to "#diaspora", tag_path('diaspora') %br - = link_to "#kittens", "#" + = link_to "#kittens", tag_path('kittens') %br - = link_to "#puppies", "#" + = link_to "#puppies", tag_path('puppies') %br - = link_to "#maddog", "#" + = link_to "#maddog", tag_path('maddog') .clearfix %br %br - %li + %li.cubbies .getting_started_number %h3 - 5 + = @step += 1 .content %h3 = t(".connect_to") diff --git a/app/views/users/getting_started/_step_1.html.haml b/app/views/users/getting_started/_step_1.html.haml deleted file mode 100644 index 967e739f0..000000000 --- a/app/views/users/getting_started/_step_1.html.haml +++ /dev/null @@ -1,22 +0,0 @@ --# Copyright (c) 2010, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - - -= form_tag profile_path, :method => :put, :multipart => true, :id => 'update_profile_form' do - %div{:style => "width:360px"} - = render 'profiles/edit_public', :profile => @profile, :aspect => @aspect, :person => @person - = hidden_field_tag :getting_started, @step - - %h4 - = t('search') - %p{:class=>"checkbox_select"} - = label_tag 'profile[searchable]', t('profiles.edit.allow_search') - = check_box_tag 'profile[searchable]', true, @profile.searchable - - %br - %br - %br - - .submit_block - = submit_tag "#{t('users.getting_started.save_and_continue')} →" diff --git a/app/views/users/getting_started/_step_2.html.haml b/app/views/users/getting_started/_step_2.html.haml deleted file mode 100644 index 900aa12f9..000000000 --- a/app/views/users/getting_started/_step_2.html.haml +++ /dev/null @@ -1,19 +0,0 @@ --# Copyright (c) 2010, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - - -%br -%br -%br -%br -%br -%h3{:style => 'text-align: center;'} - = t('.find_your_friends_on_diaspora') - %br - %br - %br - = link_to image_tag('services/facebook_sign_in.png', :id => 'getting_started_logo', :width => 154, :height => 22), '/auth/facebook' - -.submit_block - = link_to "#{t('.skip')} →", getting_started_path(:step => @step+1), :class => 'button' diff --git a/app/views/users/getting_started/_step_3.html.haml b/app/views/users/getting_started/_step_3.html.haml deleted file mode 100644 index 267ece875..000000000 --- a/app/views/users/getting_started/_step_3.html.haml +++ /dev/null @@ -1,21 +0,0 @@ --# Copyright (c) 2010, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. -- content_for :head do - = include_javascripts :aspects - -%h3 - = t('.people_already_on_diaspora') - - %br - %br - -#people_stream.stream - - for friend in @friends - = render :partial => 'people/person', :locals => {:person => friend.person, :contact => friend.contact} - -%br -%br - -.submit_block - = link_to "#{t('.finish')} →", getting_started_completed_path, :class => 'button' diff --git a/config/initializers/fetch_featured_users.rb b/config/initializers/fetch_featured_users.rb index eba98d1cc..7029bec96 100644 --- a/config/initializers/fetch_featured_users.rb +++ b/config/initializers/fetch_featured_users.rb @@ -1,4 +1,4 @@ -unless AppConfig[:featured_users].count == Person.featured_users.count +unless Rails.env == 'test' || AppConfig[:featured_users].count == Person.featured_users.count puts "Fetching featured users from remote servers..." AppConfig[:featured_users].each do |x| Webfinger.new(x).fetch diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 72514cea1..6dfcd8963 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -794,6 +794,8 @@ en: follow_your_interests: "Follow your interests" connect_to: "Connect to" + find_friends_from_facebook: "find friends from Facebook" + profile_fields: name: "Name" birthday: "Birthday" diff --git a/public/images/icons/check_box_checked.svg b/public/images/icons/check_box_checked.svg new file mode 100755 index 000000000..8d829aeb4 --- /dev/null +++ b/public/images/icons/check_box_checked.svg @@ -0,0 +1,11 @@ + + + + + + diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index d44288b36..92ff9f0ab 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -3203,6 +3203,18 @@ ul#getting_started input[type='search'] :width 210px + &.completed + @include opacity(0.4) + @include transition(opacity, 0.2s) + + &:hover, + &:active + @include opacity(1) + + .content h3 + :text + :decoration line-through + .profile :min-height 170px @@ -3282,9 +3294,9 @@ ul#getting_started :padding :left 20px -.completed - :background - :image url('/images/icons/check_yes_ok.png') !important + &.completed + :background + :image url('/images/icons/check_yes_ok.png') !important #featured_users_pane :padding 10px 0 diff --git a/spec/factories.rb b/spec/factories.rb index abe0a7f85..a294c4362 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -16,7 +16,6 @@ Factory.define :profile do |p| p.birthday Date.today end - Factory.define :person do |p| p.sequence(:diaspora_handle) { |n| "bob-person-#{n}#{r_str}@aol.com" } p.sequence(:url) { |n| AppConfig[:pod_url] } diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb index 5e8562aac..83f9a5abf 100644 --- a/spec/helpers/users_helper_spec.rb +++ b/spec/helpers/users_helper_spec.rb @@ -4,18 +4,105 @@ require 'spec_helper' describe UsersHelper do - describe '#first_name_or_username' do + before do + @current_user = alice + end + + def current_user + @current_user + end + + describe "#has_completed_profile?" do + it 'returns true if the current user has filled out all 7 suggested fields (from getting started)' do + profile = @current_user.person.profile + profile.update_attributes!( + {:first_name => "alice", :last_name => "smith", :image_url => "abcd.jpg", :birthday => Date.new, + :gender => "cow", :location => "san fran", :tag_string => "#sup", :bio => "holler" }) + has_completed_profile?.should be_true + end + + it 'returns false if the current user has not filled out all 7 suggested fields (from getting started)' do + @current_user.update_attributes(:person => {:profile => + {:first_name => nil, :last_name => nil, :birthday => nil, :gender => nil }}) + has_completed_profile?.should be_false + end + end + + describe "#has_connected_services?" do before do - @user = alice + AppConfig[:connected_services] = ['fake_service'] end - it 'should display the first name if it is set' do - first_name_or_username(@user).should == @user.person.profile.first_name + it 'returns true if the current user has connected at least one service' do + @current_user.services << Factory.build(:service) + has_connected_services?.should be_true end - it 'should display the username if the first name is empty' do - @user.person.profile.first_name = "" - first_name_or_username(@user).should == @user.username + it 'returns true if the current user has zero connected services and the server has no services to connect' do + AppConfig[:connected_services] = [] + @current_user.services.delete_all + has_connected_services?.should be_true + end + + it 'returns false if the current user has not connected any service' do + @current_user.services.delete_all + has_connected_services?.should be_false + end + end + + describe "#has_few_contacts?" do + it 'returns true if the current_user has more than 2 contacts' do + 3.times do |n| + @current_user.contacts << Contact.new(:person => Factory(:person), :receiving => true) + end + has_few_contacts?.should be_true + end + + it 'returns false if the current_user has less than 2 contacts (inclusive)' do + @current_user.contacts.delete_all + has_few_contacts?.should be_false + end + end + + describe "has_few_followed_tags?" do + it 'returns true if the current_user has more than 2 contacts' do + 3.times do |n| + @current_user.followed_tags << ActsAsTaggableOn::Tag.new(:name => "poodles_#{n}") + end + has_few_followed_tags?.should be_true + end + + it 'returns false if the current_user has less than 2 contacts (inclusive)' do + @current_user.followed_tags.delete_all + has_few_followed_tags?.should be_false + end + end + + describe "#has_connected_cubbies?" do + before do + pending + end + + it 'returns true if the current user has connected cubbies to their account' do + has_connected_cubbies?.should be_true + end + + it 'returns false if the current user has not connected cubbies to their account' do + has_connected_cubbies?.should be_false + end + end + + describe "#has_completed_getting_started?" do + it 'returns true if the current user has completed getting started' do + @current_user.getting_started = false + @current_user.save + has_completed_getting_started?.should be_true + end + + it 'returns false if the current user has not completed getting started' do + @current_user.getting_started = true + @current_user.save + has_completed_getting_started?.should be_false end end end From 120cf9835b9677e823eacc5016d344c784131b54 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 3 Aug 2011 12:42:09 -0700 Subject: [PATCH 07/14] added more translations; welcome text switch --- app/helpers/users_helper.rb | 10 +++++- app/views/users/getting_started.html.haml | 24 +++++++------- config/locales/diaspora/en.yml | 39 +++++++++++------------ spec/helpers/users_helper_spec.rb | 15 +++++++++ 4 files changed, 54 insertions(+), 34 deletions(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 003b89a37..e4c5c8229 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -3,7 +3,6 @@ # the COPYRIGHT file. module UsersHelper - # @return [Boolean] The user has filled out all profile fields def has_completed_profile? profile = current_user.person.profile @@ -39,4 +38,13 @@ module UsersHelper def has_completed_getting_started? current_user.getting_started == false end + + # @return [String] Welcome text with or without the current_user's first_name + def welcome_text + if current_user.person.profile.first_name.present? + t('users.getting_started.welcome_with_name', :name => current_user.first_name) + else + t('users.getting_started.welcome') + end + end end diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 1339841d3..511260e84 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -23,7 +23,7 @@ .span-13.append-1 .stream_container %h2 - = "Welcome, #{current_user.first_name}!" + = welcome_text %ul#getting_started %li.profile{:class => ("completed" if has_completed_profile?)} @@ -64,10 +64,10 @@ = @step += 1 .content %h3 - = t(".connect_with_people") + = t('.connect_with_people') %p - Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily. + = t('.connect_with_people_explanation') #diaspora_hq_pane - person = Person.find_by_diaspora_handle("diasporahq@joindiaspora.com") @@ -87,7 +87,7 @@ #featured_users_pane %h4 - Featured users + = t('.featured_users') %div - Person.featured_users[0..5].each do |person| @@ -97,12 +97,12 @@ - person.profile.tags[0..2].each do |tg| = "##{tg}" - = link_to "See all featured users ->", "#" + = link_to "#{t('.see_all_featured_users')} ->", featured_users_path %br #find_friends_pane %h4 - Find friends + = t('.find_friends') .span-5.append-1 #global_search = form_tag(people_path, :method => 'get', :id => "global_search_form") do @@ -119,10 +119,10 @@ = @step += 1 .content %h3 - = t(".follow_your_interests") + = t('.follow_your_interests') %p - Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora. + = t('.hashtag_explanation') .span-5.append-1 #global_search @@ -130,7 +130,7 @@ = text_field_tag 'q', nil, :placeholder => "Search for #hashtags", :type => 'search', :results => 5 .span-5.last %h4 - Featured tags + = t('.featured_tags') %p = link_to "#diaspora", tag_path('diaspora') %br @@ -158,6 +158,6 @@ = image_tag '/images/cubbies_collage.png', :width => 422, :height => 159, :class => "cubbies_collage_small" = image_tag '/images/cubbies_screenshot2.png', :height => 151, :width => 200, :class => "cubbies_user_page_small" -.span-5.rightBar.last - /= render 'selected_contacts', :people => @selected_people.sample(20), :count => @contact_count - /= render 'shared/right_sections' +/.span-5.rightBar.last +/ = render 'selected_contacts', :people => @selected_people.sample(20), :count => @contact_count +/ = render 'shared/right_sections' diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 6dfcd8963..e7cfb17bd 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -777,25 +777,13 @@ en: email_awaiting_confirmation: "We have sent you an activation link to %{unconfirmed_email}. Until you follow this link and activate the new address, we will continue to use your original address %{email}." destroy: "Your account has been locked. It may take 20 minutes for us to finish closing your account. Thank you for trying Diaspora." getting_started: - welcome: "Welcome to Diaspora!" - signup_steps: "Finish your sign up by completing these three steps:" - edit_profile: "Edit your profile" - connect_on_diaspora: "Connect on Diaspora" - connect_services: "Connect your other services" - finished: "Finished!" + welcome: "Welcome!" + welcome_with_name: "Welcome, %{name}!" + skip: "skip getting started" - save_and_continue: "Save and continue" - could_not_find_anyone: "Could not find any friends on Diaspora*. Use the friend finder to invite them." fill_out_your_profile: "Fill out your profile" profile_description: "Description of why you'd want to do this" - connect_to_your_other_social_networks: "Connect to your other social networks" - connect_with_people: "Connect with cool people" - follow_your_interests: "Follow your interests" - connect_to: "Connect to" - - find_friends_from_facebook: "find friends from Facebook" - profile_fields: name: "Name" birthday: "Birthday" @@ -805,12 +793,21 @@ en: gender: "Gender" location: "Location" - step_3: - finish: "Finish" - people_already_on_diaspora: "People already on Diaspora" - step_2: - find_your_friends_on_diaspora: "Would you like to find your Facebook friends on Diaspora?" - skip: "Skip" + connect_to_your_other_social_networks: "Connect to your other social networks" + connect_with_people: "Connect with cool people" + connect_with_people_explanation: "Connect with people by placing them into one or more of your aspects. Aspects are an intuative way to group new and familar faces, allowing you to filter down or share with subsets of your contacts easily." + featured_users: "Featured users" + + follow_your_interests: "Follow your interests" + connect_to: "Connect to" + + find_friends_from_facebook: "find friends from Facebook" + featured_tags: "Featured tags" + find_friends: "Find friends" + see_all_featured_users: "See all featured users" + + hashtag_explanation: "Hashtags allow you to talk about and follow your interests. They're also a great way to find new people on Diaspora." + update: password_changed: "Password changed. You can now log in with your new password." password_not_changed: "Password change failed" diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb index 83f9a5abf..94498cefa 100644 --- a/spec/helpers/users_helper_spec.rb +++ b/spec/helpers/users_helper_spec.rb @@ -105,4 +105,19 @@ describe UsersHelper do has_completed_getting_started?.should be_false end end + + describe "#welcome_text" do + it 'returns "Welcome" without a name if first_name is not set' do + profile = @current_user.person.profile + profile.first_name = "" + profile.save + @current_user.person.instance_variable_set(:@first_name, nil) + + welcome_text.should == "Welcome!" + end + + it 'returns "Welcome, {first_name}" if first_name is set' do + welcome_text.should == "Welcome, #{current_user.first_name}!" + end + end end From e589dd88b24849e87e7a99c65833c7f08edb3070 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 3 Aug 2011 13:14:33 -0700 Subject: [PATCH 08/14] added has_connected_cubbies? --- app/helpers/users_helper.rb | 1 + app/views/users/getting_started.html.haml | 2 +- spec/helpers/users_helper_spec.rb | 5 +---- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index e4c5c8229..693305e42 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -32,6 +32,7 @@ module UsersHelper # @return [Boolean] The user has connected to cubbi.es def has_connected_cubbies? + current_user.authorizations.size > 0 end # @return [Boolean] The user has completed all steps in getting started diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 511260e84..cf72d9e78 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -143,7 +143,7 @@ %br %br - %li.cubbies + %li.cubbies{:class => ("completed" if has_connected_cubbies?)} .getting_started_number %h3 = @step += 1 diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb index 94498cefa..5feeca8e7 100644 --- a/spec/helpers/users_helper_spec.rb +++ b/spec/helpers/users_helper_spec.rb @@ -79,11 +79,8 @@ describe UsersHelper do end describe "#has_connected_cubbies?" do - before do - pending - end - it 'returns true if the current user has connected cubbies to their account' do + @current_user.authorizations << Factory(:oauth_authorization) has_connected_cubbies?.should be_true end From 984eef25be9e68e64329d2a185fb2b66affc4970 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 3 Aug 2011 13:17:53 -0700 Subject: [PATCH 09/14] UsersHelper -> GettingStartedHelper --- app/helpers/{users_helper.rb => getting_started_helper.rb} | 2 +- .../{users_helper_spec.rb => getting_started_helper_spec.rb} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename app/helpers/{users_helper.rb => getting_started_helper.rb} (98%) rename spec/helpers/{users_helper_spec.rb => getting_started_helper_spec.rb} (99%) diff --git a/app/helpers/users_helper.rb b/app/helpers/getting_started_helper.rb similarity index 98% rename from app/helpers/users_helper.rb rename to app/helpers/getting_started_helper.rb index 693305e42..af25a9bd7 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/getting_started_helper.rb @@ -2,7 +2,7 @@ # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. -module UsersHelper +module GettingStartedHelper # @return [Boolean] The user has filled out all profile fields def has_completed_profile? profile = current_user.person.profile diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/getting_started_helper_spec.rb similarity index 99% rename from spec/helpers/users_helper_spec.rb rename to spec/helpers/getting_started_helper_spec.rb index 5feeca8e7..5067fc618 100644 --- a/spec/helpers/users_helper_spec.rb +++ b/spec/helpers/getting_started_helper_spec.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. require 'spec_helper' -describe UsersHelper do +describe GettingStartedHelper do before do @current_user = alice end From e23439d193a44f2eb48b68d69f8f5006757c2cb1 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 3 Aug 2011 15:08:27 -0700 Subject: [PATCH 10/14] fix cucumber; temporarily remove fetch featured users initilizer --- app/controllers/profiles_controller.rb | 2 +- app/views/layouts/_header.html.haml | 3 +- app/views/users/getting_started.html.haml | 4 +++ config/initializers/fetch_featured_users.rb | 16 ++++++----- config/locales/diaspora/en.yml | 2 +- features/accepts_invitation.feature | 31 +++++++++++++-------- features/signs_up.feature | 22 +++++++++------ 7 files changed, 51 insertions(+), 29 deletions(-) diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index 66ead779e..68f936979 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -36,7 +36,7 @@ class ProfilesController < ApplicationController if current_user.update_profile params[:profile] flash[:notice] = I18n.t 'profiles.update.updated' - if params[:getting_started] + if current_user.getting_started? redirect_to getting_started_path(:step => params[:getting_started].to_i+1) else redirect_to edit_profile_path diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 2d8cdd5e9..b5c719a9f 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -73,13 +73,14 @@ #lightbox-backdrop + = current_user.diaspora_handle %ul#user_menu.dropdown %li .right ▼ .avatar = owner_image_tag(:thumb_small) - = link_to current_user.name, '#' + = link_to current_user.name, '#', :title => current_user.diaspora_handle %li= link_to t('.profile'), current_user.person %li= link_to t('.settings'), edit_user_path -if current_user.admin? diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index cf72d9e78..ecdc33ee6 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -158,6 +158,10 @@ = image_tag '/images/cubbies_collage.png', :width => 422, :height => 159, :class => "cubbies_collage_small" = image_tag '/images/cubbies_screenshot2.png', :height => 151, :width => 200, :class => "cubbies_user_page_small" + %li{:style => 'text-align:center;'} + %p + = link_to t('.skip'), getting_started_completed_path + /.span-5.rightBar.last / = render 'selected_contacts', :people => @selected_people.sample(20), :count => @contact_count / = render 'shared/right_sections' diff --git a/config/initializers/fetch_featured_users.rb b/config/initializers/fetch_featured_users.rb index 7029bec96..76b75f5f8 100644 --- a/config/initializers/fetch_featured_users.rb +++ b/config/initializers/fetch_featured_users.rb @@ -1,7 +1,9 @@ -unless Rails.env == 'test' || AppConfig[:featured_users].count == Person.featured_users.count - puts "Fetching featured users from remote servers..." - AppConfig[:featured_users].each do |x| - Webfinger.new(x).fetch - end - puts "Done fetching!" -end +#this breaks seed scripts +# +#unless Rails.env == 'test' || AppConfig[:featured_users].count == Person.featured_users.count +# puts "Fetching featured users from remote servers..." +# AppConfig[:featured_users].each do |x| +# Webfinger.new(x).fetch +# end +# puts "Done fetching!" +#end diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index e7cfb17bd..18282956b 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -780,7 +780,7 @@ en: welcome: "Welcome!" welcome_with_name: "Welcome, %{name}!" - skip: "skip getting started" + skip: "Skip getting started" fill_out_your_profile: "Fill out your profile" profile_description: "Description of why you'd want to do this" diff --git a/features/accepts_invitation.feature b/features/accepts_invitation.feature index 1987be9e8..87ec1a86e 100644 --- a/features/accepts_invitation.feature +++ b/features/accepts_invitation.feature @@ -10,14 +10,19 @@ Feature: invitation acceptance | Password confirmation | secret | And I press "Sign up" Then I should be on the getting started page - And I should see "getting_started_logo" + And I should see "Welcome" + Then I follow "Edit Profile" And I fill in the following: | profile_first_name | O | | profile_last_name | Hai | | tags | #beingawesome | - And I press "Save and continue" - And I should see "Would you like to find your Facebook friends on Diaspora?" - And I should not see "Here are the people who are waiting for you:" + | profile_bio | swagger | + | profile_location | new york, ny | + | profile_gender | diasporian | + And I press "Update Profile" + And I should see "Welcome" + When I follow "Skip getting started" + Then I should be on the aspects page Scenario: accept invitation from user Given I have been invited by a user @@ -29,13 +34,17 @@ Feature: invitation acceptance | Password confirmation | secret | And I press "Sign up" Then I should be on the getting started page - And I should see "getting_started_logo" + And I should see "Welcome" + Then I follow "Edit Profile" And I fill in the following: - | profile_first_name | O | - | profile_last_name | Hai | - | tags | #tags | - And I press "Save and continue" - And I should see "Would you like to find your Facebook friends on Diaspora?" - When I follow "Skip" + | profile_first_name | O | + | profile_last_name | Hai | + | tags | #beingawesome | + | profile_bio | swagger | + | profile_location | new york, ny | + | profile_gender | diasporian | + And I press "Update Profile" + And I should see "Welcome" + When I follow "Skip getting started" Then I should be on the aspects page diff --git a/features/signs_up.feature b/features/signs_up.feature index 566b6ebfd..ebc3b53ee 100644 --- a/features/signs_up.feature +++ b/features/signs_up.feature @@ -9,26 +9,32 @@ Feature: new user registration And I fill in "Password confirmation" with "secret" And I press "Sign up" Then I should be on the getting started page - And I should see "getting_started_logo" + And I should see "Welcome" + And I should see "Fill out your profile" + And I should see "Connect to your other social networks" + And I should see "Connect with cool people" + And I should see "Follow your interests" + And I should see "Connect to Cubbi.es" Scenario: new user goes through the setup wizard - When I fill in "profile_first_name" with "O" + When I follow "Edit Profile" + And I fill in "profile_first_name" with "O" And I fill in "profile_last_name" with "Hai" And I fill in "tags" with "#tags" - And I press "Save and continue" + And I press "Update Profile" And I wait for the ajax to finish Then I should see "Profile updated" - And I should see "Would you like to find your Facebook friends on Diaspora?" - And I follow "Skip" + And I should see "Welcome" + And I follow "Skip getting started" Then I should be on the aspects page - And I should not see "skip getting started" + And I should not see "Skip getting started" Scenario: new user skips the setup wizard and returns to the setup wizard - When I follow "skip getting started" + When I follow "Skip getting started" And I go to the getting started page Then I should not see "skip getting started" Scenario: new user skips the setup wizard - When I follow "skip getting started" + When I follow "Skip getting started" Then I should be on the aspects page From 7d01deb99d06d50b84f1ef1d7fa0a782926ea276 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 3 Aug 2011 15:41:52 -0700 Subject: [PATCH 11/14] don't show connect to cubbies in right bar if user is already connected --- app/views/shared/_right_sections.html.haml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/views/shared/_right_sections.html.haml b/app/views/shared/_right_sections.html.haml index 6f1641e78..891cb510f 100644 --- a/app/views/shared/_right_sections.html.haml +++ b/app/views/shared/_right_sections.html.haml @@ -3,14 +3,15 @@ -# the COPYRIGHT file. -.section - .title - = image_tag('/images/icons/cubbies.png') - %h5 - = t('aspects.index.cubbies.heading') - .content - = t('aspects.index.cubbies.explanation') - = link_to t('aspects.index.cubbies.learn_more'), token_path +- unless has_connected_cubbies? + .section + .title + = image_tag('/images/icons/cubbies.png') + %h5 + = t('aspects.index.cubbies.heading') + .content + = t('aspects.index.cubbies.explanation') + = link_to t('aspects.index.cubbies.learn_more'), token_path - unless AppConfig.configured_services.blank? .section From 23c2eaf1c52b6e37b84028e9d6f05979b166a9de Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 3 Aug 2011 15:52:02 -0700 Subject: [PATCH 12/14] added a real profile description on the welcome tab --- app/views/users/getting_started.html.haml | 4 ++-- config/initializers/fetch_featured_users.rb | 17 +++++++++-------- config/locales/diaspora/en.yml | 2 +- public/stylesheets/sass/application.sass | 2 ++ 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index ecdc33ee6..542190630 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -31,10 +31,10 @@ %h3 = @step += 1 .content - #getting_started_profile_photo - = person_image_link(current_user.person, :size => :thumb_medium) %h3 = t(".fill_out_your_profile") + #getting_started_profile_photo + = person_image_link(current_user.person, :size => :thumb_medium) %p = t(".profile_description") .span-8.fields diff --git a/config/initializers/fetch_featured_users.rb b/config/initializers/fetch_featured_users.rb index 76b75f5f8..cf03ca3ad 100644 --- a/config/initializers/fetch_featured_users.rb +++ b/config/initializers/fetch_featured_users.rb @@ -1,9 +1,10 @@ #this breaks seed scripts -# -#unless Rails.env == 'test' || AppConfig[:featured_users].count == Person.featured_users.count -# puts "Fetching featured users from remote servers..." -# AppConfig[:featured_users].each do |x| -# Webfinger.new(x).fetch -# end -# puts "Done fetching!" -#end + +unless Rails.env == 'test' || AppConfig[:featured_users].count == Person.featured_users.count + print "Fetching featured users from remote servers" + AppConfig[:featured_users].each do |x| + Webfinger.new(x).fetch + print "." + end + puts " done!" +end diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 18282956b..da3a9d778 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -783,7 +783,7 @@ en: skip: "Skip getting started" fill_out_your_profile: "Fill out your profile" - profile_description: "Description of why you'd want to do this" + profile_description: "Make it easier for people to find you by filling out your profile information." profile_fields: name: "Name" birthday: "Birthday" diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 92ff9f0ab..b931f741c 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -3223,6 +3223,8 @@ ul#getting_started .avatar :height 150px :width 150px + :margin + :left 5px #edit_profile_button_div :padding From 987d334764d09cb5698dd88756f577c6c0214af8 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 3 Aug 2011 16:55:04 -0700 Subject: [PATCH 13/14] fixed tests, translations, initalizer --- app/views/layouts/_header.html.haml | 2 -- app/views/users/getting_started.html.haml | 7 ++++--- config/initializers/fetch_featured_users.rb | 2 +- features/step_definitions/session_steps.rb | 2 +- spec/controllers/contacts_controller_spec.rb | 10 ---------- 5 files changed, 6 insertions(+), 17 deletions(-) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index b5c719a9f..9a181d969 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -72,8 +72,6 @@ #lightbox-backdrop - - = current_user.diaspora_handle %ul#user_menu.dropdown %li .right diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 542190630..4caee399e 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -108,8 +108,9 @@ = form_tag(people_path, :method => 'get', :id => "global_search_form") do = text_field_tag 'q', nil, :placeholder => "Search for people", :type => 'search', :results => 5 .span-5.last{:style => "height:30px;"} - or - = link_to t('.find_friends_from_facebook'), friend_finder_path('facebook'), :rel => 'facebox' + %h4{:style => "margin-top:7px;"} + or + = link_to t('.find_friends_from_facebook'), friend_finder_path('facebook'), :rel => 'facebox' .clearfix %br @@ -129,7 +130,7 @@ = form_tag(people_path, :method => 'get', :id => "global_search_form") do = text_field_tag 'q', nil, :placeholder => "Search for #hashtags", :type => 'search', :results => 5 .span-5.last - %h4 + %h4{:style => "margin-top:7px;"} = t('.featured_tags') %p = link_to "#diaspora", tag_path('diaspora') diff --git a/config/initializers/fetch_featured_users.rb b/config/initializers/fetch_featured_users.rb index cf03ca3ad..82d903a91 100644 --- a/config/initializers/fetch_featured_users.rb +++ b/config/initializers/fetch_featured_users.rb @@ -1,6 +1,6 @@ #this breaks seed scripts -unless Rails.env == 'test' || AppConfig[:featured_users].count == Person.featured_users.count +unless !ActiveRecord::Base.connection.table_exists?('people') || Rails.env == 'test' || AppConfig[:featured_users].count == Person.featured_users.count print "Fetching featured users from remote servers" AppConfig[:featured_users].each do |x| Webfinger.new(x).fetch diff --git a/features/step_definitions/session_steps.rb b/features/step_definitions/session_steps.rb index 043d53130..787315dae 100644 --- a/features/step_definitions/session_steps.rb +++ b/features/step_definitions/session_steps.rb @@ -11,7 +11,7 @@ end Given /^(?:I am signed in|I sign in)$/ do When %(I try to sign in) - wait_until { page.has_content?(@me.diaspora_handle) } + wait_until { page.has_content?("#{@me.first_name} #{@me.last_name}") } end When /^I try to sign in$/ do diff --git a/spec/controllers/contacts_controller_spec.rb b/spec/controllers/contacts_controller_spec.rb index ccef9d82a..dfdff97a2 100644 --- a/spec/controllers/contacts_controller_spec.rb +++ b/spec/controllers/contacts_controller_spec.rb @@ -81,15 +81,5 @@ describe ContactsController do get :featured assigns[:people].should == [alice.person] end - - it 'fetches the webfinger profiles' do - AppConfig[:featured_users] = [alice.diaspora_handle] - - wf = mock - wf.should_receive(:fetch) - Webfinger.should_receive(:new).with(alice.diaspora_handle).and_return(wf) - - get :featured - end end end From 99ac97659431486640839648eab9592c42ff8963 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Wed, 3 Aug 2011 17:48:46 -0700 Subject: [PATCH 14/14] fix redirects around getting_started and aspect/index --- app/controllers/application_controller.rb | 2 +- app/controllers/aspects_controller.rb | 6 ------ app/controllers/profiles_controller.rb | 2 +- app/helpers/getting_started_helper.rb | 2 +- app/views/users/getting_started.html.haml | 8 ++++---- config/locales/diaspora/en.yml | 2 +- features/accepts_invitation.feature | 4 ++-- features/signs_up.feature | 11 +++-------- spec/controllers/aspects_controller_spec.rb | 6 ++---- spec/helpers/getting_started_helper_spec.rb | 6 +++--- 10 files changed, 18 insertions(+), 31 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c7443c7af..f9e90316f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -122,6 +122,6 @@ class ApplicationController < ActionController::Base end def after_sign_in_path_for(resource) - stored_location_for(:user) || aspects_path + stored_location_for(:user) || (current_user.getting_started? ? getting_started_path : aspects_path) end end diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 9764a0e73..feaa11a74 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -22,12 +22,6 @@ class AspectsController < ApplicationController aspect_ids = @aspects.map{|a| a.id} - # redirect to signup - if current_user.getting_started == true && !request.format.mobile? && !request.format.js? - redirect_to getting_started_path - return - end - # redirect to aspects creation if @aspects.blank? redirect_to new_aspect_path diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index 68f936979..51e4f2ddd 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -37,7 +37,7 @@ class ProfilesController < ApplicationController if current_user.update_profile params[:profile] flash[:notice] = I18n.t 'profiles.update.updated' if current_user.getting_started? - redirect_to getting_started_path(:step => params[:getting_started].to_i+1) + redirect_to getting_started_path else redirect_to edit_profile_path end diff --git a/app/helpers/getting_started_helper.rb b/app/helpers/getting_started_helper.rb index af25a9bd7..97a8b64c2 100644 --- a/app/helpers/getting_started_helper.rb +++ b/app/helpers/getting_started_helper.rb @@ -17,7 +17,7 @@ module GettingStartedHelper # @return [Boolean] The user has connected at least one service def has_connected_services? - AppConfig[:connected_services].blank? || current_user.services.size > 0 + AppConfig[:configured_services].blank? || current_user.services.size > 0 end # @return [Boolean] The user has at least 3 contacts diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 4caee399e..d8fed4f6b 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -135,11 +135,11 @@ %p = link_to "#diaspora", tag_path('diaspora') %br - = link_to "#kittens", tag_path('kittens') + = link_to "#art", tag_path('art') %br - = link_to "#puppies", tag_path('puppies') + = link_to "#gif", tag_path('gif') %br - = link_to "#maddog", tag_path('maddog') + = link_to "#french", tag_path('french') .clearfix %br %br @@ -161,7 +161,7 @@ %li{:style => 'text-align:center;'} %p - = link_to t('.skip'), getting_started_completed_path + = link_to t('.finished'), getting_started_completed_path, :class => "button" /.span-5.rightBar.last / = render 'selected_contacts', :people => @selected_people.sample(20), :count => @contact_count diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index da3a9d778..30767d1c1 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -780,7 +780,7 @@ en: welcome: "Welcome!" welcome_with_name: "Welcome, %{name}!" - skip: "Skip getting started" + finished: "Finished" fill_out_your_profile: "Fill out your profile" profile_description: "Make it easier for people to find you by filling out your profile information." diff --git a/features/accepts_invitation.feature b/features/accepts_invitation.feature index 87ec1a86e..518bb41d5 100644 --- a/features/accepts_invitation.feature +++ b/features/accepts_invitation.feature @@ -21,7 +21,7 @@ Feature: invitation acceptance | profile_gender | diasporian | And I press "Update Profile" And I should see "Welcome" - When I follow "Skip getting started" + When I follow "Finished" Then I should be on the aspects page Scenario: accept invitation from user @@ -45,6 +45,6 @@ Feature: invitation acceptance | profile_gender | diasporian | And I press "Update Profile" And I should see "Welcome" - When I follow "Skip getting started" + When I follow "Finished" Then I should be on the aspects page diff --git a/features/signs_up.feature b/features/signs_up.feature index ebc3b53ee..7003b038f 100644 --- a/features/signs_up.feature +++ b/features/signs_up.feature @@ -25,16 +25,11 @@ Feature: new user registration And I wait for the ajax to finish Then I should see "Profile updated" And I should see "Welcome" - And I follow "Skip getting started" + And I follow "Finished" Then I should be on the aspects page - And I should not see "Skip getting started" + And I should not see "Finished" - Scenario: new user skips the setup wizard and returns to the setup wizard - When I follow "Skip getting started" - And I go to the getting started page - Then I should not see "skip getting started" - Scenario: new user skips the setup wizard - When I follow "Skip getting started" + When I follow "Finished" Then I should be on the aspects page diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index c9d9ba89e..25fa6e007 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -77,14 +77,12 @@ describe AspectsController do alice.getting_started = true alice.save end - it 'redirects to getting_started' do - get :index - response.should redirect_to getting_started_path - end + it 'does not redirect mobile users to getting_started' do get :index, :format => :mobile response.should_not be_redirect end + it 'does not redirect ajax to getting_started' do get :index, :format => :js response.should_not be_redirect diff --git a/spec/helpers/getting_started_helper_spec.rb b/spec/helpers/getting_started_helper_spec.rb index 5067fc618..0223b9230 100644 --- a/spec/helpers/getting_started_helper_spec.rb +++ b/spec/helpers/getting_started_helper_spec.rb @@ -30,7 +30,7 @@ describe GettingStartedHelper do describe "#has_connected_services?" do before do - AppConfig[:connected_services] = ['fake_service'] + AppConfig[:configured_services] = ['fake_service'] end it 'returns true if the current user has connected at least one service' do @@ -38,8 +38,8 @@ describe GettingStartedHelper do has_connected_services?.should be_true end - it 'returns true if the current user has zero connected services and the server has no services to connect' do - AppConfig[:connected_services] = [] + it 'returns true if the current user has zero connected services and the server has no services configured' do + AppConfig[:configured_services] = [] @current_user.services.delete_all has_connected_services?.should be_true end