diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ed6658678..a4a6475e9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -40,7 +40,12 @@ class UsersController < ApplicationController flash[:error] = "Failed to update profile" end end - redirect_to edit_user_path(@user) + + if params[:getting_started] + redirect_to getting_started_path(params[:getting_started].to_i+1) + else + redirect_to edit_user_path(@user) + end end diff --git a/app/views/users/_profile.haml b/app/views/users/_profile.haml index 8bf100c4d..b18a56c86 100644 --- a/app/views/users/_profile.haml +++ b/app/views/users/_profile.haml @@ -49,9 +49,6 @@ =will_paginate @photos - - - .submit_block = link_to t('.cancel'), edit_user_path(current_user) = t('.or') diff --git a/app/views/users/getting_started/1.html.haml b/app/views/users/getting_started/1.html.haml index 4496290b8..5ffb4a1ae 100644 --- a/app/views/users/getting_started/1.html.haml +++ b/app/views/users/getting_started/1.html.haml @@ -10,7 +10,7 @@ Do the stuff below to further complete some things. %h3 - = link_to "Edit your profile", getting_started_path(1) + = link_to "Edit your profile", getting_started_path(1), :class => 'selected' %br = link_to "Define your aspects", getting_started_path(2) %br @@ -18,5 +18,56 @@ %br .span-15.last - = render 'users/profile' + .floating + = form_for @user do |user| + %h3 + Your Profile + .description + This info will be available to whomever you connect with on Diaspora. + + = user.error_messages + + = user.fields_for :profile do |profile| + %h4 + Your name + = profile.text_field :first_name, :value => @profile.first_name, :placeholder => "First name" + = profile.text_field :last_name, :value => @profile.last_name, :placeholder => "Last name" + + %h4 + Your birthday + %br + = select_date Time.now, :order => [:month, :day, :year] + + %h4 + Your bio + = profile.text_area :bio, :value => @profile.bio, :rows => 5, :placeholder => "Fill me out" + + %h4 + Your photo + %div#image_picker + = profile.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field' + + - unless @photos.nil? || @photos.empty? + - for photo in @photos + - if @profile.image_url && @profile.image_url.include?(photo.url(:thumb_medium)) + %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} + = check_box_tag 'checked_photo', true, true + = link_to image_tag(photo.url(:thumb_medium)), "#" + - else + %div.small_photo{:id => photo.url(:thumb_medium)} + = check_box_tag 'checked_photo' + = link_to image_tag(photo.url(:thumb_medium)), "#" + + - else + =t('.you_dont_have_any_photos') + = link_to t('.albums'), albums_path(:aspect => 'all') + =t('.page_to_upload_some') + + =will_paginate @photos + + = hidden_field_tag :getting_started, 1 + + + .submit_block + = user.submit "Save and continue →" diff --git a/app/views/users/getting_started/2.html.haml b/app/views/users/getting_started/2.html.haml index 806461e1f..3e7fe3175 100644 --- a/app/views/users/getting_started/2.html.haml +++ b/app/views/users/getting_started/2.html.haml @@ -22,7 +22,7 @@ .description Do the stuff below to further complete some things. - %h3 + %h3.nav = link_to "Edit your profile", getting_started_path(1) %br = link_to "Define your aspects", getting_started_path(2) @@ -31,30 +31,36 @@ %br .span-15.last - %h3 - Your aspects - %p - Diaspora aspects are mappings of your real-life aspects. + .floating + %h3 + Your aspects + %p + Diaspora aspects are mappings of your real-life aspects. - %h4 - Aspect name - - form_for Aspect.new, :remote => true do |aspect| - = aspect.text_field :name - = aspect.submit "Add" + %h4 + Aspect name + - form_for Aspect.new, :remote => true do |aspect| + = aspect.text_field :name + = aspect.submit "Add" - %ul.aspects - - for aspect in @aspects - %li{:style=>"position:relative;"} - = aspect - .friend_pictures.horizontal - - for friend in aspect.people - = person_image_link(friend) + %ul.aspects + - for aspect in @aspects + %li{:style=>"position:relative;"} + = aspect + .friend_pictures.horizontal + - for friend in aspect.people + = person_image_link(friend) - = link_to (image_tag('add_friend_button.png', :title => "add to #{@aspect}")), "#add_request_pane", :class => 'add_request_button' + = link_to (image_tag('add_friend_button.png', :title => "add to #{aspect}")), "#add_request_pane", :class => 'add_request_button' - .fancybox_content - #add_request_pane - = render "requests/new_request", :aspect => aspect + .fancybox_content + #add_request_pane + = render "requests/new_request", :aspect => aspect - = link_to "x", aspect_path(aspect), :confirm => "are you sure?", :method => :delete, :remote => true, :class => "delete right" + = link_to "x", aspect_path(aspect), :confirm => "are you sure?", :method => :delete, :remote => true, :class => "delete right" + %br + %br + + .submit_block + = link_to "Save and continue →", getting_started_path(3), :class => "button" diff --git a/app/views/users/getting_started/3.html.haml b/app/views/users/getting_started/3.html.haml index 8a4c6b95a..65fae6637 100644 --- a/app/views/users/getting_started/3.html.haml +++ b/app/views/users/getting_started/3.html.haml @@ -16,24 +16,23 @@ = link_to "Define your aspects", getting_started_path(2) %br = link_to "Connect your services", getting_started_path(3) + %br .span-15.last - %h3 - Your friends - .description - Find your friends on Diaspora, Facebook, or send them an invite via email. + .floating + %h3 + Your friends + .description + Find your friends on Diaspora, Facebook, or send them an invite via email. - .span-5.last %h4 On Diaspora = text_field_tag :diaspora_handle, nil, :placeholder => "Diaspora handle" - .span-5.last %h4 On Facebook = text_field_tag :facebook_handle, nil, :placeholder => "Name" - .span-5.last %h4 Invite = text_field_tag :email, nil, :placeholder => "Email", :type => "email" diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index c5cc05e2a..6a1e7e7a7 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1266,7 +1266,7 @@ ul.aspects :size 24px > li - :padding 12px + :padding 12px 0 :border :bottom 1px solid #eee @@ -1293,3 +1293,14 @@ ul.aspects .inline :display inline + +.floating + :padding 12px + :background + :color rgb(254,254,254) + :-webkit-box-shadow 0 1px 3px #333 + :border-radius 2px + :border + :bottom 1px solid #ccc + :top 1px solid #fff +