From aa0aaa2f92b69e996fcf51981f237168dca3ff68 Mon Sep 17 00:00:00 2001 From: Pistos <github.pistos@purepistos.net> Date: Wed, 30 Nov 2011 22:22:32 -0500 Subject: [PATCH] Revert "Merge pull request #2428 from geckoxx/comment_stream" This reverts commit 8a2756827390e1eef4daf21204687ced93d78468, reversing changes made to 31ef2d60f75233495d77c3d408cd8e199142e190. Conflicts: app/helpers/stream_helper.rb app/views/aspects/index.html.haml config/locales/diaspora/en.yml config/routes.rb spec/lib/stream/comments_spec.rb --- app/controllers/comment_stream_controller.rb | 11 ---------- app/helpers/stream_helper.rb | 2 -- app/models/status_message.rb | 4 ---- app/views/aspects/index.html.haml | 6 ----- config/locales/diaspora/en.yml | 4 ---- config/routes.rb | 4 +--- lib/stream/comments.rb | 22 ------------------- .../javascripts/pages/comment-stream-index.js | 10 --------- spec/lib/stream/comments_spec.rb | 12 ---------- 9 files changed, 1 insertion(+), 74 deletions(-) delete mode 100644 app/controllers/comment_stream_controller.rb delete mode 100644 lib/stream/comments.rb delete mode 100644 public/javascripts/pages/comment-stream-index.js delete mode 100644 spec/lib/stream/comments_spec.rb diff --git a/app/controllers/comment_stream_controller.rb b/app/controllers/comment_stream_controller.rb deleted file mode 100644 index e355790871..0000000000 --- a/app/controllers/comment_stream_controller.rb +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -require File.join(Rails.root, 'lib','stream', 'comments') - -class CommentStreamController < ApplicationController - def index - default_stream_action(Stream::Comments) - end -end diff --git a/app/helpers/stream_helper.rb b/app/helpers/stream_helper.rb index da00c5f0ca..70d83c7338 100644 --- a/app/helpers/stream_helper.rb +++ b/app/helpers/stream_helper.rb @@ -22,8 +22,6 @@ module StreamHelper public_stream_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order]) elsif controller.instance_of?(AspectsController) aspects_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :a_ids => @stream.aspect_ids, :sort_order => session[:sort_order]) - elsif controller.instance_of?(CommentStreamController) - comment_stream_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order]) elsif controller.instance_of?(LikeStreamController) like_stream_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order]) else diff --git a/app/models/status_message.rb b/app/models/status_message.rb index 8524d78d4a..6f8e756ae8 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -41,10 +41,6 @@ class StatusMessage < Post joins(:likes).where(:likes => {:author_id => person.id}) } - scope :commented_by, lambda { |person| - joins(:comments).where(:comments => {:author_id => person.id}).group("posts.id") - } - def self.user_tag_stream(user, tag_ids) owned_or_visible_by_user(user). tag_stream(tag_ids) diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 61cf89b7ba..240bd3b101 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -43,12 +43,6 @@ %b = link_to t('streams.mentions.title'), mentions_path, :class => 'home_selector' - .section - %ul.left_nav - %li - %b - = link_to t('streams.comment_stream.title'), comment_stream_path, :class => 'home_selector' - .section %ul.left_nav %li diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 2c4628cf8d..2da4f4e778 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -889,10 +889,6 @@ en: title: "@Mentions" contacts_title: "People who mentioned you" - comment_stream: - title: "Commented Posts" - contacts_title: "People who posts you commented" - like_stream: title: "Like Stream" contacts_title: "People who Posts you like" diff --git a/config/routes.rb b/config/routes.rb index fe6185b528..a25f05ada2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -59,8 +59,6 @@ Diaspora::Application.routes.draw do resources :mentions, :only => [:index] resources "tag_followings", :only => [:create] - get 'comment_stream' => 'comment_stream#index', :as => 'comment_stream' - get 'like_stream' => 'like_stream#index', :as => 'like_stream' get 'tags/:name' => 'tags#show', :as => 'tag' @@ -188,7 +186,7 @@ Diaspora::Application.routes.draw do #Protocol Url get 'protocol' => redirect("https://github.com/diaspora/diaspora/wiki/Diaspora%27s-federation-protocol") - + # Resque web if AppConfig[:mount_resque_web] mount Resque::Server.new, :at => '/resque-jobs', :as => "resque_web" diff --git a/lib/stream/comments.rb b/lib/stream/comments.rb deleted file mode 100644 index 68bd4e5e76..0000000000 --- a/lib/stream/comments.rb +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -class Stream::Comments < Stream::Base - def link(opts={}) - Rails.application.routes.url_helpers.comment_stream_path(opts) - end - - def title - I18n.translate("streams.comment_stream.title") - end - - # @return [ActiveRecord::Association<Post>] AR association of posts - def posts - @posts ||= StatusMessage.commented_by(self.user.person) - end - - def contacts_title - I18n.translate('streams.comment_stream.contacts_title') - end -end diff --git a/public/javascripts/pages/comment-stream-index.js b/public/javascripts/pages/comment-stream-index.js deleted file mode 100644 index f79f523658..0000000000 --- a/public/javascripts/pages/comment-stream-index.js +++ /dev/null @@ -1,10 +0,0 @@ -Diaspora.Pages.CommentStreamIndex = function() { - var self = this; - - this.subscribe("page/ready", function(evt, document) { - - self.aspectNavigation = self.instantiate("AspectNavigation", document.find("ul#aspect_nav")); - self.stream = self.instantiate("Stream", document.find("#aspect_stream_container")); - self.infiniteScroll = self.instantiate("InfiniteScroll"); - }); -}; diff --git a/spec/lib/stream/comments_spec.rb b/spec/lib/stream/comments_spec.rb deleted file mode 100644 index e18655a9ae..0000000000 --- a/spec/lib/stream/comments_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'spec_helper' -require File.join(Rails.root, 'spec', 'shared_behaviors', 'stream') - -describe Stream::Comments do - before do - @stream = Stream::Comments.new(alice, :max_time => Time.now, :order => 'updated_at') - end - - describe 'shared behaviors' do - it_should_behave_like 'it is a stream' - end -end -- GitLab