decidim-elections 0.31.0.rc2 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/helpers/decidim/elections/application_helper.rb +12 -0
  3. data/app/packs/stylesheets/decidim/elections/elections.scss +4 -0
  4. data/app/views/decidim/elections/admin/census/edit.html.erb +15 -13
  5. data/app/views/decidim/elections/admin/dashboard/_questions.html.erb +1 -0
  6. data/app/views/decidim/elections/admin/dashboard/_questions_with_results.html.erb +1 -0
  7. data/app/views/decidim/elections/admin/elections/_form.html.erb +2 -2
  8. data/app/views/decidim/elections/admin/elections/dashboard.html.erb +4 -4
  9. data/app/views/decidim/elections/admin/elections/new.html.erb +1 -1
  10. data/app/views/decidim/elections/admin/questions/edit_questions.html.erb +2 -2
  11. data/app/views/decidim/elections/per_question_votes/show.html.erb +4 -1
  12. data/app/views/decidim/elections/votes/show.html.erb +4 -1
  13. data/config/locales/ca-IT.yml +0 -1
  14. data/config/locales/ca.yml +0 -1
  15. data/config/locales/cs.yml +23 -0
  16. data/config/locales/en.yml +0 -1
  17. data/config/locales/es-MX.yml +0 -1
  18. data/config/locales/es-PY.yml +0 -1
  19. data/config/locales/es.yml +0 -1
  20. data/config/locales/eu.yml +1 -2
  21. data/config/locales/fi-plain.yml +0 -1
  22. data/config/locales/fi.yml +0 -1
  23. data/config/locales/fr-CA.yml +8 -0
  24. data/config/locales/fr.yml +8 -0
  25. data/config/locales/ja.yml +0 -1
  26. data/config/locales/sv.yml +0 -1
  27. data/lib/decidim/elections/engine.rb +6 -0
  28. data/lib/decidim/elections/test/per_question_vote_examples.rb +9 -0
  29. data/lib/decidim/elections/test/vote_examples.rb +2 -0
  30. data/lib/decidim/elections/version.rb +1 -1
  31. metadata +14 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1350982617f9cf2b5417179740fe67d319fd01e74c85fbcc823f092d78b23923
4
- data.tar.gz: 29788cfe9ee20c68fbbd6739baee65968c98c1ed3daf344e11634ba3f458687e
3
+ metadata.gz: 9ec49644173bf7e80079c7743d7eb81ba6ba300a744c1001b1175315bd150d8e
4
+ data.tar.gz: 2ed772499e951961cc6cd12efad4df11ad9afb0b54879458674bbb4bcd2221f2
5
5
  SHA512:
6
- metadata.gz: 3535497567d41f0d365331a63ffb3aa2f751bcef39460de3f9c3ab377f64e0be9011f85748b819f4910141bdcfbd5ff506b96d11ba3d52d71175571381b80f91
7
- data.tar.gz: 07cfca093845a3378687f949072ac9a16fcace3ce766e1bbe6be70922db0dc04b8380c3c44fa67d867802766ef5cf1800dd164d9937889ec8c375be1140e3526
6
+ metadata.gz: 60d40111642b60f26d17c7b32fe0d6f5a03853634c3e24224762e24682ec02234cff2e1f7e2654577a9f8f743df6a1feeb795556a27d49389a50111f442ddf33
7
+ data.tar.gz: 6a02d692108948fab7732182a94a36c0b49b01cd069be61ed744d05717e43073000107280020724c4b684e3cc067a6bd10871ce646cc874b820a1b52ce9da937
@@ -43,6 +43,18 @@ module Decidim
43
43
  end
44
44
  end
45
45
 
46
+ def render_question_description(question)
47
+ description = translated_attribute(question.description)
48
+ return if description.blank?
49
+
50
+ sanitized = decidim_sanitize_admin(description)
51
+ if rich_text_editor_in_public_views?
52
+ Decidim::ContentProcessor.render_without_format(sanitized).html_safe
53
+ else
54
+ Decidim::ContentProcessor.render(sanitized, "div")
55
+ end
56
+ end
57
+
46
58
  def selected_response_option_id(question)
47
59
  session.dig(:votes_buffer, question.id.to_s, "response_option_id")&.to_i
48
60
  end
@@ -89,3 +89,7 @@
89
89
  }
90
90
  }
91
91
  }
92
+
93
+ .vote_booth-question_title {
94
+ @apply h3 mb-4;
95
+ }
@@ -2,33 +2,35 @@
2
2
 
3
3
  <div class="item_show__header form-defaults border-none">
4
4
  <h1 class="item_show__header-title">
5
- <%= t(".title") %>
5
+ <%= t("decidim.elections.actions.edit") %>
6
6
  </h1>
7
+ </div>
8
+
9
+ <%= render "decidim/elections/admin/elections/tabs_menu" %>
10
+
11
+ <div class="form-defaults my-8 flex justify-end">
7
12
  <%= select_tag "census_manifest",
8
13
  options_for_select(census_manifests.to_h { |manifest| [manifest.label, manifest.name] }, selected: election.census&.name),
9
14
  include_blank: t(".choose_census"),
10
15
  id: "census-manifest-selector" %>
11
-
12
16
  </div>
13
17
 
14
- <%= render "decidim/elections/admin/elections/tabs_menu" %>
15
-
16
- <% if election.census_ready? %>
17
- <%
18
- census_ready = t("decidim.elections.censuses.census_ready_html", election_title: decidim_sanitize_translated(election.title))
19
- census_count = t("decidim.elections.censuses.census_size_html", count: census_count(election))
20
- %>
18
+ <% if election.census_ready? %>
19
+ <%
20
+ census_ready = t("decidim.elections.censuses.census_ready_html", election_title: decidim_sanitize_translated(election.title))
21
+ census_count = t("decidim.elections.censuses.census_size_html", count: census_count(election))
22
+ %>
21
23
  <%= cell "decidim/announcement", "#{census_ready}<br>#{census_count}", callout_class: "success" %>
22
- <% end %>
24
+ <% end %>
25
+
23
26
  <div class="card-section census-form form-defaults 2xl:mr-80">
24
27
  <% if @form && election.census&.admin_form_partial %>
25
28
  <%= decidim_form_for(@form, url: election_census_path(election, manifest: election.census&.name), method: :patch, multipart: true, html: { id: "census-election-form" }) do |f| %>
26
29
  <%= render partial: election.census.admin_form_partial, locals: { form: f } %>
27
30
  <% end %>
28
31
  <% end %>
29
- <div class="border-t border-gray-3 my-4">
30
- <%= render partial: "decidim/elections/admin/census/preview", locals: { election: } if preview_users(election).present? %>
31
- </div>
32
+
33
+ <%= render partial: "decidim/elections/admin/census/preview", locals: { election: } if preview_users(election).present? %>
32
34
  </div>
33
35
 
34
36
  <div class="item__edit-sticky">
@@ -19,6 +19,7 @@
19
19
  <%= translated_attribute(question.body) %>
20
20
  <small class="font-normal ml-4"><%= t("decidim.forms.question_types.#{question.question_type}") %></small>
21
21
  </h3>
22
+ <div><%= decidim_sanitize_admin translated_attribute(question.description) %></div>
22
23
  <h3 class="h6 mt-4 mb-2"><%= t("decidim.elections.admin.dashboard.questions.labels.answers") %>:</h3>
23
24
  <ul>
24
25
  <% question.response_options.each_with_index do |option, opt_index| %>
@@ -15,6 +15,7 @@
15
15
  </div>
16
16
  <% end %>
17
17
  </h3>
18
+ <div><%= decidim_sanitize_admin translated_attribute(question.description) %></div>
18
19
  </div>
19
20
  <div class="row column">
20
21
  <div class="table-scroll mb-4">
@@ -55,11 +55,11 @@
55
55
  <div class="row column election-fields--time">
56
56
  <div class="md:flex w-100">
57
57
  <div class="row column election_start_time">
58
- <%= form.datetime_field :start_at, label: t("decidim.elections.admin.elections.form.start_at") %>
58
+ <%= form.datetime_field :start_at, label: t("decidim.elections.admin.elections.form.start_at"), disabled: disable_fields %>
59
59
  <%= form.hidden_field :start_at, value: election.start_at if disable_fields %>
60
60
  </div>
61
61
  <div class="row column">
62
- <%= form.datetime_field :end_at, label: t("decidim.elections.admin.elections.form.end_at") %>
62
+ <%= form.datetime_field :end_at, label: t("decidim.elections.admin.elections.form.end_at"), disabled: disable_fields %>
63
63
  <%= form.hidden_field :end_at, value: election.end_at if disable_fields %>
64
64
  </div>
65
65
  </div>
@@ -5,15 +5,15 @@
5
5
 
6
6
  <div class="item_show__header" style="border-bottom: none;">
7
7
  <h1 class="item_show__header-title">
8
- <%= t(".title") %>
8
+ <%= t("decidim.elections.actions.edit") %>
9
9
  </h1>
10
10
 
11
11
  <div>
12
- <%= link_to resource_locator(election).path, class: "button button__xs button__transparent-secondary", target: :blank, data: { "external-link": false } do %>
13
- <%= icon "eye-line" %>
12
+ <%= link_to resource_locator(election).path, class: "button button__xs button__transparent-secondary flex flex-row items-center gap-2", target: :blank, data: { "external-link": false } do %>
13
+ <%= icon "eye-line", class: "inline-block" %>
14
14
  <%# i18n-tasks-use t("decidim.elections.actions.view") %>
15
15
  <%# i18n-tasks-use t("decidim.elections.actions.preview") %>
16
- <%= t(election.published? ? "view" : "preview", scope: "decidim.elections.actions") %>
16
+ <span class="whitespace-nowrap"><%= t(election.published? ? "view" : "preview", scope: "decidim.elections.actions") %></span>
17
17
  <% end %>
18
18
  </div>
19
19
  </div>
@@ -3,7 +3,7 @@
3
3
  <% append_javascript_pack_tag "decidim_elections_admin" %>
4
4
  <% append_stylesheet_pack_tag "decidim_elections_admin" %>
5
5
 
6
- <div class="item_show__header">
6
+ <div class="item_show__header border-none">
7
7
  <h1 class="item_show__header-title">
8
8
  <%= t(".title") %>
9
9
  </h1>
@@ -3,8 +3,7 @@
3
3
  <div class="questionnaire-questions">
4
4
  <div class="item_show__header" style="border-bottom: none;">
5
5
  <h1 class="item_show__header-title">
6
- <%= t(".title") %>
7
- <button class="button button__sm button__transparent-secondary add-question"><%= t("add_question", scope: "decidim.forms.admin.questionnaires.form") %></button>
6
+ <%= t("decidim.elections.actions.edit") %>
8
7
  </h1>
9
8
  </div>
10
9
 
@@ -26,5 +25,6 @@
26
25
  </div>
27
26
  </div>
28
27
  </div>
28
+ <button class="button button__sm button__transparent-secondary add-question mt-1"><%= t("add_question", scope: "decidim.forms.admin.questionnaires.form") %></button>
29
29
  </div>
30
30
  </div>
@@ -1,5 +1,8 @@
1
1
  <%= form_with url: url_for(action: :show, id: question), method: :patch, local: true do %>
2
- <%= question_title(question, :h1, class: "h4 mb-8") %>
2
+ <%= question_title(question, :h1, class: "vote_booth-question_title") %>
3
+ <div class="editor-content">
4
+ <%= render_question_description(question) %>
5
+ </div>
3
6
 
4
7
  <div class="question__response-options mt-4 flex flex-col gap-4">
5
8
  <% question.response_options.each do |option| %>
@@ -1,5 +1,8 @@
1
1
  <%= form_with url: url_for(action: :show, id: question), method: :patch, local: true do %>
2
- <%= question_title(question, :h1, class: "h4 mb-8") %>
2
+ <%= question_title(question, :h1, class: "vote_booth-question_title") %>
3
+ <div class="editor-content">
4
+ <%= render_question_description(question) %>
5
+ </div>
3
6
 
4
7
  <div class="question__response-options mt-4 flex flex-col gap-4">
5
8
  <% question.response_options.each do |option| %>
@@ -45,7 +45,6 @@ ca-IT:
45
45
  choose_census: Tria el tipus de cens que vols vincular a aquesta elecció
46
46
  created_at: Creada el
47
47
  identifier: Identificador d'usuària
48
- title: Tipus de cens
49
48
  preview:
50
49
  title:
51
50
  one: La vista prèvia de la llista està limitada a %{count} registre.
@@ -45,7 +45,6 @@ ca:
45
45
  choose_census: Tria el tipus de cens que vols vincular a aquesta elecció
46
46
  created_at: Creada el
47
47
  identifier: Identificador d'usuària
48
- title: Tipus de cens
49
48
  preview:
50
49
  title:
51
50
  one: La vista prèvia de la llista està limitada a %{count} registre.
@@ -129,7 +129,22 @@ cs:
129
129
  already_have_an_account?: Již máte účet?
130
130
  are_you_new?: Nový účastník?
131
131
  sign_in_description: Přihlaste se k hlasování v těchto volbách
132
+ sign_up_description: Vytvořte účet pro hlasování v této volbě
133
+ internal_users_form:
134
+ authorization_options_invalid: Bohužel, i když máte všechna požadovaná oprávnění, některé z nich pro tyto volby neplatí.
135
+ invalid: V těchto volbách nemáte oprávnění volit.
136
+ missing: Vašemu uživateli chybí některá požadovaná autorizace. Zkontrolujte prosím informace a zkuste to znovu.
137
+ resume_with_method: Pokračovat v ověřování pomocí %{name}
138
+ verify_with_method: Ověřit pomocí %{name}
132
139
  token_csv:
140
+ example: |
141
+ e-mail;token
142
+ user@example.org;123456
143
+ user2@example.org;ABCXYZ
144
+ info_html: |
145
+ Musí být soubor ve formátu CSV se dvěma sloupci, jedna s e-mailovou adresou a druhá s hodnotou tokenu, který uživatel bude muset představit, aby mohl hlasovat.
146
+ Musí být oddělena středníkem (;)
147
+ label: Neregistrovaní účastníci s tokeny (fixní)
133
148
  upload_file: Nahrát soubor
134
149
  upload_new_census: Nahrát CSV soubor
135
150
  token_csv_form:
@@ -147,6 +162,7 @@ cs:
147
162
  other: "%{count} voleb"
148
163
  elections:
149
164
  empty: Nejsou k dispozici žádné volby.
165
+ empty_filters: Neexistují žádné volby, které by odpovídaly vašim filtrům.
150
166
  filters:
151
167
  all: Vše
152
168
  state: Stav
@@ -164,6 +180,8 @@ cs:
164
180
  show:
165
181
  vote_button: Hlasovat
166
182
  vote_results:
183
+ subtitle:
184
+ per_question: Výsledky jsou k dispozici na jednu otázku. Výsledky pro každou otázku můžete vidět po povolení hlasování a po zveřejnění výsledků.
167
185
  title: Výsledky
168
186
  models:
169
187
  election:
@@ -176,11 +194,14 @@ cs:
176
194
  per_question_votes:
177
195
  waiting:
178
196
  edit_vote: Upravte svůj hlas
197
+ exit_button: Odejít z čekací místnosti
198
+ title: Čekání na další otázku
179
199
  status:
180
200
  active: Aktivní
181
201
  finished: Dokončeno
182
202
  not_started: Nezahájeno
183
203
  ongoing: Probíhající
204
+ published_results: Zveřejněné výsledky
184
205
  scheduled: Naplánováno
185
206
  unpublished: Nezveřejněno
186
207
  voting_enabled: Probíhá hlasování
@@ -190,9 +211,11 @@ cs:
190
211
  success: Váš hlas byl úspěšně odeslán.
191
212
  check_census:
192
213
  access: Přístup
214
+ election_not_open: Volby ještě nejsou otevřeny. Zkontrolujte prosím datum a zkuste to znovu.
193
215
  failed: Vaši identitu nelze ověřit. Zkontrolujte zadané informace a zkuste to znovu.
194
216
  form_title: Ověřte svou identitu
195
217
  confirm:
218
+ edit_vote: Upravte svůj hlas
196
219
  not_answered: Na tuto otázku jste neodpověděl.
197
220
  title: Potvrďte svůj hlas
198
221
  not_authorized: V těchto volbách nemáte oprávnění volit.
@@ -45,7 +45,6 @@ en:
45
45
  choose_census: Choose the census type you want to use for this election
46
46
  created_at: Created at
47
47
  identifier: User identifier
48
- title: Census type
49
48
  preview:
50
49
  title:
51
50
  one: The preview list is limited to %{count} record.
@@ -45,7 +45,6 @@ es-MX:
45
45
  choose_census: Elige el tipo de censo que quieres vincular esta elección
46
46
  created_at: Creado el
47
47
  identifier: Identificador de usuaria
48
- title: Tipo de censo
49
48
  preview:
50
49
  title:
51
50
  one: La vista previa de la lista está limitada a %{count} registro.
@@ -45,7 +45,6 @@ es-PY:
45
45
  choose_census: Elige el tipo de censo que quieres vincular esta elección
46
46
  created_at: Creado el
47
47
  identifier: Identificador de usuaria
48
- title: Tipo de censo
49
48
  preview:
50
49
  title:
51
50
  one: La vista previa de la lista está limitada a %{count} registro.
@@ -45,7 +45,6 @@ es:
45
45
  choose_census: Elige el tipo de censo que quieres vincular esta elección
46
46
  created_at: Creado el
47
47
  identifier: Identificador de usuaria
48
- title: Tipo de censo
49
48
  preview:
50
49
  title:
51
50
  one: La vista previa de la lista está limitada a %{count} registro.
@@ -45,7 +45,6 @@ eu:
45
45
  choose_census: Hautatu hauteskunde hauetarako erabili nahi duzun errolda-mota
46
46
  created_at: Sortze-data
47
47
  identifier: Parte-hartzailearen identifikatzailea
48
- title: Errolda-mota
49
48
  preview:
50
49
  title:
51
50
  one: Aurrebistaren zerrenda erregistro batera mugatuta dago.
@@ -181,7 +180,7 @@ eu:
181
180
  unpublish: "%{user_name} parte-hartzaileak %{resource_name} hauteskundea despublikatu du %{space_name} espazioan"
182
181
  update: "%{user_name} parte-hartzaileak %{resource_name} hauteskundea eguneratu du %{space_name} espazioan"
183
182
  question:
184
- update: "%{user_name} -k eguneratu ditu %{resource_name} aukerako galderak"
183
+ update: "%{user_name} parte-hartzaileak eguneratu ditu %{resource_name} aukerako galderak"
185
184
  censuses:
186
185
  census_ready_html: Erroldako datuak kargatuta daude eta prest daude % <b>%{election_title}{@eleccion_title}</b> bozketan erabiltzeko.
187
186
  census_size_html:
@@ -45,7 +45,6 @@ fi-pl:
45
45
  choose_census: Valitse henkilötietorekisterin tyyppi, jota haluat käyttää tälle vaalille
46
46
  created_at: Luonnin ajankohta
47
47
  identifier: Käyttäjän tunniste
48
- title: Henkilötietorekisterin tyyppi
49
48
  preview:
50
49
  title:
51
50
  one: Esikatselulista on rajattu %{count} tietueeseen.
@@ -45,7 +45,6 @@ fi:
45
45
  choose_census: Valitse henkilötietorekisterin tyyppi, jota haluat käyttää tälle vaalille
46
46
  created_at: Luonnin ajankohta
47
47
  identifier: Käyttäjän tunniste
48
- title: Henkilötietorekisterin tyyppi
49
48
  preview:
50
49
  title:
51
50
  one: Esikatselulista on rajattu %{count} tietueeseen.
@@ -41,6 +41,7 @@ fr-CA:
41
41
  admin:
42
42
  census:
43
43
  edit:
44
+ choose_census: Choisissez le type de recensement que vous souhaitez utiliser pour cette élection
44
45
  created_at: Créée le
45
46
  identifier: Identifiant de l'utilisateur
46
47
  preview:
@@ -72,6 +73,7 @@ fr-CA:
72
73
  publish_button: Publier les résultats
73
74
  title: Résultats
74
75
  status:
76
+ census: 'Recensement:'
75
77
  results_availability:
76
78
  after_end: Résultats disponibles après la fin de l'élection
77
79
  per_question: Résultats disponibles par question
@@ -81,6 +83,8 @@ fr-CA:
81
83
  create:
82
84
  invalid: Il y a eu un problème lors de la création de l'élection.
83
85
  success: Élection créée avec succès.
86
+ dashboard:
87
+ subtitle: 'Étape finale: éxaminez vos détails. Des modifications peuvent toujours être apportées avant de publier. Une fois publiée, vous serez toujours en mesure de mettre à jour la description de l''élection.'
84
88
  edit:
85
89
  title: Modifier l'élection
86
90
  form:
@@ -143,6 +147,9 @@ fr-CA:
143
147
  internal_users:
144
148
  already_have_an_account?: Vous avez déjà un compte?
145
149
  are_you_new?: Nouveau participant ?
150
+ info_html: |
151
+ Vous pouvez restreindre la participation à l'élection aux participants qui ont une autorisation.<br>
152
+ Notez que les participants devront satisfaire aux autorisations sélectionnées pour voter. Laisser toutes les cases à cocher vides permettra à toute personne enregistrée de voter.
146
153
  internal_type_title: Autorisations supplémentaires requises pour voter (facultatif)
147
154
  sign_in_description: Connectez-vous pour voter durant cette élection
148
155
  sign_up_description: Créer un compte pour voter durant cette élection
@@ -185,6 +192,7 @@ fr-CA:
185
192
  state_values:
186
193
  finished: Terminées
187
194
  ongoing: En cours
195
+ scheduled: Programmé
188
196
  orders:
189
197
  end_at: Date de fin
190
198
  label: Trier par
@@ -41,6 +41,7 @@ fr:
41
41
  admin:
42
42
  census:
43
43
  edit:
44
+ choose_census: Choisissez le type de recensement que vous souhaitez utiliser pour cette élection
44
45
  created_at: Créée le
45
46
  identifier: Identifiant de l'utilisateur
46
47
  preview:
@@ -72,6 +73,7 @@ fr:
72
73
  publish_button: Publier les résultats
73
74
  title: Résultats
74
75
  status:
76
+ census: 'Recensement:'
75
77
  results_availability:
76
78
  after_end: Résultats disponibles après la fin de l'élection
77
79
  per_question: Résultats disponibles par question
@@ -81,6 +83,8 @@ fr:
81
83
  create:
82
84
  invalid: Il y a eu un problème lors de la création de l'élection.
83
85
  success: Élection créée avec succès.
86
+ dashboard:
87
+ subtitle: 'Étape finale: éxaminez vos détails. Des modifications peuvent toujours être apportées avant de publier. Une fois publiée, vous serez toujours en mesure de mettre à jour la description de l''élection.'
84
88
  edit:
85
89
  title: Modifier l'élection
86
90
  form:
@@ -143,6 +147,9 @@ fr:
143
147
  internal_users:
144
148
  already_have_an_account?: Vous avez déjà un compte?
145
149
  are_you_new?: Nouveau participant ?
150
+ info_html: |
151
+ Vous pouvez restreindre la participation à l'élection aux participants qui ont une autorisation.<br>
152
+ Notez que les participants devront satisfaire aux autorisations sélectionnées pour voter. Laisser toutes les cases à cocher vides permettra à toute personne enregistrée de voter.
146
153
  internal_type_title: Autorisations supplémentaires requises pour voter (facultatif)
147
154
  sign_in_description: Connectez-vous pour voter durant cette élection
148
155
  sign_up_description: Créer un compte pour voter durant cette élection
@@ -185,6 +192,7 @@ fr:
185
192
  state_values:
186
193
  finished: Terminées
187
194
  ongoing: En cours
195
+ scheduled: Programmé
188
196
  orders:
189
197
  end_at: Date de fin
190
198
  label: Trier par
@@ -45,7 +45,6 @@ ja:
45
45
  choose_census: この選挙に使用したいセンサスの種類を選択してください
46
46
  created_at: 作成日時
47
47
  identifier: ユーザーID
48
- title: センサスの種類
49
48
  preview:
50
49
  title:
51
50
  other: プレビューリストは %{count} レコードに制限されています。
@@ -40,7 +40,6 @@ sv:
40
40
  choose_census: Välj vilken typ av folkräkning du vill använda för detta val
41
41
  created_at: Skapad den
42
42
  identifier: Identifierare för användare
43
- title: Typ av folkräkning
44
43
  preview:
45
44
  title:
46
45
  one: Förhandsgranskningen är begränsad till %{count} post.
@@ -32,6 +32,12 @@ module Decidim
32
32
  Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Elections::Engine.root}/app/views") # for partials
33
33
  end
34
34
 
35
+ initializer "decidim_elections.data_migrate", after: "decidim_core.data_migrate" do
36
+ DataMigrate.configure do |config|
37
+ config.data_migrations_path << root.join("db/data").to_s
38
+ end
39
+ end
40
+
35
41
  initializer "decidim.elections.default_censuses" do |_app|
36
42
  Decidim::Elections.census_registry.register(:token_csv) do |manifest|
37
43
  manifest.admin_form = "Decidim::Elections::Admin::Censuses::TokenCsvForm"
@@ -10,6 +10,7 @@ shared_examples "a csv token per question votable election" do
10
10
  click_on "Access"
11
11
  expect(page).to have_current_path(election_vote_path(question1))
12
12
  expect(page).to have_content(translated_attribute(question1.body))
13
+ expect(page).to have_content(strip_tags(translated_attribute(question1.description)))
13
14
  choose translated_attribute(question1.response_options.first.body)
14
15
  click_on "Cast vote"
15
16
  expect(page).to have_content("Your vote has been successfully cast.")
@@ -18,6 +19,7 @@ shared_examples "a csv token per question votable election" do
18
19
  # wait for javascript to update the page
19
20
  sleep 2
20
21
  expect(page).to have_current_path(election_vote_path(question2))
22
+ expect(page).to have_content(strip_tags(translated_attribute(question2.description)))
21
23
  click_on "Cast vote"
22
24
  expect(page).to have_content("There was a problem casting your vote.")
23
25
  check translated_attribute(question2.response_options.first.body)
@@ -52,6 +54,7 @@ shared_examples "a per question votable election" do
52
54
  expect(page).to have_content(translated_attribute(question1.body))
53
55
  expect(page).to have_content(translated_attribute(question2.body))
54
56
  click_on "Vote"
57
+ expect(page).to have_content(strip_tags(translated_attribute(question1.description)))
55
58
  choose translated_attribute(question1.response_options.first.body)
56
59
  click_on "Cast vote"
57
60
  expect(page).to have_current_path(waiting_election_votes_path)
@@ -61,6 +64,7 @@ shared_examples "a per question votable election" do
61
64
  # wait for javascript to update the page
62
65
  sleep 2
63
66
  expect(page).to have_current_path(election_vote_path(question2))
67
+ expect(page).to have_content(strip_tags(translated_attribute(question2.description)))
64
68
  check translated_attribute(question2.response_options.first.body)
65
69
  click_on "Cast vote"
66
70
  expect(page).to have_current_path(receipt_election_votes_path)
@@ -101,6 +105,7 @@ shared_examples "a per question votable election with published results" do
101
105
  # wait for javascript to update the page
102
106
  sleep 2
103
107
  expect(page).to have_current_path(election_vote_path(question2))
108
+ expect(page).to have_content(strip_tags(translated_attribute(question2.description)))
104
109
  check translated_attribute(question2.response_options.first.body)
105
110
  click_on "Cast vote"
106
111
  expect(page).to have_current_path(receipt_election_votes_path)
@@ -137,6 +142,7 @@ shared_examples "a per question votable election with already voted questions" d
137
142
  expect(page).to have_content(translated_attribute(question2.body))
138
143
  expect(page).to have_content(translated_attribute(question3.body))
139
144
  click_on "Vote"
145
+ expect(page).to have_content(strip_tags(translated_attribute(question1.description)))
140
146
  choose translated_attribute(question1.response_options.first.body)
141
147
  click_on "Cast vote"
142
148
  check translated_attribute(question2.response_options.first.body)
@@ -144,10 +150,12 @@ shared_examples "a per question votable election with already voted questions" d
144
150
  expect(page).to have_current_path(waiting_election_votes_path)
145
151
  click_on "Edit your vote"
146
152
  expect(page).to have_current_path(election_vote_path(question1))
153
+ expect(page).to have_content(strip_tags(translated_attribute(question1.description)))
147
154
  expect(find("input[value='#{question1.response_options.first.id}']")).to be_checked
148
155
  choose translated_attribute(question1.response_options.second.body)
149
156
  click_on "Cast vote"
150
157
  expect(page).to have_current_path(election_vote_path(question2))
158
+ expect(page).to have_content(strip_tags(translated_attribute(question2.description)))
151
159
  expect(find("input[value='#{question2.response_options.first.id}']")).to be_checked
152
160
  expect(find("input[value='#{question2.response_options.second.id}']")).not_to be_checked
153
161
  check translated_attribute(question2.response_options.second.body)
@@ -156,6 +164,7 @@ shared_examples "a per question votable election with already voted questions" d
156
164
  question1.update!(published_results_at: Time.current)
157
165
  click_on "Edit your vote"
158
166
  expect(page).to have_current_path(election_vote_path(question2))
167
+ expect(page).to have_content(strip_tags(translated_attribute(question2.description)))
159
168
  question2.update!(published_results_at: Time.current)
160
169
  click_on "Cast vote"
161
170
  expect(page).to have_current_path(waiting_election_votes_path)
@@ -22,10 +22,12 @@ end
22
22
  def fill_in_votes
23
23
  expect(page).to have_current_path(election_vote_path(election.questions.first))
24
24
  expect(page).to have_content(translated_attribute(election.questions.first.body))
25
+ expect(page).to have_content(strip_tags(translated_attribute(election.questions.first.description)))
25
26
  choose translated_attribute(election.questions.first.response_options.first.body)
26
27
  click_on "Next"
27
28
  expect(page).to have_current_path(election_vote_path(election.questions.second))
28
29
  expect(page).to have_content(translated_attribute(election.questions.second.body))
30
+ expect(page).to have_content(strip_tags(translated_attribute(election.questions.second.description)))
29
31
  check translated_attribute(election.questions.second.response_options.first.body)
30
32
  check translated_attribute(election.questions.second.response_options.second.body)
31
33
  click_on "Next"
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Elections
5
5
  def self.version
6
- "0.31.0.rc2"
6
+ "0.31.0"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-elections
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0.rc2
4
+ version: 0.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Vergés
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-28 00:00:00.000000000 Z
11
+ date: 2025-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin
@@ -16,84 +16,84 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.31.0.rc2
19
+ version: 0.31.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.31.0.rc2
26
+ version: 0.31.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim-core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.31.0.rc2
33
+ version: 0.31.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.31.0.rc2
40
+ version: 0.31.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: decidim-forms
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.31.0.rc2
47
+ version: 0.31.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.31.0.rc2
54
+ version: 0.31.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: decidim-admin
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.31.0.rc2
61
+ version: 0.31.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.31.0.rc2
68
+ version: 0.31.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: decidim-dev
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.31.0.rc2
75
+ version: 0.31.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 0.31.0.rc2
82
+ version: 0.31.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: decidim-participatory_processes
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.31.0.rc2
89
+ version: 0.31.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.31.0.rc2
96
+ version: 0.31.0
97
97
  description: A module that aims to provide a set of tools to create elections in Decidim.
98
98
  email:
99
99
  - ivan@pokecode.net