decidim-elections 0.31.5 → 0.31.6
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.
- checksums.yaml +4 -4
- data/app/commands/decidim/elections/admin/create_election.rb +6 -6
- data/app/commands/decidim/elections/admin/update_election.rb +6 -6
- data/app/forms/decidim/elections/admin/election_form.rb +4 -2
- data/app/helpers/decidim/elections/application_helper.rb +1 -6
- data/app/views/decidim/elections/admin/elections/_actions.html.erb +2 -2
- data/app/views/decidim/elections/admin/elections/_form.html.erb +1 -1
- data/app/views/decidim/elections/elections/_questions.html.erb +4 -1
- data/app/views/layouts/decidim/election_booth.html.erb +2 -2
- data/config/locales/cs.yml +9 -0
- data/config/locales/eu.yml +6 -6
- data/lib/decidim/elections/version.rb +1 -1
- metadata +14 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b1cd34e4ac32722720c997f093e9ea61e7101e10ac9000289cc4e122a9780d71
|
|
4
|
+
data.tar.gz: 8344c46f7d15ab7a5b3765429ecef88713dca0fa616dec6ed2eb661dc86e99e3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a1152e25ae24419fcf560fe91bbc33b27d89cf027adb7cc92e0e680873ad54b4eb2203273f3a138d0cbfcd1be4bb80108dfb49be6f38bfe74c096025b4dff78
|
|
7
|
+
data.tar.gz: fcbd8bf7008081bf115f118320c6926c9102fb8ffd4883f90889d64001eeb7ab2b0b31e55632633aa4559a20fc4cec32f3fb39bd215978dc11dcf07709af6348
|
|
@@ -4,13 +4,13 @@ module Decidim
|
|
|
4
4
|
module Elections
|
|
5
5
|
module Admin
|
|
6
6
|
class CreateElection < Decidim::Commands::CreateResource
|
|
7
|
-
include ::Decidim::
|
|
7
|
+
include ::Decidim::MultipleAttachmentsMethods
|
|
8
8
|
|
|
9
9
|
fetch_form_attributes :title, :description, :start_at, :end_at, :results_availability
|
|
10
10
|
|
|
11
11
|
protected
|
|
12
12
|
|
|
13
|
-
attr_reader :
|
|
13
|
+
attr_reader :attachments
|
|
14
14
|
|
|
15
15
|
def resource_class = Decidim::Elections::Election
|
|
16
16
|
|
|
@@ -34,14 +34,14 @@ module Decidim
|
|
|
34
34
|
|
|
35
35
|
def run_after_hooks
|
|
36
36
|
@attached_to = resource
|
|
37
|
-
|
|
37
|
+
create_attachments if process_attachments?
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def run_before_hooks
|
|
41
|
-
return unless
|
|
41
|
+
return unless process_attachments?
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
raise Decidim::Commands::HookError if
|
|
43
|
+
build_attachments
|
|
44
|
+
raise Decidim::Commands::HookError if attachments_invalid?
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
end
|
|
@@ -4,7 +4,7 @@ module Decidim
|
|
|
4
4
|
module Elections
|
|
5
5
|
module Admin
|
|
6
6
|
class UpdateElection < Decidim::Commands::UpdateResource
|
|
7
|
-
include ::Decidim::
|
|
7
|
+
include ::Decidim::MultipleAttachmentsMethods
|
|
8
8
|
fetch_form_attributes :title, :description, :start_at, :end_at, :results_availability
|
|
9
9
|
|
|
10
10
|
def initialize(form, election)
|
|
@@ -43,15 +43,15 @@ module Decidim
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def run_after_hooks
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
create_attachments if process_attachments?
|
|
47
|
+
attachment_cleanup!(include_all_attachments: true)
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def run_before_hooks
|
|
51
|
-
return unless
|
|
51
|
+
return unless process_attachments?
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
raise Decidim::Commands::HookError if
|
|
53
|
+
build_attachments
|
|
54
|
+
raise Decidim::Commands::HookError if attachments_invalid?
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
end
|
|
@@ -20,12 +20,12 @@ module Decidim
|
|
|
20
20
|
attribute :results_availability, String, default: "after_end"
|
|
21
21
|
attribute :attachment, AttachmentForm
|
|
22
22
|
|
|
23
|
-
attachments_attribute :
|
|
23
|
+
attachments_attribute :attachments
|
|
24
24
|
|
|
25
25
|
validates :title, translatable_presence: true
|
|
26
26
|
validates :results_availability, inclusion: { in: Decidim::Elections::Election::RESULTS_AVAILABILITY_OPTIONS }
|
|
27
27
|
validates :start_at, date: { before: :end_at }, unless: :manual_start?
|
|
28
|
-
validates :start_at, date: { after: proc { Time.current } }, if:
|
|
28
|
+
validates :start_at, date: { after: proc { Time.current } }, if: ->(f) { f.election&.scheduled? && f.start_at.present? }
|
|
29
29
|
validates :manual_start, acceptance: true, if: :per_question_not_started?
|
|
30
30
|
validates :end_at, presence: true
|
|
31
31
|
validates :end_at, date: { after: :start_at }, if: ->(f) { f.start_at.present? && f.end_at.present? }
|
|
@@ -33,6 +33,8 @@ module Decidim
|
|
|
33
33
|
|
|
34
34
|
def map_model(election)
|
|
35
35
|
self.manual_start = election.start_at.blank?
|
|
36
|
+
self.attachments = election.attachments.ids
|
|
37
|
+
self.add_attachments = election.attachments.map { |att| { id: att.id, title: att.title } }
|
|
36
38
|
end
|
|
37
39
|
|
|
38
40
|
def results_availability_labels
|
|
@@ -47,12 +47,7 @@ module Decidim
|
|
|
47
47
|
description = translated_attribute(question.description)
|
|
48
48
|
return if description.blank?
|
|
49
49
|
|
|
50
|
-
|
|
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
|
|
50
|
+
decidim_sanitize_editor_admin(description)
|
|
56
51
|
end
|
|
57
52
|
|
|
58
53
|
def selected_response_option_id(question)
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
<% else %>
|
|
43
43
|
<li class="dropdown__item">
|
|
44
44
|
<div class="dropdown__button-disabled">
|
|
45
|
-
<%= with_tooltip t("tooltips.edit_elections_info", scope: "decidim.admin") do %>
|
|
45
|
+
<%= with_tooltip t("tooltips.edit_elections_info", scope: "decidim.admin"), class: :left do %>
|
|
46
46
|
<%= icon "pencil-line", class: "text-gray" %>
|
|
47
47
|
<span>
|
|
48
48
|
<%= t("actions.edit", scope: "decidim.elections") %>
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
<% else %>
|
|
78
78
|
<li class="dropdown__item">
|
|
79
79
|
<div class="dropdown__button-disabled">
|
|
80
|
-
<%= with_tooltip t("tooltips.deleted_elections_info", scope: "decidim.admin") do %>
|
|
80
|
+
<%= with_tooltip t("tooltips.deleted_elections_info", scope: "decidim.admin"), class: :left do %>
|
|
81
81
|
<%= icon "delete-bin-line", class: "text-gray" %>
|
|
82
82
|
<span>
|
|
83
83
|
<%= t("actions.soft_delete", scope: "decidim.admin") %>
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
</button>
|
|
13
13
|
</div>
|
|
14
14
|
<div id="panel-question-<%= question.id %>" class="card-accordion-section" aria-hidden="true">
|
|
15
|
-
|
|
15
|
+
<% description = render_question_description(question) %>
|
|
16
|
+
<% if description.present? %>
|
|
17
|
+
<div class="editor-content"><%= description %></div>
|
|
18
|
+
<% end %>
|
|
16
19
|
|
|
17
20
|
<% question.response_options.each do |answer| %>
|
|
18
21
|
<h4><%= translated_attribute answer.body %></h4>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</head>
|
|
13
13
|
<body class="text-black text-md form-defaults<%= yield (:body_class) %>">
|
|
14
14
|
<div class="layout-container">
|
|
15
|
-
<header>
|
|
15
|
+
<header role="banner">
|
|
16
16
|
<div id="elections-header-container">
|
|
17
17
|
<%= render partial: "layouts/decidim/election_votes_header" %>
|
|
18
18
|
</div>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<%= display_flash_messages %>
|
|
23
23
|
</div>
|
|
24
24
|
<% end %>
|
|
25
|
-
<main class="layout-1col cols-6">
|
|
25
|
+
<main class="layout-1col cols-6" role="main">
|
|
26
26
|
<div class="py-8 space-y-8 lg:py-12 lg:space-y-12">
|
|
27
27
|
<%= yield %>
|
|
28
28
|
</div>
|
data/config/locales/cs.yml
CHANGED
|
@@ -142,9 +142,18 @@ cs:
|
|
|
142
142
|
form_description: Otázka musí mít alespoň dvě odpovědi, aby mohla jít k dalšímu kroku.
|
|
143
143
|
update:
|
|
144
144
|
invalid: Při aktualizaci otázek došlo k chybě.
|
|
145
|
+
success: Otázky byly úspěšně aktualizovány.
|
|
145
146
|
statuses:
|
|
147
|
+
enable_voting:
|
|
148
|
+
invalid: Při povolování hlasování došlo k chybě.
|
|
149
|
+
success: Hlasování bylo úspěšně aktivováno.
|
|
150
|
+
end:
|
|
151
|
+
invalid: Vyskytl se problém s ukončením voleb.
|
|
146
152
|
publish_results:
|
|
147
153
|
invalid: Při publikování výsledků došlo k chybě.
|
|
154
|
+
success: Výsledky byly úspěšně zveřejněny.
|
|
155
|
+
start:
|
|
156
|
+
invalid: Vyskytl se problém při zahájení voleb.
|
|
148
157
|
unknown: Neznámý stav
|
|
149
158
|
admin_log:
|
|
150
159
|
election:
|
data/config/locales/eu.yml
CHANGED
|
@@ -42,7 +42,7 @@ eu:
|
|
|
42
42
|
new: Beste hauteskunde bat
|
|
43
43
|
preview: Aurrebistaratu
|
|
44
44
|
title: Ekintzak
|
|
45
|
-
view:
|
|
45
|
+
view: Ikusi hauteskundeak
|
|
46
46
|
view_deleted_elections: Ikusi ezabatutako hauteskundeak
|
|
47
47
|
admin:
|
|
48
48
|
census:
|
|
@@ -188,7 +188,7 @@ eu:
|
|
|
188
188
|
question:
|
|
189
189
|
update: "%{user_name} parte-hartzaileak eguneratu ditu %{resource_name} aukerako galderak"
|
|
190
190
|
censuses:
|
|
191
|
-
census_ready_html: Erroldako datuak kargatuta
|
|
191
|
+
census_ready_html: Erroldako datuak kargatuta eta prest daude % <b>{eleccion_title}</b> bozketan erabiltzeko.
|
|
192
192
|
census_size_html:
|
|
193
193
|
one: Gaur egun <strong>bat</strong> pertsona dago hautesleku honetan botoa jasotzeko gai dena (hau errolda dinamiko batean alda daiteke).
|
|
194
194
|
other: Gaur egun <strong>bat</strong> pertsona daude hautesleku honetan botoa jasotzeko gai deirnak (hau errolda dinamiko batean alda daiteke).
|
|
@@ -210,7 +210,7 @@ eu:
|
|
|
210
210
|
verify_with_method: Egiaztatu %{name} izenaz
|
|
211
211
|
token_csv:
|
|
212
212
|
example: |
|
|
213
|
-
e-maila:
|
|
213
|
+
e-maila:
|
|
214
214
|
user@example.org;123456
|
|
215
215
|
user2@example.org;ABCXYZ
|
|
216
216
|
info_html: |
|
|
@@ -255,7 +255,7 @@ eu:
|
|
|
255
255
|
vote_button: Eman babesa
|
|
256
256
|
voted: Bozkatu duzu. Berriz bozkatu dezakezu, zure azken botoa baino ez da kontuan hartuko.
|
|
257
257
|
votes_count:
|
|
258
|
-
one: 1
|
|
258
|
+
one: Boto 1
|
|
259
259
|
other: "%{count} boto"
|
|
260
260
|
voting_began: 'Bozketa hasi zen: %{start_date}'
|
|
261
261
|
vote_results:
|
|
@@ -280,7 +280,7 @@ eu:
|
|
|
280
280
|
waiting:
|
|
281
281
|
description: Hemen itxaron dezakezu hurrengo galdera egin arte. Automatikoki hurrengo galderara itzuliko zara prest dagoenean.
|
|
282
282
|
edit_vote: Zure botoa editau
|
|
283
|
-
exit_button:
|
|
283
|
+
exit_button: Irten itxarongelatik
|
|
284
284
|
title: Hurrengo galderaren zain
|
|
285
285
|
status:
|
|
286
286
|
active: Aktibo
|
|
@@ -313,7 +313,7 @@ eu:
|
|
|
313
313
|
next: Hurrengoa
|
|
314
314
|
receipt:
|
|
315
315
|
description: Bozkatzeko epea zabalik dagoen bitartean edozein unetan eman daiteke berriro botoa. Zure aurreko botoa berriaz gainidatziko da.
|
|
316
|
-
edit_vote:
|
|
316
|
+
edit_vote: Editatu zure botoa
|
|
317
317
|
exit_button: Irten bozkatzeko kabinatik
|
|
318
318
|
title: Zure botoak zuzen eman dira
|
|
319
319
|
metadata:
|
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.
|
|
4
|
+
version: 0.31.6
|
|
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: 2026-
|
|
11
|
+
date: 2026-07-06 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.
|
|
19
|
+
version: 0.31.6
|
|
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.
|
|
26
|
+
version: 0.31.6
|
|
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.
|
|
33
|
+
version: 0.31.6
|
|
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.
|
|
40
|
+
version: 0.31.6
|
|
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.
|
|
47
|
+
version: 0.31.6
|
|
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.
|
|
54
|
+
version: 0.31.6
|
|
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.
|
|
61
|
+
version: 0.31.6
|
|
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.
|
|
68
|
+
version: 0.31.6
|
|
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.
|
|
75
|
+
version: 0.31.6
|
|
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.
|
|
82
|
+
version: 0.31.6
|
|
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.
|
|
89
|
+
version: 0.31.6
|
|
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.
|
|
96
|
+
version: 0.31.6
|
|
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
|