decidim-elections 0.26.7 → 0.26.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/commands/decidim/elections/admin/create_answer.rb +1 -1
- data/app/commands/decidim/elections/admin/create_question.rb +1 -1
- data/app/commands/decidim/elections/admin/destroy_answer.rb +1 -1
- data/app/commands/decidim/elections/admin/destroy_election.rb +1 -1
- data/app/commands/decidim/elections/admin/destroy_question.rb +1 -1
- data/app/commands/decidim/elections/admin/import_proposals_to_elections.rb +1 -1
- data/app/commands/decidim/elections/admin/update_answer.rb +1 -1
- data/app/commands/decidim/elections/admin/update_question.rb +1 -1
- data/app/controllers/decidim/elections/admin/trustees_participatory_spaces_controller.rb +1 -1
- data/app/controllers/decidim/elections/trustee_zone/application_controller.rb +6 -4
- data/app/controllers/decidim/votings/admin/exports_controller.rb +14 -0
- data/app/controllers/decidim/votings/admin/reminders_controller.rb +14 -0
- data/app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb +1 -1
- data/app/controllers/decidim/votings/admin/votings_landing_page_controller.rb +1 -1
- data/app/controllers/decidim/votings/polling_officer_zone/closures_controller.rb +5 -1
- data/app/controllers/decidim/votings/polling_officer_zone/in_person_votes_controller.rb +5 -1
- data/app/controllers/decidim/votings/votings_controller.rb +1 -1
- data/app/forms/decidim/elections/admin/setup_form.rb +2 -1
- data/app/permissions/decidim/elections/admin/permissions.rb +1 -7
- data/app/permissions/decidim/votings/admin/permissions.rb +1 -1
- data/app/views/decidim/elections/admin/elections/edit.html.erb +1 -0
- data/app/views/decidim/elections/admin/elections/index.html.erb +1 -0
- data/app/views/decidim/elections/admin/elections/new.html.erb +1 -0
- data/app/views/decidim/elections/admin/trustees_participatory_spaces/index.html.erb +1 -0
- data/app/views/decidim/elections/admin/trustees_participatory_spaces/new.html.erb +1 -0
- data/app/views/decidim/votings/admin/ballot_styles/edit.html.erb +1 -0
- data/app/views/decidim/votings/admin/ballot_styles/index.html.erb +1 -0
- data/app/views/decidim/votings/admin/ballot_styles/new.html.erb +1 -0
- data/app/views/decidim/votings/admin/votings/edit.html.erb +1 -0
- data/app/views/decidim/votings/admin/votings/index.html.erb +1 -0
- data/app/views/decidim/votings/admin/votings/new.html.erb +0 -1
- data/app/views/decidim/votings/census/admin/census/show.html.erb +1 -0
- data/config/environment.rb +3 -0
- data/config/locales/ar.yml +3 -2
- data/config/locales/ca.yml +12 -12
- data/config/locales/cs.yml +0 -3
- data/config/locales/de.yml +117 -17
- data/config/locales/el.yml +1090 -1
- data/config/locales/en.yml +2 -2
- data/config/locales/es-MX.yml +9 -9
- data/config/locales/es-PY.yml +9 -9
- data/config/locales/es.yml +9 -9
- data/config/locales/eu.yml +150 -79
- data/config/locales/fi-plain.yml +1 -4
- data/config/locales/fi.yml +3 -6
- data/config/locales/fr-CA.yml +5 -5
- data/config/locales/fr.yml +8 -8
- data/config/locales/ga-IE.yml +1 -1
- data/config/locales/gl.yml +13 -7
- data/config/locales/hu.yml +20 -4
- data/config/locales/it.yml +8 -36
- data/config/locales/ja.yml +12 -15
- data/config/locales/lt.yml +23 -5
- data/config/locales/lv.yml +3 -4
- data/config/locales/nl.yml +7 -32
- data/config/locales/no.yml +21 -6
- data/config/locales/pl.yml +15 -33
- data/config/locales/pt-BR.yml +20 -32
- data/config/locales/pt.yml +1 -28
- data/config/locales/ro-RO.yml +14 -11
- data/config/locales/sq-AL.yml +1 -0
- data/config/locales/sv.yml +6 -10
- data/config/locales/th-TH.yml +1 -0
- data/config/locales/tr-TR.yml +52 -5
- data/config/locales/zh-CN.yml +23 -6
- data/config/locales/zh-TW.yml +0 -29
- data/lib/decidim/elections/test/factories.rb +1 -0
- data/lib/decidim/elections/version.rb +1 -1
- data/lib/decidim/votings/admin_engine.rb +1 -0
- data/lib/decidim/votings/voting_serializer.rb +2 -2
- metadata +17 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b32054a1fc9143e20c406cc0ae4aee863e9ba62a7fcf8d6e6ddb8e4b545a6890
|
4
|
+
data.tar.gz: e5c4cd1231931c8dcc16e2dc70a6342aca41ecebd28a22663ff5c586dda59c19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09f9dd3236344018700fc9229bc7dae5475967320573f77df2dedae8af72bb774985d4346f9d216f0a3de89acef1b59930416cf38adb022de00da6dc08f61c26'
|
7
|
+
data.tar.gz: 7563d634035423209a16ee4791a9f098435de2af6564fa7d53c416cfa8fe4975151edc6ddce71c7df48d85e59002c7d3207fab9ac8d2688589e7610a925ee7fd
|
@@ -14,7 +14,7 @@ module Decidim
|
|
14
14
|
#
|
15
15
|
# Broadcasts :ok if successful, :invalid otherwise.
|
16
16
|
def call
|
17
|
-
return broadcast(:election_started) if form.election.
|
17
|
+
return broadcast(:election_started) if form.election.blocked?
|
18
18
|
return broadcast(:invalid) if form.invalid?
|
19
19
|
|
20
20
|
create_question!
|
@@ -72,7 +72,7 @@ module Decidim
|
|
72
72
|
private
|
73
73
|
|
74
74
|
def trustee_participatory_space
|
75
|
-
@trustee_participatory_space ||= TrusteesParticipatorySpace.find_by(id: params[:id])
|
75
|
+
@trustee_participatory_space ||= TrusteesParticipatorySpace.find_by(id: params[:id], participatory_space: current_participatory_space)
|
76
76
|
end
|
77
77
|
|
78
78
|
def trustees
|
@@ -13,6 +13,11 @@ module Decidim
|
|
13
13
|
|
14
14
|
before_action :ensure_configured_bulletin_board!
|
15
15
|
|
16
|
+
register_permissions(::Decidim::Elections::TrusteeZone::ApplicationController,
|
17
|
+
::Decidim::Elections::Permissions,
|
18
|
+
::Decidim::Admin::Permissions,
|
19
|
+
::Decidim::Permissions)
|
20
|
+
|
16
21
|
private
|
17
22
|
|
18
23
|
def ensure_configured_bulletin_board!
|
@@ -34,10 +39,7 @@ module Decidim
|
|
34
39
|
end
|
35
40
|
|
36
41
|
def permission_class_chain
|
37
|
-
|
38
|
-
Decidim::Elections::Permissions,
|
39
|
-
Decidim::Permissions
|
40
|
-
]
|
42
|
+
::Decidim.permissions_registry.chain_for(::Decidim::Elections::TrusteeZone::ApplicationController)
|
41
43
|
end
|
42
44
|
end
|
43
45
|
end
|
@@ -0,0 +1,14 @@
|
|
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
|
@@ -0,0 +1,14 @@
|
|
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
|
data/app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb
CHANGED
@@ -18,7 +18,7 @@ module Decidim
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def scoped_resource
|
21
|
-
@scoped_resource ||= Voting.find_by(slug: params[:voting_slug])
|
21
|
+
@scoped_resource ||= Voting.find_by(slug: params[:voting_slug], organization: current_organization)
|
22
22
|
end
|
23
23
|
|
24
24
|
def enforce_permission_to_update_resource
|
@@ -16,7 +16,7 @@ module Decidim
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def scoped_resource
|
19
|
-
@scoped_resource ||= Voting.find_by(slug: params[:voting_slug])
|
19
|
+
@scoped_resource ||= Voting.find_by(slug: params[:voting_slug], organization: current_organization)
|
20
20
|
end
|
21
21
|
|
22
22
|
def enforce_permission_to_update_resource
|
@@ -111,7 +111,11 @@ module Decidim
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def election
|
114
|
-
@election ||= Decidim::Elections::Election
|
114
|
+
@election ||= Decidim::Elections::Election
|
115
|
+
.joins("INNER JOIN decidim_components component ON component.id = decidim_elections_elections.decidim_component_id")
|
116
|
+
.where(component: { participatory_space: current_organization.participatory_spaces })
|
117
|
+
.includes(questions: :answers)
|
118
|
+
.find_by(id: params[:election_id])
|
115
119
|
end
|
116
120
|
|
117
121
|
def polling_station
|
@@ -121,7 +121,11 @@ module Decidim
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def election
|
124
|
-
@election ||= Decidim::Elections::Election
|
124
|
+
@election ||= Decidim::Elections::Election
|
125
|
+
.joins("INNER JOIN decidim_components component ON component.id = decidim_elections_elections.decidim_component_id")
|
126
|
+
.where(component: { participatory_space: current_organization.participatory_spaces })
|
127
|
+
.includes(questions: :answers)
|
128
|
+
.find_by(id: params[:election_id])
|
125
129
|
end
|
126
130
|
|
127
131
|
def polling_officer
|
@@ -99,7 +99,7 @@ module Decidim
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def election
|
102
|
-
@election ||= Decidim::Elections::Election.find(params[:election_id])
|
102
|
+
@election ||= Decidim::Elections::Election.where(component: current_participatory_space.components).find(params[:election_id])
|
103
103
|
end
|
104
104
|
|
105
105
|
def elections
|
@@ -41,7 +41,8 @@ module Decidim
|
|
41
41
|
[:max_selections, {}, election.valid_questions?],
|
42
42
|
[:published, {}, election.published_at.present?],
|
43
43
|
[:component_published, {}, election.component.published?],
|
44
|
-
[:time_before, { hours: Decidim::Elections.setup_minimum_hours_before_start },
|
44
|
+
[:time_before, { hours: I18n.t("datetime.distance_in_words.x_hours", count: Decidim::Elections.setup_minimum_hours_before_start) },
|
45
|
+
election.minimum_hours_before_start?],
|
45
46
|
[:trustees_number, { number: bulletin_board.number_of_trustees }, participatory_space_trustees_with_public_key.size >= bulletin_board.number_of_trustees]
|
46
47
|
].freeze
|
47
48
|
end
|
@@ -24,10 +24,8 @@ module Decidim
|
|
24
24
|
case permission_action.action
|
25
25
|
when :create, :read
|
26
26
|
allow!
|
27
|
-
when :delete, :update, :unpublish
|
27
|
+
when :delete, :update, :unpublish, :publish
|
28
28
|
allow_if_not_blocked
|
29
|
-
when :publish
|
30
|
-
allow_if_valid_and_not_blocked
|
31
29
|
end
|
32
30
|
when :trustees
|
33
31
|
case permission_action.action
|
@@ -80,10 +78,6 @@ module Decidim
|
|
80
78
|
toggle_allow(election && !election.blocked?)
|
81
79
|
end
|
82
80
|
|
83
|
-
def allow_if_valid_and_not_blocked
|
84
|
-
toggle_allow(election && !election.blocked? && election.valid_questions?)
|
85
|
-
end
|
86
|
-
|
87
81
|
def allow_if_not_related_to_any_election
|
88
82
|
toggle_allow(trustee_participatory_space.trustee.elections.empty?)
|
89
83
|
end
|
@@ -132,7 +132,7 @@ module Decidim
|
|
132
132
|
when :ballot_styles
|
133
133
|
toggle_allow(user.admin?) if permission_action.action == :read
|
134
134
|
when :component_data
|
135
|
-
toggle_allow(user.admin?) if permission_action.action
|
135
|
+
toggle_allow(user.admin?) if [:import, :export].member? permission_action.action
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
data/config/locales/ar.yml
CHANGED
@@ -18,8 +18,6 @@ ar:
|
|
18
18
|
models:
|
19
19
|
answer:
|
20
20
|
name: الإجابة
|
21
|
-
question:
|
22
|
-
name: سؤال
|
23
21
|
steps:
|
24
22
|
tally:
|
25
23
|
invalid: كانت هناك مشكلة في الإبلاغ عن الأمين المفقود
|
@@ -42,6 +40,9 @@ ar:
|
|
42
40
|
show:
|
43
41
|
identification_keys:
|
44
42
|
cancel: إلغاء
|
43
|
+
votes:
|
44
|
+
confirm:
|
45
|
+
answer: الإجابة
|
45
46
|
votings:
|
46
47
|
admin:
|
47
48
|
models:
|
data/config/locales/ca.yml
CHANGED
@@ -216,7 +216,7 @@ ca:
|
|
216
216
|
answer:
|
217
217
|
name: Resposta
|
218
218
|
election:
|
219
|
-
name:
|
219
|
+
name: Elecció
|
220
220
|
question:
|
221
221
|
name: Pregunta
|
222
222
|
trustee:
|
@@ -636,7 +636,7 @@ ca:
|
|
636
636
|
upload_legend: Decidim té les teves claus públiques d'identificació, però el teu navegador encara no les té. Necessites importar l'arxiu amb les teves claus d'identificació al teu ordinador des de la còpia de seguretat que vas crear després de generar-les.
|
637
637
|
not_supported_browser_description: Sembla que estàs usant un navegador que no pot ser utilitzat per a actuar com a garant. Assegura't que estàs usant la versió més recent del teu navegador, o intenta usar qualsevol dels navegadors més populars per a poder completar les teves tasques com a garant.
|
638
638
|
not_supported_browser_title: Actualitza el navegador per a actuar com a garant
|
639
|
-
trustee_role_description:
|
639
|
+
trustee_role_description: Has estat assignada com a garant en algunes de les eleccions celebrades en aquesta plataforma.
|
640
640
|
update:
|
641
641
|
success: La teva clau pública d'identificació va ser guardada amb èxit.
|
642
642
|
votes:
|
@@ -684,10 +684,10 @@ ca:
|
|
684
684
|
header:
|
685
685
|
ballot_decision: Envia o audita el teu vot
|
686
686
|
casting: El vot s'està dipositant
|
687
|
-
confirm:
|
687
|
+
confirm: Confirmar el teu vot
|
688
688
|
confirmed: Vot confirmat
|
689
689
|
encrypting: El vot s'està xifrant
|
690
|
-
failed:
|
690
|
+
failed: Vot fallit
|
691
691
|
messages:
|
692
692
|
invalid_token: La sessió de la cabina de votació no és vàlida. Prova de votar de nou.
|
693
693
|
not_allowed: No pots votar en aquesta votació en aquest moment.
|
@@ -730,7 +730,7 @@ ca:
|
|
730
730
|
continue: Següent
|
731
731
|
warnings:
|
732
732
|
no_elections_warning: No hi ha cap votació que coincideixi amb la teva cerca o no n'hi ha cap programada.
|
733
|
-
no_scheduled_elections_warning: Actualment no hi ha votacions programades, però pots veure les anteriors.
|
733
|
+
no_scheduled_elections_warning: Actualment no hi ha votacions programades, però pots veure un llistat de les anteriors.
|
734
734
|
events:
|
735
735
|
elections:
|
736
736
|
election_published:
|
@@ -818,15 +818,15 @@ ca:
|
|
818
818
|
description:
|
819
819
|
name: Descripció de la votació
|
820
820
|
elections:
|
821
|
-
name: Eleccions
|
821
|
+
name: Eleccions
|
822
822
|
header:
|
823
823
|
name: Capçalera de la votació
|
824
824
|
html_block_1:
|
825
|
-
name: Bloc html 1 de votació
|
825
|
+
name: Bloc html 1 de la votació
|
826
826
|
html_block_2:
|
827
|
-
name: Bloc html 2 de votació
|
827
|
+
name: Bloc html 2 de la votació
|
828
828
|
html_block_3:
|
829
|
-
name: Bloc html 3 de votació
|
829
|
+
name: Bloc html 3 de la votació
|
830
830
|
metrics:
|
831
831
|
name: Mètriques de la votació
|
832
832
|
polling_stations:
|
@@ -1041,7 +1041,7 @@ ca:
|
|
1041
1041
|
promoted: Destacada
|
1042
1042
|
select_a_voting_type: Si us plau selecciona un tipus de votació
|
1043
1043
|
slug: Nom curt d'URL
|
1044
|
-
slug_help: 'Els noms curts d''URL s''utilitzen per generar els URL que apunten a
|
1044
|
+
slug_help: 'Els noms curts d''URL s''utilitzen per generar els URL que apunten a aquesta votació. Només accepta lletres, números i guions, i ha de començar amb una lletra. Exemple: %{url}'
|
1045
1045
|
title: Títol
|
1046
1046
|
voting_type:
|
1047
1047
|
hybrid: Híbrida
|
@@ -1176,7 +1176,7 @@ ca:
|
|
1176
1176
|
certify:
|
1177
1177
|
add_images: Afegir imatges
|
1178
1178
|
error: S'ha produït un error en adjuntar el certificat. Si us plau, prova de nou.
|
1179
|
-
form_legend: Puja una imatge del
|
1179
|
+
form_legend: Puja una imatge del Certificat de Tancament Electoral
|
1180
1180
|
heading: Recompte de vots - Pujar certificat
|
1181
1181
|
info_text: Si us plau, puja una imatge del certificat de tancament electoral.
|
1182
1182
|
submit: Pujar el certificat
|
@@ -1404,7 +1404,7 @@ ca:
|
|
1404
1404
|
footer_button_text:
|
1405
1405
|
participate: Participa
|
1406
1406
|
view: Veure
|
1407
|
-
vote:
|
1407
|
+
vote: Votar
|
1408
1408
|
unspecified: Sense especificar
|
1409
1409
|
voting_type:
|
1410
1410
|
hybrid: Híbrida
|
data/config/locales/cs.yml
CHANGED
@@ -656,7 +656,6 @@ cs:
|
|
656
656
|
upload_legend: Decidim má vaše veřejné identifikační klíče, ale váš prohlížeč jej stále nemá. Je třeba importovat soubor s identifikačními klíči do počítače ze zálohy, kterou jste vytvořili po jejich vygenerování.
|
657
657
|
not_supported_browser_description: Vypadá to, že používáte webový prohlížeč, který nelze použít jako správce. Ujistěte se, že používáte nejnovější verzi prohlížeče, nebo zkuste použít některý z nejpopulárnějších prohlížečů, abyste mohli dokončit své úkoly správce.
|
658
658
|
not_supported_browser_title: Upgradujte prohlížeč abyste mohl fungovat jako důvěrník
|
659
|
-
trustee_role_description: Byl jste pověřen, abyste v některých volbách, které na této platformě probíhají, jednal jako důvěrník.
|
660
659
|
update:
|
661
660
|
success: Váš identifikační veřejný klíč byl úspěšně uložen.
|
662
661
|
votes:
|
@@ -750,7 +749,6 @@ cs:
|
|
750
749
|
continue: Další
|
751
750
|
warnings:
|
752
751
|
no_elections_warning: Žádné volby neodpovídají zadaným kritériím nebo nejsou naplánovány žádné volby.
|
753
|
-
no_scheduled_elections_warning: V současné době nejsou žádné plánované volby, ale zde najdete všechny minulé volby na seznamu.
|
754
752
|
events:
|
755
753
|
elections:
|
756
754
|
election_published:
|
@@ -1196,7 +1194,6 @@ cs:
|
|
1196
1194
|
certify:
|
1197
1195
|
add_images: Přidat obrázky
|
1198
1196
|
error: Došlo k chybě při připojování certifikátu, zkuste to prosím znovu.
|
1199
|
-
form_legend: Nahrajte prosím fotografii volebního certifikátu o uzavření
|
1200
1197
|
heading: Přepočet hlasů - Nahrát certifikát
|
1201
1198
|
info_text: Nahrajte prosím fotografii volebního certifikátu o uzavření.
|
1202
1199
|
submit: Nahrát certifikát
|