diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 630335d86..ed6658678 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -66,7 +66,16 @@ class UsersController < ApplicationController end def getting_started - render 'users/getting_started' + @aspect = :getting_started + @user = current_user + @profile = current_user.profile + @photos = current_user.visible_posts(:person_id => current_user.person.id, :_type => 'Photo').paginate :page => params[:page], :order => 'created_at DESC' + + if params[:id].to_i < 4 + render "users/getting_started/#{params[:id]}" + else + render "users/getting_started/1" + end end def export diff --git a/app/models/profile.rb b/app/models/profile.rb index baab495d7..544277ce7 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -9,13 +9,15 @@ class Profile include ROXML xml_reader :person_id - xml_accessor :first_name - xml_accessor :last_name - xml_accessor :image_url + xml_reader :first_name + xml_reader :last_name + xml_reader :image_url + xml_reader :bio key :first_name, String key :last_name, String key :image_url, String + key :bio, String validates_presence_of :first_name, :last_name after_validation :strip_names diff --git a/app/models/user.rb b/app/models/user.rb index 6a184b156..4790ac25d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -40,6 +40,8 @@ class User key :invite_messages, Hash + key :getting_started, Boolean, :default => false + before_validation :strip_username, :on => :create validates_presence_of :username validates_uniqueness_of :username, :case_sensitive => false diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 22a5a4f8a..78dd8c8b9 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -30,7 +30,6 @@ = javascript_include_tag 'fileuploader' = javascript_include_tag 'view', 'image_picker', 'stream' - = javascript_include_tag 'easySlider1.7' = render 'js/websocket_js' @@ -68,3 +67,6 @@ .span-24.last = render "posts/debug" + + #getting_started_button + = link_to "Getting started", getting_started_path(1) diff --git a/app/views/users/_profile.haml b/app/views/users/_profile.haml index f57c775cb..8bf100c4d 100644 --- a/app/views/users/_profile.haml +++ b/app/views/users/_profile.haml @@ -20,11 +20,11 @@ %h4 Your birthday %br - = select_date + = select_date Time.now, :order => [:month, :day, :year] %h4 Your bio - = text_area_tag :bio, nil, :placeholder => "Fill me out" + = profile.text_area :bio, :value => @profile.bio, :rows => 5, :placeholder => "Fill me out" %h4 Your photo diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml deleted file mode 100644 index b0ea13a36..000000000 --- a/app/views/users/getting_started.html.haml +++ /dev/null @@ -1,93 +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. - - - -%h1 - = "Welcome, #{current_user.real_name}!" - - .description - Do the stuff below to further complete some things. - -#slider - %ul - %li - %h2 - %u - Edit your profile - ➔ - Define your aspects ➔ - Find your friends - - - %h3 - Your Profile - .description - This info will be available to whomever you connect with on Diaspora. - - %h4 - Your name - = text_field_tag :first_name, nil, :placeholder => "First name" - = text_field_tag :last_name, nil, :placeholder => "Last name" - - %h4 - Your birthday - %br - = select_date - - %h4 - Your bio - = text_area_tag :bio, nil, :placeholder => "Fill me out" - - %h4 - Your photo - %br - = file_field_tag :photo - - - %li - %h2 - Edit your profile ➔ - %u - Define your aspects - ➔ - Find your friends - - %h3 - Your aspects - .description - These will be blah blah blah blah and some stuff. - - %h4 - Aspect name - = text_field_tag :aspect_name, nil, :placeholder => "New aspect" - - - %li - %h2 - Edit your profile ➔ - Define your aspects ➔ - %u - Find your friends - - - %h3 - Your friends - .description - Find your friends on Diaspora, Facebook, or send them an invite via email. - - .span-5 - %h4 - On Diaspora - = text_field_tag :diaspora_handle, nil, :placeholder => "Diaspora handle" - - .span-5 - %h4 - On Facebook - = text_field_tag :facebook_handle, nil, :placeholder => "Name" - - .span-5 - %h4 - Invite - = text_field_tag :email, nil, :placeholder => "Email", :type => "email" diff --git a/app/views/users/getting_started/1.html.haml b/app/views/users/getting_started/1.html.haml new file mode 100644 index 000000000..51cc5ee07 --- /dev/null +++ b/app/views/users/getting_started/1.html.haml @@ -0,0 +1,20 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + + + +%h1 + = "Welcome, #{current_user.real_name}!" + .description + Do the stuff below to further complete some things. + +%h2 + %u + Edit your profile + ➔ + Define your aspects ➔ + Find your friends + += render 'users/profile' + diff --git a/app/views/users/getting_started/2.html.haml b/app/views/users/getting_started/2.html.haml new file mode 100644 index 000000000..de532553e --- /dev/null +++ b/app/views/users/getting_started/2.html.haml @@ -0,0 +1,35 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + + + +%h1 + = "Welcome, #{current_user.real_name}!" + .description + Do the stuff below to further complete some things. + +%h2 + Edit your profile ➔ + %u + Define your aspects + ➔ + Find your friends + +%h3 + Your aspects + .description + These will be blah blah blah blah and some stuff. + +%h4 + Aspect name + = text_field_tag :aspect_name, nil, :placeholder => "New aspect" + +%ul.aspects + - for aspect in @aspects + %li + = aspect + .friend_pictures.horizontal + - for friend in @friends + = person_image_link(friend) + diff --git a/app/views/users/getting_started/3.html.haml b/app/views/users/getting_started/3.html.haml new file mode 100644 index 000000000..e6c6fcd24 --- /dev/null +++ b/app/views/users/getting_started/3.html.haml @@ -0,0 +1,36 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + + + +%h1 + = "Welcome, #{current_user.real_name}!" + .description + Do the stuff below to further complete some things. + +%h2 + Edit your profile ➔ + Define your aspects ➔ + %u + Find your friends + +%h3 + Your friends + .description + Find your friends on Diaspora, Facebook, or send them an invite via email. + +.span-5 + %h4 + On Diaspora + = text_field_tag :diaspora_handle, nil, :placeholder => "Diaspora handle" + +.span-5 + %h4 + On Facebook + = text_field_tag :facebook_handle, nil, :placeholder => "Name" + +.span-5 + %h4 + Invite + = text_field_tag :email, nil, :placeholder => "Email", :type => "email" diff --git a/config/routes.rb b/config/routes.rb index b1d68fff7..8a9af0e61 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -17,12 +17,12 @@ Diaspora::Application.routes.draw do :password => "devise/passwords", :invitations => "invitations"} # added public route to user - match 'public/:username', :to => 'users#public' - match 'users/getting_started', :to => 'users#getting_started' - match 'users/export', :to => 'users#export' - match 'users/import', :to => 'users#import' - match 'users/export_photos', :to => 'users#export_photos' - resources :users, :except => [:create, :new, :show] + match 'public/:username', :to => 'users#public' + match 'users/getting_started/:id', :to => 'users#getting_started', :as => 'getting_started' + match 'users/export', :to => 'users#export' + match 'users/import', :to => 'users#import' + match 'users/export_photos', :to => 'users#export_photos' + resources :users, :except => [:create, :new, :show] match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' match 'aspects/add_to_aspect',:to => 'aspects#add_to_aspect', :as => 'add_to_aspect' diff --git a/public/javascripts/easySlider1.7.js b/public/javascripts/easySlider1.7.js deleted file mode 100644 index beaa2376e..000000000 --- a/public/javascripts/easySlider1.7.js +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Easy Slider 1.7 - jQuery plugin - * written by Alen Grakalic - * http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding - * - * Copyright (c) 2009 Alen Grakalic (http://cssglobe.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * Built for jQuery library - * http://jquery.com - * - */ - -/* - * markup example for $("#slider").easySlider(); - * - *




