From 278a74f1f92f83b02bcc89bdd3cbf98472a5c8e9 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Fri, 15 Oct 2010 11:07:11 -0700 Subject: [PATCH 01/28] draft --- app/controllers/users_controller.rb | 4 + app/views/users/getting_started.html.haml | 93 +++++++++++++++++++++++ config/routes.rb | 1 + public/stylesheets/sass/application.sass | 15 ++++ 4 files changed, 113 insertions(+) create mode 100644 app/views/users/getting_started.html.haml diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9c1bb3e9c..630335d86 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -65,6 +65,10 @@ class UsersController < ApplicationController end end + def getting_started + render 'users/getting_started' + end + def export exporter = Diaspora::Exporter.new(Diaspora::Exporters::XML) send_data exporter.execute(current_user), :filename => "#{current_user.username}_diaspora_data.xml", :type => :xml diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml new file mode 100644 index 000000000..405c62dbc --- /dev/null +++ b/app/views/users/getting_started.html.haml @@ -0,0 +1,93 @@ +-# 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 + + +%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 + + +%br +%br +%br +%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" + +%br +%br +%br +%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" diff --git a/config/routes.rb b/config/routes.rb index b9b05ca65..b1d68fff7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,6 +18,7 @@ Diaspora::Application.routes.draw do :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' diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index c4da5d4fc..88999049a 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1136,6 +1136,21 @@ ul#settings_nav :size 80px :display inline-block +h1,h2,h3 + .description + :font + :size 70% + :weight 100 + :color #ccc + :margin + :top 5px + +h2,h3 + .description + :font + :size 80% + :weight 200 + input[type="search"] :-webkit-appearance textfield From 31713d9597fb7a00393323676ac87385d7f454d0 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Fri, 15 Oct 2010 13:20:02 -0700 Subject: [PATCH 02/28] html5 placeholder text --- app/views/users/getting_started.html.haml | 2 +- public/stylesheets/sass/application.sass | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 405c62dbc..530c4038e 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -90,4 +90,4 @@ .span-5 %h4 Invite - = text_field_tag :email, nil, :placeholder => "Email" + = text_field_tag :email, nil, :placeholder => "Email", :type => "email" diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 88999049a..07b5c78a9 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -596,9 +596,7 @@ li.message .from .right :color #ccc -input[type='text'], -input[type='password'], -input[type="search"], +input:not([type='submit']), textarea :font :family 'Arial', 'Helvetica', sans-serif From b52afdd93cfb58e1a57ae6252c0285353d9e856c Mon Sep 17 00:00:00 2001 From: danielvincent Date: Fri, 15 Oct 2010 15:04:59 -0700 Subject: [PATCH 03/28] changed account and profile partials to better reflect styling changes --- app/views/users/_account.haml | 49 ++++++++------- app/views/users/_profile.haml | 80 ++++++++++++------------ public/stylesheets/sass/application.sass | 14 ++--- 3 files changed, 69 insertions(+), 74 deletions(-) diff --git a/app/views/users/_account.haml b/app/views/users/_account.haml index e76ae6cc6..2e3391f2c 100644 --- a/app/views/users/_account.haml +++ b/app/views/users/_account.haml @@ -3,39 +3,40 @@ -# the COPYRIGHT file. -%h2 Account +%h3 + Your Account + .description + Connect Diaspora to publish to other applications, export your data, or close your account. -= link_to "invite friends", new_user_invitation_path(current_user) += form_for @user do |user| + %h4 + Change Password + = user.error_messages -%br -%br -%br - -%h3 Change Password -= form_for @user do |f| - = f.error_messages - - %p - = f.label :password, "New Password" - = f.password_field :password - %p - = f.label :password_confirmation - = f.password_field :password_confirmation + = user.password_field :password, :placeholder => "New password" + = user.password_field :password_confirmation, :placeholder => "Password confirmation" .submit_block = link_to "Cancel", edit_user_path(current_user) or - = f.submit 'Change password' + = user.submit 'Change password' -%h3 Export Data -= link_to "download my xml", users_export_path, :class => "button" -= link_to "download my photos", users_export_photos_path, :class => "button" +%h4 + Export Data + %br + %br + = link_to "Download my account", users_export_path, :class => "button" + = link_to "Download my photos", users_export_photos_path, :class => "button" %br %br %br -%h3 Close Account -= link_to "Close Account", current_user, - :confirm => "Are you sure?", :method => :delete, - :class => "button" +%h4 + Close Account + .description + Closing your account will delete all of your posts, friends, and settings. You will be removed from this server. + %br + = link_to "Close Account", current_user, + :confirm => "Are you sure?", :method => :delete, + :class => "button" diff --git a/app/views/users/_profile.haml b/app/views/users/_profile.haml index cbb2b6d6a..f57c775cb 100644 --- a/app/views/users/_profile.haml +++ b/app/views/users/_profile.haml @@ -3,56 +3,56 @@ -# the COPYRIGHT file. -%h2 Profile -= form_for @user do |f| - = f.error_messages += form_for @user do |user| + %h3 + Your Profile + .description + This info will be available to whomever you connect with on Diaspora. - = f.fields_for :profile do |p| + = user.error_messages - %h3="#{t('.picture')}" - %div#image_picker - = p.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field' + = 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" - - 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)), "#" + %h4 + Your birthday + %br + = select_date - - else - =t('.you_dont_have_any_photos') - = link_to t('.albums'), albums_path(:aspect => 'all') - =t('.page_to_upload_some') + %h4 + Your bio + = text_area_tag :bio, nil, :placeholder => "Fill me out" - =will_paginate @photos + %h4 + Your photo + %div#image_picker + = profile.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field' - %br + - 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 - %h3="#{t('.info')}" - %p - %b - ="#{t('.diaspora_username')}:" - = @user.diaspora_handle - %p - = p.label :first_name - = p.text_field :first_name, :value => @profile.first_name - %p - = p.label :last_name - = p.text_field :last_name, :value => @profile.last_name .submit_block = link_to t('.cancel'), edit_user_path(current_user) = t('.or') - = f.submit t('.update_profile') - -#content_bottom - .back - = link_to "⇧ #{t('.home')}", root_path - + = user.submit t('.update_profile') diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 07b5c78a9..1414e73ec 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -393,10 +393,6 @@ li.message form :position relative - :font - :size 120% - :margin 1em - :left 0em #user_name :margin @@ -615,8 +611,6 @@ textarea .submit_block :text :align right - :font - :size 12px form p :position relative @@ -694,6 +688,8 @@ label :display inline #image_picker + :margin + :top 5px .small_photo :height 100px :position relative @@ -1134,16 +1130,14 @@ ul#settings_nav :size 80px :display inline-block -h1,h2,h3 +h1,h2,h3,h4 .description :font :size 70% :weight 100 :color #ccc - :margin - :top 5px -h2,h3 +h2,h3,h4 .description :font :size 80% From f23d19923061d23a1cf7ca75de67f3441c6da4dc Mon Sep 17 00:00:00 2001 From: danielvincent Date: Fri, 15 Oct 2010 16:40:16 -0700 Subject: [PATCH 04/28] added slider to getting started flow --- app/views/layouts/application.html.haml | 1 + app/views/users/getting_started.html.haml | 132 ++++++------- public/javascripts/easySlider1.7.js | 226 ++++++++++++++++++++++ public/javascripts/view.js | 10 + public/stylesheets/sass/application.sass | 9 + 5 files changed, 312 insertions(+), 66 deletions(-) create mode 100644 public/javascripts/easySlider1.7.js diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 0e21eb7de..22a5a4f8a 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -30,6 +30,7 @@ = javascript_include_tag 'fileuploader' = javascript_include_tag 'view', 'image_picker', 'stream' + = javascript_include_tag 'easySlider1.7' = render 'js/websocket_js' diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 530c4038e..b0ea13a36 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -10,84 +10,84 @@ .description Do the stuff below to further complete some things. -%h2 - %u - Edit your profile - ➔ - Define your aspects ➔ - Find your friends +#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. + %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 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 birthday + %br + = select_date -%h4 - Your bio - = text_area_tag :bio, nil, :placeholder => "Fill me out" + %h4 + Your bio + = text_area_tag :bio, nil, :placeholder => "Fill me out" -%h4 - Your photo - %br - = file_field_tag :photo + %h4 + Your photo + %br + = file_field_tag :photo -%br -%br -%br -%h2 - Edit your profile ➔ - %u - Define your aspects - ➔ - Find your friends + %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. + %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" - -%br -%br -%br -%h2 - Edit your profile ➔ - Define your aspects ➔ - %u - Find your friends + %h4 + Aspect name + = text_field_tag :aspect_name, nil, :placeholder => "New aspect" -%h3 - Your friends - .description - Find your friends on Diaspora, Facebook, or send them an invite via email. + %li + %h2 + Edit your profile ➔ + Define your aspects ➔ + %u + Find your friends -.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" + %h3 + Your friends + .description + Find your friends on Diaspora, Facebook, or send them an invite via email. -.span-5 - %h4 - Invite - = text_field_tag :email, nil, :placeholder => "Email", :type => "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/public/javascripts/easySlider1.7.js b/public/javascripts/easySlider1.7.js new file mode 100644 index 000000000..beaa2376e --- /dev/null +++ b/public/javascripts/easySlider1.7.js @@ -0,0 +1,226 @@ +/* + * 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(); + * + *
+ *
    + *
  • + *
  • + *
  • + *
  • + *
  • + *
+ *
+ * + */ + +(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 += '
    '; + } else { + if(options.firstShow) html += ''+ options.firstText +''; + html += ' '+ options.prevText +''; + html += ' '+ options.nextText +''; + if(options.lastShow) html += ' '+ options.lastText +''; + }; + + html += options.controlsAfter; + $(obj).after(html); + }; + + if(options.numeric){ + for(var i=0;i'+ (i+1) +'') + .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 26b3fea55..f8b2fb8b2 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -73,6 +73,9 @@ $(document).ready(function(){ $(".reshare_box").hide(); }; }); + + $("#slider").easySlider({speed:400, numeric:true}); + $("img", "#left_pane").tipsy({live:true}); $(".add_aspect_button", "#aspect_nav").tipsy({gravity:'w'}); @@ -133,3 +136,10 @@ $(".make_profile_photo").live("click", function(){ }); }); +$(".getting_started_box").live("click",function(evt){ + $(this).animate({ + left: parseInt($(this).css('left'),30) == 0 ? + -$(this).outerWidth() : + 0 + },function(evt){ $(this).css('left', '1000px')}); +}); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 1414e73ec..9ba66b8df 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1243,3 +1243,12 @@ ul#breadcrumb &:last-child &:after :content '' + +#slider ul, #slider li + :margin 0 + :padding 0 + :list-style none + +#slider, #slider li + :width 1000px + :overflow hidden From 69b1b71a5d65eda0c1b7d14abd06f915101d7366 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 20 Oct 2010 16:12:34 -0700 Subject: [PATCH 05/28] removed javascript slider. made each getting_started section its own page. added bio to profile (and changed xml_accessors to xml_readers). --- app/controllers/users_controller.rb | 11 +- app/models/profile.rb | 8 +- app/models/user.rb | 2 + app/views/layouts/application.html.haml | 4 +- app/views/users/_profile.haml | 4 +- app/views/users/getting_started.html.haml | 93 -------- app/views/users/getting_started/1.html.haml | 20 ++ app/views/users/getting_started/2.html.haml | 35 +++ app/views/users/getting_started/3.html.haml | 36 ++++ config/routes.rb | 12 +- public/javascripts/easySlider1.7.js | 226 -------------------- public/javascripts/view.js | 2 +- public/stylesheets/sass/application.sass | 55 +++-- 13 files changed, 156 insertions(+), 352 deletions(-) delete mode 100644 app/views/users/getting_started.html.haml create mode 100644 app/views/users/getting_started/1.html.haml create mode 100644 app/views/users/getting_started/2.html.haml create mode 100644 app/views/users/getting_started/3.html.haml delete mode 100644 public/javascripts/easySlider1.7.js 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(); - * - *
    - *
      - *
    • - *
    • - *
    • - *
    • - *
    • - *
    - *
    - * - */ - -(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 += '
      '; - } else { - if(options.firstShow) html += ''+ options.firstText +''; - html += ' '+ options.prevText +''; - html += ' '+ options.nextText +''; - if(options.lastShow) html += ' '+ options.lastText +''; - }; - - html += options.controlsAfter; - $(obj).after(html); - }; - - if(options.numeric){ - for(var i=0;i'+ (i+1) +'') - .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 f8b2fb8b2..7b8af68d7 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 9ba66b8df..824cc7ff6 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 From dd4f46c8b0cf83e76a7e172fa759f10f621ef3bb Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 20 Oct 2010 16:41:38 -0700 Subject: [PATCH 06/28] repositioning layout on getting started --- app/views/users/getting_started/1.html.haml | 25 +++++----- app/views/users/getting_started/2.html.haml | 51 ++++++++++---------- app/views/users/getting_started/3.html.haml | 53 +++++++++++---------- public/stylesheets/sass/application.sass | 1 - 4 files changed, 67 insertions(+), 63 deletions(-) diff --git a/app/views/users/getting_started/1.html.haml b/app/views/users/getting_started/1.html.haml index 51cc5ee07..41e2c3aaf 100644 --- a/app/views/users/getting_started/1.html.haml +++ b/app/views/users/getting_started/1.html.haml @@ -3,18 +3,19 @@ -# the COPYRIGHT file. +.span-8.append-1.last + %h1{:style => "text-align:right;"} + = "Welcome!" + .description + Do the stuff below to further complete some things. -%h1 - = "Welcome, #{current_user.real_name}!" - .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 "Find your friends", getting_started_path(3) -%h2 - %u - Edit your profile - ➔ - Define your aspects ➔ - Find your friends - -= render 'users/profile' +.span-15.last + = render 'users/profile' diff --git a/app/views/users/getting_started/2.html.haml b/app/views/users/getting_started/2.html.haml index de532553e..d7ec9baeb 100644 --- a/app/views/users/getting_started/2.html.haml +++ b/app/views/users/getting_started/2.html.haml @@ -3,33 +3,34 @@ -# the COPYRIGHT file. +.span-8.append-1.last + %h1{:style => "text-align:right;"} + = "Welcome!" + .description + Do the stuff below to further complete some things. -%h1 - = "Welcome, #{current_user.real_name}!" - .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 "Find your friends", getting_started_path(3) -%h2 - Edit your profile ➔ - %u - Define your aspects - ➔ - Find your friends +.span-15.last + %h3 + Your aspects + .description + These will be blah blah blah blah and some stuff. -%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" -%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) + %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 index e6c6fcd24..f5136aeaf 100644 --- a/app/views/users/getting_started/3.html.haml +++ b/app/views/users/getting_started/3.html.haml @@ -4,33 +4,36 @@ -%h1 - = "Welcome, #{current_user.real_name}!" - .description - Do the stuff below to further complete some things. +.span-8.append-1.last + %h1{:style => "text-align:right;"} + = "Welcome!" + .description + Do the stuff below to further complete some things. -%h2 - Edit your profile ➔ - Define your aspects ➔ - %u - Find your friends + %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 "Find your friends", getting_started_path(3) -%h3 - Your friends - .description - Find your friends on Diaspora, Facebook, or send them an invite via email. +.span-15.last + %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.last + %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.last + %h4 + On Facebook + = text_field_tag :facebook_handle, nil, :placeholder => "Name" -.span-5 - %h4 - Invite - = text_field_tag :email, nil, :placeholder => "Email", :type => "email" + .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 824cc7ff6..3912b1cc0 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1259,7 +1259,6 @@ ul.aspects :margin 0 :padding 0 :list-style none - :width 67% :color #999 :font :size 24px From 0c72257c501686a66184defeaa8d0d60949ddc4d Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 26 Oct 2010 11:59:57 -0700 Subject: [PATCH 07/28] aspects can be created/destroyed via ajax on getting_started#2 --- app/views/users/getting_started/1.html.haml | 9 +++--- app/views/users/getting_started/2.html.haml | 36 +++++++++++++++------ public/stylesheets/sass/application.sass | 27 +++++++++++++++- 3 files changed, 58 insertions(+), 14 deletions(-) diff --git a/app/views/users/getting_started/1.html.haml b/app/views/users/getting_started/1.html.haml index 41e2c3aaf..4533186e2 100644 --- a/app/views/users/getting_started/1.html.haml +++ b/app/views/users/getting_started/1.html.haml @@ -3,18 +3,19 @@ -# the COPYRIGHT file. -.span-8.append-1.last - %h1{:style => "text-align:right;"} - = "Welcome!" +.span-8.append-1.last{:style => "text-align:right;"} + %h1 + = "Welcome to Diaspora!" .description Do the stuff below to further complete some things. - %h3{:style => "text-align:right;"} + %h3 = link_to "Edit your profile", getting_started_path(1) %br = link_to "Define your aspects", getting_started_path(2) %br = link_to "Find your friends", getting_started_path(3) + %br .span-15.last = render 'users/profile' diff --git a/app/views/users/getting_started/2.html.haml b/app/views/users/getting_started/2.html.haml index d7ec9baeb..ce4269d1e 100644 --- a/app/views/users/getting_started/2.html.haml +++ b/app/views/users/getting_started/2.html.haml @@ -3,34 +3,52 @@ -# the COPYRIGHT file. -.span-8.append-1.last - %h1{:style => "text-align:right;"} - = "Welcome!" +- content_for :head do + :javascript + $("#new_aspect").live("submit", function(){ + var newAspectName = $(this).children("#aspect_name").val(); + $("ul.aspects").prepend($("
    1. " + newAspectName + "
    2. ").fadeIn(200)); + $("#aspect_nav").find("ul").first().find("li:last").before($("
    3. " + newAspectName + "
    4. ").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{:style => "text-align:right;"} + %h3 = link_to "Edit your profile", getting_started_path(1) %br = link_to "Define your aspects", getting_started_path(2) %br = link_to "Find your friends", getting_started_path(3) + %br .span-15.last %h3 Your aspects - .description - These will be blah blah blah blah and some stuff. + %p + Diaspora aspects are mappings of your real-life aspects. %h4 Aspect name - = text_field_tag :aspect_name, nil, :placeholder => "New aspect" + - form_for Aspect.new, :remote => true do |aspect| + = aspect.text_field :name + = aspect.submit "Add" %ul.aspects - for aspect in @aspects - %li + %li{:style=>"position:relative;"} = aspect .friend_pictures.horizontal - - for friend in @friends + - for friend in aspect.people = person_image_link(friend) + = link_to "x", aspect_path(aspect), :confirm => "are you sure?", :method => :delete, :remote => true, :class => "delete right" + diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 3912b1cc0..c5cc05e2a 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1130,6 +1130,8 @@ h1,h2,h3,h4 :size 70% :weight 100 :color #ccc + :margin + :top 0.5em h2,h3,h4 .description @@ -1264,7 +1266,30 @@ ul.aspects :size 24px > li - :padding 12px 0 + :padding 12px :border :bottom 1px solid #eee + &:hover + :background + :color #fafafa + + + .right + :top 12px + :right 12px + + .delete + :background + :color #eee + :width 20px + :height 20px + + :-webkit-border-radius 10px + + :line-height 16px + :text-indent 6px + :font-size 16px + +.inline + :display inline From ec141a2019481cdb9225f5c14804e41c9429ae7a Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 26 Oct 2010 12:53:12 -0700 Subject: [PATCH 08/28] a user can add a person to an aspect from getting_started#2 --- app/views/requests/_new_request.haml | 2 +- app/views/shared/_aspect_friends.haml | 2 +- app/views/users/getting_started/1.html.haml | 2 +- app/views/users/getting_started/2.html.haml | 8 +++++++- app/views/users/getting_started/3.html.haml | 2 +- public/javascripts/view.js | 3 ++- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index c67bc61b9..11e6f73c2 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -9,7 +9,7 @@ %i= aspect.name - if @friends_not_in_aspect - = render('shared/add_friend_dropdown', :aspect => @aspect, :friends => @friends_not_in_aspect) + = render('shared/add_friend_dropdown', :aspect => aspect, :friends => @friends_not_in_aspect) diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index f4b2f06f7..c7137b025 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -16,7 +16,7 @@ = person_image_link(friend) -unless (@aspect == :all) - = link_to (image_tag('add_friend_button.png', :title => "add to #{@aspect}")), "#add_request_pane", :id => '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 diff --git a/app/views/users/getting_started/1.html.haml b/app/views/users/getting_started/1.html.haml index 4533186e2..4496290b8 100644 --- a/app/views/users/getting_started/1.html.haml +++ b/app/views/users/getting_started/1.html.haml @@ -14,7 +14,7 @@ %br = link_to "Define your aspects", getting_started_path(2) %br - = link_to "Find your friends", getting_started_path(3) + = link_to "Connect your services", getting_started_path(3) %br .span-15.last diff --git a/app/views/users/getting_started/2.html.haml b/app/views/users/getting_started/2.html.haml index ce4269d1e..806461e1f 100644 --- a/app/views/users/getting_started/2.html.haml +++ b/app/views/users/getting_started/2.html.haml @@ -27,7 +27,7 @@ %br = link_to "Define your aspects", getting_started_path(2) %br - = link_to "Find your friends", getting_started_path(3) + = link_to "Connect your services", getting_started_path(3) %br .span-15.last @@ -50,5 +50,11 @@ - 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 + = link_to "x", aspect_path(aspect), :confirm => "are you sure?", :method => :delete, :remote => true, :class => "delete right" diff --git a/app/views/users/getting_started/3.html.haml b/app/views/users/getting_started/3.html.haml index f5136aeaf..8a4c6b95a 100644 --- a/app/views/users/getting_started/3.html.haml +++ b/app/views/users/getting_started/3.html.haml @@ -15,7 +15,7 @@ %br = link_to "Define your aspects", getting_started_path(2) %br - = link_to "Find your friends", getting_started_path(3) + = link_to "Connect your services", getting_started_path(3) .span-15.last %h3 diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 7b8af68d7..6bb6b45b4 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -27,7 +27,7 @@ $(document).ready(function(){ //buttons////// $(".add_aspect_button").fancybox({ 'titleShow' : false , 'hideOnOverlayClick' : false }); - $("#add_request_button").fancybox({ 'titleShow': false , 'hideOnOverlayClick' : false }); + $(".add_request_button").fancybox({ 'titleShow': false , 'hideOnOverlayClick' : false }); $(".invite_user_button").fancybox({ 'titleShow': false , 'hideOnOverlayClick' : false }); $(".add_request_button").fancybox({ 'titleShow': false , 'hideOnOverlayClick' : false }); $(".remove_person_button").fancybox({ 'titleShow': false , 'hideOnOverlayClick' : false }); @@ -80,6 +80,7 @@ $(document).ready(function(){ $("img", "#left_pane").tipsy({live:true}); $(".add_aspect_button", "#aspect_nav").tipsy({gravity:'w'}); $(".person img", ".dropzone").tipsy({live:true}); + $(".avatar", ".aspects").tipsy({live:true}); });//end document ready From ea46fa8fd89bde935d6f133f82f838083d44836a Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 26 Oct 2010 15:03:38 -0700 Subject: [PATCH 09/28] save and continue buttons on getting_started#1 and getting_started#2. raise fields --- app/controllers/users_controller.rb | 7 ++- app/views/users/_profile.haml | 3 -- app/views/users/getting_started/1.html.haml | 55 ++++++++++++++++++++- app/views/users/getting_started/2.html.haml | 50 ++++++++++--------- app/views/users/getting_started/3.html.haml | 13 +++-- public/stylesheets/sass/application.sass | 13 ++++- 6 files changed, 105 insertions(+), 36 deletions(-) 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 + From f1fbb68fd8aed83e395aa994468be5fe66df515e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 26 Oct 2010 18:35:14 -0700 Subject: [PATCH 10/28] added success to getting_started. fixed birthday selectors to display years down to 1930. made buttons rounder. all save and continue buttons step forward. --- app/controllers/requests_controller.rb | 7 ++++- app/controllers/services_controller.rb | 1 - app/controllers/users_controller.rb | 3 ++- app/views/people/edit.html.haml | 2 +- app/views/requests/_new_request.haml | 8 +++--- app/views/users/getting_started/1.html.haml | 5 +++- app/views/users/getting_started/2.html.haml | 8 +++--- app/views/users/getting_started/3.html.haml | 29 ++++++++++----------- app/views/users/getting_started/4.html.haml | 27 +++++++++++++++++++ public/stylesheets/sass/application.sass | 20 +++++++++++++- public/stylesheets/sass/ui.sass | 8 +++--- 11 files changed, 85 insertions(+), 33 deletions(-) create mode 100644 app/views/users/getting_started/4.html.haml diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 4a10821aa..0f07640fb 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -44,7 +44,12 @@ class RequestsController < ApplicationController else raise e end - respond_with :location => aspect + + if params[:getting_started] + redirect_to getting_started_path(params[:getting_started]) + else + respond_with :location => aspect + end return end diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 7c5da42a7..d5fd50c83 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -31,7 +31,6 @@ class ServicesController < ApplicationController :uid => auth['uid']) end - flash[:notice] = "Authentication successful." redirect_to services_url end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index fb1fa8e70..9e1f9dd91 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -61,8 +61,9 @@ class UsersController < ApplicationController @person = @user.person @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' + @services = current_user.services - if params[:id].to_i < 4 + if params[:id].to_i < 5 render "users/getting_started/#{params[:id]}" else render "users/getting_started/1" diff --git a/app/views/people/edit.html.haml b/app/views/people/edit.html.haml index 4e657eddf..11a3986f5 100644 --- a/app/views/people/edit.html.haml +++ b/app/views/people/edit.html.haml @@ -29,7 +29,7 @@ %h4 Your birthday %br - = select_date Time.now, :order => [:month, :day, :year] + = date_select person, :birthday, :order => [:month, :day, :year], :start_year => 1930, :end_year => Time.now.year %h4 Your bio diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index 11e6f73c2..1f7355d2a 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -11,10 +11,6 @@ - if @friends_not_in_aspect = render('shared/add_friend_dropdown', :aspect => aspect, :friends => @friends_not_in_aspect) - - - - = form_for Request.new do |fr_request| = fr_request.error_messages @@ -26,5 +22,9 @@ = fr_request.label :destination_url, t(".friends_username") = fr_request.text_field :destination_url = fr_request.hidden_field :aspect_id, :value => aspect.id + + - if defined?(getting_started) + = hidden_field_tag :getting_started, getting_started + = fr_request.submit diff --git a/app/views/users/getting_started/1.html.haml b/app/views/users/getting_started/1.html.haml index 8bb35efd4..ca743df5f 100644 --- a/app/views/users/getting_started/1.html.haml +++ b/app/views/users/getting_started/1.html.haml @@ -36,7 +36,7 @@ %h4 Your birthday %br - = select_date Time.now, :order => [:month, :day, :year] + = date_select person, :birthday, :order => [:month, :day, :year], :start_year => 1930, :end_year => Time.now.year %h4 Your bio @@ -71,3 +71,6 @@ .submit_block = person.submit "Save and continue →" +/.bottom_notification +/ .blue_button +/ SKIP diff --git a/app/views/users/getting_started/2.html.haml b/app/views/users/getting_started/2.html.haml index 3e7fe3175..ffb7e5cc8 100644 --- a/app/views/users/getting_started/2.html.haml +++ b/app/views/users/getting_started/2.html.haml @@ -34,13 +34,13 @@ .floating %h3 Your aspects - %p - Diaspora aspects are mappings of your real-life 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. %h4 Aspect name - form_for Aspect.new, :remote => true do |aspect| - = aspect.text_field :name + = aspect.text_field :name, :style => "display:inline;" = aspect.submit "Add" %ul.aspects @@ -55,7 +55,7 @@ .fancybox_content #add_request_pane - = render "requests/new_request", :aspect => aspect + = 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" diff --git a/app/views/users/getting_started/3.html.haml b/app/views/users/getting_started/3.html.haml index 65fae6637..13725bfc4 100644 --- a/app/views/users/getting_started/3.html.haml +++ b/app/views/users/getting_started/3.html.haml @@ -6,7 +6,7 @@ .span-8.append-1.last %h1{:style => "text-align:right;"} - = "Welcome!" + = "Welcome to Diaspora!" .description Do the stuff below to further complete some things. @@ -20,19 +20,18 @@ .span-15.last .floating - %h3 - Your friends - .description - Find your friends on Diaspora, Facebook, or send them an invite via email. + %h3 Your services + %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 - On Diaspora - = text_field_tag :diaspora_handle, nil, :placeholder => "Diaspora handle" + %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'] !="" - %h4 - On Facebook - = text_field_tag :facebook_handle, nil, :placeholder => "Name" - - %h4 - Invite - = text_field_tag :email, nil, :placeholder => "Email", :type => "email" + .submit_block + = link_to "Save and continue →", getting_started_path(4), :class => "button" diff --git a/app/views/users/getting_started/4.html.haml b/app/views/users/getting_started/4.html.haml new file mode 100644 index 000000000..a1cfef842 --- /dev/null +++ b/app/views/users/getting_started/4.html.haml @@ -0,0 +1,27 @@ +-# 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 + %h1 + You're all set up! + %h3 + = link_to "Continue on to your everyone page, an overview of all of your aspects.", root_path + diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 8e6b2af86..6860a7301 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1300,10 +1300,28 @@ ul.aspects .floating :padding 12px :background - :color rgb(254,254,254) + :color rgb(255,255,255) :-webkit-box-shadow 0 1px 3px #333 :border-radius 2px :border :bottom 1px solid #ccc :top 1px solid #fff + + +.bottom_notification + :position fixed + :bottom 0 + :left 0 + :width 100% + :background + :color rgba(16,127,201,0.8) + + :text + :align center + :font + :size 16px + :weight bold + :color #fff + :padding 21px + diff --git a/public/stylesheets/sass/ui.sass b/public/stylesheets/sass/ui.sass index e064b3fcf..ff4b3c099 100644 --- a/public/stylesheets/sass/ui.sass +++ b/public/stylesheets/sass/ui.sass @@ -10,7 +10,7 @@ :display inline - :padding 4px + :padding 5px :font-size 12px :line-height 100% @@ -27,9 +27,9 @@ :left 1px solid #ccc :right 1px solid #ccc - :border-radius 3px - :-moz-border-radius 3px - :-webkit-border-radius 3px + :border-radius 8px + :-moz-border-radius 8px + :-webkit-border-radius 8px :cursor pointer From a8086f2990305f03e620227359d8602606e39b7d Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 26 Oct 2010 23:27:26 -0700 Subject: [PATCH 11/28] further refinements. added back buttons, more explanation text. --- app/views/users/getting_started/1.html.haml | 3 -- app/views/users/getting_started/2.html.haml | 9 ++--- app/views/users/getting_started/3.html.haml | 6 +++- app/views/users/getting_started/4.html.haml | 31 ++++++++++++++++- config/locales/diaspora/en.yml | 6 ++++ public/stylesheets/sass/application.sass | 38 ++++++++++++++++++--- 6 files changed, 79 insertions(+), 14 deletions(-) diff --git a/app/views/users/getting_started/1.html.haml b/app/views/users/getting_started/1.html.haml index ca743df5f..395845ec1 100644 --- a/app/views/users/getting_started/1.html.haml +++ b/app/views/users/getting_started/1.html.haml @@ -71,6 +71,3 @@ .submit_block = person.submit "Save and continue →" -/.bottom_notification -/ .blue_button -/ SKIP diff --git a/app/views/users/getting_started/2.html.haml b/app/views/users/getting_started/2.html.haml index ffb7e5cc8..0516cdd9f 100644 --- a/app/views/users/getting_started/2.html.haml +++ b/app/views/users/getting_started/2.html.haml @@ -35,13 +35,13 @@ %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. + 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" + - form_for Aspect.new, :remote => true do |aspect| + = aspect.text_field :name, :style => "display:inline;" + = aspect.submit "Add" %ul.aspects - for aspect in @aspects @@ -63,4 +63,5 @@ %br .submit_block + = link_to "Back", getting_started_path(1), :class => "button" = 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 13725bfc4..e2271d545 100644 --- a/app/views/users/getting_started/3.html.haml +++ b/app/views/users/getting_started/3.html.haml @@ -20,7 +20,10 @@ .span-15.last .floating - %h3 Your services + %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 @@ -34,4 +37,5 @@ %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" diff --git a/app/views/users/getting_started/4.html.haml b/app/views/users/getting_started/4.html.haml index a1cfef842..c90de31cd 100644 --- a/app/views/users/getting_started/4.html.haml +++ b/app/views/users/getting_started/4.html.haml @@ -21,7 +21,36 @@ .span-15.last .floating %h1 - You're all set up! + = "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" diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 91b80deab..0165b8262 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -117,6 +117,12 @@ en: edit: editing_profile: "Editing profile" destroy: "Account successfully closed." + getting_started: + '1': + albums: "Albums" + you_dont_have_any_photos: "You don't have any photos! Go to the" + page_to_upload_some: "page to upload some." + or: "or" comments: comment: ago: "ago" diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 6860a7301..734a6190c 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -393,8 +393,11 @@ li.message form :position relative - :font - :size 14px + input, + textarea, + label + :font + :size 14px #user_name :margin @@ -596,7 +599,6 @@ li.message .from .right h5 :color #ccc - input:not([type='submit']), textarea :font @@ -612,6 +614,8 @@ textarea :-webkit-border-radius 5px :-moz-border-radius 5px +input[type='checkbox'] + :width auto .submit_block :text @@ -685,7 +689,6 @@ label :display inline .public_toggle - :width 300px :font :size smaller :style italic @@ -1298,6 +1301,7 @@ ul.aspects :display inline .floating + :position relative :padding 12px :background :color rgb(255,255,255) @@ -1306,8 +1310,12 @@ ul.aspects :border :bottom 1px solid #ccc :top 1px solid #fff + :min-height 500px - + .submit_block + :position absolute + :bottom 13px + :right 12px .bottom_notification :position fixed @@ -1325,3 +1333,23 @@ ul.aspects :color #fff :padding 21px + +.inline_aspect_listing + :margin 0 + :padding 0 + :list + :style none + :display inline + > li + :display inline + :font + :weight normal + + &:after + :content ", " + + &:last-child + &:before + :content "and " + &:after + :content "." From b320f5df7295b57b29a8db6342b657d18b47f12a Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 08:45:43 -0700 Subject: [PATCH 12/28] fixed js for changing a user's profile photo on photos#show --- public/javascripts/view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 6bb6b45b4..730358083 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -127,8 +127,8 @@ $(".make_profile_photo").live("click", function(){ $.ajax({ type: "PUT", - url: '/users/'+user_id, - data: {"user":{"profile":{ "image_url": photo_url }}}, + url: '/people/'+user_id, + data: {"person":{"profile":{ "image_url": photo_url }}}, success: function(){ $("img[data-person_id='"+ person_id +"']").each( function() { $(this).attr('src', photo_url); From 4ec11691cd8b031200c352cabf44227045c0febc Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 10:36:13 -0700 Subject: [PATCH 13/28] user has a getting_started flag, set true by default. aspect#index checks to see if getting_started flag is set. --- app/controllers/aspects_controller.rb | 4 +++ app/controllers/users_controller.rb | 23 +++++++++----- app/models/user.rb | 2 +- app/views/layouts/application.html.haml | 2 -- app/views/users/getting_started/1.html.haml | 2 ++ app/views/users/getting_started/2.html.haml | 4 +++ app/views/users/getting_started/3.html.haml | 3 ++ app/views/users/getting_started/4.html.haml | 9 +++++- public/stylesheets/sass/application.sass | 33 +++++++++------------ 9 files changed, 52 insertions(+), 30 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 985fb68a9..71927046c 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -11,6 +11,10 @@ class AspectsController < ApplicationController def index @posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' @aspect = :all + + if current_user.getting_started == true + redirect_to getting_started_path(1) + end end def create diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9e1f9dd91..faa40e425 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -20,14 +20,23 @@ class UsersController < ApplicationController def update @user = current_user - params[:user].delete(:password) if params[:user][:password].blank? - params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank? - if params[:user][:password] && params[:user][:password_confirmation] - if @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation]) - flash[:notice] = "Password Changed" - else - flash[:error] = "Password Change Failed" + if params[:user][:getting_started] + puts "here" + boolean = params[:user][:getting_started] == "true" + @user.update_attributes( :getting_started => boolean ) + redirect_to root_path + + else + params[:user].delete(:password) if params[:user][:password].blank? + params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank? + + if params[:user][:password] && params[:user][:password_confirmation] + if @user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation]) + flash[:notice] = "Password Changed" + else + flash[:error] = "Password Change Failed" + end end end diff --git a/app/models/user.rb b/app/models/user.rb index accedb2d3..fa245c290 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -40,7 +40,7 @@ class User key :invite_messages, Hash - key :getting_started, Boolean, :default => false + key :getting_started, Boolean, :default => true before_validation :strip_username, :on => :create validates_presence_of :username diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index f0c74cc50..ddbdc9377 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -69,5 +69,3 @@ .span-24.last = render "posts/debug" - #getting_started_button - = link_to "Getting started", getting_started_path(1) diff --git a/app/views/users/getting_started/1.html.haml b/app/views/users/getting_started/1.html.haml index 395845ec1..8cfb0e747 100644 --- a/app/views/users/getting_started/1.html.haml +++ b/app/views/users/getting_started/1.html.haml @@ -71,3 +71,5 @@ .submit_block = person.submit "Save and continue →" +.bottom_notification + = link_to "skip getting started →", '#', :id => "getting_started_skip" diff --git a/app/views/users/getting_started/2.html.haml b/app/views/users/getting_started/2.html.haml index 0516cdd9f..479523d3d 100644 --- a/app/views/users/getting_started/2.html.haml +++ b/app/views/users/getting_started/2.html.haml @@ -65,3 +65,7 @@ .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 →", '#' diff --git a/app/views/users/getting_started/3.html.haml b/app/views/users/getting_started/3.html.haml index e2271d545..0ce946d7f 100644 --- a/app/views/users/getting_started/3.html.haml +++ b/app/views/users/getting_started/3.html.haml @@ -39,3 +39,6 @@ .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 →", '#' diff --git a/app/views/users/getting_started/4.html.haml b/app/views/users/getting_started/4.html.haml index c90de31cd..d635bf9c2 100644 --- a/app/views/users/getting_started/4.html.haml +++ b/app/views/users/getting_started/4.html.haml @@ -3,6 +3,14 @@ -# 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;"} @@ -31,7 +39,6 @@ %br %br - %h3 = link_to "Continue on to your everyone page, an overview of all of your aspects.", root_path diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 734a6190c..14829f35c 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1246,23 +1246,6 @@ ul#breadcrumb &:after :content '' -#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 @@ -1328,10 +1311,22 @@ ul.aspects :text :align center :font - :size 16px + :size 14px :weight bold :color #fff - :padding 21px + :padding 12px + :bottom 10px + + a + :color #fafafa + :background + :color rgb(16,127,201) + :padding 8px + :border-radius 10px + + &:hover + :background + :color #22AAE0 .inline_aspect_listing From cd726c0ba72dff29811126a3a3e2fc884e45b476 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 12:21:25 -0700 Subject: [PATCH 14/28] users#getting_started route -> getting_started. getting_started is now a mini-template referring to partials in users/getting_started/ --- app/controllers/people_controller.rb | 2 +- app/controllers/users_controller.rb | 20 +++-- app/views/users/getting_started.html.haml | 28 +++++++ app/views/users/getting_started/1.html.haml | 75 ------------------- app/views/users/getting_started/2.html.haml | 71 ------------------ app/views/users/getting_started/3.html.haml | 44 ----------- app/views/users/getting_started/4.html.haml | 63 ---------------- .../users/getting_started/_step_1.html.haml | 56 ++++++++++++++ .../users/getting_started/_step_2.html.haml | 38 ++++++++++ .../users/getting_started/_step_3.html.haml | 23 ++++++ .../users/getting_started/_step_4.html.haml | 44 +++++++++++ config/locales/diaspora/en.yml | 2 +- config/routes.rb | 2 +- public/stylesheets/sass/application.sass | 8 ++ 14 files changed, 209 insertions(+), 267 deletions(-) create mode 100644 app/views/users/getting_started.html.haml delete mode 100644 app/views/users/getting_started/1.html.haml delete mode 100644 app/views/users/getting_started/2.html.haml delete mode 100644 app/views/users/getting_started/3.html.haml delete mode 100644 app/views/users/getting_started/4.html.haml create mode 100644 app/views/users/getting_started/_step_1.html.haml create mode 100644 app/views/users/getting_started/_step_2.html.haml create mode 100644 app/views/users/getting_started/_step_3.html.haml create mode 100644 app/views/users/getting_started/_step_4.html.haml diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index cb3d974a2..5a7737bac 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -49,7 +49,7 @@ class PeopleController < ApplicationController end 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 redirect_to edit_person_path end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index faa40e425..3ecf933b1 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -65,18 +65,16 @@ class UsersController < ApplicationController end def getting_started - @aspect = :getting_started - @user = current_user - @person = @user.person - @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' - @services = current_user.services + @aspect = :getting_started + @user = current_user + @person = @user.person + @profile = @user.profile + @photos = @user.visible_posts(:person_id => current_user.person.id, :_type => 'Photo').paginate :page => params[:page], :order => 'created_at DESC' + @services = @user.services - if params[:id].to_i < 5 - render "users/getting_started/#{params[:id]}" - else - render "users/getting_started/1" - end + @step = ((params[:step].to_i>0)&&(params[:step].to_i<5)) ? params[:step].to_i : 1 + @step ||= 1 + render "users/getting_started" end def export diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml new file mode 100644 index 000000000..6f69c8de2 --- /dev/null +++ b/app/views/users/getting_started.html.haml @@ -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" diff --git a/app/views/users/getting_started/1.html.haml b/app/views/users/getting_started/1.html.haml deleted file mode 100644 index 8cfb0e747..000000000 --- a/app/views/users/getting_started/1.html.haml +++ /dev/null @@ -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" diff --git a/app/views/users/getting_started/2.html.haml b/app/views/users/getting_started/2.html.haml deleted file mode 100644 index 479523d3d..000000000 --- a/app/views/users/getting_started/2.html.haml +++ /dev/null @@ -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($("
    5. " + newAspectName + "
    6. ").fadeIn(200)); - $("#aspect_nav").find("ul").first().find("li:last").before($("
    7. " + newAspectName + "
    8. ").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 →", '#' diff --git a/app/views/users/getting_started/3.html.haml b/app/views/users/getting_started/3.html.haml deleted file mode 100644 index 0ce946d7f..000000000 --- a/app/views/users/getting_started/3.html.haml +++ /dev/null @@ -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 →", '#' diff --git a/app/views/users/getting_started/4.html.haml b/app/views/users/getting_started/4.html.haml deleted file mode 100644 index d635bf9c2..000000000 --- a/app/views/users/getting_started/4.html.haml +++ /dev/null @@ -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" diff --git a/app/views/users/getting_started/_step_1.html.haml b/app/views/users/getting_started/_step_1.html.haml new file mode 100644 index 000000000..d57d0b119 --- /dev/null +++ b/app/views/users/getting_started/_step_1.html.haml @@ -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 →" + diff --git a/app/views/users/getting_started/_step_2.html.haml b/app/views/users/getting_started/_step_2.html.haml new file mode 100644 index 000000000..503ab8f5f --- /dev/null +++ b/app/views/users/getting_started/_step_2.html.haml @@ -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" + diff --git a/app/views/users/getting_started/_step_3.html.haml b/app/views/users/getting_started/_step_3.html.haml new file mode 100644 index 000000000..18789da19 --- /dev/null +++ b/app/views/users/getting_started/_step_3.html.haml @@ -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" + diff --git a/app/views/users/getting_started/_step_4.html.haml b/app/views/users/getting_started/_step_4.html.haml new file mode 100644 index 000000000..b5ca7b274 --- /dev/null +++ b/app/views/users/getting_started/_step_4.html.haml @@ -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. + diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 0165b8262..9695c0237 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -118,7 +118,7 @@ en: editing_profile: "Editing profile" destroy: "Account successfully closed." getting_started: - '1': + 'step_1': albums: "Albums" you_dont_have_any_photos: "You don't have any photos! Go to the" page_to_upload_some: "page to upload some." diff --git a/config/routes.rb b/config/routes.rb index 39b3f76ec..c72ed855f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,7 +18,7 @@ Diaspora::Application.routes.draw do :invitations => "invitations"} # added public route to user 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/import', :to => 'users#import' match 'users/export_photos', :to => 'users#export_photos' diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 14829f35c..315b8a41f 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1300,6 +1300,9 @@ ul.aspects :bottom 13px :right 12px + form + :display relative + .bottom_notification :position fixed :bottom 0 @@ -1348,3 +1351,8 @@ ul.aspects :content "and " &:after :content "." + +#previous_step + :position absolute + :left 12px + :bottom 12px From b906dd5a1d62ba2d39a31886d6989ff0b85b53d0 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 12:31:48 -0700 Subject: [PATCH 15/28] added redirect to getting_started_path in requests#create --- app/controllers/requests_controller.rb | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 0f07640fb..ffc845c93 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -46,7 +46,7 @@ class RequestsController < ApplicationController end if params[:getting_started] - redirect_to getting_started_path(params[:getting_started]) + redirect_to getting_started_path(:step=>params[:getting_started]) else respond_with :location => aspect end @@ -66,16 +66,29 @@ class RequestsController < ApplicationController else raise e end - respond_with :location => aspect + + if params[:getting_started] + redirect_to getting_started_path(:step=>params[:getting_started]) + else + respond_with :location => aspect + end return end if @request flash[:notice] = I18n.t 'requests.create.success',:destination_url => @request.destination_url - respond_with :location => aspect + if params[:getting_started] + redirect_to getting_started_path(:step=>params[:getting_started]) + else + respond_with :location => aspect + end else flash[:error] = I18n.t 'requests.create.horribly_wrong' - respond_with :location => aspect + if params[:getting_started] + redirect_to getting_started_path(:step=>params[:getting_started]) + else + respond_with :location => aspect + end end end From 335bd9c96aeb530e688fd4330dde03c85f6dbedc Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 12:53:46 -0700 Subject: [PATCH 16/28] skip getting started button sets getting_started to false via js and redirects to root_path --- app/controllers/users_controller.rb | 5 ++--- app/views/users/getting_started.html.haml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3ecf933b1..21182fd94 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -22,7 +22,6 @@ class UsersController < ApplicationController @user = current_user if params[:user][:getting_started] - puts "here" boolean = params[:user][:getting_started] == "true" @user.update_attributes( :getting_started => boolean ) redirect_to root_path @@ -38,9 +37,9 @@ class UsersController < ApplicationController flash[:error] = "Password Change Failed" end end - end - redirect_to edit_user_path(@user) + redirect_to edit_user_path(@user) + end end def destroy diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 6f69c8de2..71bc63dd0 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -3,6 +3,18 @@ -# the COPYRIGHT file. +- if current_user.getting_started == true + :javascript + $("#getting_started_skip").live("click", function(evt){ + evt.preventDefault(); + $.ajax({ + type: "PUT", + url: "/users/#{current_user.id}", + data: {"user":{"getting_started":'false'}}, + success: function() { window.location = "#{root_path}"} + }) + }); + .span-8.append-1.last %h1{:style => "text-align:right;"} = "Welcome to Diaspora!" From bfb1c6df282f7cc57a7f2a2108c611d46ddccdc8 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 13:33:42 -0700 Subject: [PATCH 17/28] collapsed layout views --- app/controllers/application_controller.rb | 10 --- app/views/devise/passwords/new.html.haml | 21 +++--- app/views/devise/sessions/new.html.haml | 53 +++++++------- app/views/layouts/application.html.haml | 30 ++++---- app/views/layouts/session_wall.html.haml | 53 -------------- app/views/registrations/new.html.haml | 84 +++++++++++------------ 6 files changed, 100 insertions(+), 151 deletions(-) delete mode 100644 app/views/layouts/session_wall.html.haml diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index df08808ae..b4018863b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,16 +10,6 @@ class ApplicationController < ActionController::Base before_filter :count_requests before_filter :set_invites - layout :layout_by_resource - - def layout_by_resource - if devise_controller? - "session_wall" - else - "application" - end - end - def set_friends_and_status if current_user if params[:aspect] == nil || params[:aspect] == 'all' diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index 1d877b70e..d9431bbb8 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -1,9 +1,12 @@ -%h2 Forgot your password? -= form_for(resource, :as => resource_name, :url => password_path(resource_name)) do |f| - = devise_error_messages! - %p - = f.label :email - = f.text_field :email - %p - = f.submit "Send me reset password instructions" -= render :partial => "devise/shared/links" +.span-12.prepend-6.last + .floating + %h3 + Forgot your password? + = form_for(resource, :as => resource_name, :url => password_path(resource_name)) do |f| + = devise_error_messages! + %p + = f.label :email + = f.text_field :email + %p + = f.submit "Send me reset password instructions" + = render :partial => "devise/shared/links" diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 5803415b4..852a8afd5 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,26 +1,33 @@ -%h1 - This is a technology preview, do not provide any private information. -%h3 - your account may be deleted until we move into a more stable development period. -%h3 - USE AT YOUR OWN RISK!! -= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| - #user - %p.username - = f.label :username - = f.text_field :username - %p.user_network - ="@#{APP_CONFIG[:terse_pod_url]}" +.span-10.append-1.last + .floating + %h3 Login + = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| + #user + %p.username + = f.label :username + = f.text_field :username + %p.user_network + ="@#{APP_CONFIG[:terse_pod_url]}" + %p + = f.label :password + = f.password_field :password + /%p + /- if devise_mapping.rememberable? + / = f.check_box :remember_me + / = f.label :remember_me + = f.submit "Sign in" + %p - = f.label :password - = f.password_field :password - /%p - /- if devise_mapping.rememberable? - / = f.check_box :remember_me - / = f.label :remember_me - = f.submit "Sign in" - = link_to "Have a problem? Find an answer here", 'http://diaspora.shapado.com/' - %p -= render :partial => "devise/shared/links" + = render :partial => "devise/shared/links" + %p + = link_to "Have a problem? Find an answer here", 'http://diaspora.shapado.com/' + +.span-13.last + %h1 + This is a technology preview, do not provide any private information. + %h3 + your account may be deleted until we move into a more stable development period. + %h3 + USE AT YOUR OWN RISK!! diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index ddbdc9377..c7deeda8e 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -31,7 +31,8 @@ = javascript_include_tag 'view', 'image_picker', 'stream' - = render 'js/websocket_js' + - if current_user + = render 'js/websocket_js' = csrf_meta_tag = yield(:head) @@ -43,24 +44,25 @@ %header .container{:style => "position:relative;"} #diaspora_text{:href => root_path} - = link_to "DIASPORA*", root_path + = link_to "DIASPORA*", (current_user ? root_path : new_user_session_path) %span.sub_text PREVIEW - #global_search - = form_tag(people_path, :method => 'get') do - = text_field_tag 'q', nil, :placeholder => "Search", :type => 'search', :results => 5 + - if current_user + #global_search + = form_tag(people_path, :method => 'get') do + = text_field_tag 'q', nil, :placeholder => "Search", :type => 'search', :results => 5 - %ul#user_menu - .avatar - = owner_image_tag - = link_to current_user.real_name, '#' - %li= link_to "view profile", current_user.person - %li= link_to "edit profile", edit_person_path(current_user.person) - %li= link_to "account settings", edit_user_path(current_user) - %li= link_to t('.logout.'), destroy_user_session_path + %ul#user_menu + .avatar + = owner_image_tag + = link_to current_user.real_name, '#' + %li= link_to "view profile", current_user.person + %li= link_to "edit profile", edit_person_path(current_user.person) + %li= link_to "account settings", edit_user_path(current_user) + %li= link_to t('.logout.'), destroy_user_session_path - = render "shared/aspect_nav" + = render "shared/aspect_nav" .container .span-24.last diff --git a/app/views/layouts/session_wall.html.haml b/app/views/layouts/session_wall.html.haml deleted file mode 100644 index bc15063d6..000000000 --- a/app/views/layouts/session_wall.html.haml +++ /dev/null @@ -1,53 +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. - -!!! -%html - %head - %title - DIASPORA | login - %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - %meta{"http-equiv"=> "X-UA-Compatible", :content =>"chrome=1" } - - = stylesheet_link_tag "sessions" - /= javascript_include_tag"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" - = javascript_include_tag 'jquery142' - = javascript_include_tag 'jquery.infieldlabel' - - :javascript - $(document).ready(function(){ - $("#user_username").focus(); - $("label").inFieldLabels(); - }); - - = csrf_meta_tag - = yield(:head) - - %body - - :plain - - - - flash.each do |name, msg| - = content_tag :div, msg, :id => "flash_#{name}" - %div#huge_text - DIASPORA* - = yield - - /= link_to "signup", "/signup" diff --git a/app/views/registrations/new.html.haml b/app/views/registrations/new.html.haml index cea31ff78..191f885e6 100644 --- a/app/views/registrations/new.html.haml +++ b/app/views/registrations/new.html.haml @@ -1,50 +1,50 @@ -= image_tag "http://needcoffee.cachefly.net/needcoffee/uploads/2009/02/predator-arnold-schwarzenegger.jpg" - -= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| - %p - = f.label :username - = f.text_field :username - %p - = f.label :email - = f.text_field :email - %p - = f.label :password - = f.password_field :password - %p - = f.label :password_confirmation - = f.password_field :password_confirmation - - = f.fields_for :person do |p| - = p.fields_for :profile do |pr| +.span-12.prepend-6.last + .floating + %h3 + Sign up for Diaspora + = image_tag "http://needcoffee.cachefly.net/needcoffee/uploads/2009/02/predator-arnold-schwarzenegger.jpg" + = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %p - = pr.label :first_name - = pr.text_field :first_name + = f.label :username + = f.text_field :username %p - = pr.label :last_name - = pr.text_field :last_name - = f.submit t('.sign_up') -= render :partial => "devise/shared/links" + = f.label :email + = f.text_field :email + %p + = f.label :password + = f.password_field :password + %p + = f.label :password_confirmation + = f.password_field :password_confirmation + + = f.fields_for :person do |p| + = p.fields_for :profile do |pr| + %p + = pr.label :first_name + = pr.text_field :first_name + %p + = pr.label :last_name + = pr.text_field :last_name + = f.submit t('.sign_up') -%br -%br + .floating + %h3 + Upload an existing Diaspora account -%h2 or, upload yourself + = form_tag '/users/import', :multipart => true do + %p + = label_tag 'user[email]' + = text_field_tag 'user[email]' + %p + = label_tag 'user[password]' + = password_field_tag 'user[password]' + %p + = label_tag 'user[password_confirmation]' + = password_field_tag 'user[password_confirmation]' -= form_tag '/users/import', :multipart => true do - - %p - = label_tag 'user[email]' - = text_field_tag 'user[email]' - %p - = label_tag 'user[password]' - = password_field_tag 'user[password]' - %p - = label_tag 'user[password_confirmation]' - = password_field_tag 'user[password_confirmation]' - - %label Select File - = file_field 'upload', 'file' - = submit_tag "Upload" + %label Select File + = file_field 'upload', 'file' + = submit_tag "Upload" From 05c5e770eee422c75cd6d244fb487ff52a588dfa Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 16:25:22 -0700 Subject: [PATCH 18/28] removed real name from signup process. --- app/controllers/aspects_controller.rb | 2 +- app/models/person.rb | 6 ++- app/models/profile.rb | 1 - app/models/user.rb | 7 ++-- app/views/registrations/new.html.haml | 8 ---- app/views/users/getting_started.html.haml | 2 +- public/stylesheets/sass/application.sass | 1 - .../registrations_controller_spec.rb | 8 +--- spec/models/person_spec.rb | 37 +++++++++++-------- spec/models/profile_spec.rb | 20 ---------- spec/models/user_spec.rb | 2 +- 11 files changed, 34 insertions(+), 60 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 71927046c..2cb295f21 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -13,7 +13,7 @@ class AspectsController < ApplicationController @aspect = :all if current_user.getting_started == true - redirect_to getting_started_path(1) + redirect_to getting_started_path end end diff --git a/app/models/person.rb b/app/models/person.rb index 5a1486653..b794c8811 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -58,7 +58,11 @@ class Person end def real_name - "#{profile.first_name.to_s} #{profile.last_name.to_s}" + if profile.first_name.nil? || profile.first_name.empty? + self.diaspora_handle + else + "#{profile.first_name.to_s} #{profile.last_name.to_s}" + end end def owns?(post) diff --git a/app/models/profile.rb b/app/models/profile.rb index 544277ce7..7258c4bfd 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -19,7 +19,6 @@ class Profile key :image_url, String key :bio, String - validates_presence_of :first_name, :last_name after_validation :strip_names before_save :strip_names diff --git a/app/models/user.rb b/app/models/user.rb index fa245c290..eb50ff8e8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -89,10 +89,6 @@ class User self.person.send(method, *args) end - def real_name - "#{person.profile.first_name.to_s} #{person.profile.last_name.to_s}" - end - ######### Aspects ###################### def aspect(opts = {}) aspect = Aspect.new(opts) @@ -405,12 +401,15 @@ class User ###Helpers############ def self.build(opts = {}) + opts[:person] = {} opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}" opts[:person][:url] = APP_CONFIG[:pod_url] opts[:serialized_private_key] = generate_key opts[:person][:serialized_public_key] = opts[:serialized_private_key].public_key + opts[:person][:profile] = Profile.new + u = User.new(opts) u end diff --git a/app/views/registrations/new.html.haml b/app/views/registrations/new.html.haml index 191f885e6..ea0be2b75 100644 --- a/app/views/registrations/new.html.haml +++ b/app/views/registrations/new.html.haml @@ -17,14 +17,6 @@ = f.label :password_confirmation = f.password_field :password_confirmation - = f.fields_for :person do |p| - = p.fields_for :profile do |pr| - %p - = pr.label :first_name - = pr.text_field :first_name - %p - = pr.label :last_name - = pr.text_field :last_name = f.submit t('.sign_up') diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index 71bc63dd0..da1b6c40f 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -30,7 +30,7 @@ %br .span-15.last - .floating + .floating{:style=>"min-height:500px;"} = render "users/getting_started/step_#{@step}", :current_user => current_user - if @step > 1 diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 315b8a41f..61794ba0f 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1293,7 +1293,6 @@ ul.aspects :border :bottom 1px solid #ccc :top 1px solid #fff - :min-height 500px .submit_block :position absolute diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index 3c9bbde07..942e8f5c9 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -14,11 +14,7 @@ describe RegistrationsController do @valid_params = {"user" => {"username" => "jdoe", "email" => "jdoe@example.com", "password" => "password", - "password_confirmation" => "password", - "person" => { - "profile" => { - "first_name" => "John", - "last_name" => "Doe"}}}} + "password_confirmation" => "password"}} end describe "#create" do @@ -41,7 +37,7 @@ describe RegistrationsController do end context "with invalid parameters" do before do - @valid_params["user"]["person"]["profile"].delete("first_name") + @valid_params["user"]["password_confirmation"] = "baddword" @invalid_params = @valid_params end it "does not create a user" do diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index fa89610af..afbf41d8d 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -13,22 +13,6 @@ describe Person do @aspect2 = @user2.aspect(:name => "Abscence of Babes") end - describe "validation" do - describe "of associated profile" do - it "fails if the profile isn't valid" do - person = Factory.build(:person) - person.should be_valid - - person.profile.update_attribute(:first_name, nil) - person.profile.should_not be_valid - person.should_not be_valid - - person.errors.count.should == 1 - person.errors.full_messages.first.should =~ /first name/i - end - end - end - describe '#diaspora_handle' do context 'local people' do it 'uses the pod config url to set the diaspora_handle' do @@ -54,6 +38,27 @@ describe Person do end end + context '#real_name' do + let!(:user) { Factory(:user) } + let!(:person) { user.person } + let!(:profile) { person.profile } + + context 'with first name' do + it 'should return their name for real name' do + person.real_name.should match /#{profile.first_name}|#{profile.last_name}/ + end + end + + context 'without first name' do + it 'should display their diaspora handle' do + person.profile.first_name = nil + person.profile.last_name = nil + person.save! + person.real_name.should == person.diaspora_handle + end + end + end + describe 'xml' do before do @xml = @person.to_xml.to_s diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index de2eb6955..fed124726 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -7,16 +7,6 @@ require 'spec_helper' describe Profile do describe 'validation' do describe "of first_name" do - it "requires first name" do - profile = Factory.build(:profile, :first_name => nil) - profile.should_not be_valid - profile.first_name = "Hortense" - profile.should be_valid - end - it "requires non-empty first name" do - profile = Factory.build(:profile, :first_name => " ") - profile.should_not be_valid - end it "strips leading and trailing whitespace" do profile = Factory.build(:profile, :first_name => " Shelly ") profile.should be_valid @@ -24,16 +14,6 @@ describe Profile do end end describe "of last_name" do - it "requires a last name" do - profile = Factory.build(:profile, :last_name => nil) - profile.should_not be_valid - profile.last_name = "Shankar" - profile.should be_valid - end - it "requires non-empty last name" do - profile = Factory.build(:profile, :last_name => " ") - profile.should_not be_valid - end it "strips leading and trailing whitespace" do profile = Factory.build(:profile, :last_name => " Ohba ") profile.should be_valid diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 351d5347c..dfb5995c0 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -124,7 +124,7 @@ describe User do :username => "ohai", :email => "ohai@example.com", :password => "password", - :password_confirmation => "password", + :password_confirmation => "wrongpasswordz", :person => {:profile => {:first_name => "", :last_name => ""}}} end it "raises no error" do From db1a753add388aa34086e02555a18324aa7a3a7c Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 18:08:55 -0700 Subject: [PATCH 19/28] major hack on getting_started#2 with aspect javascript. reload the page on ajax success on new aspect creation just to get it working. --- app/controllers/aspects_controller.rb | 2 +- app/views/users/getting_started.html.haml | 29 +++++++++++++------ .../users/getting_started/_step_2.html.haml | 2 +- public/stylesheets/sass/application.sass | 6 ++++ 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 2cb295f21..d5962614b 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -47,7 +47,7 @@ class AspectsController < ApplicationController def show @aspect = current_user.aspect_by_id params[:id] - @friends_not_in_aspect = current_user.friends_not_in_aspect(@aspect) + @friends_not_in_aspect = current_user.friends #current_user.friends_not_in_aspect(@aspect) unless @aspect render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404 else diff --git a/app/views/users/getting_started.html.haml b/app/views/users/getting_started.html.haml index da1b6c40f..5edb3e67a 100644 --- a/app/views/users/getting_started.html.haml +++ b/app/views/users/getting_started.html.haml @@ -3,18 +3,29 @@ -# the COPYRIGHT file. -- if current_user.getting_started == true +- content_for :head do :javascript - $("#getting_started_skip").live("click", function(evt){ - evt.preventDefault(); - $.ajax({ - type: "PUT", - url: "/users/#{current_user.id}", - data: {"user":{"getting_started":'false'}}, - success: function() { window.location = "#{root_path}"} - }) + $("#new_aspect").live("ajax:success", function(data,stat,xhr){ + window.location.reload(); }); + $(".aspects li").find(".delete").live("click", function(){ + var aspectElement = $(this).parent("li"); + aspectElement.fadeOut(300, function(){aspectElement.remove();}); + }); + + - if current_user.getting_started == true + :javascript + $("#getting_started_skip").live("click", function(evt){ + evt.preventDefault(); + $.ajax({ + type: "PUT", + url: "/users/#{current_user.id}", + data: {"user":{"getting_started":'false'}}, + success: function() { window.location = "#{root_path}"} + }) + }); + .span-8.append-1.last %h1{:style => "text-align:right;"} = "Welcome to Diaspora!" diff --git a/app/views/users/getting_started/_step_2.html.haml b/app/views/users/getting_started/_step_2.html.haml index 503ab8f5f..3935cd760 100644 --- a/app/views/users/getting_started/_step_2.html.haml +++ b/app/views/users/getting_started/_step_2.html.haml @@ -10,7 +10,7 @@ %h4 Aspect name - - form_for Aspect.new, :remote => true do |aspect| + - form_for Aspect.new, :remote => true, :format => :json do |aspect| = aspect.text_field :name, :style => "display:inline;" = aspect.submit "Add" diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 61794ba0f..03cdcabf5 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1355,3 +1355,9 @@ ul.aspects :position absolute :left 12px :bottom 12px + +#user_photo_uploader + .avatar + :border-radius 5px + :height 100px + :width 100px From 59858cd86b0ac5c9227729cd5e23ca5bb10cb7a0 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 18:34:51 -0700 Subject: [PATCH 20/28] opts[:person] set to empty hash only if not already defined. same with opts[:person][:profile]. rake db:reset works properly again. --- app/models/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index b011c7df1..16cc2783e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -407,14 +407,14 @@ class User ###Helpers############ def self.build(opts = {}) - opts[:person] = {} + opts[:person] ||= {} + opts[:person][:profile] ||= Profile.new opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}" opts[:person][:url] = APP_CONFIG[:pod_url] opts[:serialized_private_key] = generate_key opts[:person][:serialized_public_key] = opts[:serialized_private_key].public_key - opts[:person][:profile] = Profile.new u = User.new(opts) u From dc89d984f1db02f28c3d0d18cd153b6f60363466 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 18:36:15 -0700 Subject: [PATCH 21/28] put remove buttons on incoming requests, allowing a user to ignore again. --- app/views/aspects/manage.html.haml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index a49030d34..cbc5c0ff1 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -22,6 +22,10 @@ - else - for request in @remote_requests %li.person.request{:data=>{:guid=>request.id, :person_id=>request.person.id}} + .delete + .x + X + .circle = person_image_tag(request.person) %h3 Remove from Aspect From 06654b13b2d1580c4d84000f4ff54a01b98d386d Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 27 Oct 2010 22:55:58 -0700 Subject: [PATCH 22/28] posts don't socket into services#index anymore. --- app/views/services/index.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/services/index.html.haml b/app/views/services/index.html.haml index 8d00f8eb3..ee298eb34 100644 --- a/app/views/services/index.html.haml +++ b/app/views/services/index.html.haml @@ -14,7 +14,7 @@ %h2 Services - %ul#stream + %ul - for service in @services %h3 %b= service.provider From bb9a6e47a4af4bf7fa50f48cd7a868fd28e1ad81 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 28 Oct 2010 11:01:16 -0700 Subject: [PATCH 23/28] added birthday and gender to Profile. fixed a view issue on getting_started#2 --- app/controllers/people_controller.rb | 6 ++++++ app/models/profile.rb | 4 ++++ app/views/people/edit.html.haml | 7 ++++++- app/views/users/getting_started/_step_1.html.haml | 7 ++++++- app/views/users/getting_started/_step_2.html.haml | 2 +- 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 512f47ed2..f76f1c6e6 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -41,6 +41,12 @@ class PeopleController < ApplicationController end def update + # convert date selector into proper timestamp + birthday = params[:date] + if birthday + params[:person][:profile][:birthday] ||= Date.parse("#{birthday[:year]}-#{birthday[:month]}-#{birthday[:day]}") + end + prep_image_url(params[:person]) if current_user.update_profile params[:person][:profile] diff --git a/app/models/profile.rb b/app/models/profile.rb index 7258c4bfd..8848cd823 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -12,11 +12,15 @@ class Profile xml_reader :first_name xml_reader :last_name xml_reader :image_url + xml_reader :birthday + xml_reader :gender xml_reader :bio key :first_name, String key :last_name, String key :image_url, String + key :birthday, Date + key :gender, String key :bio, String after_validation :strip_names diff --git a/app/views/people/edit.html.haml b/app/views/people/edit.html.haml index 11a3986f5..29e10d757 100644 --- a/app/views/people/edit.html.haml +++ b/app/views/people/edit.html.haml @@ -26,10 +26,15 @@ = 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 gender + %br + = select_tag 'person[profile][gender]', options_for_select(["","Female","Male"], @person.profile.gender) + %h4 Your birthday %br - = date_select person, :birthday, :order => [:month, :day, :year], :start_year => 1930, :end_year => Time.now.year + = select_date @person.profile.birthday, :order => [:month, :day, :year], :start_year => 1930, :end_year => 2000 %h4 Your bio diff --git a/app/views/users/getting_started/_step_1.html.haml b/app/views/users/getting_started/_step_1.html.haml index d57d0b119..7778a39f8 100644 --- a/app/views/users/getting_started/_step_1.html.haml +++ b/app/views/users/getting_started/_step_1.html.haml @@ -17,10 +17,15 @@ = 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 gender + %br + = select_tag 'person[profile][gender]', options_for_select(["","Female","Male"], @person.profile.gender) + %h4 Your birthday %br - = date_select person, :birthday, :order => [:month, :day, :year], :start_year => 1930, :end_year => Time.now.year + = select_date @person.profile.birthday, :order => [:month, :day, :year], :start_year => 1930, :end_year => 2000 %h4 Your bio diff --git a/app/views/users/getting_started/_step_2.html.haml b/app/views/users/getting_started/_step_2.html.haml index 3935cd760..bed14bd33 100644 --- a/app/views/users/getting_started/_step_2.html.haml +++ b/app/views/users/getting_started/_step_2.html.haml @@ -19,7 +19,7 @@ %li{:style=>"position:relative;"} = aspect .friend_pictures.horizontal - - for friend in aspect.people + - for friend in aspect.person_objects = person_image_link(friend) = link_to (image_tag('add_friend_button.png', :title => "add to #{aspect}")), "#add_request_pane", :class => 'add_request_button' From 6626b009618e32450c078e98c85df63201943cc2 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 28 Oct 2010 11:11:05 -0700 Subject: [PATCH 24/28] fix on aspect#show in @friends_not_in_aspect --- app/controllers/aspects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 14e796833..9aa0c1d3a 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -47,7 +47,7 @@ class AspectsController < ApplicationController def show @aspect = current_user.aspect_by_id params[:id] - @friends_not_in_aspect = current_user.friends #current_user.friends_not_in_aspect(@aspect) + @friends_not_in_aspect = current_user.friends_not_in_aspect(@aspect) unless @aspect render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404 else From a0d83e28a188bda6c9169f588965d55cd7bbe0b9 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 28 Oct 2010 11:28:58 -0700 Subject: [PATCH 25/28] copy in manage page by clicking 'add a new friend' for now --- app/controllers/aspects_controller.rb | 7 +++++-- app/views/aspects/manage.html.haml | 2 +- app/views/requests/_new_request.haml | 5 +++-- app/views/shared/_add_friend_dropdown.html.haml | 2 ++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 9aa0c1d3a..6887e4bee 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -47,7 +47,6 @@ class AspectsController < ApplicationController def show @aspect = current_user.aspect_by_id params[:id] - @friends_not_in_aspect = current_user.friends_not_in_aspect(@aspect) unless @aspect render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404 else @@ -90,7 +89,11 @@ class AspectsController < ApplicationController flash[:error] = I18n.t 'aspects.add_to_aspect.failure' end - redirect_to aspect_path(params[:aspect_id]) + if params[:manage] + redirect_to aspects_manage_path + else + redirect_to aspect_path(params[:aspect_id]) + end end def remove_from_aspect diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index cbc5c0ff1..77ca7750d 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -67,6 +67,6 @@ .fancybox_content %div{:id => "add_request_pane_#{aspect.id}"} - = render "requests/new_request", :aspect => aspect + = render "requests/new_request", :aspect => aspect, :manage => true diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index 1f7355d2a..0ec66d163 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -8,8 +8,7 @@ =t('.add_a_new_friend_to') %i= aspect.name - - if @friends_not_in_aspect - = render('shared/add_friend_dropdown', :aspect => aspect, :friends => @friends_not_in_aspect) + = render 'shared/add_friend_dropdown', :aspect => aspect, :friends => current_user.friends_not_in_aspect(aspect), :manage => defined?(manage) = form_for Request.new do |fr_request| = fr_request.error_messages @@ -25,6 +24,8 @@ - if defined?(getting_started) = hidden_field_tag :getting_started, getting_started + - if defined?(manage) + = hidden_field_tag :manage, true = fr_request.submit diff --git a/app/views/shared/_add_friend_dropdown.html.haml b/app/views/shared/_add_friend_dropdown.html.haml index ee39fc6ad..6ca34e534 100644 --- a/app/views/shared/_add_friend_dropdown.html.haml +++ b/app/views/shared/_add_friend_dropdown.html.haml @@ -2,4 +2,6 @@ = form_tag '/aspects/add_to_aspect', :id => 'add_to_aspect' do = select_tag :friend_id, options_from_collection_for_select(friends, "id", "real_name"), :include_blank => true = hidden_field_tag :aspect_id, aspect.id + - if defined?(manage) + = hidden_field_tag :manage, true = submit_tag "add to #{aspect.name}" From d02c36b53a66fb5b5616606692b6157b09a39b4a Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 28 Oct 2010 11:30:45 -0700 Subject: [PATCH 26/28] quickfix in add_friend_dropdown --- app/views/shared/_add_friend_dropdown.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_add_friend_dropdown.html.haml b/app/views/shared/_add_friend_dropdown.html.haml index 6ca34e534..062f534b8 100644 --- a/app/views/shared/_add_friend_dropdown.html.haml +++ b/app/views/shared/_add_friend_dropdown.html.haml @@ -2,6 +2,6 @@ = form_tag '/aspects/add_to_aspect', :id => 'add_to_aspect' do = select_tag :friend_id, options_from_collection_for_select(friends, "id", "real_name"), :include_blank => true = hidden_field_tag :aspect_id, aspect.id - - if defined?(manage) + - if defined?(manage) && manage = hidden_field_tag :manage, true = submit_tag "add to #{aspect.name}" From f484eb957fb7f62414f76ea5b4a0c9147a5e2a21 Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Thu, 28 Oct 2010 12:13:39 -0700 Subject: [PATCH 27/28] comments now don't imbed the person in the xml --- app/models/comment.rb | 15 +++++- app/models/user.rb | 2 +- lib/diaspora/user/receiving.rb | 4 +- spec/lib/diaspora/parser_spec.rb | 25 +++------- spec/models/comment_spec.rb | 44 +++++++----------- spec/models/person_spec.rb | 4 +- spec/models/user/attack_vectors_spec.rb | 24 ---------- spec/models/user/receive_spec.rb | 61 +++++++++++++++---------- 8 files changed, 76 insertions(+), 103 deletions(-) diff --git a/app/models/comment.rb b/app/models/comment.rb index 540b44f2e..e6686efce 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -2,6 +2,14 @@ # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. +class HandleValidator < ActiveModel::Validator + def validate(document) + unless document.diaspora_handle == document.person.diaspora_handle + document.errors[:base] << "Diaspora handle and person handle must match" + end + end +end + class Comment include MongoMapper::Document include ROXML @@ -10,18 +18,21 @@ class Comment include Diaspora::Socketable xml_accessor :text - xml_accessor :person, :as => Person + xml_reader :diaspora_handle xml_accessor :post_id xml_accessor :_id key :text, String key :post_id, ObjectId key :person_id, ObjectId + key :diaspora_handle, String belongs_to :post, :class_name => "Post" belongs_to :person, :class_name => "Person" - validates_presence_of :text + validates_presence_of :text, :diaspora_handle + validates_with HandleValidator + timestamps! diff --git a/app/models/user.rb b/app/models/user.rb index 82d103034..6b183874d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -275,7 +275,7 @@ class User def build_comment(text, options = {}) raise "must comment on something!" unless options[:on] - comment = Comment.new(:person_id => self.person.id, :text => text, :post => options[:on]) + comment = Comment.new(:person_id => self.person.id, :diaspora_handle => self.person.diaspora_handle, :text => text, :post => options[:on]) comment.creator_signature = comment.sign_with_key(encryption_key) if comment.save comment diff --git a/lib/diaspora/user/receiving.rb b/lib/diaspora/user/receiving.rb index bcf8897f1..19732552f 100644 --- a/lib/diaspora/user/receiving.rb +++ b/lib/diaspora/user/receiving.rb @@ -44,6 +44,7 @@ module Diaspora elsif object.is_a? Profile sender = Diaspora::Parser.owner_id_from_xml xml elsif object.is_a?(Comment) + object.person = Person.by_webfinger(object.diaspora_handle) sender = (owns?(object.post))? object.person : object.post.person else sender = object.person @@ -82,14 +83,13 @@ module Diaspora end def receive_comment comment, xml - comment.person = Diaspora::Parser.parse_or_find_person_from_xml( xml ).save if comment.person.nil? raise "In receive for #{self.real_name}, signature was not valid on: #{comment.inspect}" unless comment.post.person == self.person || comment.verify_post_creator_signature self.visible_people = self.visible_people | [comment.person] self.save Rails.logger.debug("The person parsed from comment xml is #{comment.person.inspect}") unless comment.person.nil? comment.person.save Rails.logger.debug("From: #{comment.person.inspect}") if comment.person - comment.save + comment.save! unless owns?(comment) dispatch_comment comment end diff --git a/spec/lib/diaspora/parser_spec.rb b/spec/lib/diaspora/parser_spec.rb index 4ee82da6b..db980cf6f 100644 --- a/spec/lib/diaspora/parser_spec.rb +++ b/spec/lib/diaspora/parser_spec.rb @@ -13,31 +13,18 @@ describe Diaspora::Parser do let(:person) { user3.person } describe "parsing compliant XML object" do - it 'should be able to correctly handle comments with person in db' do + it 'should be able to correctly parse comment fields' do post = user.post :status_message, :message => "hello", :to => aspect.id - comment = Factory.build(:comment, :post => post, :person => person, :text => "Freedom!") + comment = Factory.create(:comment, :post => post, :person => person, :diaspora_handle => person.diaspora_handle, :text => "Freedom!") comment.delete xml = comment.to_diaspora_xml + puts xml comment_from_xml = Diaspora::Parser.from_xml(xml) - comment_from_xml.text.should == "Freedom!" - comment_from_xml.person.should == person + comment_from_xml.diaspora_handle person.diaspora_handle comment_from_xml.post.should == post - end - - it 'should be able to correctly handle person on a comment with person not in db' do - friend_users(user, aspect, user2, aspect2) - post = user.post :status_message, :message => "hello", :to => aspect.id - comment = user2.comment "Fool!", :on => post - - xml = comment.to_diaspora_xml - user2.delete - user2.person.delete - - parsed_person = Diaspora::Parser::parse_or_find_person_from_xml(xml) - parsed_person.save.should be true - parsed_person.diaspora_handle.should == user2.person.diaspora_handle - parsed_person.profile.should_not be_nil + comment_from_xml.text.should == "Freedom!" + comment_from_xml.should_not be comment end it 'should accept retractions' do diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index 66056789d..70b99582a 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -11,6 +11,13 @@ describe Comment do let(:user2) {Factory.create(:user)} let(:aspect2) {user2.aspect(:name => "Lame-faces")} + it 'validates that the handle belongs to the person' do + user_status = user.post(:status_message, :message => "hello", :to => aspect.id) + comment = Comment.new(:person_id => user2.person.id, :text => "hey", :post => user_status) + comment.valid? + comment.errors.full_messages.should include "Diaspora handle and person handle must match" + end + describe 'User#comment' do before do @status = user.post(:status_message, :message => "hello", :to => aspect.id) @@ -52,28 +59,6 @@ describe Comment do user.reload end - it 'should receive a comment from a person not on the pod' do - user3 = Factory.create(:user) - aspect3 = user3.aspect(:name => "blah") - - friend_users(user, aspect, user3, aspect3) - - comment = Comment.new(:person_id => user3.person.id, :text => "hey", :post => @user_status) - comment.creator_signature = comment.sign_with_key(user3.encryption_key) - comment.post_creator_signature = comment.sign_with_key(user.encryption_key) - - xml = user.salmon(comment).xml_for(user2) - - user3.person.delete - user3.delete - - @user_status.reload - @user_status.comments.should == [] - user2.receive_salmon(xml) - @user_status.reload - @user_status.comments.include?(comment).should be true - end - it "should send a user's comment on a person's post to that person" do User::QUEUE.should_receive(:add_post_request) user.comment "yo", :on => @person_status @@ -86,8 +71,9 @@ describe Comment do end it 'should send a comment a person made on your post to all people' do - comment = Comment.new(:person_id => @person.id, :text => "balls", :post => @user_status) + comment = Comment.new(:person_id => @person.id, :diaspora_handle => @person.diaspora_handle, :text => "cats", :post => @user_status) User::QUEUE.should_receive(:add_post_request).twice + Person.should_receive(:by_webfinger).and_return(@person) user.receive comment.to_diaspora_xml, @person end @@ -103,13 +89,13 @@ describe Comment do end it 'should not send a comment a person made on his own post to anyone' do User::QUEUE.should_not_receive(:add_post_request) - comment = Comment.new(:person_id => @person.id, :text => "balls", :post => @person_status) + comment = Comment.new(:person_id => @person.id, :diaspora_handle => @person.diaspora_handle, :text => "cats", :post => @person_status) user.receive comment.to_diaspora_xml, @person end it 'should not send a comment a person made on a person post to anyone' do User::QUEUE.should_not_receive(:add_post_request) - comment = Comment.new(:person_id => @person2.id, :text => "balls", :post => @person_status) + comment = Comment.new(:person_id => @person2.id, :diaspora_handle => @person.diaspora_handle, :text => "cats", :post => @person_status) user.receive comment.to_diaspora_xml, @person end after(:all) do @@ -119,7 +105,7 @@ describe Comment do it 'should not clear the aspect post array on receiving a comment' do aspect.post_ids.include?(@user_status.id).should be true - comment = Comment.new(:person_id => @person.id, :text => "balls", :post => @user_status) + comment = Comment.new(:person_id => @person.id, :diaspora_handle => @person.diaspora_handle, :text => "cats", :post => @user_status) user.receive comment.to_diaspora_xml, @person @@ -128,14 +114,16 @@ describe Comment do end end describe 'serialization' do - it 'should serialize the commenter' do + it 'should serialize the handle and not the sender' do commenter = Factory.create(:user) commenter_aspect = commenter.aspect :name => "bruisers" friend_users(user, aspect, commenter, commenter_aspect) post = user.post :status_message, :message => "hello", :to => aspect.id comment = commenter.comment "Fool!", :on => post comment.person.should_not == user.person - comment.to_diaspora_xml.include?(commenter.person.id.to_s).should be true + xml = comment.to_diaspora_xml + xml.include?(commenter.person.id.to_s).should be false + xml.include?(commenter.diaspora_handle).should be true end end diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index fa89610af..8fe333955 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -91,8 +91,8 @@ describe Person do status_message = Factory.create(:status_message, :person => @person) - Factory.create(:comment, :person_id => person.id, :text => "i love you", :post => status_message) - Factory.create(:comment, :person_id => @person.id, :text => "you are creepy", :post => status_message) + Factory.create(:comment, :person_id => person.id, :diaspora_handle => person.diaspora_handle, :text => "i love you", :post => status_message) + Factory.create(:comment, :person_id => @person.id,:diaspora_handle => @person.diaspora_handle, :text => "you are creepy", :post => status_message) lambda {person.destroy}.should_not change(Comment, :count) end diff --git a/spec/models/user/attack_vectors_spec.rb b/spec/models/user/attack_vectors_spec.rb index 36a586647..db5c613a2 100644 --- a/spec/models/user/attack_vectors_spec.rb +++ b/spec/models/user/attack_vectors_spec.rb @@ -79,29 +79,5 @@ describe "attack vectors" do user2.reload user2.profile.first_name.should == first_name end - - it 'should not overwrite another persons profile through comment' do - pending - user_status = user.post(:status_message, :message => "hi", :to => 'all') - comment = Comment.new(:person_id => user3.person.id, :text => "hey", :post => user_status) - - comment.creator_signature = comment.sign_with_key(user3.encryption_key) - comment.post_creator_signature = comment.sign_with_key(user.encryption_key) - - person = user3.person - original_url = person.url - original_id = person.id - puts original_url - - comment.person.url = "http://bad.com/" - user3.delete - person.delete - - comment.to_diaspora_xml.include?("bad.com").should be true - user2.receive_salmon(user.salmon(comment).xml_for(user2.person)) - - comment.person.url.should == original_url - Person.first(:id => original_id).url.should == original_url - end end end diff --git a/spec/models/user/receive_spec.rb b/spec/models/user/receive_spec.rb index e339c56fc..1ff2012e8 100644 --- a/spec/models/user/receive_spec.rb +++ b/spec/models/user/receive_spec.rb @@ -94,36 +94,47 @@ describe User do describe 'comments' do before do friend_users(user, aspect, user3, aspect3) + @post = user.post :status_message, :message => "hello", :to => aspect.id + + user2.receive @post.to_diaspora_xml, user.person + user3.receive @post.to_diaspora_xml, user.person + + @comment = user3.comment('tada',:on => @post) + @comment.post_creator_signature = @comment.sign_with_key(user.encryption_key) + @xml = user.salmon(@comment).xml_for(user2.person) + @comment.delete end + it 'should correctly attach the user already on the pod' do + local_person = user3.person + + user2.reload.raw_visible_posts.size.should == 1 + post_in_db = user2.raw_visible_posts.first + post_in_db.comments.should == [] + user2.receive_salmon(@xml) + post_in_db.reload + + post_in_db.comments.include?(@comment).should be true + post_in_db.comments.first.person.should == local_person + end + it 'should correctly marshal a stranger for the downstream user' do + remote_person = user3.person + remote_person.delete + user3.delete - post = user.post :status_message, :message => "hello", :to => aspect.id + Person.should_receive(:by_webfinger).twice.and_return{ |handle| if handle == user.person.diaspora_handle; user.person.save + user.person; else; remote_person.save; remote_person; end } - user2.receive post.to_diaspora_xml, user.person - user3.receive post.to_diaspora_xml, user.person - - comment = user2.comment('tada',:on => post) - user.receive comment.to_diaspora_xml, user2.person - user.reload - - commenter_id = user2.person.id - - user2.person.delete - user2.delete - comment_id = comment.id - - comment.delete - comment.post_creator_signature = comment.sign_with_key(user.encryption_key) - user3.receive comment.to_diaspora_xml, user.person - user3.reload - - new_comment = Comment.find_by_id(comment_id) - new_comment.should_not be_nil - new_comment.person.should_not be_nil - new_comment.person.profile.should_not be_nil - - user3.visible_person_by_id(commenter_id).should_not be_nil + + user2.reload.raw_visible_posts.size.should == 1 + post_in_db = user2.raw_visible_posts.first + post_in_db.comments.should == [] + user2.receive_salmon(@xml) + post_in_db.reload + + post_in_db.comments.include?(@comment).should be true + post_in_db.comments.first.person.should == remote_person end end From 0dcffc62274c49758bbff821c117ad15e3ceb418 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 28 Oct 2010 14:07:52 -0700 Subject: [PATCH 28/28] made 404 page message clearer. --- public/404.html | 6 ++---- public/images/404.png | Bin 0 -> 17649 bytes 2 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 public/images/404.png diff --git a/public/404.html b/public/404.html index 13597a69a..02624c38a 100644 --- a/public/404.html +++ b/public/404.html @@ -18,9 +18,7 @@ -
      -

      The page you were looking for doesn't exist.

      -

      You should try going outside.

      -
      + + diff --git a/public/images/404.png b/public/images/404.png new file mode 100644 index 0000000000000000000000000000000000000000..f7a87253295485fdf416c3200c71f106c2f598ae GIT binary patch literal 17649 zcmXtg1yozl(>6|Vm!buV2Ps;-Kq*>WLa`JtQXGm~p;&R!;#NFBaEIXT5Zp@9;O>0+ z{onJ=IXU;UO<{^ zx(diEk|_U2?EfRt|B>SV$l!lu^FR9bKZ^Jt{rVpj|Bo8}NB#Z%^Yin&ySqFGB%S9A!5b>su+9HOjYx&uqS5_AT_wsGb z8QXKm^;5f8d9R=&r{nGYYkz5o{gAn)VT083)erCR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