about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-04 16:56:45 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-04 16:56:45 +0100
commitd236dcded20b1a561b1f396fbb423811f27c77e5 (patch)
treea852c6c894354bc5d6f233abc1b8d3f800975ac7
parent00e9dac1d356e0e3fba757f53c5e5a5a565b904b (diff)
Fix public tags page
-rw-r--r--app/controllers/tags_controller.rb5
-rw-r--r--app/views/tags/show.html.haml4
2 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb
index 4a70b2a8f..6b6c73080 100644
--- a/app/controllers/tags_controller.rb
+++ b/app/controllers/tags_controller.rb
@@ -4,7 +4,8 @@ class TagsController < ApplicationController
   layout 'public'
 
   def show
-    @statuses = Tag.find_by!(name: params[:id].downcase).statuses.order('id desc').paginate_by_max_id(20, params[:max_id] || nil)
-  	@statuses = cache_collection(@statuses, Status)
+    @tag      = Tag.find_by!(name: params[:id].downcase)
+    @statuses = @tag.statuses.order('id desc').paginate_by_max_id(20, params[:max_id])
+    @statuses = cache_collection(@statuses, Status)
   end
 end
diff --git a/app/views/tags/show.html.haml b/app/views/tags/show.html.haml
index bfe5c0439..dd42fe22c 100644
--- a/app/views/tags/show.html.haml
+++ b/app/views/tags/show.html.haml
@@ -5,4 +5,6 @@
   .activity-stream
     = render partial: 'stream_entries/status', collection: @statuses, as: :status, cached: true
 
-= id_paginate tag_path, 20, @statuses
+.pagination
+  - if @statuses.size == 20
+    = link_to safe_join([t('pagination.next'), fa_icon('chevron-right')], ' '), tag_url(@tag, max_id: @statuses.last.id), class: 'next_page', rel: 'next'