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 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..42979d897 --- /dev/null +++ b/app/cells/decidim/initiatives_votes/vote/show.erb @@ -0,0 +1,36 @@ +<% collect_user_extra_fields = model.initiative.type.collect_user_extra_fields %> +
+
+
+ <%= initiative_id %> +
+
+ <%= initiative_title %> +
+ <% if collect_user_extra_fields %> +
+ <%= name_and_surname %> +
+
+ <%= document_number %> +
+
+ <%= date_of_birth %> +
+
+ <%= postal_code %> +
+ <% end %> +
+ <%= time_and_date %> +
+
+ <%= timestamp %> +
+
+ <%= hash_id %> +
+
+ <%= scope %> +
+
diff --git a/app/views/decidim/initiatives/admin/initiatives/_signatures.html.erb b/app/views/decidim/initiatives/admin/initiatives/_signatures.html.erb new file mode 100644 index 000000000..4f76a8fee --- /dev/null +++ b/app/views/decidim/initiatives/admin/initiatives/_signatures.html.erb @@ -0,0 +1,85 @@ +<% style_initiative_title = "border: 1pt solid black; margin: 15pt 0; font-size: 12pt; font-weight: bold; text-transform: uppercase; text-align: center;" %> +<% style_initiatives_votes_table = "width: 100%; display: block; border: 1pt solid black;" %> +<% style_initiatives_votes_table_header = "background-color: lightgray; display: inline-block; width: 100%; font-size: 12pt; font-weight: bold; border-bottom: 1pt solid black;" %> +<% style_initiatives_votes_table_row = "width: 100%; display: inline-block; min-height: 33pt;" %> +<% style_initiatives_votes_table_cell = "width: 19%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;" %> +
+ <%= translated_attribute(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") %> +
+
+
+
+ <%= initiative.reference %> +
+
+ <%= translated_attribute(initiative.title) %> +
+
+ <%= initiative.signature_start_date %> +
+
+ <%= 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") %> +
+ <% if collect_user_extra_fields %> +
+ <%= 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") %> +
+ <% end %> +
+ <%= 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 6c1d6db07..12d4cacca 100644 --- a/spec/lib/overrides_spec.rb +++ b/spec/lib/overrides_spec.rb @@ -91,6 +91,8 @@ { package: "decidim-initiatives", files: { + "/app/cells/decidim/initiatives_votes/vote/show.erb" => "ab0c6d849c32ed9a76037587492f85f1", + "/app/views/decidim/initiatives/admin/initiatives/_signatures.html.erb" => "a57884ead149d3c455aa1037df715791", "/app/cells/decidim/initiatives/initiative_metadata_g_cell.rb" => "e41380534ae3c4c441530a6739e3746a", "/app/models/decidim/initiative.rb" => "77c9775fcff404b16e5a382915116fe1", "/app/permissions/decidim/initiatives/admin/permissions.rb" => "c0f9bf5d9edaca545a7c931c0dc5c0e9",