diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 630335d86d11953b7b6f4e349a0d97b6ed617ac2..ed66586788df0624db0d734c011b7f82ca27f551 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 baab495d7d658ff8003ef727921aa91623a9b0b7..544277ce7baba7826062fc96b0ff8abd5ac68fd8 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 6a184b1566c7786b0e725788e05da554ad7c2d59..4790ac25def6dd86985c69ce606e55eff32fa8d3 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 22a5a4f8a0cafdb064f83adb7f5a033710524e9c..78dd8c8b9ccc404c23b388c0c3379ec35040e94c 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 f57c775cbce3caf402d56fbd109b08123669403c..8bf100c4dcd159550e6e9c78073a8dc49ce96b12 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 b0ea13a361e2ae8fbd0b6ba9c9d22e6f72ab8f33..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..51cc5ee0710b51794bdbee0c3dfb245b70abe381 --- /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 0000000000000000000000000000000000000000..de532553efe10f92bcfd02e58c6f4763068fe049 --- /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 0000000000000000000000000000000000000000..e6c6fcd24ce4178f77e53dd31f45bd3a9bffec6e --- /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 b1d68fff798b8fd65cd8dd05eb3eb388facf4889..8a9af0e61fe49055977c09c09c0d9c61803f02c6 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 beaa2376e42858d0d451f85291f4d736e1eddce2..0000000000000000000000000000000000000000 --- 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(); - * - * <div id="slider"> - * <ul> - * <li><img src="images/01.jpg" alt="" /></li> - * <li><img src="images/02.jpg" alt="" /></li> - * <li><img src="images/03.jpg" alt="" /></li> - * <li><img src="images/04.jpg" alt="" /></li> - * <li><img src="images/05.jpg" alt="" /></li> - * </ul> - * </div> - * - */ - -(function($) { - - $.fn.easySlider = function(options){ - - // default configuration properties - var defaults = { - prevId: 'prevBtn', - prevText: 'Previous', - nextId: 'nextBtn', - nextText: 'Next', - controlsShow: true, - controlsBefore: '', - controlsAfter: '', - controlsFade: true, - firstId: 'firstBtn', - firstText: 'First', - firstShow: false, - lastId: 'lastBtn', - lastText: 'Last', - lastShow: false, - vertical: false, - speed: 800, - auto: false, - pause: 2000, - continuous: false, - numeric: false, - numericId: 'controls' - }; - - var options = $.extend(defaults, options); - - this.each(function() { - var obj = $(this); - var s = $("li", obj).length; - var w = $("li", obj).width(); - var h = $("li", obj).height(); - var clickable = true; - obj.width(w); - obj.height(h); - obj.css("overflow","hidden"); - var ts = s-1; - var t = 0; - $("ul", obj).css('width',s*w); - - if(options.continuous){ - $("ul", obj).prepend($("ul li:last-child", obj).clone().css("margin-left","-"+ w +"px")); - $("ul", obj).append($("ul li:nth-child(2)", obj).clone()); - $("ul", obj).css('width',(s+1)*w); - }; - - if(!options.vertical) $("li", obj).css('float','left'); - - if(options.controlsShow){ - var html = options.controlsBefore; - if(options.numeric){ - html += '<ol id="'+ options.numericId +'"></ol>'; - } else { - if(options.firstShow) html += '<span id="'+ options.firstId +'"><a href=\"javascript:void(0);\">'+ options.firstText +'</a></span>'; - html += ' <span id="'+ options.prevId +'"><a href=\"javascript:void(0);\">'+ options.prevText +'</a></span>'; - html += ' <span id="'+ options.nextId +'"><a href=\"javascript:void(0);\">'+ options.nextText +'</a></span>'; - if(options.lastShow) html += ' <span id="'+ options.lastId +'"><a href=\"javascript:void(0);\">'+ options.lastText +'</a></span>'; - }; - - html += options.controlsAfter; - $(obj).after(html); - }; - - if(options.numeric){ - for(var i=0;i<s;i++){ - $(document.createElement("li")) - .attr('id',options.numericId + (i+1)) - .html('<a rel='+ i +' href=\"javascript:void(0);\">'+ (i+1) +'</a>') - .appendTo($("#"+ options.numericId)) - .click(function(){ - animate($("a",$(this)).attr('rel'),true); - }); - }; - } else { - $("a","#"+options.nextId).click(function(){ - animate("next",true); - }); - $("a","#"+options.prevId).click(function(){ - animate("prev",true); - }); - $("a","#"+options.firstId).click(function(){ - animate("first",true); - }); - $("a","#"+options.lastId).click(function(){ - animate("last",true); - }); - }; - - function setCurrent(i){ - i = parseInt(i)+1; - $("li", "#" + options.numericId).removeClass("current"); - $("li#" + options.numericId + i).addClass("current"); - }; - - function adjust(){ - if(t>ts) t=0; - if(t<0) t=ts; - if(!options.vertical) { - $("ul",obj).css("margin-left",(t*w*-1)); - } else { - $("ul",obj).css("margin-left",(t*h*-1)); - } - clickable = true; - if(options.numeric) setCurrent(t); - }; - - function animate(dir,clicked){ - if (clickable){ - clickable = false; - var ot = t; - switch(dir){ - case "next": - t = (ot>=ts) ? (options.continuous ? t+1 : ts) : t+1; - break; - case "prev": - t = (t<=0) ? (options.continuous ? t-1 : 0) : t-1; - break; - case "first": - t = 0; - break; - case "last": - t = ts; - break; - default: - t = dir; - break; - }; - var diff = Math.abs(ot-t); - var speed = diff*options.speed; - if(!options.vertical) { - p = (t*w*-1); - $("ul",obj).animate( - { marginLeft: p }, - { queue:false, duration:speed, complete:adjust } - ); - } else { - p = (t*h*-1); - $("ul",obj).animate( - { marginTop: p }, - { queue:false, duration:speed, complete:adjust } - ); - }; - - if(!options.continuous && options.controlsFade){ - if(t==ts){ - $("a","#"+options.nextId).hide(); - $("a","#"+options.lastId).hide(); - } else { - $("a","#"+options.nextId).show(); - $("a","#"+options.lastId).show(); - }; - if(t==0){ - $("a","#"+options.prevId).hide(); - $("a","#"+options.firstId).hide(); - } else { - $("a","#"+options.prevId).show(); - $("a","#"+options.firstId).show(); - }; - }; - - if(clicked) clearTimeout(timeout); - if(options.auto && dir=="next" && !clicked){; - timeout = setTimeout(function(){ - animate("next",false); - },diff*options.speed+options.pause); - }; - - }; - - }; - // init - var timeout; - if(options.auto){; - timeout = setTimeout(function(){ - animate("next",false); - },options.pause); - }; - - if(options.numeric) setCurrent(0); - - if(!options.continuous && options.controlsFade){ - $("a","#"+options.prevId).hide(); - $("a","#"+options.firstId).hide(); - }; - - }); - - }; - -})(jQuery); - - - diff --git a/public/javascripts/view.js b/public/javascripts/view.js index f8b2fb8b2513e73616f3f891e8fa9b1b42157921..7b8af68d7cbc36eae8facc04aea54448cf739a18 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -74,7 +74,7 @@ $(document).ready(function(){ }; }); - $("#slider").easySlider({speed:400, numeric:true}); + //$("#slider").easySlider({speed:400}); $("img", "#left_pane").tipsy({live:true}); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 9ba66b8df8f695ed559d7e9845a6ff6dd003d0d3..824cc7ff6837825eb3398a5cc7de22e8f2c31919 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -393,6 +393,8 @@ li.message form :position relative + :font + :size 14px #user_name :margin @@ -442,7 +444,6 @@ form > li :background none :border none - #stream ul.comments :display none @@ -453,6 +454,10 @@ form :margin :right 10px + form + :margin + :right 12px + input.comment_submit :display none :margin @@ -635,7 +640,6 @@ label :width 100% :margin :bottom 10px - :top -14px :border :bottom 2px #777 solid @@ -674,14 +678,14 @@ label :bottom -2px input[type='submit'] :position absolute - :right -13px + :right 0 :top 5px :width 75px + input + :display inline .public_toggle :width 300px - :margin - :left -3px :font :size smaller :style italic @@ -1074,16 +1078,6 @@ ul#settings_nav :width 30px :height 30px -.friend_pictures.horizontal - :display inline - :margin - :left 20px - - img - :width 30px - :height 30px - :margin-right -4px - #thumbnails :line-height 14px @@ -1244,11 +1238,34 @@ ul#breadcrumb &:after :content '' -#slider ul, #slider li +#getting_started_button + :position fixed + :bottom 4px + :margin + :left 680px + + a + :padding 10px + :background #333 + :color #eee + + :-webkit-border-radius 5px 5px 0 0 + :-moz-border-radius 5px 5px 0 0 + :border-radius 5px 5px 0 0 + + :-webkit-box-shadow 0 0 2px #666 + +ul.aspects :margin 0 :padding 0 :list-style none + :width 67% + :color #999 + :font + :size 24px + + > li + :padding 12px 0 + :border + :bottom 1px solid #eee -#slider, #slider li - :width 1000px - :overflow hidden