From bc058332d368c5429ca02e8680b48de00b3c015d Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Tue, 1 Feb 2011 12:54:05 -0800 Subject: [PATCH 1/2] commented on post email now includes the comment --- app/views/notifier/comment_on_post.text.haml | 1 + config/locales/diaspora/en.yml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/notifier/comment_on_post.text.haml b/app/views/notifier/comment_on_post.text.haml index 29375760c..ae94e8f0e 100644 --- a/app/views/notifier/comment_on_post.text.haml +++ b/app/views/notifier/comment_on_post.text.haml @@ -2,6 +2,7 @@ = "#{@sender.name} (#{@sender.diaspora_handle})" = t('notifier.comment_on_post.commented') += @comment.text = "#{t('notifier.love')} \n" = t('notifier.diaspora') diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index e2d361fc2..9b50272b5 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -460,13 +460,14 @@ en: subject: "new Diaspora* contact request from %{from}" just_sent_you: "just sent you a contact request on Diaspora*" try_it_out: "You should really think about checking it out." - sign_in: "sign in here" + sign_in: "Sign in here" request_accepted: subject: "%{name} has accepted your contact request on Diaspora*" accepted: "has accepted your contact request!" + sign_in: "Sign in here" comment_on_post: subject: "%{name} has commented on your post." - commented: "has commented on your post!" + commented: "has commented on your post:" sign_in: "Sign in to view it." also_commented: subject: "%{name} has also commented." From cfd6639f4d3afb831470bfc72cf8220100bfe380 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 1 Feb 2011 13:15:20 -0800 Subject: [PATCH 2/2] Revert "Merge branch 'open-aspects'" This reverts commit 181bd823c4fc64b44c9777b7f6440cf2214a90cd, reversing changes made to 2c3ed2ab73112dd903731f9c6e492d497b513b39. --- app/controllers/aspects_controller.rb | 2 - app/controllers/home_controller.rb | 6 +- app/models/user.rb | 3 - app/views/layouts/_header.html.haml | 2 +- ...20110201013408_add_open_aspects_to_user.rb | 9 --- db/schema.rb | 5 +- features/saved_state.feature | 56 ------------------- features/step_definitions/user_steps.rb | 12 ---- spec/controllers/aspects_controller_spec.rb | 18 ------ spec/controllers/home_controller_spec.rb | 13 +---- 10 files changed, 6 insertions(+), 120 deletions(-) delete mode 100644 db/migrate/20110201013408_add_open_aspects_to_user.rb delete mode 100644 features/saved_state.feature diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 96fdceab1..46321e441 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -15,8 +15,6 @@ class AspectsController < ApplicationController else @aspects = current_user.aspects.includes(:contacts => {:person => :profile}) end - current_user.open_aspects = params[:a_ids] - current_user.save # redirect to signup if current_user.getting_started == true || @aspects.blank? diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index e4529226e..60a53a381 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -6,11 +6,7 @@ class HomeController < ApplicationController def show if current_user - if params[:home] - redirect_to :controller => 'aspects', :action => 'index' - else - redirect_to :controller => 'aspects', :action => 'index', :a_ids => current_user.open_aspects - end + redirect_to aspects_path elsif is_mobile_device? redirect_to user_session_path else diff --git a/app/models/user.rb b/app/models/user.rb index e303b248e..0f850180b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -38,9 +38,6 @@ class User < ActiveRecord::Base has_many :contact_people, :through => :contacts has_many :services - serialize :open_aspects, Array - - before_destroy :disconnect_everyone, :remove_person before_save do person.save if person diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 3f1a46dfe..b7002efad 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -42,7 +42,7 @@ -unless @landing_page %ul#aspect_nav %li{:class => ('selected' if @aspect == :all)} - = link_to t('_home'), root_path(:home => true), :class => 'home_selector' + = link_to t('_home'), root_path, :class => 'home_selector' - for aspect in @all_aspects %li{:data=>{:guid=>aspect.id}, :class => ("selected" if @object_aspect_ids.include?(aspect.id))} diff --git a/db/migrate/20110201013408_add_open_aspects_to_user.rb b/db/migrate/20110201013408_add_open_aspects_to_user.rb deleted file mode 100644 index ddc214129..000000000 --- a/db/migrate/20110201013408_add_open_aspects_to_user.rb +++ /dev/null @@ -1,9 +0,0 @@ -class AddOpenAspectsToUser < ActiveRecord::Migration - def self.up - add_column(:users, :open_aspects, :text) - end - - def self.down - remove_column(:users, :open_aspects) - end -end diff --git a/db/schema.rb b/db/schema.rb index ad00b9575..78e1b15fe 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110201013408) do +ActiveRecord::Schema.define(:version => 20110130072907) do create_table "aspect_memberships", :force => true do |t| t.integer "aspect_id", :null => false @@ -312,8 +312,10 @@ ActiveRecord::Schema.define(:version => 20110201013408) do t.boolean "unread", :default => true, :null => false t.datetime "created_at" t.datetime "updated_at" + t.string "mongo_id" end + add_index "notifications", ["mongo_id"], :name => "index_notifications_on_mongo_id" add_index "notifications", ["recipient_id"], :name => "index_notifications_on_recipient_id" add_index "notifications", ["target_id"], :name => "index_notifications_on_target_id" add_index "notifications", ["target_type", "target_id"], :name => "index_notifications_on_target_type_and_target_id" @@ -458,7 +460,6 @@ ActiveRecord::Schema.define(:version => 20110201013408) do t.string "mongo_id" t.string "invitation_service" t.string "invitation_identifier" - t.text "open_aspects" end add_index "users", ["email"], :name => "index_users_on_email" diff --git a/features/saved_state.feature b/features/saved_state.feature deleted file mode 100644 index b8e5e26ff..000000000 --- a/features/saved_state.feature +++ /dev/null @@ -1,56 +0,0 @@ -@javascript -Feature: saved state - Scenario: open aspects persist across sessions - Given I am signed in - And I have an aspect called "Open 1" - And I have an aspect called "Closed 1" - And I have an aspect called "Closed 2" - And I have an aspect called "Open 2" - And I am on the aspects page - When I follow "Open 1" - And I follow "Open 2" - - Then I should have aspect "Open 1" "selected" - Then I should have aspect "Open 2" "selected" - Then I should have aspect "Closed 1" "not selected" - Then I should have aspect "Closed 2" "not selected" - - And I click on my name in the header - And I follow "logout" - - And I go to the new user session page - - And I am signed in - - Then I should be on the aspects page - Then I should have aspect "Open 1" "selected" - But I should have aspect "Open 2" "selected" - But I should have aspect "Closed 1" "not selected" - But I should have aspect "Closed 2" "not selected" - - And I follow "Home" - Then I should have aspect "Home" "selected" - - Scenario: home persists across sessions - Given I am signed in - And I have an aspect called "Closed 1" - And I have an aspect called "Closed 2" - And I am on the aspects page - When I follow "Closed 1" - When I follow "Home" - - Then I should have aspect "Home" "selected" - Then I should have aspect "Closed 1" "not selected" - Then I should have aspect "Closed 2" "not selected" - - And I click on my name in the header - And I follow "logout" - - And I go to the new user session page - - And I am signed in - - Then I should be on the aspects page - Then I should have aspect "Home" "selected" - Then I should have aspect "Closed 1" "not selected" - Then I should have aspect "Closed 2" "not selected" diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 3ce3cf4f3..76d6840b6 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -71,15 +71,3 @@ end When /^I click on the contact request$/ do find(".person.request.ui-draggable a").click end - -Then /^I should have aspect "([^"]*)" "([^"]*)"$/ do |arg1, arg2| - val = evaluate_script("$('a:contains(\"#{arg1}\")').parent('li').hasClass('selected');") # - if arg2 == "selected" - val.should == true - elsif arg2 == "not selected" - val.should == false - else - raise "Aspect state should either be 'selected' or 'not selected'" - end -end - diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index 9e20ff0c8..11fe163a3 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -87,23 +87,6 @@ describe AspectsController do get :index, :a_ids => [@aspect0.id.to_s, @aspect1.id.to_s] assigns(:posts).length.should == 8 end - - context "storing state" do - before do - @index_params = {:a_ids => [@aspect0.id.to_s, @aspect1.id.to_s]} - end - it "stores the aspect params in the user" do - get :index, @index_params - @user.reload.open_aspects.should == @index_params[:a_ids] - end - - it "correctly stores the aspect params" do - @user.open_aspects = @index_params[:a_ids] - @user.save - get :index - @user.reload.open_aspects.should == nil - end - end end context 'performance' do @@ -336,7 +319,6 @@ describe AspectsController do describe "#hashes_for_posts" do it 'returns only distinct people' do - pending end end end diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb index aa476e343..fd151a0b4 100644 --- a/spec/controllers/home_controller_spec.rb +++ b/spec/controllers/home_controller_spec.rb @@ -23,18 +23,7 @@ describe HomeController do it 'redirects to aspects index if user is logged in' do sign_in @user get :show - response.should redirect_to( :controller => 'aspects', :action => 'index') - end - - it 'redirects to aspects index with stored aspects' do - sign_in @user - @aspect0 = @user.aspects.all[0] - @aspect1 = @user.aspects.create(:name => "Yeaaaah!") - @index_params = {:a_ids => [@aspect0.id.to_s, @aspect1.id.to_s]} - @user.open_aspects = @index_params[:a_ids] - @user.save - get :show - response.should redirect_to( :controller => 'aspects', :action => 'index', :a_ids => @index_params[:a_ids] ) + response.should redirect_to aspects_path end end