From c8c0b5c8a2e600f1960aacbaa94b0710e0d2e750 Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Thu, 18 Nov 2010 14:27:44 -0800 Subject: [PATCH 1/3] made the service image the same size --- app/views/shared/_publisher.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 3e2fd0025..f196a5f7b 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -44,7 +44,7 @@ = image_tag("social_media_logos/feed-16x16.png") - if current_user.services - for service in current_user.services - = image_tag("social_media_logos/#{service.provider}-24x24.png") + = image_tag("social_media_logos/#{service.provider}-16x16.png") = link_to '(?)', "#question_mark_pane", :class => 'question_mark', :style=>"display:none;" From 0e171e85043f98c02ccde25b231575e1bba9ffa2 Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Thu, 18 Nov 2010 15:22:03 -0800 Subject: [PATCH 2/3] added a fixed the pending request query --- app/controllers/people_controller.rb | 2 +- app/views/people/_person.html.haml | 2 +- lib/diaspora/user/querying.rb | 3 +++ spec/models/user/querying_spec.rb | 15 +++++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 1b10ef424..dec2524ba 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -36,7 +36,7 @@ class PeopleController < ApplicationController if @contact @aspects_with_person = @contact.aspects else - @pending_request = current_user.pending_requests.find_by_person_id(@person.id) + @pending_request = current_user.request_for(@person) end @posts = current_user.visible_posts(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC' diff --git a/app/views/people/_person.html.haml b/app/views/people/_person.html.haml index b0c94bbe3..5afce753f 100644 --- a/app/views/people/_person.html.haml +++ b/app/views/people/_person.html.haml @@ -15,7 +15,7 @@ = t('.thats_you') - elsif current_user.person_objects.include?(person) = t('.already_connected') - - elsif current_user.pending_requests.find_by_person_id(person.id) + - elsif current_user.request_for(person) = link_to =t('.pending_request'), aspects_manage_path - else - single_aspect_form ||= nil diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index c864c4908..1f7718f50 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -84,6 +84,9 @@ module Diaspora self.aspects.all.collect{|x| x.id} end + def request_for(to_person) + Request.first(:from_id => self.person.id, :to_id => to_person.id).first + end end end end diff --git a/spec/models/user/querying_spec.rb b/spec/models/user/querying_spec.rb index e981b436e..c6ab423cc 100644 --- a/spec/models/user/querying_spec.rb +++ b/spec/models/user/querying_spec.rb @@ -173,4 +173,19 @@ describe User do end end + describe "#request_for" do + let!(:user5) {make_user} + + it 'should not have a pending request before connecting' do + request = user.request_for(user5.person) + request.should be_nil + end + + it 'should have a pending request after sending a request' do + user.send_contact_request_to(user5.person, user.aspects.first) + request = user.reload.request_for(user5.person) + request.should_not be_nil + end + end + end From 5b8eb2cacd9d81e6542c3b51c1121f3e3435e73f Mon Sep 17 00:00:00 2001 From: Alec Leamas Date: Fri, 19 Nov 2010 00:34:10 +0100 Subject: [PATCH 3/3] Production/test mode somment in config/server.sh --- config/server.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/server.sh b/config/server.sh index 8fe715c97..73fe1dcd1 100644 --- a/config/server.sh +++ b/config/server.sh @@ -7,5 +7,6 @@ SOCKET_PORT=8080 # See thin -h for possible values. DEFAULT_THIN_ARGS="-p $THIN_PORT" -# Uncomment to run in production mode. -#export RAILS_ENV="production rails server" +# Uncomment to run in production/test mode. +# DEFAULT_THIN_ARGs="$DEFAULT_THIN_ARGS -e production" +# DEFAULT_THIN_ARGs="$DEFAULT_THIN_ARGS -e test"