Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show export PDF signatures by row instead of by column #432

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ group :development do
gem "listen"
gem "rubocop"
gem "web-console"
gem "wkhtmltopdf-binary"
end

group :production do
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1039,6 +1040,7 @@ DEPENDENCIES
stackprof
web-console
wicked_pdf (< 2.8)
wkhtmltopdf-binary

RUBY VERSION
ruby 3.1.1p18
Expand Down
36 changes: 36 additions & 0 deletions app/cells/decidim/initiatives_votes/vote/show.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<% collect_user_extra_fields = model.initiative.type.collect_user_extra_fields %>
<br>
<div>
<div>
<%= initiative_id %>
</div>
<div>
<%= initiative_title %>
</div>
<% if collect_user_extra_fields %>
<div>
<%= name_and_surname %>
</div>
<div>
<%= document_number %>
</div>
<div>
<%= date_of_birth %>
</div>
<div>
<%= postal_code %>
</div>
<% end %>
<div>
<%= time_and_date %>
</div>
<div style="word-wrap: break-word;">
<%= timestamp %>
</div>
<div>
<%= hash_id %>
</div>
<div>
<%= scope %>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -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;" %>
<div class="initiative-title" style="<%= style_initiative_title %>">
<%= translated_attribute(initiative.title) %>
</div>
<div class="initiatives-votes-table" style="<%= style_initiatives_votes_table %>">
<div class="initiatives-votes-table-header" style="<%= style_initiatives_votes_table_header %>">
<div class="initiatives-votes-table-cell w20" style="<%= style_initiatives_votes_table_cell %>">
<%= t("models.initiatives_votes.fields.initiative_id", scope: "decidim.admin") %>
</div>
<div class="initiatives-votes-table-cell w20" style="<%= style_initiatives_votes_table_cell %>">
<%= t("models.initiatives_votes.fields.initiative_title", scope: "decidim.admin") %>
</div>
<div class="initiatives-votes-table-cell w20" style="<%= style_initiatives_votes_table_cell %>">
<%= t("models.initiatives_votes.fields.initiative_start_date", scope: "decidim.admin") %>
</div>
<div class="initiatives-votes-table-cell w20" style="<%= style_initiatives_votes_table_cell %>">
<%= t("models.initiatives_votes.fields.initiative_end_date", scope: "decidim.admin") %>
</div>
<div class="initiatives-votes-table-cell w20" style="<%= style_initiatives_votes_table_cell %>">
<%= t("models.initiatives_votes.fields.initiative_signatures_count", scope: "decidim.admin") %>
</div>
</div>
<div class="initiatives-votes-table-row" style="<%= style_initiatives_votes_table_row %>">
<div class="initiatives-votes-table-cell w20" style="<%= style_initiatives_votes_table_cell %>">
<%= initiative.reference %>
</div>
<div class="initiatives-votes-table-cell w20" style="<%= style_initiatives_votes_table_cell %>">
<%= translated_attribute(initiative.title) %>
</div>
<div class="initiatives-votes-table-cell w20" style="<%= style_initiatives_votes_table_cell %>">
<%= initiative.signature_start_date %>
</div>
<div class="initiatives-votes-table-cell w20" style="<%= style_initiatives_votes_table_cell %>">
<%= initiative.signature_end_date %>
</div>
<div class="initiatives-votes-table-cell w20" style="<%= style_initiatives_votes_table_cell %>">
<%= votes.count %>
</div>
</div>
</div>
<br>
<br>
<div style="word-wrap: break-word;">
<div>
<div>
<%= t("models.initiatives_votes.fields.initiative_id", scope: "decidim.admin") %>
</div>
<div>
<%= t("models.initiatives_votes.fields.initiative_title", scope: "decidim.admin") %>
</div>
<% if collect_user_extra_fields %>
<div>
<%= t("models.initiatives_votes.fields.name_and_surname", scope: "decidim.admin") %>
</div>
<div>
<%= t("models.initiatives_votes.fields.document_number", scope: "decidim.admin") %>
</div>
<div>
<%= t("models.initiatives_votes.fields.date_of_birth", scope: "decidim.admin") %>
</div>
<div>
<%= t("models.initiatives_votes.fields.postal_code", scope: "decidim.admin") %>
</div>
<% end %>
<div>
<%= t("models.initiatives_votes.fields.time_and_date", scope: "decidim.admin") %>
</div>
<div>
<%= t("models.initiatives_votes.fields.timestamp", scope: "decidim.admin") %>
</div>
<div>
<%= t("models.initiatives_votes.fields.hash", scope: "decidim.admin") %>
</div>
<div>
<%= t("models.initiatives_votes.fields.scope", scope: "decidim.admin") %>
</div>
</div>
<% votes.each do |vote| %>
<%= cell "decidim/initiatives_votes/vote", vote %>
<% end %>
</div>
2 changes: 2 additions & 0 deletions spec/lib/overrides_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading