From a4a924b149f8065f1bb8ed26e95dbefe52abce3d Mon Sep 17 00:00:00 2001 From: barbara oliveira Date: Tue, 7 Jan 2025 17:50:40 +0100 Subject: [PATCH 1/8] fix wcag by adding pagination in Proposals index --- .../app/views/decidim/proposals/proposals/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decidim-proposals/app/views/decidim/proposals/proposals/index.html.erb b/decidim-proposals/app/views/decidim/proposals/proposals/index.html.erb index 5f30111b6ea01..a27868ca28f1f 100644 --- a/decidim-proposals/app/views/decidim/proposals/proposals/index.html.erb +++ b/decidim-proposals/app/views/decidim/proposals/proposals/index.html.erb @@ -1,6 +1,6 @@ <% add_decidim_meta_tags( description: translated_attribute(current_participatory_space.short_description), - title: component_name, + title: "#{component_name} - Page #{@proposals.current_page} of #{@proposals.total_pages}", url: proposals_url, resource: current_component) %> From 02cff0f41b228d701bde78e909134de6e956535a Mon Sep 17 00:00:00 2001 From: barbara oliveira Date: Fri, 10 Jan 2025 17:14:02 +0100 Subject: [PATCH 2/8] add trad key --- .../app/views/decidim/proposals/proposals/index.html.erb | 5 ++++- decidim-proposals/config/locales/en.yml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/decidim-proposals/app/views/decidim/proposals/proposals/index.html.erb b/decidim-proposals/app/views/decidim/proposals/proposals/index.html.erb index a27868ca28f1f..efdaa7df6cf4b 100644 --- a/decidim-proposals/app/views/decidim/proposals/proposals/index.html.erb +++ b/decidim-proposals/app/views/decidim/proposals/proposals/index.html.erb @@ -1,6 +1,9 @@ <% add_decidim_meta_tags( description: translated_attribute(current_participatory_space.short_description), - title: "#{component_name} - Page #{@proposals.current_page} of #{@proposals.total_pages}", + title: t("decidim.proposals.pagination.page_title", + component_name: component_name, + current_page: @proposals.current_page, + total_pages: @proposals.total_pages ), url: proposals_url, resource: current_component) %> diff --git a/decidim-proposals/config/locales/en.yml b/decidim-proposals/config/locales/en.yml index f14526d43c719..186d54ea42a55 100644 --- a/decidim-proposals/config/locales/en.yml +++ b/decidim-proposals/config/locales/en.yml @@ -895,6 +895,8 @@ en: title: Status new: limit_reached: You cannot create new proposals since you have exceeded the limit. + pagination: + page_title: "%{component_name} - Page %{current_page} of %{total_pages}" participatory_text_proposal: alternative_title: There are no participatory texts at the moment buttons: From 215dfb18469dbe968f2ccfaa4058835afc32f9d9 Mon Sep 17 00:00:00 2001 From: barbara oliveira Date: Wed, 15 Jan 2025 15:49:48 +0100 Subject: [PATCH 3/8] add pagination to title in the component: Blogs --- .../app/controllers/decidim/blogs/posts_controller.rb | 4 +++- decidim-blogs/app/views/decidim/blogs/posts/index.html.erb | 5 ++++- decidim-blogs/config/locales/en.yml | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb b/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb index 4cbf96e7d485b..6087bbfdc8384 100644 --- a/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb +++ b/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb @@ -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 diff --git a/decidim-blogs/app/views/decidim/blogs/posts/index.html.erb b/decidim-blogs/app/views/decidim/blogs/posts/index.html.erb index 903340eb50577..b0d1e74fa8ef0 100644 --- a/decidim-blogs/app/views/decidim/blogs/posts/index.html.erb +++ b/decidim-blogs/app/views/decidim/blogs/posts/index.html.erb @@ -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) %> diff --git a/decidim-blogs/config/locales/en.yml b/decidim-blogs/config/locales/en.yml index d975fdefbc13f..60cb06aac2af2 100644 --- a/decidim-blogs/config/locales/en.yml +++ b/decidim-blogs/config/locales/en.yml @@ -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: From f23a3ef1929ada7d0303fa15411de69221817212 Mon Sep 17 00:00:00 2001 From: barbara oliveira Date: Wed, 15 Jan 2025 17:31:22 +0100 Subject: [PATCH 4/8] add pagination to title in the component: Debates --- .../app/controllers/decidim/debates/debates_controller.rb | 4 ++++ .../app/views/decidim/debates/debates/index.html.erb | 5 ++++- decidim-debates/config/locales/en.yml | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/decidim-debates/app/controllers/decidim/debates/debates_controller.rb b/decidim-debates/app/controllers/decidim/debates/debates_controller.rb index 8a159ece39e04..154ba3230a678 100644 --- a/decidim-debates/app/controllers/decidim/debates/debates_controller.rb +++ b/decidim-debates/app/controllers/decidim/debates/debates_controller.rb @@ -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 diff --git a/decidim-debates/app/views/decidim/debates/debates/index.html.erb b/decidim-debates/app/views/decidim/debates/debates/index.html.erb index 4557e9431f0a4..6f0c381afd9ad 100644 --- a/decidim-debates/app/views/decidim/debates/debates/index.html.erb +++ b/decidim-debates/app/views/decidim/debates/debates/index.html.erb @@ -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) %> diff --git a/decidim-debates/config/locales/en.yml b/decidim-debates/config/locales/en.yml index f9a1f90344895..7e24058250a85 100644 --- a/decidim-debates/config/locales/en.yml +++ b/decidim-debates/config/locales/en.yml @@ -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 From 9b482b257233d4814f7b92941b26612e25b358b6 Mon Sep 17 00:00:00 2001 From: barbara oliveira Date: Wed, 15 Jan 2025 17:47:08 +0100 Subject: [PATCH 5/8] lint --- .../app/controllers/decidim/blogs/posts_controller.rb | 4 ++-- .../app/controllers/decidim/debates/debates_controller.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb b/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb index 6087bbfdc8384..f74a8db56ea3d 100644 --- a/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb +++ b/decidim-blogs/app/controllers/decidim/blogs/posts_controller.rb @@ -10,8 +10,8 @@ class PostsController < Decidim::Blogs::ApplicationController helper_method :posts, :post, :post_presenter, :paginate_posts, :posts_most_commented, :tabs, :panels - def index; - @posts = paginate_posts + def index + @posts = paginate_posts end def show diff --git a/decidim-debates/app/controllers/decidim/debates/debates_controller.rb b/decidim-debates/app/controllers/decidim/debates/debates_controller.rb index 154ba3230a678..7501e6e684dd5 100644 --- a/decidim-debates/app/controllers/decidim/debates/debates_controller.rb +++ b/decidim-debates/app/controllers/decidim/debates/debates_controller.rb @@ -16,7 +16,7 @@ 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; + def index @debates = paginated_debates end From 21ed815c4cbc933e4b806038c672c870b16c68d2 Mon Sep 17 00:00:00 2001 From: barbara oliveira Date: Fri, 17 Jan 2025 12:07:45 +0100 Subject: [PATCH 6/8] add pagination in title for component: meetings --- .../app/controllers/decidim/meetings/meetings_controller.rb | 1 + .../app/views/decidim/meetings/meetings/index.html.erb | 5 ++++- decidim-meetings/config/locales/en.yml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb b/decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb index d866d272b55f2..a6083299f6445 100644 --- a/decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb +++ b/decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb @@ -45,6 +45,7 @@ def create end def index + @meetings = paginate(search.result) return unless search.result.blank? && params.dig("filter", "date") != %w(past) @past_meetings ||= search_with(filter_params.merge(with_any_date: %w(past))) diff --git a/decidim-meetings/app/views/decidim/meetings/meetings/index.html.erb b/decidim-meetings/app/views/decidim/meetings/meetings/index.html.erb index 55da86eae680c..86f43f9d792f9 100644 --- a/decidim-meetings/app/views/decidim/meetings/meetings/index.html.erb +++ b/decidim-meetings/app/views/decidim/meetings/meetings/index.html.erb @@ -1,6 +1,9 @@ <% add_decidim_meta_tags( description: translated_attribute(current_component.participatory_space.try(:description)), - title: translated_attribute(current_component.name), + title: t("decidim.components.pagination.page_title", + component_name: translated_attribute(current_component.name), + current_page: @meetings.current_page, + total_pages: @meetings.total_pages ), url: meetings_url, resource: current_component) %> diff --git a/decidim-meetings/config/locales/en.yml b/decidim-meetings/config/locales/en.yml index 8a88232a5c5b3..ba56252affa42 100644 --- a/decidim-meetings/config/locales/en.yml +++ b/decidim-meetings/config/locales/en.yml @@ -178,6 +178,8 @@ en: comments_blocked: Comments blocked creation_enabled_for_participants: Meeting creation by participants enabled creation_enabled_for_user_groups: Meeting creation by user groups enabled + pagination: + page_title: "%{component_name} - Page %{current_page} of %{total_pages}" download_your_data: help: registrations: From c1a4c38ad64611ee35b156948c4dcb84b9bd4c47 Mon Sep 17 00:00:00 2001 From: barbara oliveira Date: Fri, 17 Jan 2025 13:07:19 +0100 Subject: [PATCH 7/8] add pagination to title in component: Sortitions --- .../app/views/decidim/sortitions/sortitions/index.html.erb | 5 ++++- decidim-sortitions/config/locales/en.yml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/decidim-sortitions/app/views/decidim/sortitions/sortitions/index.html.erb b/decidim-sortitions/app/views/decidim/sortitions/sortitions/index.html.erb index 01691c66f4e3a..6d61bbc0b71c6 100644 --- a/decidim-sortitions/app/views/decidim/sortitions/sortitions/index.html.erb +++ b/decidim-sortitions/app/views/decidim/sortitions/sortitions/index.html.erb @@ -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: @sortitions.current_page, + total_pages: @sortitions.total_pages ), url: sortitions_url, resource: current_component) %> diff --git a/decidim-sortitions/config/locales/en.yml b/decidim-sortitions/config/locales/en.yml index 3c13389549f7a..d03b6694aec69 100644 --- a/decidim-sortitions/config/locales/en.yml +++ b/decidim-sortitions/config/locales/en.yml @@ -18,6 +18,8 @@ en: other: Sortitions decidim: components: + pagination: + page_title: "%{component_name} - Page %{current_page} of %{total_pages}" sortitions: actions: comment: Comment From ab2929817699deb9e21935e3bcb195031c0fbc28 Mon Sep 17 00:00:00 2001 From: barbara oliveira Date: Fri, 17 Jan 2025 15:53:17 +0100 Subject: [PATCH 8/8] add pagination to title in component: Budgets --- .../app/controllers/decidim/budgets/budgets_controller.rb | 2 ++ .../app/views/decidim/budgets/budgets/index.html.erb | 5 ++++- decidim-budgets/config/locales/en.yml | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/decidim-budgets/app/controllers/decidim/budgets/budgets_controller.rb b/decidim-budgets/app/controllers/decidim/budgets/budgets_controller.rb index 18a1592b7ea88..0fb0b53effb0a 100644 --- a/decidim-budgets/app/controllers/decidim/budgets/budgets_controller.rb +++ b/decidim-budgets/app/controllers/decidim/budgets/budgets_controller.rb @@ -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 diff --git a/decidim-budgets/app/views/decidim/budgets/budgets/index.html.erb b/decidim-budgets/app/views/decidim/budgets/budgets/index.html.erb index c5810bafcc340..dd85781984b32 100644 --- a/decidim-budgets/app/views/decidim/budgets/budgets/index.html.erb +++ b/decidim-budgets/app/views/decidim/budgets/budgets/index.html.erb @@ -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) %> diff --git a/decidim-budgets/config/locales/en.yml b/decidim-budgets/config/locales/en.yml index c79f98776cb2d..361e5d858a1b9 100644 --- a/decidim-budgets/config/locales/en.yml +++ b/decidim-budgets/config/locales/en.yml @@ -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: