Skip to content

Commit

Permalink
add pagination to title in component: Budgets
Browse files Browse the repository at this point in the history
  • Loading branch information
BarbaraOliveira13 committed Jan 17, 2025
1 parent c1a4c38 commit ab29298
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ class BudgetsController < Decidim::Budgets::ApplicationController

include Decidim::Budgets::Orderable
include Decidim::TranslatableAttributes
include Decidim::Paginable

def index
redirect_to budget_projects_path(current_workflow.single) if current_workflow.single?
@projects = paginate(Decidim::Budgets::Project.joins(:budget).where(decidim_budgets_budgets: { component: current_component }))
end

def show
Expand Down
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: translated_attribute(current_component.name),
current_page: @projects.current_page,
total_pages: @projects.total_pages ),
url: budgets_url,
resource: current_component) %>

Expand Down
2 changes: 2 additions & 0 deletions decidim-budgets/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ en:
disabled: Voting disabled
enabled: Voting enabled
finished: Voting finished
pagination:
page_title: "%{component_name} - Page %{current_page} of %{total_pages}"
download_your_data:
help:
orders:
Expand Down

0 comments on commit ab29298

Please sign in to comment.