decidim-elections 0.26.7 → 0.26.8
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/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/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 +0 -0
- data/config/locales/ar.yml +3 -0
- data/config/locales/ca.yml +7 -7
- data/config/locales/cs.yml +0 -4
- data/config/locales/de.yml +111 -11
- data/config/locales/el.yml +1095 -0
- data/config/locales/en.yml +2 -2
- data/config/locales/es-MX.yml +5 -5
- data/config/locales/es-PY.yml +5 -5
- data/config/locales/es.yml +5 -5
- data/config/locales/eu.yml +1 -23
- data/config/locales/fi-plain.yml +1 -1
- data/config/locales/fi.yml +1 -1
- data/config/locales/fr-CA.yml +2 -24
- data/config/locales/fr.yml +5 -27
- data/config/locales/ga-IE.yml +1 -1
- data/config/locales/gl.yml +8 -5
- data/config/locales/hu.yml +11 -0
- data/config/locales/it.yml +4 -28
- data/config/locales/ja.yml +4 -4
- data/config/locales/lt.yml +0 -24
- data/config/locales/lv.yml +3 -0
- data/config/locales/nl.yml +4 -25
- data/config/locales/no.yml +14 -1
- data/config/locales/pl.yml +4 -26
- data/config/locales/pt-BR.yml +6 -27
- data/config/locales/pt.yml +1 -23
- data/config/locales/ro-RO.yml +11 -7
- data/config/locales/sv.yml +1 -18
- data/config/locales/tr-TR.yml +45 -1
- data/config/locales/zh-CN.yml +15 -1
- data/config/locales/zh-TW.yml +0 -24
- 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 +16 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 786343e6be9c50d6b789d4fa5fb26ef66c0ed984ca72e62dfa376d5664642310
|
4
|
+
data.tar.gz: dcfe8ab018b810d8ce7c694f05c545966e5b21c947be3594db0a9ae7dab79908
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e14eabe02a500e64ef20e5b204057e7036af7b11690f08a3f7df7e533fbc9cede6ce6f5084f8a3d5b2f2b70525fbea5e8d6dd50a7d922da91b85ec1f94c7175c
|
7
|
+
data.tar.gz: 511ee2f08dc98e56bbb53ba3d2b884a1ab68effd61fe7478469a42e4772df006e16043a3b8989d09982f7c52bf35e608cf99d178f68c92512f5314fb1add487e
|
@@ -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
|
@@ -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
|
@@ -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
|
|
File without changes
|
data/config/locales/ar.yml
CHANGED
data/config/locales/ca.yml
CHANGED
@@ -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.
|
@@ -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:
|
@@ -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
@@ -833,14 +833,10 @@ cs:
|
|
833
833
|
highlighted_votings:
|
834
834
|
max_results: Maximální počet prvků k zobrazení
|
835
835
|
landing_page:
|
836
|
-
attachments_and_folders:
|
837
|
-
name: Přílohy a složky hlasování
|
838
836
|
description:
|
839
837
|
name: Popis hlasování
|
840
838
|
elections:
|
841
839
|
name: Hlasovací volby
|
842
|
-
header:
|
843
|
-
name: Záhlaví hlasování
|
844
840
|
html_block_1:
|
845
841
|
name: Html blok 1 hlasování
|
846
842
|
html_block_2:
|