From 4c508baf08f83f9a00767572779f8e19aa7d1f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Bol=C3=ADvar?= Date: Mon, 28 Nov 2022 17:31:48 +0100 Subject: [PATCH 1/3] Show export PDF signatures by row instead of by column --- .../decidim/initiatives_votes/vote/show.erb | 33 ++++++++ .../initiatives/export_pdf_signatures.pdf.erb | 78 +++++++++++++++++++ spec/lib/overrides_spec.rb | 2 + 3 files changed, 113 insertions(+) create mode 100644 app/cells/decidim/initiatives_votes/vote/show.erb create mode 100644 app/views/decidim/initiatives/admin/initiatives/export_pdf_signatures.pdf.erb diff --git a/app/cells/decidim/initiatives_votes/vote/show.erb b/app/cells/decidim/initiatives_votes/vote/show.erb new file mode 100644 index 000000000..6c344b87b --- /dev/null +++ b/app/cells/decidim/initiatives_votes/vote/show.erb @@ -0,0 +1,33 @@ +
+
+
+ <%= initiative_id %> +
+
+ <%= initiative_title %> +
+
+ <%= name_and_surname %> +
+
+ <%= document_number %> +
+
+ <%= date_of_birth %> +
+
+ <%= postal_code %> +
+
+ <%= time_and_date %> +
+
+ <%= timestamp %> +
+
+ <%= hash_id %> +
+
+ <%= scope %> +
+
diff --git a/app/views/decidim/initiatives/admin/initiatives/export_pdf_signatures.pdf.erb b/app/views/decidim/initiatives/admin/initiatives/export_pdf_signatures.pdf.erb new file mode 100644 index 000000000..96226e0c9 --- /dev/null +++ b/app/views/decidim/initiatives/admin/initiatives/export_pdf_signatures.pdf.erb @@ -0,0 +1,78 @@ +
+ <%= translated_attribute(current_initiative.title) %> +
+
+
+
+ <%= t("models.initiatives_votes.fields.initiative_id", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.initiative_title", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.initiative_start_date", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.initiative_end_date", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.initiative_signatures_count", scope: "decidim.admin") %> +
+
+
+
+ <%= current_initiative.reference %> +
+
+ <%= translated_attribute(current_initiative.title) %> +
+
+ <%= current_initiative.signature_start_date %> +
+
+ <%= current_initiative.signature_end_date %> +
+
+ <%= @votes.count %> +
+
+
+
+
+
+
+
+ <%= t("models.initiatives_votes.fields.initiative_id", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.initiative_title", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.name_and_surname", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.document_number", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.date_of_birth", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.postal_code", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.time_and_date", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.timestamp", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.hash", scope: "decidim.admin") %> +
+
+ <%= t("models.initiatives_votes.fields.scope", scope: "decidim.admin") %> +
+
+ <% @votes.each do |vote| %> + <%= cell "decidim/initiatives_votes/vote", vote %> + <% end %> +
diff --git a/spec/lib/overrides_spec.rb b/spec/lib/overrides_spec.rb index d3df6f350..81c6fa70a 100644 --- a/spec/lib/overrides_spec.rb +++ b/spec/lib/overrides_spec.rb @@ -63,6 +63,8 @@ { package: "decidim-initiatives", files: { + "/app/cells/decidim/initiatives_votes/vote/show.erb" => "e7b749bf6d3d95dee2615b9b911e6b6e", + "/app/views/decidim/initiatives/admin/initiatives/export_pdf_signatures.pdf.erb" => "5234cf40c6281602b0c53555cea18b57", "/app/cells/decidim/initiatives/initiative_m_cell.rb" => "a20b707d0533dd8883b0bdbf8bc0b2c0", "/app/views/layouts/decidim/_initiative_header_steps.html.erb" => "f1bcd3e7c406a2263d49d0f341930bfc" } From 41d80aaf32c2a8e81d9a49b3fe850dc452496302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Bol=C3=ADvar?= Date: Wed, 26 Jul 2023 14:19:02 +0200 Subject: [PATCH 2/3] Show full signatures --- app/cells/decidim/initiatives_votes/vote/show.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/cells/decidim/initiatives_votes/vote/show.erb b/app/cells/decidim/initiatives_votes/vote/show.erb index 6c344b87b..c04dfd469 100644 --- a/app/cells/decidim/initiatives_votes/vote/show.erb +++ b/app/cells/decidim/initiatives_votes/vote/show.erb @@ -21,7 +21,7 @@
<%= time_and_date %>
-
+
<%= timestamp %>
From 28e34d6e3185c6d54b17da85371f1dd0d7b59928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Bol=C3=ADvar?= Date: Wed, 27 Nov 2024 14:22:16 +0100 Subject: [PATCH 3/3] Install wkhtmltopdf-binary for development usage --- Gemfile | 1 + Gemfile.lock | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Gemfile b/Gemfile index 46235f26d..022cfb309 100644 --- a/Gemfile +++ b/Gemfile @@ -45,6 +45,7 @@ group :development do gem "listen" gem "rubocop" gem "web-console" + gem "wkhtmltopdf-binary" end group :production do diff --git a/Gemfile.lock b/Gemfile.lock index e85c9bdf8..a9d2416cd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -977,6 +977,7 @@ GEM activesupport wisper (2.0.1) wisper-rspec (1.1.0) + wkhtmltopdf-binary (0.12.6.8) xpath (3.2.0) nokogiri (~> 1.8) zeitwerk (2.6.18) @@ -1039,6 +1040,7 @@ DEPENDENCIES stackprof web-console wicked_pdf (< 2.8) + wkhtmltopdf-binary RUBY VERSION ruby 3.1.1p18