Skip to content
Extraits de code Groupes Projets
Valider aa0aaa2f rédigé par Pistos's avatar Pistos
Parcourir les fichiers

Revert "Merge pull request #2428 from geckoxx/comment_stream"

This reverts commit 8a275682, reversing
changes made to 31ef2d60.

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
parent cec1f092
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# 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
...@@ -22,8 +22,6 @@ module StreamHelper ...@@ -22,8 +22,6 @@ module StreamHelper
public_stream_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order]) public_stream_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order])
elsif controller.instance_of?(AspectsController) 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]) 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) elsif controller.instance_of?(LikeStreamController)
like_stream_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order]) like_stream_path(:max_time => time_for_scroll(opts[:ajax_stream], @stream), :sort_order => session[:sort_order])
else else
......
...@@ -41,10 +41,6 @@ class StatusMessage < Post ...@@ -41,10 +41,6 @@ class StatusMessage < Post
joins(:likes).where(:likes => {:author_id => person.id}) 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) def self.user_tag_stream(user, tag_ids)
owned_or_visible_by_user(user). owned_or_visible_by_user(user).
tag_stream(tag_ids) tag_stream(tag_ids)
......
...@@ -43,12 +43,6 @@ ...@@ -43,12 +43,6 @@
%b %b
= link_to t('streams.mentions.title'), mentions_path, :class => 'home_selector' = 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 .section
%ul.left_nav %ul.left_nav
%li %li
......
...@@ -889,10 +889,6 @@ en: ...@@ -889,10 +889,6 @@ en:
title: "@Mentions" title: "@Mentions"
contacts_title: "People who mentioned you" contacts_title: "People who mentioned you"
comment_stream:
title: "Commented Posts"
contacts_title: "People who posts you commented"
like_stream: like_stream:
title: "Like Stream" title: "Like Stream"
contacts_title: "People who Posts you like" contacts_title: "People who Posts you like"
......
...@@ -59,8 +59,6 @@ Diaspora::Application.routes.draw do ...@@ -59,8 +59,6 @@ Diaspora::Application.routes.draw do
resources :mentions, :only => [:index] resources :mentions, :only => [:index]
resources "tag_followings", :only => [:create] resources "tag_followings", :only => [:create]
get 'comment_stream' => 'comment_stream#index', :as => 'comment_stream'
get 'like_stream' => 'like_stream#index', :as => 'like_stream' get 'like_stream' => 'like_stream#index', :as => 'like_stream'
get 'tags/:name' => 'tags#show', :as => 'tag' get 'tags/:name' => 'tags#show', :as => 'tag'
...@@ -188,7 +186,7 @@ Diaspora::Application.routes.draw do ...@@ -188,7 +186,7 @@ Diaspora::Application.routes.draw do
#Protocol Url #Protocol Url
get 'protocol' => redirect("https://github.com/diaspora/diaspora/wiki/Diaspora%27s-federation-protocol") get 'protocol' => redirect("https://github.com/diaspora/diaspora/wiki/Diaspora%27s-federation-protocol")
# Resque web # Resque web
if AppConfig[:mount_resque_web] if AppConfig[:mount_resque_web]
mount Resque::Server.new, :at => '/resque-jobs', :as => "resque_web" mount Resque::Server.new, :at => '/resque-jobs', :as => "resque_web"
......
# 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
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");
});
};
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
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter