Skip to content

Commit

Permalink
add pagination to title in the component: Blogs
Browse files Browse the repository at this point in the history
  • Loading branch information
BarbaraOliveira13 committed Jan 15, 2025
1 parent 02cff0f commit 215dfb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class PostsController < Decidim::Blogs::ApplicationController

helper_method :posts, :post, :post_presenter, :paginate_posts, :posts_most_commented, :tabs, :panels

def index; end
def index;
@posts = paginate_posts
end

def show
raise ActionController::RoutingError, "Not Found" unless post
Expand Down
5 changes: 4 additions & 1 deletion decidim-blogs/app/views/decidim/blogs/posts/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<% add_decidim_meta_tags(
description: translated_attribute(current_component.participatory_space.try(:description)),
title: component_name,
title: t("decidim.components.pagination.page_title",
component_name: component_name,
current_page: @posts.current_page,
total_pages: @posts.total_pages ),
url: posts_url,
resource: current_component) %>

Expand Down
2 changes: 2 additions & 0 deletions decidim-blogs/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ en:
comments_blocked: Comments blocked
endorsements_blocked: Endorsements blocked
endorsements_enabled: Endorsements enabled
pagination:
page_title: "%{component_name} - Page %{current_page} of %{total_pages}"
events:
blogs:
post_created:
Expand Down

0 comments on commit 215dfb1

Please sign in to comment.