Skip to content

Commit

Permalink
add pagination to title in the component: Debates
Browse files Browse the repository at this point in the history
  • Loading branch information
BarbaraOliveira13 committed Jan 15, 2025
1 parent 215dfb1 commit f23a3ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class DebatesController < Decidim::Debates::ApplicationController
helper_method :debates, :debate, :form_presenter, :paginated_debates, :close_debate_form, :tab_panel_items
before_action :authenticate_user!, only: [:new, :create]

def index;
@debates = paginated_debates
end

def new
enforce_permission_to :create, :debate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<% add_decidim_meta_tags(
description: translated_attribute(current_participatory_space.short_description),
title: component_name,
title: t("decidim.components.pagination.page_title",
component_name: component_name,
current_page: @debates.current_page,
total_pages: @debates.total_pages ),
url: debates_url,
resource: current_component) %>

Expand Down
2 changes: 2 additions & 0 deletions decidim-debates/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ en:
creation_enabled: Participants can create debates
endorsements_blocked: Endorsements blocked
endorsements_enabled: Endorsements enabled
pagination:
page_title: "%{component_name} - Page %{current_page} of %{total_pages}"
debates:
actions:
close: Close
Expand Down

0 comments on commit f23a3ef

Please sign in to comment.