diff --git a/app/controllers/apis_controller.rb b/app/controllers/apis_controller.rb index af8fe2c24..4bad3f232 100644 --- a/app/controllers/apis_controller.rb +++ b/app/controllers/apis_controller.rb @@ -31,7 +31,7 @@ class ApisController < ApplicationController #We should start with this versione def home_timeline set_defaults timeline = current_user.visible_posts(:max_time => params[:max_time], - :per_page => params[:per_page], + :limit => params[:per_page], :order => "#{params[:order]} DESC").includes(:comments, :photos, :likes, :dislikes) respond_with timeline do |format| format.json{ render :json => timeline.to_json(:format => :twitter) } diff --git a/app/views/shared/_stream_element.html.haml b/app/views/shared/_stream_element.html.haml index b2ef0b58c..cfbfbdfee 100644 --- a/app/views/shared/_stream_element.html.haml +++ b/app/views/shared/_stream_element.html.haml @@ -21,7 +21,7 @@ .content .from = person_link(post.author, :class => 'author') - %time.timeago{:datetime => post.created_at, :integer => post.created_at.to_i} + %time.time.timeago{:datetime => post.created_at, :integer => post.created_at.to_i} = render 'status_messages/status_message', :post => post, :photos => post.photos .info @@ -33,7 +33,7 @@ %span.aspect_badges = aspect_badges(aspects_with_post(all_aspects, post), :link => true) - %span.timeago + %span.timeago.time = link_to(how_long_ago(post), status_message_path(post)) - unless (defined?(@commenting_disabled) && @commenting_disabled) diff --git a/app/views/shared/_stream_element.mobile.haml b/app/views/shared/_stream_element.mobile.haml index 1b00a09a7..82a342790 100644 --- a/app/views/shared/_stream_element.mobile.haml +++ b/app/views/shared/_stream_element.mobile.haml @@ -12,6 +12,6 @@ = render 'status_messages/status_message', :post => post, :photos => post.photos .info - %span.time + %span.time{:integer => post.created_at.to_i} = t('ago', :time => time_ago_in_words(post.created_at)) = link_to "#{t('comments', :count => post.comments.length)} →", status_message_path(post), :class => 'comment_link right' diff --git a/public/javascripts/infinite-scroll.js b/public/javascripts/infinite-scroll.js index 6f0b239df..68c158d90 100644 --- a/public/javascripts/infinite-scroll.js +++ b/public/javascripts/infinite-scroll.js @@ -7,10 +7,8 @@ var InfiniteScroll = { itemSelector : ".stream_element", // selector for all items you'll retrieve pathParse : function( pathStr, nextPage ){ - console.log(pathStr); - console.log(nextPage); var newPath = pathStr.replace("?", "?only_posts=true&"); - var last_time = $('#main_stream .stream_element').last().find('time.timeago').attr('integer'); + var last_time = $('#main_stream .stream_element').last().find('.time').attr('integer'); return newPath.replace( /max_time=\d+/, 'max_time=' + last_time); }, bufferPx: 500,