decidim-elections 0.27.0.rc1 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/votings/content_blocks/highlighted_votings/show.erb +1 -1
  3. data/app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb +1 -4
  4. data/app/cells/decidim/votings/content_blocks/landing_page/description/show.erb +1 -1
  5. data/app/cells/decidim/votings/content_blocks/landing_page/header/show.erb +2 -2
  6. data/app/commands/decidim/votings/census/admin/create_dataset.rb +13 -5
  7. data/app/commands/decidim/votings/census/admin/launch_access_codes_export.rb +3 -1
  8. data/app/commands/decidim/votings/census/admin/launch_access_codes_generation.rb +1 -1
  9. data/app/controllers/decidim/votings/census/admin/census_controller.rb +6 -2
  10. data/app/forms/decidim/elections/admin/setup_form.rb +42 -0
  11. data/app/models/decidim/elections/election.rb +2 -2
  12. data/app/models/decidim/votings/census/dataset.rb +1 -1
  13. data/app/packs/src/decidim/elections/admin/pending_action.js +2 -0
  14. data/app/packs/src/decidim/elections/admin/trustees_process.js +2 -0
  15. data/app/packs/src/decidim/elections/broken_promises_handler.js +11 -0
  16. data/app/packs/src/decidim/elections/trustee/key_ceremony.js +3 -0
  17. data/app/packs/src/decidim/elections/trustee/tally.js +3 -0
  18. data/app/packs/src/decidim/elections/voter/casting-vote.js +3 -0
  19. data/app/packs/src/decidim/elections/voter/setup-vote.js +2 -6
  20. data/app/packs/src/decidim/votings/admin/update_census_dataset_status.js +2 -2
  21. data/app/packs/src/decidim/votings/in-person-vote.js +3 -0
  22. data/app/views/decidim/elections/admin/steps/_create_election.html.erb +14 -1
  23. data/app/views/decidim/elections/admin/steps/index.html.erb +2 -0
  24. data/app/views/decidim/elections/{votes/_server_error_modal.html.erb → shared/_broken_promises_modal.html.erb} +10 -5
  25. data/app/views/decidim/elections/trustee_zone/elections/show.html.erb +2 -0
  26. data/app/views/decidim/elections/votes/_show_casting.html.erb +2 -0
  27. data/app/views/decidim/elections/votes/new.html.erb +1 -1
  28. data/app/views/decidim/votings/census/admin/census/_creating_data.html.erb +1 -1
  29. data/app/views/decidim/votings/census/admin/census/_exporting_codes.html.erb +1 -1
  30. data/app/views/decidim/votings/census/admin/census/_freeze.html.erb +2 -0
  31. data/app/views/decidim/votings/census/admin/census/_generate_codes.html.erb +14 -4
  32. data/app/views/decidim/votings/census/admin/census/show.html.erb +1 -1
  33. data/app/views/decidim/votings/polling_officer_zone/in_person_votes/new.html.erb +2 -0
  34. data/app/views/decidim/votings/polling_officer_zone/in_person_votes/show.html.erb +2 -0
  35. data/app/views/decidim/votings/votings/_promoted_voting.html.erb +1 -1
  36. data/config/locales/am-ET.yml +0 -1
  37. data/config/locales/ca.yml +21 -7
  38. data/config/locales/cs.yml +26 -11
  39. data/config/locales/da.yml +0 -1
  40. data/config/locales/de.yml +55 -7
  41. data/config/locales/en.yml +22 -7
  42. data/config/locales/eo.yml +0 -1
  43. data/config/locales/es-MX.yml +22 -8
  44. data/config/locales/es-PY.yml +22 -8
  45. data/config/locales/es.yml +22 -8
  46. data/config/locales/et.yml +0 -1
  47. data/config/locales/eu.yml +0 -6
  48. data/config/locales/fi-plain.yml +22 -7
  49. data/config/locales/fi.yml +22 -7
  50. data/config/locales/fr-CA.yml +28 -3
  51. data/config/locales/fr.yml +28 -3
  52. data/config/locales/gl.yml +0 -6
  53. data/config/locales/hr.yml +0 -1
  54. data/config/locales/hu.yml +7 -0
  55. data/config/locales/id-ID.yml +0 -1
  56. data/config/locales/is-IS.yml +1 -2
  57. data/config/locales/it.yml +0 -6
  58. data/config/locales/ja.yml +24 -3
  59. data/config/locales/ko.yml +0 -1
  60. data/config/locales/lt.yml +1444 -0
  61. data/config/locales/mt.yml +0 -1
  62. data/config/locales/nl.yml +0 -6
  63. data/config/locales/oc-FR.yml +1 -0
  64. data/config/locales/om-ET.yml +0 -1
  65. data/config/locales/pl.yml +0 -6
  66. data/config/locales/pt-BR.yml +1 -7
  67. data/config/locales/pt.yml +0 -6
  68. data/config/locales/ru.yml +0 -1
  69. data/config/locales/si-LK.yml +0 -1
  70. data/config/locales/sk.yml +0 -1
  71. data/config/locales/so-SO.yml +0 -1
  72. data/config/locales/sr-CS.yml +0 -1
  73. data/config/locales/sv.yml +0 -2
  74. data/config/locales/sw-KE.yml +0 -1
  75. data/config/locales/ti-ER.yml +0 -1
  76. data/config/locales/uk.yml +0 -1
  77. data/config/locales/val-ES.yml +0 -1
  78. data/config/locales/vi.yml +0 -1
  79. data/config/locales/zh-TW.yml +0 -1
  80. data/db/migrate/20220711112802_rename_dataset_file_to_filename.rb +7 -0
  81. data/lib/decidim/elections/version.rb +1 -1
  82. data/lib/decidim/votings/test/factories.rb +1 -1
  83. metadata +18 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11ba350fe95a17c5fdacb0d334da600c9661fefd43617ee0324655acc3a18bc8
4
- data.tar.gz: 39b15243a85e5e7bc6d04bea37945c23e849a26e36ad421a855779ca2f681c8d
3
+ metadata.gz: 8aa5ef0b803fbdafa54efa8e320182aef565556c8d178a3ea2c85ad721d80db1
4
+ data.tar.gz: f67cc9b5e11cc9a561bac0a467bf29b28fb9bec5283dca2f8172a5d8200d3ec7
5
5
  SHA512:
6
- metadata.gz: fac8953cc1dca3a079f3970efe597a3cf19c63cf60dde0443c0511060881bd4b424a434cab13f544a8a4d31a8d571ae2593c1f65c1ee465af81b87c599dac1f2
7
- data.tar.gz: 180c6299a0f8a5e8a5451396865d82824e01e858431e570e2279240d4bd7026e1abdd97f887e05739db83aab32bcb204cfdd7b9a1e9b7e14b4feb00d7f52ba03
6
+ metadata.gz: 9cc5ab308bb915c625a0a959a4d212da03852e6d97e4aaa2c231f4417380a760055bd2b773e2f1b4fb397cfa4164b365162f1fd9af7e87db089941f49036a3de
7
+ data.tar.gz: 8cc70e73a42948b23ef9b82f685df0b155120fe48bc92ab5b71cec164ffc0b28c7709e4e9d66e270192960b0f405efaaa6ce5433b2d79cf7863dda3d24ee9fdd
@@ -8,7 +8,7 @@
8
8
  <div class="column">
9
9
  <%= link_to decidim_votings.voting_path(voting), class: "card card--voting card--mini" do %>
10
10
  <div aria-hidden="true" class="card__image-top"
11
- style="background-image:url(<%= voting.attached_uploader(:banner_image).path %>)"></div>
11
+ style="background-image:url('<%= voting.attached_uploader(:banner_image).path %>')"></div>
12
12
  <div class="card__content">
13
13
  <span class="card__title card__link"><%= translated_attribute voting.title %></span>
14
14
  </div>
@@ -33,12 +33,9 @@ module Decidim
33
33
  def cache_hash
34
34
  hash = []
35
35
  hash.push(I18n.locale)
36
+ hash.push(highlighted_votings.map(&:cache_key_with_version))
36
37
  hash.join(Decidim.cache_key_separator)
37
38
  end
38
-
39
- def cache_expiry_time
40
- 10.minutes
41
- end
42
39
  end
43
40
  end
44
41
  end
@@ -1,4 +1,4 @@
1
- <div class="row section voting-description-cell">
1
+ <div class="row section voting-description-cell mt-m">
2
2
  <div class="columns">
3
3
  <% if introductory_image.attached? %>
4
4
  <div id="introductory-image" class="columns medium-4 mediumlarge-5">
@@ -1,4 +1,4 @@
1
- <section class="extended hero" style="background-image:url(<%= current_participatory_space.attached_uploader(:banner_image).path %>);">
1
+ <section class="extended hero" style="background-image:url('<%= current_participatory_space.attached_uploader(:banner_image).path %>');">
2
2
  <div class="hero__container">
3
3
  <div class="row">
4
4
  <div class="columns large-10 text-left">
@@ -24,6 +24,6 @@
24
24
  </div>
25
25
  </section>
26
26
 
27
- <section class="section">
27
+ <section>
28
28
  <%= extended_navigation_bar(navigation_items) %>
29
29
  </section>
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "English"
3
4
  require "csv"
4
5
 
5
6
  module Decidim
@@ -55,7 +56,7 @@ module Decidim
55
56
  current_user,
56
57
  {
57
58
  voting: form.current_participatory_space,
58
- file: form.file,
59
+ filename: form.file.filename.to_s,
59
60
  csv_row_raw_count: csv_row_count,
60
61
  status: :creating_data
61
62
  },
@@ -64,27 +65,34 @@ module Decidim
64
65
  end
65
66
 
66
67
  def csv_header_invalid?
67
- CSV.parse_line(File.open(file_path), col_sep: ";", headers: true, header_converters: :symbol).headers != expected_headers
68
+ headers.blank? || headers != expected_headers
68
69
  end
69
70
 
70
71
  def headers
72
+ @headers ||= CSV.parse_line(File.open(file_path), col_sep: ";", headers: true, header_converters: :symbol)&.headers
73
+ end
74
+
75
+ def no_ballot_headers
71
76
  [:document_id, :document_type, :date_of_birth, :full_name, :full_address, :postal_code, :mobile_phone_number, :email_address]
72
77
  end
73
78
 
74
79
  def ballot_style_headers
75
- headers.push(:ballot_style_code)
80
+ no_ballot_headers.push(:ballot_style_code)
76
81
  end
77
82
 
78
83
  def expected_headers
79
- @expected_headers ||= form.current_participatory_space.has_ballot_styles? ? ballot_style_headers : headers
84
+ @expected_headers ||= form.current_participatory_space.has_ballot_styles? ? ballot_style_headers : no_ballot_headers
80
85
  end
81
86
 
82
87
  def csv_row_count
83
88
  @csv_row_count ||= file_lines_count - 1
84
89
  end
85
90
 
91
+ # count lines in the most resource-efficient way using ruby, handles milions of lines with minimal memory footprint
86
92
  def file_lines_count
87
- `wc -l "#{file_path.shellescape}"`.strip.split.first.to_i
93
+ lines = 0
94
+ File.foreach(file_path) { lines += 1 }
95
+ lines
88
96
  end
89
97
  end
90
98
  end
@@ -19,6 +19,8 @@ module Decidim
19
19
  def call
20
20
  return broadcast(:invalid) unless valid?
21
21
 
22
+ UpdateDataset.call(dataset, { status: :exporting_codes }, user)
23
+
22
24
  ExportAccessCodesJob.perform_later(dataset, user)
23
25
 
24
26
  broadcast(:ok)
@@ -29,7 +31,7 @@ module Decidim
29
31
  private
30
32
 
31
33
  def valid?
32
- user.present? && dataset&.data&.present? && dataset.codes_generated?
34
+ user.present? && dataset&.data&.exists? && dataset.codes_generated?
33
35
  end
34
36
  end
35
37
  end
@@ -31,7 +31,7 @@ module Decidim
31
31
  private
32
32
 
33
33
  def valid?
34
- user.present? && dataset&.data&.present? && dataset.data_created?
34
+ user.present? && dataset&.data&.exists? && dataset.data_created?
35
35
  end
36
36
 
37
37
  def update_dataset_status(dataset, status, user)
@@ -8,12 +8,12 @@ module Decidim
8
8
  class CensusController < Admin::ApplicationController
9
9
  helper_method :votings, :current_participatory_space, :current_census, :census_steps, :current_census_action_view,
10
10
  :user_email, :ballot_style_callout_text, :ballot_style_callout_level, :ballot_style_code_header
11
- helper_method :admin_voting_census_path, :admin_status_voting_census_path, :generate_access_codes_path, :export_access_codes_path
11
+ helper_method :admin_voting_census_path, :admin_status_voting_census_path, :generate_access_codes_path, :export_access_codes_path, :waiting_status?
12
12
 
13
13
  def show
14
14
  enforce_permission_to :manage, :census, voting: current_participatory_space
15
15
 
16
- flash[:notice] = "Finished processing #{current_census.file}" if current_census.data_created?
16
+ flash[:notice] = "Finished processing #{current_census.filename}" if current_census.data_created?
17
17
 
18
18
  @form = form(DatasetForm).instance
19
19
  end
@@ -184,6 +184,10 @@ module Decidim
184
184
  def ballot_style_code_header
185
185
  "Ballot Style Code"
186
186
  end
187
+
188
+ def waiting_status?
189
+ current_census.creating_data? || current_census.generating_codes? || current_census.exporting_codes?
190
+ end
187
191
  end
188
192
  end
189
193
  end
@@ -13,6 +13,12 @@ module Decidim
13
13
  validations.each do |message, t_args, valid|
14
14
  errors.add(message, I18n.t("steps.create_election.errors.#{message}", **t_args, scope: "decidim.elections.admin")) unless valid
15
15
  end
16
+
17
+ if needs_census?
18
+ census_validations.each do |message, t_args, valid|
19
+ errors.add(message, I18n.t("steps.create_election.errors.#{message}", **t_args, scope: "decidim.elections.admin")) unless valid
20
+ end
21
+ end
16
22
  end
17
23
 
18
24
  def current_step; end
@@ -40,12 +46,28 @@ module Decidim
40
46
  ].freeze
41
47
  end
42
48
 
49
+ def census_validations
50
+ return [] unless needs_census?
51
+
52
+ @census_validations ||= [
53
+ [:census_uploaded, {}, census.present? && census.data.exists?],
54
+ [:census_codes_generated, {}, census_codes_generated?],
55
+ [:census_frozen, {}, census&.freeze?]
56
+ ].freeze
57
+ end
58
+
43
59
  def messages
44
60
  @messages ||= validations.to_h do |message, t_args, _valid|
45
61
  [message, I18n.t("steps.create_election.requirements.#{message}", **t_args, scope: "decidim.elections.admin")]
46
62
  end
47
63
  end
48
64
 
65
+ def census_messages
66
+ @census_messages ||= census_validations.to_h do |message, t_args, _valid|
67
+ [message, I18n.t("steps.create_election.requirements.#{message}", **t_args, scope: "decidim.elections.admin")]
68
+ end
69
+ end
70
+
49
71
  def participatory_space_trustees
50
72
  @participatory_space_trustees ||= Decidim::Elections::Trustees::ByParticipatorySpace.new(election.component.participatory_space).to_a
51
73
  end
@@ -58,6 +80,26 @@ module Decidim
58
80
  @bulletin_board ||= context[:bulletin_board] || Decidim::Elections.bulletin_board
59
81
  end
60
82
 
83
+ def needs_census?
84
+ vote_flow.is_a?(Decidim::Votings::CensusVoteFlow)
85
+ end
86
+
87
+ def vote_flow
88
+ @vote_flow ||= election.participatory_space.try(:vote_flow_for, election)
89
+ end
90
+
91
+ def census_codes_generated?
92
+ return unless needs_census?
93
+
94
+ census&.codes_generated? || census&.exporting_codes? || census&.freeze?
95
+ end
96
+
97
+ def census
98
+ return unless needs_census?
99
+
100
+ @census ||= election.component.participatory_space.dataset
101
+ end
102
+
61
103
  def main_button?
62
104
  true
63
105
  end
@@ -89,7 +89,7 @@ module Decidim
89
89
  #
90
90
  # Returns a boolean.
91
91
  def minimum_answers?
92
- questions.all? { |question| question.answers.size > 1 }
92
+ questions.any? && questions.all? { |question| question.answers.size > 1 }
93
93
  end
94
94
 
95
95
  # Public: Checks if the election results are published and election finished
@@ -110,7 +110,7 @@ module Decidim
110
110
  #
111
111
  # Returns a boolean.
112
112
  def valid_questions?
113
- questions.all?(&:valid_max_selection?)
113
+ questions.any? && questions.all?(&:valid_max_selection?)
114
114
  end
115
115
 
116
116
  # Public: Gets the voting period status of the election
@@ -21,7 +21,7 @@ module Decidim
21
21
 
22
22
  enum status: [:init_data, :creating_data, :data_created, :generating_codes, :codes_generated, :exporting_codes, :freeze]
23
23
 
24
- validates :file, presence: true
24
+ validates :filename, presence: true
25
25
 
26
26
  alias participatory_space voting
27
27
 
@@ -1,3 +1,5 @@
1
+ // show a message to the user if comunication is lost
2
+ import "src/decidim/elections/broken_promises_handler";
1
3
  import { Client } from "@decidim/decidim-bulletin_board";
2
4
 
3
5
  $(() => {
@@ -1,3 +1,5 @@
1
+ // show a message to the user if comunication is lost
2
+ import "src/decidim/elections/broken_promises_handler";
1
3
  import {
2
4
  Client,
3
5
  Election,
@@ -0,0 +1,11 @@
1
+ /* Fallback for non-handled failed promises */
2
+ window.addEventListener("unhandledrejection", (event) => {
3
+ console.log("broken", event)
4
+ $("#server-failure .tech-info").html(event.reason);
5
+ if (event.reason.toString().indexOf("fetch") === -1) {
6
+ $("#server-failure .communication_error").addClass("hide");
7
+ $("#server-failure .generic_error").removeClass("hide");
8
+ }
9
+ $("#server-failure").foundation("open");
10
+ });
11
+
@@ -1,3 +1,6 @@
1
+ // show a message to the user if comunication is lost
2
+ import "src/decidim/elections/broken_promises_handler";
3
+
1
4
  import {
2
5
  KeyCeremonyComponent,
3
6
  MessageIdentifier,
@@ -1,3 +1,6 @@
1
+ // show a message to the user if comunication is lost
2
+ import "src/decidim/elections/broken_promises_handler";
3
+
1
4
  import {
2
5
  TallyComponent,
3
6
  IdentificationKeys,
@@ -1,3 +1,6 @@
1
+ // show a message to the user if comunication is lost
2
+ import "src/decidim/elections/broken_promises_handler";
3
+
1
4
  import { Client } from "@decidim/decidim-bulletin_board";
2
5
 
3
6
  $(async () => {
@@ -1,5 +1,7 @@
1
1
  /* eslint-disable require-jsdoc */
2
2
 
3
+ // show a message to the user if comunication is lost
4
+ import "src/decidim/elections/broken_promises_handler";
3
5
  import { VoteComponent } from "@decidim/decidim-bulletin_board";
4
6
 
5
7
  import * as VotingSchemesDummy from "@decidim/voting_schemes-dummy";
@@ -46,12 +48,6 @@ export default function setupVoteComponent($voteWrapper) {
46
48
  });
47
49
  }
48
50
 
49
- /* Fallback for non-handled failed promises */
50
- window.addEventListener("unhandledrejection", (event) => {
51
- $("#server-failure .tech-info").html(event.reason);
52
- $("#server-failure").foundation("open");
53
- });
54
-
55
51
  window.Decidim = window.Decidim || {};
56
52
  window.Decidim.setupVoteComponent = setupVoteComponent;
57
53
 
@@ -8,6 +8,6 @@ $(() => {
8
8
  }
9
9
  }
10
10
 
11
- // 1 minute
12
- setInterval(updateCensusDatasetStatus, 60000);
11
+ // 10 seconds
12
+ setInterval(updateCensusDatasetStatus, 10000);
13
13
  });
@@ -1,3 +1,6 @@
1
+ // show a message to the user if comunication is lost
2
+ import "src/decidim/elections/broken_promises_handler";
3
+
1
4
  import { Client } from "@decidim/decidim-bulletin_board";
2
5
 
3
6
  $(async () => {
@@ -14,10 +14,23 @@
14
14
  <% end %>
15
15
  </ul>
16
16
 
17
+ <% if form.needs_census? %>
18
+ <h4><%= t(".census") %></h4>
19
+ <ul class="no-bullet-indented">
20
+ <% form.census_messages.each do |key, value| %>
21
+ <% if form.errors.include?(key) %>
22
+ <li><%= icon "x", class: "text-alert", role: "img", "aria-hidden": true %>&nbsp;<%= form.errors.messages[key][0].html_safe %></li>
23
+ <% else %>
24
+ <li><%= icon "check", class: "text-success", role: "img", "aria-hidden": true %>&nbsp;<%= value.html_safe %></li>
25
+ <% end %>
26
+ <% end %>
27
+ </ul>
28
+ <% end %>
29
+
17
30
  <h4><%= t(".trustees") %></h4>
18
31
  <ul class="no-bullet-indented">
19
32
  <% if form.participatory_space_trustees.none? %>
20
- <li><%= t(".no_trustees") %></li>
33
+ <li><%= icon "x", class: "text-alert", role: "img", "aria-hidden": true %>&nbsp;<%= t(".no_trustees") %></li>
21
34
  <% end %>
22
35
 
23
36
  <% form.participatory_space_trustees.map {|trustee| [trustee, form.trustees.none? || form.trustees.include?(trustee)] }
@@ -43,3 +43,5 @@
43
43
  <%= render partial: current_step.to_s %>
44
44
  </div>
45
45
  <% end %>
46
+
47
+ <%= render "decidim/elections/shared/broken_promises_modal" %>
@@ -1,18 +1,23 @@
1
+ <% i18n_scope ||= "decidim.elections.connection.failed" %>
2
+
1
3
  <div class="reveal" id="server-failure" data-reveal>
2
4
  <div class="reveal__header">
3
5
  <h3 class="reveal__title">
4
- <%= t("modal.title", scope: "decidim.elections.votes.failed") %>
6
+ <%= t("modal.title", scope: i18n_scope) %>
5
7
  </h3>
6
8
 
7
- <button class="close-button" data-close aria-label="<%= t("modal.close", scope: "decidim.elections.votes.failed") %>"
9
+ <button class="close-button" data-close aria-label="<%= t("modal.close", scope: i18n_scope) %>"
8
10
  type="button">
9
11
  <span aria-hidden="true">&times;</span>
10
12
  </button>
11
13
  </div>
12
14
 
13
15
  <div class="row">
14
- <p>
15
- <%= t("modal.communication_lost", scope: "decidim.elections.votes.failed").html_safe %>
16
+ <p class="communication_error">
17
+ <%= t("modal.communication_lost", scope: i18n_scope).html_safe %>
18
+ </p>
19
+ <p class="generic_error hide">
20
+ <%= t("modal.generic_error", scope: i18n_scope).html_safe %>
16
21
  </p>
17
22
 
18
23
  <p class="help-text tech-info"></p>
@@ -21,7 +26,7 @@
21
26
  <div class="row">
22
27
  <div class="column flex-center">
23
28
  <button class="button primary expanded" data-close type="button">
24
- <%= t("modal.close", scope: "decidim.elections.votes.failed") %>
29
+ <%= t("modal.close", scope: i18n_scope) %>
25
30
  </button>
26
31
  </div>
27
32
  </div>
@@ -18,6 +18,8 @@
18
18
  <%= render("#{current_step}_steps") %>
19
19
  </div>
20
20
 
21
+ <%= render "decidim/elections/shared/broken_promises_modal" %>
22
+
21
23
  <% content_for :js_content do %>
22
24
  <%= javascript_pack_tag "decidim_elections_trustee_#{current_step}" %>
23
25
  <% end %>
@@ -22,6 +22,8 @@
22
22
  <%= form_tag election_vote_path(election, id: vote.encrypted_vote_hash), method: :patch, class: "update_vote_status" %>
23
23
  </div>
24
24
 
25
+ <%= render "decidim/elections/shared/broken_promises_modal" %>
26
+
25
27
  <% content_for :js_content do %>
26
28
  <%= javascript_pack_tag "decidim_elections_voter_casting_vote" %>
27
29
  <% end %>
@@ -59,7 +59,7 @@
59
59
  </div>
60
60
  </div>
61
61
 
62
- <%= render "server_error_modal" %>
62
+ <%= render "decidim/elections/shared/broken_promises_modal" %>
63
63
 
64
64
  <% content_for :js_content do %>
65
65
 
@@ -4,7 +4,7 @@
4
4
  scope: "decidim.votings.census.admin.census",
5
5
  processed_count: current_census.csv_row_processed_count,
6
6
  raw_count: current_census.csv_row_raw_count,
7
- file: current_census.file)}" %>
7
+ file: current_census.filename)}" %>
8
8
 
9
9
  <%= cell("decidim/announcement", info_message, callout_class: "warning") %>
10
10
  </div>
@@ -1,3 +1,3 @@
1
1
  <div class="card-section" id="census-creating-data-wrapper" data-update-status-url="<%= admin_status_voting_census_path %>">
2
- <%= cell("decidim/announcement", "<span class='loading-spinner'></span> &nbsp;#{t("exporting_access_codes.info_message", scope: "decidim.votings.census.admin.census")}", callout_class: "warning") %>
2
+ <%= cell("decidim/announcement", "<span class='loading-spinner'></span> &nbsp;#{t("exporting_access_codes.info_message", scope: "decidim.votings.census.admin.census", email: user_email)}", callout_class: "warning") %>
3
3
  </div>
@@ -1,3 +1,5 @@
1
1
  <div class="card-section">
2
2
  <%= cell("decidim/announcement", t("freeze.callout", scope: "decidim.votings.census.admin.census", email: user_email), callout_class: "warning" ) %>
3
+
4
+ <p><%= t("freeze.help_html", scope: "decidim.votings.census.admin.census") %></p>
3
5
  </div>
@@ -3,23 +3,33 @@
3
3
  scope: "decidim.votings.census.admin.census",
4
4
  data_count: current_census.data.size,
5
5
  raw_count: current_census.csv_row_raw_count,
6
- file: current_census.file) %>
6
+ file: current_census.filename) %>
7
7
  <% callout_class = "warning" %>
8
8
  <% else %>
9
9
  <% info_message = t("generate_access_codes.info_message_all",
10
10
  scope: "decidim.votings.census.admin.census",
11
11
  data_count: current_census.data.size,
12
12
  raw_count: current_census.csv_row_raw_count,
13
- file: current_census.file) %>
13
+ file: current_census.filename) %>
14
14
  <% callout_class = "success" %>
15
15
  <% end %>
16
16
 
17
17
  <div class="card-section">
18
18
  <%= cell("decidim/announcement", info_message, callout_class: callout_class ) %>
19
19
 
20
- <%= cell("decidim/announcement", t("generate_access_codes.callout", scope: "decidim.votings.census.admin.census"), callout_class: "warning" ) %>
21
- <%= link_to t("generate_access_codes.button", scope: "decidim.votings.census.admin.census"),
20
+ <% if current_census.data.size.zero? %>
21
+ <%= cell("decidim/announcement", t("generate_access_codes.start_over", scope: "decidim.votings.census.admin.census"), callout_class: "warning" ) %>
22
+ <%= link_to t("delete.button", scope: "decidim.votings.census.admin.census"),
23
+ admin_voting_census_path,
24
+ class: "button alert destroy",
25
+ method: :delete,
26
+ data: { confirm: t("delete.confirm", scope: "decidim.votings.census.admin.census") } %>
27
+
28
+ <% else %>
29
+ <%= cell("decidim/announcement", t("generate_access_codes.callout", scope: "decidim.votings.census.admin.census"), callout_class: "warning" ) %>
30
+ <%= link_to t("generate_access_codes.button", scope: "decidim.votings.census.admin.census"),
22
31
  generate_access_codes_path,
23
32
  class: "button",
24
33
  data: { confirm: t("generate_access_codes.confirm", scope: "decidim.votings.census.admin.census") } %>
34
+ <% end %>
25
35
  </div>
@@ -18,6 +18,6 @@
18
18
  </div>
19
19
  </div>
20
20
 
21
- <% if current_census.creating_data? || current_census.generating_codes? %>
21
+ <% if waiting_status? %>
22
22
  <%= javascript_pack_tag "decidim_votings_admin_update_census_dataset_status" %>
23
23
  <% end %>
@@ -18,6 +18,8 @@
18
18
  <% end %>
19
19
  </div>
20
20
 
21
+ <%= render "decidim/elections/shared/broken_promises_modal" %>
22
+
21
23
  <% content_for :js_content do %>
22
24
  <%= javascript_pack_tag "decidim_votings_in_person_vote" %>
23
25
  <% end %>
@@ -22,6 +22,8 @@
22
22
  <%= form_tag polling_officer_election_in_person_vote_path(polling_officer, election, in_person_vote), method: :patch, class: "update_vote_status" %>
23
23
  </div>
24
24
 
25
+ <%= render "decidim/elections/shared/broken_promises_modal" %>
26
+
25
27
  <% content_for :js_content do %>
26
28
  <%= javascript_pack_tag "decidim_votings_in_person_vote" %>
27
29
  <% end %>
@@ -13,7 +13,7 @@
13
13
  </div>
14
14
  <div class="columns mediumlarge-8 large-6 card--process__column">
15
15
  <div class="card--full__image"
16
- style="background-image:url(<%= promoted_voting.attached_uploader(:banner_image).path %>)">
16
+ style="background-image:url('<%= promoted_voting.attached_uploader(:banner_image).path %>')">
17
17
  <div class="card__content row collapse">
18
18
  <div class="large-6 large-offset-6 columns">
19
19
  <%= link_to voting_path(promoted_voting), class: "button expanded button--sc" do %>
@@ -1,2 +1 @@
1
- ---
2
1
  am: