decidim-elections 0.26.8 → 0.27.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/cells/decidim/votings/content_blocks/highlighted_votings/show.erb +2 -2
  4. data/app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb +4 -5
  5. data/app/cells/decidim/votings/content_blocks/landing_page/description/show.erb +1 -1
  6. data/app/cells/decidim/votings/content_blocks/landing_page/description_cell.rb +1 -1
  7. data/app/cells/decidim/votings/content_blocks/landing_page/header/show.erb +2 -2
  8. data/app/cells/decidim/votings/content_blocks/landing_page/header_cell.rb +1 -1
  9. data/app/commands/decidim/elections/admin/add_user_as_trustee.rb +1 -1
  10. data/app/commands/decidim/elections/admin/create_answer.rb +2 -2
  11. data/app/commands/decidim/elections/admin/create_election.rb +1 -1
  12. data/app/commands/decidim/elections/admin/create_question.rb +2 -2
  13. data/app/commands/decidim/elections/admin/destroy_answer.rb +2 -2
  14. data/app/commands/decidim/elections/admin/destroy_election.rb +2 -2
  15. data/app/commands/decidim/elections/admin/destroy_question.rb +2 -2
  16. data/app/commands/decidim/elections/admin/end_vote.rb +1 -1
  17. data/app/commands/decidim/elections/admin/import_proposals_to_elections.rb +3 -6
  18. data/app/commands/decidim/elections/admin/publish_election.rb +2 -2
  19. data/app/commands/decidim/elections/admin/publish_results.rb +1 -1
  20. data/app/commands/decidim/elections/admin/remove_trustee_from_participatory_space.rb +1 -1
  21. data/app/commands/decidim/elections/admin/report_missing_trustee.rb +1 -1
  22. data/app/commands/decidim/elections/admin/setup_election.rb +1 -1
  23. data/app/commands/decidim/elections/admin/start_key_ceremony.rb +1 -1
  24. data/app/commands/decidim/elections/admin/start_tally.rb +1 -1
  25. data/app/commands/decidim/elections/admin/start_vote.rb +1 -1
  26. data/app/commands/decidim/elections/admin/unpublish_election.rb +1 -1
  27. data/app/commands/decidim/elections/admin/update_action_status.rb +1 -1
  28. data/app/commands/decidim/elections/admin/update_answer.rb +2 -2
  29. data/app/commands/decidim/elections/admin/update_answer_selection.rb +1 -1
  30. data/app/commands/decidim/elections/admin/update_election.rb +1 -1
  31. data/app/commands/decidim/elections/admin/update_question.rb +2 -2
  32. data/app/commands/decidim/elections/admin/update_trustee_participatory_space.rb +1 -1
  33. data/app/commands/decidim/elections/trustee_zone/update_election_bulletin_board_status.rb +1 -1
  34. data/app/commands/decidim/elections/trustee_zone/update_trustee.rb +1 -1
  35. data/app/commands/decidim/elections/voter/cast_vote.rb +1 -1
  36. data/app/commands/decidim/elections/voter/update_vote_status.rb +2 -2
  37. data/app/commands/decidim/votings/admin/create_ballot_style.rb +1 -1
  38. data/app/commands/decidim/votings/admin/create_monitoring_committee_member.rb +1 -1
  39. data/app/commands/decidim/votings/admin/create_polling_officer.rb +1 -1
  40. data/app/commands/decidim/votings/admin/create_voting.rb +3 -2
  41. data/app/commands/decidim/votings/admin/destroy_ballot_style.rb +1 -1
  42. data/app/commands/decidim/votings/admin/destroy_monitoring_committee_member.rb +1 -1
  43. data/app/commands/decidim/votings/admin/destroy_polling_officer.rb +1 -1
  44. data/app/commands/decidim/votings/admin/destroy_polling_station.rb +1 -1
  45. data/app/commands/decidim/votings/admin/manage_polling_station.rb +2 -2
  46. data/app/commands/decidim/votings/admin/monitoring_committee_validate_polling_station_closure.rb +1 -1
  47. data/app/commands/decidim/votings/admin/publish_voting.rb +1 -1
  48. data/app/commands/decidim/votings/admin/unpublish_voting.rb +1 -1
  49. data/app/commands/decidim/votings/admin/update_ballot_style.rb +1 -1
  50. data/app/commands/decidim/votings/admin/update_voting.rb +3 -2
  51. data/app/commands/decidim/votings/census/admin/create_dataset.rb +22 -19
  52. data/app/commands/decidim/votings/census/admin/create_datum.rb +1 -1
  53. data/app/commands/decidim/votings/census/admin/destroy_dataset.rb +1 -1
  54. data/app/commands/decidim/votings/census/admin/increment_dataset_processed_rows.rb +1 -1
  55. data/app/commands/decidim/votings/census/admin/launch_access_codes_export.rb +1 -1
  56. data/app/commands/decidim/votings/census/admin/launch_access_codes_generation.rb +1 -1
  57. data/app/commands/decidim/votings/census/admin/update_dataset.rb +1 -1
  58. data/app/commands/decidim/votings/certify_polling_station_closure.rb +1 -1
  59. data/app/commands/decidim/votings/check_census.rb +1 -1
  60. data/app/commands/decidim/votings/create_polling_station_closure.rb +1 -1
  61. data/app/commands/decidim/votings/create_polling_station_results.rb +1 -1
  62. data/app/commands/decidim/votings/send_access_code.rb +1 -1
  63. data/app/commands/decidim/votings/sign_polling_station_closure.rb +1 -1
  64. data/app/commands/decidim/votings/voter/in_person_vote.rb +1 -1
  65. data/app/commands/decidim/votings/voter/update_in_person_vote_status.rb +1 -1
  66. data/app/controllers/decidim/elections/admin/steps_controller.rb +2 -2
  67. data/app/controllers/decidim/elections/admin/trustees_participatory_spaces_controller.rb +1 -1
  68. data/app/controllers/decidim/elections/elections_controller.rb +11 -13
  69. data/app/controllers/decidim/elections/trustee_zone/application_controller.rb +4 -6
  70. data/app/controllers/decidim/elections/trustee_zone/elections_controller.rb +1 -1
  71. data/app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb +1 -1
  72. data/app/controllers/decidim/votings/admin/votings_landing_page_controller.rb +1 -1
  73. data/app/controllers/decidim/votings/polling_officer_zone/closures_controller.rb +1 -5
  74. data/app/controllers/decidim/votings/polling_officer_zone/in_person_votes_controller.rb +1 -5
  75. data/app/controllers/decidim/votings/votings_controller.rb +12 -15
  76. data/app/forms/decidim/elections/admin/setup_form.rb +3 -46
  77. data/app/forms/decidim/elections/admin/vote_period_form.rb +2 -2
  78. data/app/forms/decidim/votings/admin/ballot_style_form.rb +1 -1
  79. data/app/forms/decidim/votings/admin/voting_form.rb +4 -3
  80. data/app/forms/decidim/votings/census/admin/dataset_form.rb +2 -5
  81. data/app/forms/decidim/votings/census/admin/datum_form.rb +1 -1
  82. data/app/helpers/decidim/elections/application_helper.rb +1 -1
  83. data/app/helpers/decidim/votings/votings_helper.rb +1 -1
  84. data/app/models/decidim/elections/answer.rb +1 -6
  85. data/app/models/decidim/elections/election.rb +15 -4
  86. data/app/models/decidim/elections/question.rb +1 -6
  87. data/app/models/decidim/votings/polling_station.rb +2 -3
  88. data/app/models/decidim/votings/voting.rb +15 -0
  89. data/app/packs/src/decidim/elections/admin/pending_action.js +0 -2
  90. data/app/packs/src/decidim/elections/admin/trustees_process.js +0 -2
  91. data/app/packs/src/decidim/elections/trustee/key_ceremony.js +0 -3
  92. data/app/packs/src/decidim/elections/trustee/tally.js +1 -4
  93. data/app/packs/src/decidim/elections/voter/casting-vote.js +0 -3
  94. data/app/packs/src/decidim/elections/voter/setup-vote.js +0 -2
  95. data/app/packs/src/decidim/votings/in-person-vote.js +0 -3
  96. data/app/permissions/decidim/elections/admin/permissions.rb +7 -1
  97. data/app/permissions/decidim/votings/admin/permissions.rb +3 -18
  98. data/app/permissions/decidim/votings/permissions.rb +1 -3
  99. data/app/presenters/decidim/votings/voting_stats_presenter.rb +4 -1
  100. data/app/queries/decidim/elections/admin/pending_actions.rb +1 -1
  101. data/app/queries/decidim/elections/admin/votes_for_statistics.rb +1 -1
  102. data/app/queries/decidim/elections/elections_finished_to_end.rb +1 -1
  103. data/app/queries/decidim/elections/elections_ready_to_start.rb +1 -1
  104. data/app/queries/decidim/elections/filtered_elections.rb +1 -1
  105. data/app/queries/decidim/elections/trustees/by_participatory_space.rb +1 -1
  106. data/app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb +1 -1
  107. data/app/queries/decidim/elections/votes/last_vote_for_voter.rb +1 -1
  108. data/app/queries/decidim/elections/votes/pending_votes.rb +1 -1
  109. data/app/queries/decidim/votings/admin/admin_users.rb +1 -1
  110. data/app/queries/decidim/votings/admin/ballot_style_by_voting_code.rb +1 -1
  111. data/app/queries/decidim/votings/admin/polling_officers_join_polling_stations.rb +1 -1
  112. data/app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb +2 -2
  113. data/app/queries/decidim/votings/admin/polling_officers_join_user.rb +1 -1
  114. data/app/queries/decidim/votings/organization_prioritized_votings.rb +2 -2
  115. data/app/queries/decidim/votings/organization_promoted_votings.rb +1 -1
  116. data/app/queries/decidim/votings/organization_published_votings.rb +2 -2
  117. data/app/queries/decidim/votings/organization_votings.rb +1 -1
  118. data/app/queries/decidim/votings/prioritized_votings.rb +1 -1
  119. data/app/queries/decidim/votings/published_votings.rb +1 -1
  120. data/app/queries/decidim/votings/votes/in_person_vote_for_voter.rb +1 -1
  121. data/app/queries/decidim/votings/votes/pending_in_person_votes.rb +1 -1
  122. data/app/services/decidim/votings/census_vote_flow.rb +1 -3
  123. data/app/views/decidim/elections/admin/elections/edit.html.erb +0 -1
  124. data/app/views/decidim/elections/admin/elections/index.html.erb +0 -1
  125. data/app/views/decidim/elections/admin/elections/new.html.erb +0 -1
  126. data/app/views/decidim/elections/admin/steps/_create_election.html.erb +1 -14
  127. data/app/views/decidim/elections/admin/steps/{_tally.html.erb → _tally_started.html.erb} +1 -1
  128. data/app/views/decidim/elections/admin/steps/index.html.erb +0 -2
  129. data/app/views/decidim/elections/admin/trustees_participatory_spaces/index.html.erb +0 -1
  130. data/app/views/decidim/elections/admin/trustees_participatory_spaces/new.html.erb +0 -1
  131. data/app/views/decidim/elections/elections/_filters.html.erb +2 -2
  132. data/app/views/decidim/elections/elections/election_log.html.erb +3 -1
  133. data/app/views/decidim/elections/elections/show.html.erb +1 -1
  134. data/app/views/decidim/elections/trustee_zone/elections/show.html.erb +3 -4
  135. data/app/views/decidim/elections/trustee_zone/trustees/show.html.erb +3 -1
  136. data/app/views/decidim/elections/votes/_onboarding_modal.html.erb +3 -1
  137. data/app/views/decidim/elections/votes/_show_casting.html.erb +3 -3
  138. data/app/views/decidim/elections/votes/new.html.erb +10 -7
  139. data/app/views/decidim/elections/votes/verify.html.erb +4 -1
  140. data/app/views/decidim/votings/admin/ballot_styles/edit.html.erb +0 -1
  141. data/app/views/decidim/votings/admin/ballot_styles/index.html.erb +0 -1
  142. data/app/views/decidim/votings/admin/ballot_styles/new.html.erb +0 -1
  143. data/app/views/decidim/votings/admin/votings/_form.html.erb +10 -1
  144. data/app/views/decidim/votings/admin/votings/edit.html.erb +0 -1
  145. data/app/views/decidim/votings/admin/votings/index.html.erb +0 -1
  146. data/app/views/decidim/votings/admin/votings/new.html.erb +1 -0
  147. data/app/views/decidim/votings/census/admin/census/show.html.erb +0 -1
  148. data/app/views/decidim/votings/polling_officer_zone/closures/_certify_form.html.erb +3 -1
  149. data/app/views/decidim/votings/polling_officer_zone/closures/_sign_form.html.erb +3 -1
  150. data/app/views/decidim/votings/polling_officer_zone/closures/edit.html.erb +3 -1
  151. data/app/views/decidim/votings/polling_officer_zone/closures/new.html.erb +3 -1
  152. data/app/views/decidim/votings/polling_officer_zone/in_person_votes/_complete_voting.html.erb +8 -2
  153. data/app/views/decidim/votings/polling_officer_zone/in_person_votes/new.html.erb +3 -3
  154. data/app/views/decidim/votings/polling_officer_zone/in_person_votes/show.html.erb +3 -3
  155. data/app/views/decidim/votings/votings/_filters.html.erb +2 -3
  156. data/app/views/decidim/votings/votings/_promoted_voting.html.erb +1 -1
  157. data/app/views/layouts/decidim/election_votes.html.erb +3 -1
  158. data/config/assets.rb +1 -1
  159. data/config/locales/am-ET.yml +1 -0
  160. data/config/locales/ar.yml +2 -43
  161. data/config/locales/bg.yml +1 -0
  162. data/config/locales/ca.yml +44 -64
  163. data/config/locales/cs.yml +47 -59
  164. data/config/locales/da.yml +1 -0
  165. data/config/locales/de.yml +18 -174
  166. data/config/locales/el.yml +1 -1095
  167. data/config/locales/en.yml +37 -56
  168. data/config/locales/eo.yml +1 -0
  169. data/config/locales/es-MX.yml +44 -64
  170. data/config/locales/es-PY.yml +44 -64
  171. data/config/locales/es.yml +46 -66
  172. data/config/locales/et.yml +1 -0
  173. data/config/locales/eu.yml +31 -54
  174. data/config/locales/fi-plain.yml +37 -57
  175. data/config/locales/fi.yml +40 -60
  176. data/config/locales/fr-CA.yml +57 -65
  177. data/config/locales/fr.yml +58 -66
  178. data/config/locales/ga-IE.yml +2 -19
  179. data/config/locales/gl.yml +28 -35
  180. data/config/locales/hr.yml +1 -0
  181. data/config/locales/hu.yml +21 -29
  182. data/config/locales/id-ID.yml +1 -0
  183. data/config/locales/is-IS.yml +2 -1
  184. data/config/locales/it.yml +34 -32
  185. data/config/locales/ja.yml +46 -75
  186. data/config/locales/ko.yml +1 -0
  187. data/config/locales/lb.yml +1 -0
  188. data/config/locales/lt.yml +1 -1401
  189. data/config/locales/lv.yml +1 -3
  190. data/config/locales/mt.yml +1 -0
  191. data/config/locales/nl.yml +36 -49
  192. data/config/locales/no.yml +13 -54
  193. data/config/locales/om-ET.yml +1 -0
  194. data/config/locales/pl.yml +43 -38
  195. data/config/locales/pt-BR.yml +35 -35
  196. data/config/locales/pt.yml +36 -35
  197. data/config/locales/ro-RO.yml +19 -69
  198. data/config/locales/ru.yml +1 -0
  199. data/config/locales/si-LK.yml +1 -0
  200. data/config/locales/sk.yml +1 -0
  201. data/config/locales/sl.yml +1 -0
  202. data/config/locales/so-SO.yml +1 -0
  203. data/config/locales/sr-CS.yml +1 -0
  204. data/config/locales/sv.yml +24 -73
  205. data/config/locales/sw-KE.yml +1 -0
  206. data/config/locales/ti-ER.yml +1 -0
  207. data/config/locales/tr-TR.yml +5 -61
  208. data/config/locales/uk.yml +1 -0
  209. data/config/locales/val-ES.yml +1 -0
  210. data/config/locales/vi.yml +1 -0
  211. data/config/locales/zh-CN.yml +2 -22
  212. data/config/locales/zh-TW.yml +1 -1391
  213. data/db/migrate/20220404112802_rename_bb_status_tally_to_tally_started.rb +19 -0
  214. data/db/migrate/20220424121541_add_show_check_census_to_votings.rb +7 -0
  215. data/db/migrate/20220615102642_remove_description_from_elections_questions.rb +1 -1
  216. data/lib/decidim/elections/component.rb +4 -4
  217. data/lib/decidim/elections/test/factories.rb +4 -5
  218. data/lib/decidim/elections/version.rb +1 -1
  219. data/lib/decidim/votings/admin_engine.rb +0 -4
  220. data/lib/decidim/votings/participatory_space.rb +3 -3
  221. data/lib/decidim/votings/test/factories.rb +2 -1
  222. metadata +27 -40
  223. data/app/controllers/decidim/votings/admin/exports_controller.rb +0 -14
  224. data/app/controllers/decidim/votings/admin/imports_controller.rb +0 -14
  225. data/app/controllers/decidim/votings/admin/reminders_controller.rb +0 -14
  226. data/app/forms/decidim/votings/admin/voting_role_form.rb +0 -29
  227. data/app/packs/src/decidim/elections/broken_promises_handler.js +0 -11
  228. data/app/services/decidim/elections/election_search.rb +0 -35
  229. data/app/services/decidim/votings/voting_search.rb +0 -46
  230. data/app/views/decidim/elections/shared/_broken_promises_modal.html.erb +0 -33
  231. data/config/environment.rb +0 -0
  232. data/config/locales/fa-IR.yml +0 -1
  233. data/config/locales/gn-PY.yml +0 -1
  234. data/config/locales/ka-GE.yml +0 -1
  235. data/config/locales/kaa.yml +0 -1
  236. data/config/locales/lo-LA.yml +0 -1
  237. data/config/locales/oc-FR.yml +0 -1
  238. /data/app/packs/entrypoints/{decidim_elections_trustee_tally.js → decidim_elections_trustee_tally_started.js} +0 -0
  239. /data/app/views/decidim/elections/trustee_zone/elections/{_tally_steps.html.erb → _tally_started_steps.html.erb} +0 -0
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RenameBbStatusTallyToTallyStarted < ActiveRecord::Migration[6.1]
4
+ class Election < ApplicationRecord
5
+ self.table_name = :decidim_elections_elections
6
+ end
7
+
8
+ def up
9
+ # rubocop:disable Rails/SkipsModelValidations
10
+ Election.where(bb_status: "tally").update_all(bb_status: "tally_started")
11
+ # rubocop:enable Rails/SkipsModelValidations
12
+ end
13
+
14
+ def down
15
+ # rubocop:disable Rails/SkipsModelValidations
16
+ Election.where(bb_status: "tally_started").update_all(bb_status: "tally")
17
+ # rubocop:enable Rails/SkipsModelValidations
18
+ end
19
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddShowCheckCensusToVotings < ActiveRecord::Migration[6.1]
4
+ def change
5
+ add_column :decidim_votings_votings, :show_check_census, :boolean, default: true
6
+ end
7
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class RemoveDescriptionFromElectionsQuestions < ActiveRecord::Migration[6.0]
3
+ class RemoveDescriptionFromElectionsQuestions < ActiveRecord::Migration[6.1]
4
4
  def change
5
5
  remove_column :decidim_elections_questions, :description, :jsonb
6
6
  end
@@ -142,7 +142,7 @@ Decidim.register_component(:elections) do |component|
142
142
  description: Decidim::Faker::Localized.sentence(word_count: 5),
143
143
  attached_to: answer,
144
144
  content_type: "image/jpeg",
145
- file: ActiveStorage::Blob.create_after_upload!(
145
+ file: ActiveStorage::Blob.create_and_upload!(
146
146
  io: File.open(File.join(__dir__, "seeds", "city.jpeg")),
147
147
  filename: "city.jpeg",
148
148
  content_type: "image/jpeg",
@@ -239,7 +239,7 @@ Decidim.register_component(:elections) do |component|
239
239
  description: Decidim::Faker::Localized.sentence(word_count: 5),
240
240
  attached_to: answer,
241
241
  content_type: "image/jpeg",
242
- file: ActiveStorage::Blob.create_after_upload!(
242
+ file: ActiveStorage::Blob.create_and_upload!(
243
243
  io: File.open(File.join(__dir__, "seeds", "city.jpeg")),
244
244
  filename: "city.jpeg",
245
245
  content_type: "image/jpeg",
@@ -360,7 +360,7 @@ Decidim.register_component(:elections) do |component|
360
360
  description: Decidim::Faker::Localized.sentence(word_count: 5),
361
361
  attached_to: answer,
362
362
  content_type: "image/jpeg",
363
- file: ActiveStorage::Blob.create_after_upload!(
363
+ file: ActiveStorage::Blob.create_and_upload!(
364
364
  io: File.open(File.join(__dir__, "seeds", "city.jpeg")),
365
365
  filename: "city.jpeg",
366
366
  content_type: "image/jpeg",
@@ -476,7 +476,7 @@ Decidim.register_component(:elections) do |component|
476
476
  description: Decidim::Faker::Localized.sentence(word_count: 5),
477
477
  attached_to: answer,
478
478
  content_type: "image/jpeg",
479
- file: ActiveStorage::Blob.create_after_upload!(
479
+ file: ActiveStorage::Blob.create_and_upload!(
480
480
  io: File.open(File.join(__dir__, "seeds", "city.jpeg")),
481
481
  filename: "city.jpeg",
482
482
  content_type: "image/jpeg",
@@ -47,7 +47,6 @@ FactoryBot.define do
47
47
 
48
48
  trait :ongoing do
49
49
  started
50
- blocked_at { Time.current }
51
50
  end
52
51
 
53
52
  trait :finished do
@@ -71,7 +70,7 @@ FactoryBot.define do
71
70
 
72
71
  trait :ready_for_setup do
73
72
  transient do
74
- trustee_keys { 3.times.map { [Faker::Name.name, generate(:private_key).export.to_json] }.to_h }
73
+ trustee_keys { 3.times.to_h { [Faker::Name.name, generate(:private_key).export.to_json] } }
75
74
  end
76
75
 
77
76
  upcoming
@@ -125,13 +124,13 @@ FactoryBot.define do
125
124
  end
126
125
  end
127
126
 
128
- trait :tally do
127
+ trait :tally_started do
129
128
  vote_ended
130
- bb_status { "tally" }
129
+ bb_status { "tally_started" }
131
130
  end
132
131
 
133
132
  trait :tally_ended do
134
- tally
133
+ tally_started
135
134
  bb_status { "tally_ended" }
136
135
  verifiable_results_file_hash { SecureRandom.hex(32) }
137
136
  verifiable_results_file_url { Faker::Internet.url }
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-meetings version.
5
5
  module Elections
6
6
  def self.version
7
- "0.26.8"
7
+ "0.27.0.rc1"
8
8
  end
9
9
  end
10
10
  end
@@ -53,10 +53,6 @@ module Decidim
53
53
  get :share
54
54
  end
55
55
  resources :exports, only: :create
56
- resources :imports, only: [:new, :create] do
57
- get :example, on: :collection
58
- end
59
- resources :reminders, only: [:new, :create]
60
56
  end
61
57
  end
62
58
 
@@ -51,7 +51,7 @@ Decidim.register_participatory_space(:votings) do |participatory_space|
51
51
  Decidim::Faker::Localized.paragraph(sentence_count: 3)
52
52
  end,
53
53
  scope: n.positive? ? nil : Decidim::Scope.reorder(Arel.sql("RANDOM()")).first,
54
- banner_image: ActiveStorage::Blob.create_after_upload!(
54
+ banner_image: ActiveStorage::Blob.create_and_upload!(
55
55
  io: File.open(File.join(seeds_root, "city.jpeg")),
56
56
  filename: "banner_image.jpeg",
57
57
  content_type: "image/jpeg",
@@ -99,8 +99,8 @@ Decidim.register_participatory_space(:votings) do |participatory_space|
99
99
  user.update!(
100
100
  name: Faker::Name.name,
101
101
  nickname: Faker::Twitter.unique.screen_name,
102
- password: "decidim123456",
103
- password_confirmation: "decidim123456",
102
+ password: "decidim123456789",
103
+ password_confirmation: "decidim123456789",
104
104
  organization: organization,
105
105
  confirmed_at: Time.current,
106
106
  locale: I18n.default_locale,
@@ -29,6 +29,7 @@ FactoryBot.define do
29
29
  introductory_image { Decidim::Dev.test_file("city.jpeg", "image/jpeg") }
30
30
  voting_type { "hybrid" }
31
31
  census_contact_information { nil }
32
+ show_check_census { true }
32
33
 
33
34
  trait :unpublished do
34
35
  published_at { nil }
@@ -174,7 +175,7 @@ FactoryBot.define do
174
175
  with_questions
175
176
 
176
177
  after(:create) do |ballot_style, evaluator|
177
- evaluator.election.questions.first(2).map { |question| create(:ballot_style_question, question: question, ballot_style: ballot_style) }
178
+ evaluator.election.reload.questions.first(2).map { |question| create(:ballot_style_question, question: question, ballot_style: ballot_style) }
178
179
  end
179
180
  end
180
181
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-elections
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.8
4
+ version: 0.27.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonardo Diez
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-07-27 00:00:00.000000000 Z
12
+ date: 2022-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: decidim-bulletin_board
@@ -17,84 +17,84 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 0.22.3
20
+ version: '0.23'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 0.22.3
27
+ version: '0.23'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: voting_schemes-dummy
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 0.22.3
34
+ version: '0.23'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 0.22.3
41
+ version: '0.23'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: voting_schemes-electionguard
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - '='
47
47
  - !ruby/object:Gem::Version
48
- version: 0.22.3
48
+ version: '0.23'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - '='
54
54
  - !ruby/object:Gem::Version
55
- version: 0.22.3
55
+ version: '0.23'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: decidim-core
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - '='
61
61
  - !ruby/object:Gem::Version
62
- version: 0.26.8
62
+ version: 0.27.0.rc1
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - '='
68
68
  - !ruby/object:Gem::Version
69
- version: 0.26.8
69
+ version: 0.27.0.rc1
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: decidim-forms
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - '='
75
75
  - !ruby/object:Gem::Version
76
- version: 0.26.8
76
+ version: 0.27.0.rc1
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - '='
82
82
  - !ruby/object:Gem::Version
83
- version: 0.26.8
83
+ version: 0.27.0.rc1
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: decidim-proposals
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - '='
89
89
  - !ruby/object:Gem::Version
90
- version: 0.26.8
90
+ version: 0.27.0.rc1
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - '='
96
96
  - !ruby/object:Gem::Version
97
- version: 0.26.8
97
+ version: 0.27.0.rc1
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rack-attack
100
100
  requirement: !ruby/object:Gem::Requirement
@@ -115,28 +115,28 @@ dependencies:
115
115
  requirements:
116
116
  - - '='
117
117
  - !ruby/object:Gem::Version
118
- version: 0.26.8
118
+ version: 0.27.0.rc1
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - '='
124
124
  - !ruby/object:Gem::Version
125
- version: 0.26.8
125
+ version: 0.27.0.rc1
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: decidim-dev
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - '='
131
131
  - !ruby/object:Gem::Version
132
- version: 0.26.8
132
+ version: 0.27.0.rc1
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - '='
138
138
  - !ruby/object:Gem::Version
139
- version: 0.26.8
139
+ version: 0.27.0.rc1
140
140
  description: The Elections module adds elections to any participatory space.
141
141
  email:
142
142
  - leo@codegram.com
@@ -288,15 +288,12 @@ files:
288
288
  - app/controllers/decidim/votings/admin/ballot_styles_controller.rb
289
289
  - app/controllers/decidim/votings/admin/component_permissions_controller.rb
290
290
  - app/controllers/decidim/votings/admin/components_controller.rb
291
- - app/controllers/decidim/votings/admin/exports_controller.rb
292
- - app/controllers/decidim/votings/admin/imports_controller.rb
293
291
  - app/controllers/decidim/votings/admin/monitoring_committee_election_results_controller.rb
294
292
  - app/controllers/decidim/votings/admin/monitoring_committee_members_controller.rb
295
293
  - app/controllers/decidim/votings/admin/monitoring_committee_polling_station_closures_controller.rb
296
294
  - app/controllers/decidim/votings/admin/monitoring_committee_verify_elections_controller.rb
297
295
  - app/controllers/decidim/votings/admin/polling_officers_controller.rb
298
296
  - app/controllers/decidim/votings/admin/polling_stations_controller.rb
299
- - app/controllers/decidim/votings/admin/reminders_controller.rb
300
297
  - app/controllers/decidim/votings/admin/voting_attachment_collections_controller.rb
301
298
  - app/controllers/decidim/votings/admin/voting_attachments_controller.rb
302
299
  - app/controllers/decidim/votings/admin/votings_controller.rb
@@ -334,7 +331,6 @@ files:
334
331
  - app/forms/decidim/votings/admin/polling_station_form.rb
335
332
  - app/forms/decidim/votings/admin/publish_results_form.rb
336
333
  - app/forms/decidim/votings/admin/voting_form.rb
337
- - app/forms/decidim/votings/admin/voting_role_form.rb
338
334
  - app/forms/decidim/votings/answer_result_form.rb
339
335
  - app/forms/decidim/votings/ballot_result_form.rb
340
336
  - app/forms/decidim/votings/census/admin/dataset_form.rb
@@ -395,7 +391,7 @@ files:
395
391
  - app/packs/entrypoints/decidim_elections_election_log.js
396
392
  - app/packs/entrypoints/decidim_elections_onboarding.js
397
393
  - app/packs/entrypoints/decidim_elections_trustee_key_ceremony.js
398
- - app/packs/entrypoints/decidim_elections_trustee_tally.js
394
+ - app/packs/entrypoints/decidim_elections_trustee_tally_started.js
399
395
  - app/packs/entrypoints/decidim_elections_trustee_trustee_zone.js
400
396
  - app/packs/entrypoints/decidim_elections_trustee_zone.js
401
397
  - app/packs/entrypoints/decidim_elections_trustee_zone.scss
@@ -422,7 +418,6 @@ files:
422
418
  - app/packs/src/decidim/elections/admin/pending_action.js
423
419
  - app/packs/src/decidim/elections/admin/trustees_process.js
424
420
  - app/packs/src/decidim/elections/admin/vote_statistics.js
425
- - app/packs/src/decidim/elections/broken_promises_handler.js
426
421
  - app/packs/src/decidim/elections/election_log.js
427
422
  - app/packs/src/decidim/elections/onboarding.js
428
423
  - app/packs/src/decidim/elections/trustee/key_ceremony.js
@@ -500,11 +495,9 @@ files:
500
495
  - app/queries/decidim/votings/votes/pending_in_person_votes.rb
501
496
  - app/serializers/decidim/votings/census/datum_serializer.rb
502
497
  - app/services/decidim/elections/current_user_vote_flow.rb
503
- - app/services/decidim/elections/election_search.rb
504
498
  - app/services/decidim/elections/vote_flow.rb
505
499
  - app/services/decidim/votings/census/access_codes_exporter.rb
506
500
  - app/services/decidim/votings/census_vote_flow.rb
507
- - app/services/decidim/votings/voting_search.rb
508
501
  - app/uploaders/decidim/cw/votings/census/voting_census_uploader.rb
509
502
  - app/views/decidim/elections/admin/answers/_form.html.erb
510
503
  - app/views/decidim/elections/admin/answers/edit.html.erb
@@ -526,8 +519,8 @@ files:
526
519
  - app/views/decidim/elections/admin/steps/_key_ceremony.html.erb
527
520
  - app/views/decidim/elections/admin/steps/_key_ceremony_ended.html.erb
528
521
  - app/views/decidim/elections/admin/steps/_results_published.html.erb
529
- - app/views/decidim/elections/admin/steps/_tally.html.erb
530
522
  - app/views/decidim/elections/admin/steps/_tally_ended.html.erb
523
+ - app/views/decidim/elections/admin/steps/_tally_started.html.erb
531
524
  - app/views/decidim/elections/admin/steps/_vote.html.erb
532
525
  - app/views/decidim/elections/admin/steps/_vote_ended.html.erb
533
526
  - app/views/decidim/elections/admin/steps/_vote_stats.html.erb
@@ -544,12 +537,11 @@ files:
544
537
  - app/views/decidim/elections/elections/index.html.erb
545
538
  - app/views/decidim/elections/elections/index.js.erb
546
539
  - app/views/decidim/elections/elections/show.html.erb
547
- - app/views/decidim/elections/shared/_broken_promises_modal.html.erb
548
540
  - app/views/decidim/elections/trustee_mailer/notification.html.erb
549
541
  - app/views/decidim/elections/trustee_zone/elections/_backup_modal.html.erb
550
542
  - app/views/decidim/elections/trustee_zone/elections/_key_ceremony_steps.html.erb
551
543
  - app/views/decidim/elections/trustee_zone/elections/_restore_modal.html.erb
552
- - app/views/decidim/elections/trustee_zone/elections/_tally_steps.html.erb
544
+ - app/views/decidim/elections/trustee_zone/elections/_tally_started_steps.html.erb
553
545
  - app/views/decidim/elections/trustee_zone/elections/show.html.erb
554
546
  - app/views/decidim/elections/trustee_zone/elections/update.js.erb
555
547
  - app/views/decidim/elections/trustee_zone/trustees/show.html.erb
@@ -646,7 +638,6 @@ files:
646
638
  - app/views/layouts/decidim/voting_landing.html.erb
647
639
  - app/views/layouts/decidim/votings.html.erb
648
640
  - config/assets.rb
649
- - config/environment.rb
650
641
  - config/initializers/decidim_bulletin_board.rb
651
642
  - config/initializers/rack_attack.rb
652
643
  - config/locales/am-ET.yml
@@ -668,7 +659,6 @@ files:
668
659
  - config/locales/et-EE.yml
669
660
  - config/locales/et.yml
670
661
  - config/locales/eu.yml
671
- - config/locales/fa-IR.yml
672
662
  - config/locales/fi-plain.yml
673
663
  - config/locales/fi.yml
674
664
  - config/locales/fr-CA.yml
@@ -676,7 +666,6 @@ files:
676
666
  - config/locales/fr.yml
677
667
  - config/locales/ga-IE.yml
678
668
  - config/locales/gl.yml
679
- - config/locales/gn-PY.yml
680
669
  - config/locales/hr-HR.yml
681
670
  - config/locales/hr.yml
682
671
  - config/locales/hu.yml
@@ -685,13 +674,10 @@ files:
685
674
  - config/locales/is.yml
686
675
  - config/locales/it.yml
687
676
  - config/locales/ja.yml
688
- - config/locales/ka-GE.yml
689
- - config/locales/kaa.yml
690
677
  - config/locales/ko-KR.yml
691
678
  - config/locales/ko.yml
692
679
  - config/locales/lb-LU.yml
693
680
  - config/locales/lb.yml
694
- - config/locales/lo-LA.yml
695
681
  - config/locales/lt-LT.yml
696
682
  - config/locales/lt.yml
697
683
  - config/locales/lv.yml
@@ -699,7 +685,6 @@ files:
699
685
  - config/locales/mt.yml
700
686
  - config/locales/nl.yml
701
687
  - config/locales/no.yml
702
- - config/locales/oc-FR.yml
703
688
  - config/locales/om-ET.yml
704
689
  - config/locales/pl.yml
705
690
  - config/locales/pt-BR.yml
@@ -765,6 +750,8 @@ files:
765
750
  - db/migrate/20210422124826_add_verifiable_results_to_decidim_elections_election.rb
766
751
  - db/migrate/20210426072845_add_signed_at_to_polling_station_closure.rb
767
752
  - db/migrate/20210427131742_add_validated_at_to_votings_polling_station_closures.rb
753
+ - db/migrate/20220404112802_rename_bb_status_tally_to_tally_started.rb
754
+ - db/migrate/20220424121541_add_show_check_census_to_votings.rb
768
755
  - db/migrate/20220615102642_remove_description_from_elections_questions.rb
769
756
  - db/seeds/Exampledocument.pdf
770
757
  - db/seeds/city.jpeg
@@ -821,14 +808,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
821
808
  requirements:
822
809
  - - ">="
823
810
  - !ruby/object:Gem::Version
824
- version: '2.7'
811
+ version: '3.0'
825
812
  required_rubygems_version: !ruby/object:Gem::Requirement
826
813
  requirements:
827
- - - ">="
814
+ - - ">"
828
815
  - !ruby/object:Gem::Version
829
- version: '0'
816
+ version: 1.3.1
830
817
  requirements: []
831
- rubygems_version: 3.1.6
818
+ rubygems_version: 3.2.22
832
819
  signing_key:
833
820
  specification_version: 4
834
821
  summary: A decidim elections module (votings space and elections component)
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Votings
5
- module Admin
6
- # This controller allows exporting things.
7
- # It is targeted for customizations for exporting things that lives under
8
- # a participatory process.
9
- class ExportsController < Decidim::Admin::ExportsController
10
- include VotingAdmin
11
- end
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Votings
5
- module Admin
6
- # This controller allows importing things.
7
- # It is targeted for customizations for importing things that lives under
8
- # a voting space.
9
- class ImportsController < Decidim::Admin::ImportsController
10
- include VotingAdmin
11
- end
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Votings
5
- module Admin
6
- # This controller allows to send reminders.
7
- # It is targeted for customizations for reminder things that lives under
8
- # votings.
9
- class RemindersController < Decidim::Admin::RemindersController
10
- include VotingAdmin
11
- end
12
- end
13
- end
14
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Votings
5
- module Admin
6
- # Base class to be inherited by other forms that have roles
7
- # in the Votings space
8
- class VotingRoleForm < Decidim::Form
9
- attribute :name, String
10
- attribute :email, String
11
- attribute :user_id, Integer
12
- attribute :existing_user, Boolean, default: false
13
-
14
- validates :email, presence: true, format: { with: ::Devise.email_regexp }, unless: ->(form) { form.existing_user }
15
- validates :name, presence: true, format: { with: UserBaseEntity::REGEXP_NAME }, unless: ->(form) { form.existing_user }
16
- validates :user, presence: true, if: ->(form) { form.existing_user }
17
-
18
- def map_model(model)
19
- self.user_id = model.decidim_user_id
20
- self.existing_user = user_id.present?
21
- end
22
-
23
- def user
24
- @user ||= current_organization.users.find_by(id: user_id)
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,11 +0,0 @@
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,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Elections
5
- # This class handles search and filtering of elections.
6
- class ElectionSearch < ResourceSearch
7
- # Public: Initializes the service.
8
- # component - A Decidim::Component to get the election from.
9
- # page - The page number to paginate the results.
10
- # per_page - The number of proposals to return per page.
11
- def initialize(options = {})
12
- super(Election.all, options)
13
- end
14
-
15
- # Handle the search_text filter
16
- def search_search_text
17
- query
18
- .where("decidim_elections_elections.title::text ILIKE ?", "%#{search_text}%")
19
- .or(query.where("decidim_elections_elections.description::text ILIKE ?", "%#{search_text}%"))
20
- end
21
-
22
- # Handle the state filter
23
- def search_state
24
- active = state.member?("active") ? query.active : nil
25
- upcoming = state.member?("upcoming") ? query.upcoming : nil
26
- finished = state.member?("finished") ? query.finished : nil
27
-
28
- query
29
- .where(id: upcoming)
30
- .or(query.where(id: active))
31
- .or(query.where(id: finished))
32
- end
33
- end
34
- end
35
- end
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Votings
5
- # Service that encapsulates all logic related to filtering votings.
6
- class VotingSearch < Searchlight::Search
7
- # Public: Initializes the service.
8
- # page - The page number to paginate the results.
9
- # per_page - The number of proposals to return per page.
10
- def initialize(options = {})
11
- super(options)
12
- end
13
-
14
- def base_query
15
- Decidim::Votings::Voting.where(organization: options[:organization]).published
16
- end
17
-
18
- # Handle the search_text filter
19
- def search_search_text
20
- query
21
- .where(Arel.sql("title->>'#{current_locale}' ILIKE ?").to_s, "%#{search_text}%")
22
- .or(
23
- query.where(Arel.sql("description->>'#{current_locale}' ILIKE ?").to_s, "%#{search_text}%")
24
- )
25
- end
26
-
27
- # Handle the state filter
28
- def search_state
29
- active = state.member?("active") ? query.active : nil
30
- upcoming = state.member?("upcoming") ? query.upcoming : nil
31
- finished = state.member?("finished") ? query.finished : nil
32
-
33
- query
34
- .where(id: upcoming)
35
- .or(query.where(id: active))
36
- .or(query.where(id: finished))
37
- end
38
-
39
- private
40
-
41
- def current_locale
42
- I18n.locale.to_s
43
- end
44
- end
45
- end
46
- end
@@ -1,33 +0,0 @@
1
- <% i18n_scope ||= "decidim.elections.connection.failed" %>
2
-
3
- <div class="reveal" id="server-failure" data-reveal>
4
- <div class="reveal__header">
5
- <h3 class="reveal__title">
6
- <%= t("modal.title", scope: i18n_scope) %>
7
- </h3>
8
-
9
- <button class="close-button" data-close aria-label="<%= t("modal.close", scope: i18n_scope) %>"
10
- type="button">
11
- <span aria-hidden="true">&times;</span>
12
- </button>
13
- </div>
14
-
15
- <div class="row">
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 %>
21
- </p>
22
-
23
- <p class="help-text tech-info"></p>
24
- </div>
25
-
26
- <div class="row">
27
- <div class="column flex-center">
28
- <button class="button primary expanded" data-close type="button">
29
- <%= t("modal.close", scope: i18n_scope) %>
30
- </button>
31
- </div>
32
- </div>
33
- </div>
File without changes