decidim-elections 0.27.2 → 0.27.4
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/publish_election.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 +4 -1
- data/app/controllers/decidim/votings/polling_officer_zone/in_person_votes_controller.rb +4 -1
- data/app/controllers/decidim/votings/votings_controller.rb +1 -1
- data/app/forms/decidim/elections/admin/setup_form.rb +2 -1
- data/app/forms/decidim/votings/admin/voting_role_form.rb +29 -0
- 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/elections/elections/show.html.erb +1 -1
- 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/_form.html.erb +1 -1
- 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/_new_census.html.erb +1 -1
- data/app/views/decidim/votings/census/admin/census/show.html.erb +1 -0
- data/config/environment.rb +0 -0
- data/config/locales/ar.yml +42 -0
- data/config/locales/ca.yml +7 -7
- data/config/locales/cs.yml +0 -4
- data/config/locales/de.yml +132 -13
- data/config/locales/el.yml +1126 -0
- data/config/locales/en.yml +2 -2
- data/config/locales/es-MX.yml +6 -6
- data/config/locales/es-PY.yml +6 -6
- data/config/locales/es.yml +6 -6
- data/config/locales/eu.yml +5 -25
- data/config/locales/fa-IR.yml +1 -0
- data/config/locales/fi-plain.yml +2 -2
- data/config/locales/fi.yml +3 -3
- data/config/locales/fr-CA.yml +3 -25
- data/config/locales/fr.yml +6 -28
- data/config/locales/ga-IE.yml +1 -1
- data/config/locales/gl.yml +8 -6
- data/config/locales/hu.yml +10 -1
- data/config/locales/it.yml +6 -29
- data/config/locales/ja.yml +11 -11
- data/config/locales/kaa.yml +1 -0
- data/config/locales/lt.yml +0 -25
- data/config/locales/lv.yml +3 -0
- data/config/locales/nl.yml +7 -26
- data/config/locales/no.yml +16 -2
- data/config/locales/pl.yml +6 -27
- data/config/locales/pt-BR.yml +11 -28
- data/config/locales/pt.yml +3 -24
- data/config/locales/ro-RO.yml +12 -8
- data/config/locales/sv.yml +2 -19
- data/config/locales/tr-TR.yml +47 -1
- data/config/locales/zh-CN.yml +15 -1
- data/config/locales/zh-TW.yml +1399 -0
- 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
- metadata +22 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86f9af4eb56a517eb85ce45e079ba761c916040de349fb52b878886a3ad5b27c
|
4
|
+
data.tar.gz: '0436869e21f87e86847c41940ffd617cfcfbe6516e86bff3d2d6e2f7b9e6308b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 798f01f86d2c7a1d3232c8e76d6a2fe9289c585265d6f488178f0e1fa71931a7ae49d2f645b4ec42d0b44fd890094908e644315f31c6f8c003ddf618abd09b4a
|
7
|
+
data.tar.gz: b87ebc1509c74e59911917343b529498c3ba163ae35d691e90ff10cfbc337a4d4eca1654f4176033a4bb85c15948515cbe0e0c898975f8e7d14e3eb5522b10fb
|
@@ -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,10 @@ module Decidim
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def election
|
114
|
-
@election ||= Decidim::Elections::Election.
|
114
|
+
@election ||= Decidim::Elections::Election.joins(:component)
|
115
|
+
.where(component: { participatory_space: current_organization.participatory_spaces })
|
116
|
+
.includes(questions: :answers)
|
117
|
+
.find_by(id: params[:election_id])
|
115
118
|
end
|
116
119
|
|
117
120
|
def polling_station
|
@@ -121,7 +121,10 @@ module Decidim
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def election
|
124
|
-
@election ||= Decidim::Elections::Election.
|
124
|
+
@election ||= Decidim::Elections::Election.joins(:component)
|
125
|
+
.where(component: { participatory_space: current_organization.participatory_spaces })
|
126
|
+
.includes(questions: :answers)
|
127
|
+
.find_by(id: params[:election_id])
|
125
128
|
end
|
126
129
|
|
127
130
|
def polling_officer
|
@@ -103,7 +103,7 @@ module Decidim
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def election
|
106
|
-
@election ||= Decidim::Elections::Election.find(params[:election_id])
|
106
|
+
@election ||= Decidim::Elections::Election.where(component: current_participatory_space.components).find(params[:election_id])
|
107
107
|
end
|
108
108
|
|
109
109
|
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
|
@@ -0,0 +1,29 @@
|
|
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
|
@@ -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
|
@@ -120,7 +120,7 @@ module Decidim
|
|
120
120
|
toggle_allow(user.admin? && (voting.dataset.blank? || voting.dataset.init_data?) && ballot_style.present?)
|
121
121
|
end
|
122
122
|
when :component_data
|
123
|
-
toggle_allow(user.admin?) if permission_action.action
|
123
|
+
toggle_allow(user.admin?) if [:import, :export].member? permission_action.action
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
@@ -45,7 +45,7 @@ edit_link(
|
|
45
45
|
<% end %>
|
46
46
|
<div class="columns medium-8 mediumlarge-7">
|
47
47
|
<div class="section">
|
48
|
-
<p><%=
|
48
|
+
<p><%= decidim_sanitize_editor_admin(translated_attribute(election.description)) %></p>
|
49
49
|
|
50
50
|
<%= cell("decidim/elections/election_vote_cta", election) %>
|
51
51
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
method: :post,
|
13
13
|
html: { class: "form new_census" }) do |form| %>
|
14
14
|
<div class="field">
|
15
|
-
<%= form.upload :file,
|
15
|
+
<%= form.upload :file, required: true, help_i18n_scope: "decidim.votings.census.admin.census.new.file_help" %>
|
16
16
|
</div>
|
17
17
|
|
18
18
|
<%= submit_tag t("submit", scope: "decidim.votings.census.admin.census.new"), class: "button" %>
|
File without changes
|
data/config/locales/ar.yml
CHANGED
@@ -6,9 +6,21 @@ ar:
|
|
6
6
|
description: الوصف
|
7
7
|
election:
|
8
8
|
description: الوصف
|
9
|
+
monitoring_committee_member:
|
10
|
+
name: الاسم
|
11
|
+
polling_officer:
|
12
|
+
name: الاسم
|
9
13
|
decidim:
|
14
|
+
components:
|
15
|
+
elections:
|
16
|
+
name: الانتخابات
|
10
17
|
elections:
|
11
18
|
admin:
|
19
|
+
models:
|
20
|
+
answer:
|
21
|
+
name: الإجابة
|
22
|
+
question:
|
23
|
+
name: سؤال
|
12
24
|
steps:
|
13
25
|
tally_started:
|
14
26
|
invalid: كانت هناك مشكلة في الإبلاغ عن الأمين المفقود
|
@@ -22,16 +34,33 @@ ar:
|
|
22
34
|
results_title: النتائج
|
23
35
|
results:
|
24
36
|
percentage: "%{count}%"
|
37
|
+
models:
|
38
|
+
trustees_participatory_space:
|
39
|
+
fields:
|
40
|
+
name: الاسم
|
25
41
|
trustee_zone:
|
26
42
|
trustees:
|
27
43
|
show:
|
28
44
|
identification_keys:
|
29
45
|
cancel: إلغاء
|
46
|
+
votes:
|
47
|
+
confirm:
|
48
|
+
answer: الإجابة
|
30
49
|
votings:
|
31
50
|
admin:
|
51
|
+
models:
|
52
|
+
monitoring_committee_member:
|
53
|
+
fields:
|
54
|
+
name: الاسم
|
55
|
+
polling_officer:
|
56
|
+
fields:
|
57
|
+
name: الاسم
|
32
58
|
monitoring_committee_election_results:
|
33
59
|
actions:
|
34
60
|
title: الإجراءات
|
61
|
+
monitoring_committee_members:
|
62
|
+
actions:
|
63
|
+
destroy: حذف
|
35
64
|
polling_officer_zone:
|
36
65
|
closures:
|
37
66
|
edit:
|
@@ -39,3 +68,16 @@ ar:
|
|
39
68
|
close_modal: غلق
|
40
69
|
sign:
|
41
70
|
cancel: إلغاء
|
71
|
+
in_person_votes:
|
72
|
+
verify_document:
|
73
|
+
name: الاسم
|
74
|
+
polling_officers:
|
75
|
+
index:
|
76
|
+
polling_station:
|
77
|
+
name: الاسم
|
78
|
+
polling_officers:
|
79
|
+
actions:
|
80
|
+
destroy: حذف
|
81
|
+
polling_stations:
|
82
|
+
actions:
|
83
|
+
destroy: حذف
|
data/config/locales/ca.yml
CHANGED
@@ -688,10 +688,10 @@ ca:
|
|
688
688
|
header:
|
689
689
|
ballot_decision: Envia o audita el teu vot
|
690
690
|
casting: El vot s'està dipositant
|
691
|
-
confirm:
|
691
|
+
confirm: Confirmar el teu vot
|
692
692
|
confirmed: Vot confirmat
|
693
693
|
encrypting: El vot s'està xifrant
|
694
|
-
failed:
|
694
|
+
failed: Vot fallit
|
695
695
|
messages:
|
696
696
|
invalid_token: La sessió de la cabina de votació no és vàlida. Prova de votar de nou.
|
697
697
|
not_allowed: No pots votar en aquesta votació en aquest moment.
|
@@ -823,15 +823,15 @@ ca:
|
|
823
823
|
description:
|
824
824
|
name: Descripció de la votació
|
825
825
|
elections:
|
826
|
-
name: Eleccions
|
826
|
+
name: Eleccions
|
827
827
|
header:
|
828
828
|
name: Capçalera de la votació
|
829
829
|
html_block_1:
|
830
|
-
name: Bloc html 1 de votació
|
830
|
+
name: Bloc html 1 de la votació
|
831
831
|
html_block_2:
|
832
|
-
name: Bloc html 2 de votació
|
832
|
+
name: Bloc html 2 de la votació
|
833
833
|
html_block_3:
|
834
|
-
name: Bloc html 3 de votació
|
834
|
+
name: Bloc html 3 de la votació
|
835
835
|
metrics:
|
836
836
|
name: Mètriques de la votació
|
837
837
|
polling_stations:
|
@@ -1415,7 +1415,7 @@ ca:
|
|
1415
1415
|
footer_button_text:
|
1416
1416
|
participate: Participa
|
1417
1417
|
view: Veure
|
1418
|
-
vote:
|
1418
|
+
vote: Votar
|
1419
1419
|
unspecified: Sense especificar
|
1420
1420
|
voting_type:
|
1421
1421
|
hybrid: Híbrida
|
data/config/locales/cs.yml
CHANGED
@@ -842,14 +842,10 @@ cs:
|
|
842
842
|
highlighted_votings:
|
843
843
|
max_results: Maximální počet prvků k zobrazení
|
844
844
|
landing_page:
|
845
|
-
attachments_and_folders:
|
846
|
-
name: Přílohy a složky hlasování
|
847
845
|
description:
|
848
846
|
name: Popis hlasování
|
849
847
|
elections:
|
850
848
|
name: Hlasovací volby
|
851
|
-
header:
|
852
|
-
name: Záhlaví hlasování
|
853
849
|
html_block_1:
|
854
850
|
name: Html blok 1 hlasování
|
855
851
|
html_block_2:
|