save and continue buttons on getting_started#1 and getting_started#2. raise fields

This commit is contained in:
danielvincent 2010-10-26 15:03:38 -07:00
parent ec141a2019
commit ea46fa8fd8
6 changed files with 105 additions and 36 deletions

View file

@ -40,7 +40,12 @@ class UsersController < ApplicationController
flash[:error] = "Failed to update profile" flash[:error] = "Failed to update profile"
end end
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 end

View file

@ -49,9 +49,6 @@
=will_paginate @photos =will_paginate @photos
.submit_block .submit_block
= link_to t('.cancel'), edit_user_path(current_user) = link_to t('.cancel'), edit_user_path(current_user)
= t('.or') = t('.or')

View file

@ -10,7 +10,7 @@
Do the stuff below to further complete some things. Do the stuff below to further complete some things.
%h3 %h3
= link_to "Edit your profile", getting_started_path(1) = link_to "Edit your profile", getting_started_path(1), :class => 'selected'
%br %br
= link_to "Define your aspects", getting_started_path(2) = link_to "Define your aspects", getting_started_path(2)
%br %br
@ -18,5 +18,56 @@
%br %br
.span-15.last .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 →"

View file

@ -22,7 +22,7 @@
.description .description
Do the stuff below to further complete some things. Do the stuff below to further complete some things.
%h3 %h3.nav
= link_to "Edit your profile", getting_started_path(1) = link_to "Edit your profile", getting_started_path(1)
%br %br
= link_to "Define your aspects", getting_started_path(2) = link_to "Define your aspects", getting_started_path(2)
@ -31,30 +31,36 @@
%br %br
.span-15.last .span-15.last
%h3 .floating
Your aspects %h3
%p Your aspects
Diaspora aspects are mappings of your real-life aspects. %p
Diaspora aspects are mappings of your real-life aspects.
%h4 %h4
Aspect name Aspect name
- form_for Aspect.new, :remote => true do |aspect| - form_for Aspect.new, :remote => true do |aspect|
= aspect.text_field :name = aspect.text_field :name
= aspect.submit "Add" = aspect.submit "Add"
%ul.aspects %ul.aspects
- for aspect in @aspects - for aspect in @aspects
%li{:style=>"position:relative;"} %li{:style=>"position:relative;"}
= aspect = aspect
.friend_pictures.horizontal .friend_pictures.horizontal
- for friend in aspect.people - for friend in aspect.people
= person_image_link(friend) = 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 .fancybox_content
#add_request_pane #add_request_pane
= render "requests/new_request", :aspect => aspect = 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"

View file

@ -16,24 +16,23 @@
= link_to "Define your aspects", getting_started_path(2) = link_to "Define your aspects", getting_started_path(2)
%br %br
= link_to "Connect your services", getting_started_path(3) = link_to "Connect your services", getting_started_path(3)
%br
.span-15.last .span-15.last
%h3 .floating
Your friends %h3
.description Your friends
Find your friends on Diaspora, Facebook, or send them an invite via email. .description
Find your friends on Diaspora, Facebook, or send them an invite via email.
.span-5.last
%h4 %h4
On Diaspora On Diaspora
= text_field_tag :diaspora_handle, nil, :placeholder => "Diaspora handle" = text_field_tag :diaspora_handle, nil, :placeholder => "Diaspora handle"
.span-5.last
%h4 %h4
On Facebook On Facebook
= text_field_tag :facebook_handle, nil, :placeholder => "Name" = text_field_tag :facebook_handle, nil, :placeholder => "Name"
.span-5.last
%h4 %h4
Invite Invite
= text_field_tag :email, nil, :placeholder => "Email", :type => "email" = text_field_tag :email, nil, :placeholder => "Email", :type => "email"

View file

@ -1266,7 +1266,7 @@ ul.aspects
:size 24px :size 24px
> li > li
:padding 12px :padding 12px 0
:border :border
:bottom 1px solid #eee :bottom 1px solid #eee
@ -1293,3 +1293,14 @@ ul.aspects
.inline .inline
:display 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