From 319f87f9a83639fe08e0aa27266248b537bbe809 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 24 Aug 2010 12:29:00 -0700 Subject: [PATCH 1/7] trying setting profile photos --- db/seeds/backer.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index bc5039aa1..64e1522b5 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -19,7 +19,8 @@ def create :password => "#{username+backer_info[backer_number]['pin'].to_s}", :person => Person.new( :email => "#{username}@#{username}.joindiaspora.com", - :profile => Profile.new( :first_name => backer_info[backer_number]['given_name'], :last_name => backer_info[backer_number]['family_name'] ), + :profile => Profile.new( :first_name => backer_info[backer_number]['given_name'], :last_name => backer_info[backer_number]['family_name'] + , :image_url => "http://#{username}.joindiaspora.com/images/users/#{username}.jpg"), :url=> "http://#{username}.joindiaspora.com/") ) user.person.save From b4ab91043a98103df71cc81a344d113c907ec1ff Mon Sep 17 00:00:00 2001 From: maxwell Date: Tue, 24 Aug 2010 13:45:38 -0700 Subject: [PATCH 2/7] MS added check for current user --- app/controllers/application_controller.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4e9654c72..2d1c32ecb 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -16,9 +16,11 @@ class ApplicationController < ActionController::Base end def set_friends_and_status - @group = :all - @groups = current_user.groups - @friends = current_user.friends + unless current_user.nil? + @group = :all + @groups = current_user.groups + @friends = current_user.friends + end end def count_requests From 2c9a1e3a43ba642da1066930dcbe60ab5b0c5ad7 Mon Sep 17 00:00:00 2001 From: maxwell Date: Tue, 24 Aug 2010 13:47:58 -0700 Subject: [PATCH 3/7] added wall spec --- spec/models/person_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index ad4d00e2b..64869df86 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -144,5 +144,18 @@ describe Person do it 'should search by email exactly' do Person.by_webfinger(@friend_one.email).should == @friend_one end + + describe 'wall posting' do + it 'should be able to post on another persons wall' do + + #user2 is in user's group, user is in group2 on user + friend_users(@user, @group, @user2, @group2) + + @user.person.post_to_wall(:person => @user2.person, :message => "youve got a great smile") + @user.person.wall_posts.count.should == 1 + + end + end + end end From cc1f1e2f24bc3ae56de262106435080c8d626f5c Mon Sep 17 00:00:00 2001 From: maxwell Date: Tue, 24 Aug 2010 14:16:54 -0700 Subject: [PATCH 4/7] removed the plus button from the all people add a friend page --- app/views/shared/_group_nav.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_group_nav.haml b/app/views/shared/_group_nav.haml index 427f97289..a2aaba4e9 100644 --- a/app/views/shared/_group_nav.haml +++ b/app/views/shared/_group_nav.haml @@ -1,9 +1,10 @@ #friend_pictures - for friend in @friends = person_image_link(friend) - = link_to (image_tag 'add_friend_button.png'), "#add_request_pane", :id => 'add_request_button' - unless @group == :all + = link_to (image_tag 'add_friend_button.png'), "#add_request_pane", :id => 'add_request_button' + .yo{:style => 'display:none'} #add_request_pane = render "requests/new_request" From a70132fcdc4b39bb2b78c92cb790959d4dbd0d94 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 24 Aug 2010 14:22:21 -0700 Subject: [PATCH 5/7] IZ we update profile in zombie friends accept --- app/controllers/dev_utilities_controller.rb | 12 ++++++++++++ db/seeds/backer.rb | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb index 5fa140597..b462abd43 100644 --- a/app/controllers/dev_utilities_controller.rb +++ b/app/controllers/dev_utilities_controller.rb @@ -37,6 +37,8 @@ def warzombie def zombiefriendaccept render :nothing => true + set_profile_photo + Request.all.each{|r| current_user.accept_and_respond(r.id, current_user.groups.first.id) } @@ -54,4 +56,14 @@ def warzombie file.write(seed_num_hash.to_yaml) file.close end + + def set_profile_photo + album = current_user.post(:album, :name => "Profile Photos") + + username = backer_info[backer_number]['username'].gsub(/ /,'').downcase + photo = current_user.post(:photo, :album_id => album.id, + :user_file => "public/images/users/#{username}.jpg") + + current_user.update_profile(:image_url => photo.url) + end end diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 64e1522b5..f8fe0dc97 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -19,11 +19,12 @@ def create :password => "#{username+backer_info[backer_number]['pin'].to_s}", :person => Person.new( :email => "#{username}@#{username}.joindiaspora.com", - :profile => Profile.new( :first_name => backer_info[backer_number]['given_name'], :last_name => backer_info[backer_number]['family_name'] - , :image_url => "http://#{username}.joindiaspora.com/images/users/#{username}.jpg"), + :profile => Profile.new( :first_name => backer_info[backer_number]['given_name'], :last_name => backer_info[backer_number]['family_name'], + :image_url => "http://#{username}.joindiaspora.com/images/users/#{username}.jpg"), :url=> "http://#{username}.joindiaspora.com/") ) user.person.save + user.group(:name => "Presidents") end From 27de7f930a8b9433b208d09b5c6733de5762d954 Mon Sep 17 00:00:00 2001 From: ilya Date: Tue, 24 Aug 2010 14:29:05 -0700 Subject: [PATCH 6/7] forgot the backer number set photo --- app/controllers/dev_utilities_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb index b462abd43..4282b8964 100644 --- a/app/controllers/dev_utilities_controller.rb +++ b/app/controllers/dev_utilities_controller.rb @@ -60,6 +60,7 @@ def warzombie def set_profile_photo album = current_user.post(:album, :name => "Profile Photos") + backer_number = YAML.load_file(Rails.root.join('config','backer_number.yml'))[:seed_number].to_i username = backer_info[backer_number]['username'].gsub(/ /,'').downcase photo = current_user.post(:photo, :album_id => album.id, :user_file => "public/images/users/#{username}.jpg") From de335e7366e9abd13161c383a9e7dec7834814c9 Mon Sep 17 00:00:00 2001 From: maxwell Date: Tue, 24 Aug 2010 14:37:47 -0700 Subject: [PATCH 7/7] MS messed with the temporary group picker thing: whatever, it is less annoying --- app/views/shared/_publisher.haml | 7 +++---- public/stylesheets/application.css | 13 +++++++++++-- public/stylesheets/sass/application.sass | 14 ++++++++++++-- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 59fdbbfb7..da57beff7 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -3,8 +3,8 @@ = form_for StatusMessage.new, :remote => true do |f| = f.error_messages - .span-15.last - .span-2.last + .span-15 + .span-2 .user_image = owner_image_tag .span-13.last @@ -12,8 +12,7 @@ %label{:for => "status_message_message"} Message = f.text_area :message, :rows => 2 - .span-3.last - + .span-3 %ul.group_selector going to... - for group in current_user.groups diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 24faf671b..34cfe4904 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -319,18 +319,27 @@ label { height: 50px; padding-left: 10px; } #publisher ul.group_selector { + float: left; padding: 0; margin: 0; - width: 150px; + width: auto; + z-index: 10; + position: absolute; + height: auto; + overflow: visible; list-style: none; } #publisher ul.group_selector > li { - z-index: 10; + height: auto; + font-size: smaller; + padding: 2px; display: none; background-color: white; } #publisher ul.group_selector > li:active { background-color: yellow; } #publisher ul.group_selector:hover li { display: block; } + #publisher .button { + margin-left: 100px; } #image_picker .small_photo { height: 100px; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 3e14cab06..b603e790e 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -397,14 +397,21 @@ label :left 10px ul.group_selector + :float left :padding 0 :margin 0 - :width 150px + :width auto + :z-index 10 + :position absolute + :height auto + :overflow visible :list :style none > li - :z-index 10 + :height auto + :font-size smaller + :padding 2px :display none :background :color #fff @@ -415,6 +422,9 @@ label &:hover li :display block + + .button + :margin-left 100px #image_picker