Module: StreamHelper

Defined in:
app/helpers/stream_helper.rb

Overview

Copyright © 2010-2011, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Instance Method Summary collapse

Instance Method Details

#next_page_path(opts = {}) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/stream_helper.rb', line 6

def next_page_path(opts ={})
  if controller.instance_of?(TagsController)
    tag_path(:name => @stream.tag_name, :max_time => time_for_scroll(@stream))
  elsif controller.instance_of?(PeopleController)
    local_or_remote_person_path(@person, :max_time => time_for_scroll(@stream))
  elsif controller.instance_of?(PostsController)
    public_stream_path(:max_time => time_for_scroll(@stream))
  elsif controller.instance_of?(StreamsController)
    if current_page?(:stream)
      stream_path(:max_time => time_for_scroll(@stream))
    elsif current_page?(:aspects_stream)
      aspects_stream_path(:max_time => time_for_scroll(@stream), :a_ids => session[:a_ids])
    else
      activity_stream_path(:max_time => time_for_scroll(@stream))
    end
  else
    raise 'in order to use pagination for this new controller, update next_page_path in stream helper'
  end
end

#reshare?(post) ⇒ Boolean


26
27
28
# File 'app/helpers/stream_helper.rb', line 26

def reshare?(post)
  post.instance_of?(Reshare)
end