users#getting_started route -> getting_started. getting_started is now a mini-template referring to partials in users/getting_started/

This commit is contained in:
danielvincent 2010-10-27 12:21:25 -07:00
parent 4ec11691cd
commit cd726c0ba7
14 changed files with 209 additions and 267 deletions

View file

@ -49,7 +49,7 @@ class PeopleController < ApplicationController
end end
if params[:getting_started] if params[:getting_started]
redirect_to getting_started_path(params[:getting_started].to_i+1) redirect_to getting_started_path(:step => params[:getting_started].to_i+1)
else else
redirect_to edit_person_path redirect_to edit_person_path
end end

View file

@ -65,18 +65,16 @@ class UsersController < ApplicationController
end end
def getting_started def getting_started
@aspect = :getting_started @aspect = :getting_started
@user = current_user @user = current_user
@person = @user.person @person = @user.person
@profile = current_user.profile @profile = @user.profile
@photos = current_user.visible_posts(:person_id => current_user.person.id, :_type => 'Photo').paginate :page => params[:page], :order => 'created_at DESC' @photos = @user.visible_posts(:person_id => current_user.person.id, :_type => 'Photo').paginate :page => params[:page], :order => 'created_at DESC'
@services = current_user.services @services = @user.services
if params[:id].to_i < 5 @step = ((params[:step].to_i>0)&&(params[:step].to_i<5)) ? params[:step].to_i : 1
render "users/getting_started/#{params[:id]}" @step ||= 1
else render "users/getting_started"
render "users/getting_started/1"
end
end end
def export def export

View file

@ -0,0 +1,28 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
.span-8.append-1.last
%h1{:style => "text-align:right;"}
= "Welcome to Diaspora!"
.description
Do the stuff below to further complete some things.
%h3{:style => "text-align:right;"}
= link_to "Edit your profile", getting_started_path(:step => 1)
%br
= link_to "Define your aspects", getting_started_path(:step => 2)
%br
= link_to "Connect your services", getting_started_path(:step => 3)
%br
.span-15.last
.floating
= render "users/getting_started/step_#{@step}", :current_user => current_user
- if @step > 1
= link_to "Back", getting_started_path(:step => @step-1), :class => "button", :id => "previous_step"
.bottom_notification
= link_to "skip getting started →", '#', :id => "getting_started_skip"

View file

@ -1,75 +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.
.span-8.append-1.last{:style => "text-align:right;"}
%h1
= "Welcome to Diaspora!"
.description
Do the stuff below to further complete some things.
%h3
= link_to "Edit your profile", getting_started_path(1), :class => 'selected'
%br
= link_to "Define your aspects", getting_started_path(2)
%br
= link_to "Connect your services", getting_started_path(3)
%br
.span-15.last
.floating
= form_for @person do |person|
%h3
Your Profile
.description
This info will be available to whomever you connect with on Diaspora.
= person.error_messages
= person.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
= date_select person, :birthday, :order => [:month, :day, :year], :start_year => 1930, :end_year => Time.now.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
= person.submit "Save and continue →"
.bottom_notification
= link_to "skip getting started →", '#', :id => "getting_started_skip"

View file

@ -1,71 +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
:javascript
$("#new_aspect").live("submit", function(){
var newAspectName = $(this).children("#aspect_name").val();
$("ul.aspects").prepend($("<li>" + newAspectName + "</li>").fadeIn(200));
$("#aspect_nav").find("ul").first().find("li:last").before($("<li><a href='#'>" + newAspectName + "</a></li>").fadeIn(200));
});
$(".aspects li").find(".delete").live("click", function(){
var aspectElement = $(this).parent("li");
aspectElement.fadeOut(300, function(){aspectElement.remove();});
});
.span-8.append-1.last{:style => "text-align:right;"}
%h1
= "Welcome to Diaspora!"
.description
Do the stuff below to further complete some things.
%h3.nav
= link_to "Edit your profile", getting_started_path(1)
%br
= link_to "Define your aspects", getting_started_path(2)
%br
= link_to "Connect your services", getting_started_path(3)
%br
.span-15.last
.floating
%h3
Your aspects
.description
Diaspora aspects are mappings of your real-life aspects. You can manage these later by clicking the manage tab on the top right. Your aspects are unique to you, and not visible by others.
%h4
Aspect name
- form_for Aspect.new, :remote => true do |aspect|
= aspect.text_field :name, :style => "display:inline;"
= 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)
= 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, :getting_started => 2
= link_to "x", aspect_path(aspect), :confirm => "are you sure?", :method => :delete, :remote => true, :class => "delete right"
%br
%br
.submit_block
= link_to "Back", getting_started_path(1), :class => "button"
= link_to "Save and continue →", getting_started_path(3), :class => "button"
.bottom_notification
= link_to "skip getting started →", '#'

View file

@ -1,44 +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.
.span-8.append-1.last
%h1{:style => "text-align:right;"}
= "Welcome to Diaspora!"
.description
Do the stuff below to further complete some things.
%h3{:style => "text-align:right;"}
= link_to "Edit your profile", getting_started_path(1)
%br
= link_to "Define your aspects", getting_started_path(2)
%br
= link_to "Connect your services", getting_started_path(3)
%br
.span-15.last
.floating
%h3
Your services
.description
Connect your existing social networks to your Diaspora account. You will be able to post publically through your Everyone tab when you select "public."
%ul#stream
- for service in @services
%h3
%b= service.provider
logged in as
%b
= service.nickname
= link_to "disconnect", service, :confirm => "disconnect #{service.provider}?", :method => :delete
%h4= link_to "Connect to twitter", "/auth/twitter" if SERVICES['twitter']['consumer_key']!= ""
%h4= link_to "Connect to facebook", "/auth/facebook" if SERVICES['facebook']['app_id'] !=""
.submit_block
= link_to "Back", getting_started_path(2), :class => "button"
= link_to "Save and continue →", getting_started_path(4), :class => "button"
.bottom_notification
= link_to "skip getting started →", '#'

View file

@ -1,63 +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
- if current_user.getting_started == true
:javascript
$.ajax({
type: "PUT",
url: "/users/#{current_user.id}",
data: {"user":{"getting_started":'false'}}
})
.span-8.append-1.last
%h1{:style => "text-align:right;"}
= "Welcome to Diaspora!"
.description
Do the stuff below to further complete some things.
%h3{:style => "text-align:right;"}
= link_to "Edit your profile", getting_started_path(1)
%br
= link_to "Define your aspects", getting_started_path(2)
%br
= link_to "Connect your services", getting_started_path(3)
%br
.span-15.last
.floating
%h1
= "You're all set up, #{current_user.person.profile.first_name}!"
.description
You're now ready to start sharing with
%ul.inline_aspect_listing
- for aspect in @aspects
%li= aspect
%br
%br
%h3
= link_to "Continue on to your everyone page, an overview of all of your aspects.", root_path
%br
%br
%br
%p
You can change your profile any time by clicking
%b edit profile
in your user menu (top right).
%p
You can connect/disconnect your services any time by clicking
%b edit account
in your user menu (top right).
%p
You can manage your aspects any time by clicking the
%b manage
tab. Your contacts can also be added while on a particular aspect page, as well.
.submit_block
= link_to "Back", getting_started_path(3), :class => "button"

View file

@ -0,0 +1,56 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
= form_for @person do |person|
%h3
Your Profile
.description
This info will be available to whomever you connect with on Diaspora.
= person.error_messages
= person.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
= date_select person, :birthday, :order => [:month, :day, :year], :start_year => 1930, :end_year => Time.now.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, @step
.submit_block
= person.submit "Save and continue →"

View file

@ -0,0 +1,38 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%h3
Your aspects
.description
Diaspora aspects are mappings of your real-life aspects. You can manage these later by clicking the manage tab on the top right. Your aspects are unique to you, and not visible by others.
%h4
Aspect name
- form_for Aspect.new, :remote => true do |aspect|
= aspect.text_field :name, :style => "display:inline;"
= 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)
= 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, :getting_started => 2
= 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(:step => 3), :class => "button"

View file

@ -0,0 +1,23 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%h3
Your services
.description
Connect your existing social networks to your Diaspora account. You will be able to post publically through your Everyone tab when you select "public."
%ul#stream
- for service in @services
%h3
%b= service.provider
logged in as
%b= service.nickname
= link_to "disconnect", service, :confirm => "disconnect #{service.provider}?", :method => :delete
%h4= link_to "Connect to twitter", "/auth/twitter" if SERVICES['twitter']['consumer_key']!= ""
%h4= link_to "Connect to facebook", "/auth/facebook" if SERVICES['facebook']['app_id'] !=""
.submit_block
= link_to "Save and continue →", getting_started_path(:step => 4), :class => "button"

View file

@ -0,0 +1,44 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- if current_user.getting_started == true
:javascript
$.ajax({
type: "PUT",
url: "/users/#{current_user.id}",
data: {"user":{"getting_started":'false'}}
})
%h1
= "You're all set up, #{current_user.person.profile.first_name}!"
.description
You're now ready to start sharing with
%ul.inline_aspect_listing
- for aspect in @aspects
%li= aspect
%br
%br
%h3
= link_to "Continue on to your everyone page, an overview of all of your aspects.", root_path
%br
%br
%br
%p
You can change your profile any time by clicking
%b edit profile
in your user menu (top right).
%p
You can connect/disconnect your services any time by clicking
%b edit account
in your user menu (top right).
%p
You can manage your aspects any time by clicking the
%b manage
tab. Your contacts can also be added while on a particular aspect page, as well.

View file

@ -118,7 +118,7 @@ en:
editing_profile: "Editing profile" editing_profile: "Editing profile"
destroy: "Account successfully closed." destroy: "Account successfully closed."
getting_started: getting_started:
'1': 'step_1':
albums: "Albums" albums: "Albums"
you_dont_have_any_photos: "You don't have any photos! Go to the" you_dont_have_any_photos: "You don't have any photos! Go to the"
page_to_upload_some: "page to upload some." page_to_upload_some: "page to upload some."

View file

@ -18,7 +18,7 @@ Diaspora::Application.routes.draw do
:invitations => "invitations"} :invitations => "invitations"}
# added public route to user # added public route to user
match 'public/:username', :to => 'users#public' match 'public/:username', :to => 'users#public'
match 'users/getting_started/:id', :to => 'users#getting_started', :as => 'getting_started' match 'getting_started', :to => 'users#getting_started', :as => 'getting_started'
match 'users/export', :to => 'users#export' match 'users/export', :to => 'users#export'
match 'users/import', :to => 'users#import' match 'users/import', :to => 'users#import'
match 'users/export_photos', :to => 'users#export_photos' match 'users/export_photos', :to => 'users#export_photos'

View file

@ -1300,6 +1300,9 @@ ul.aspects
:bottom 13px :bottom 13px
:right 12px :right 12px
form
:display relative
.bottom_notification .bottom_notification
:position fixed :position fixed
:bottom 0 :bottom 0
@ -1348,3 +1351,8 @@ ul.aspects
:content "and " :content "and "
&:after &:after
:content "." :content "."
#previous_step
:position absolute
:left 12px
:bottom 12px