diff options
author | Benjamin Neff <benjamin@coding4coffee.ch> | 2016-08-26 22:04:57 +0300 |
---|---|---|
committer | Dennis Schubert <mail@dennis-schubert.de> | 2016-09-04 04:31:41 +0300 |
commit | 8c58206e63507c9152b91b2e431a9a44e01080ce (patch) | |
tree | e450e6e39da360d3a467cc8df53b3cd27c06b342 /app/helpers | |
parent | 4fea926057aa291b25a9739dcd33d344f9d1de3a (diff) |
Fix links of more-button on mobile streams
Fixes #6999
closes #7036
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/stream_helper.rb | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/app/helpers/stream_helper.rb b/app/helpers/stream_helper.rb index f3eb25415..73e23d25c 100644 --- a/app/helpers/stream_helper.rb +++ b/app/helpers/stream_helper.rb @@ -8,16 +8,8 @@ module StreamHelper 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 + next_stream_path else raise 'in order to use pagination for this new controller, update next_page_path in stream helper' end @@ -29,6 +21,24 @@ module StreamHelper private + def next_stream_path + if current_page?(:stream) + stream_path(max_time: time_for_scroll(@stream)) + elsif current_page?(:activity_stream) + activity_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]) + elsif current_page?(:public_stream) + public_stream_path(max_time: time_for_scroll(@stream)) + elsif current_page?(:mentioned_stream) + mentioned_stream_path(max_time: time_for_scroll(@stream)) + elsif current_page?(:followed_tags_stream) + followed_tags_stream_path(max_time: time_for_scroll(@stream)) + else + raise "in order to use pagination for this new stream, update next_stream_path in stream helper" + end + end + def time_for_scroll(stream) if stream.stream_posts.empty? (Time.now() + 1).to_i |