decidim-budgets 0.26.5 → 0.27.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/budgets/order_activity_cell.rb +29 -0
- data/app/commands/decidim/budgets/add_line_item.rb +4 -2
- data/app/commands/decidim/budgets/admin/create_budget.rb +1 -1
- data/app/commands/decidim/budgets/admin/create_order_reminders.rb +66 -0
- data/app/commands/decidim/budgets/admin/create_project.rb +5 -2
- data/app/commands/decidim/budgets/admin/destroy_budget.rb +1 -1
- data/app/commands/decidim/budgets/admin/destroy_project.rb +1 -1
- data/app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb +6 -6
- data/app/commands/decidim/budgets/admin/update_budget.rb +1 -1
- data/app/commands/decidim/budgets/admin/update_project.rb +5 -2
- data/app/commands/decidim/budgets/admin/update_project_category.rb +48 -0
- data/app/commands/decidim/budgets/admin/update_project_scope.rb +54 -0
- data/app/commands/decidim/budgets/admin/update_project_selection.rb +56 -0
- data/app/commands/decidim/budgets/cancel_order.rb +1 -1
- data/app/commands/decidim/budgets/checkout.rb +10 -3
- data/app/commands/decidim/budgets/remove_line_item.rb +1 -1
- data/app/controllers/decidim/budgets/admin/projects_controller.rb +149 -1
- data/app/controllers/decidim/budgets/projects_controller.rb +13 -13
- data/app/forms/decidim/budgets/admin/budget_form.rb +2 -2
- data/app/forms/decidim/budgets/admin/order_reminder_form.rb +75 -0
- data/app/forms/decidim/budgets/admin/project_form.rb +19 -3
- data/app/helpers/decidim/budgets/admin/project_bulk_actions_helper.rb +20 -0
- data/app/helpers/decidim/budgets/projects_helper.rb +29 -0
- data/app/jobs/decidim/budgets/send_vote_reminder_job.rb +16 -0
- data/app/mailers/decidim/budgets/vote_reminder_mailer.rb +39 -0
- data/app/models/decidim/budgets/order.rb +2 -3
- data/app/models/decidim/budgets/project.rb +12 -4
- data/app/packs/entrypoints/decidim_budgets_admin.js +1 -0
- data/app/packs/src/decidim/budgets/admin/projects.js +143 -0
- data/app/permissions/decidim/budgets/admin/permissions.rb +8 -3
- data/app/queries/decidim/budgets/filtered_projects.rb +1 -1
- data/app/serializers/decidim/budgets/{data_portability_budgets_order_serializer.rb → download_your_data_budgets_order_serializer.rb} +2 -2
- data/app/services/decidim/budgets/order_reminder_generator.rb +85 -0
- data/app/views/decidim/budgets/admin/budgets/index.html.erb +3 -0
- data/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb +13 -0
- data/app/views/decidim/budgets/admin/projects/_form.html.erb +6 -0
- data/app/views/decidim/budgets/admin/projects/_project-tr.html.erb +50 -0
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_change-selected.html.erb +15 -0
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_dropdown.html.erb +36 -0
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_recategorize.html.erb +15 -0
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_scope-change.html.erb +25 -0
- data/app/views/decidim/budgets/admin/projects/index.html.erb +6 -54
- data/app/views/decidim/budgets/admin/projects/update_attribute.js.erb +26 -0
- data/app/views/decidim/budgets/projects/_filters.html.erb +4 -4
- data/app/views/decidim/budgets/projects/index.html.erb +28 -1
- data/app/views/decidim/budgets/projects/show.html.erb +6 -1
- data/app/views/decidim/budgets/vote_reminder_mailer/vote_reminder.html.erb +21 -0
- data/config/assets.rb +2 -1
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +4 -0
- data/config/locales/bg.yml +1 -0
- data/config/locales/ca.yml +47 -1
- data/config/locales/cs.yml +51 -1
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +45 -3
- data/config/locales/el.yml +2 -0
- data/config/locales/en.yml +46 -1
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +43 -0
- data/config/locales/es-PY.yml +46 -0
- data/config/locales/es.yml +48 -2
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +3 -7
- data/config/locales/fi-plain.yml +46 -0
- data/config/locales/fi.yml +46 -0
- data/config/locales/fr-CA.yml +46 -1
- data/config/locales/fr.yml +47 -2
- data/config/locales/ga-IE.yml +1 -0
- data/config/locales/gl.yml +11 -0
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +19 -0
- data/config/locales/id-ID.yml +1 -0
- data/config/locales/is-IS.yml +2 -1
- data/config/locales/it.yml +2 -0
- data/config/locales/ja.yml +42 -1
- data/config/locales/ko.yml +1 -0
- data/config/locales/lb.yml +2 -0
- data/config/locales/lt.yml +1 -337
- data/config/locales/lv.yml +1 -0
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +14 -28
- data/config/locales/no.yml +17 -0
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +2 -0
- data/config/locales/pt-BR.yml +3 -1
- data/config/locales/pt.yml +2 -0
- data/config/locales/ro-RO.yml +2 -3
- data/config/locales/ru.yml +1 -0
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk.yml +1 -0
- data/config/locales/sl.yml +1 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +1 -0
- data/config/locales/sv.yml +24 -4
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +2 -0
- data/config/locales/uk.yml +1 -0
- data/config/locales/val-ES.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +1 -0
- data/config/locales/zh-TW.yml +1 -0
- data/db/migrate/20200804175222_votes_enabled_to_votes_choices.rb +2 -2
- data/db/migrate/20220428072638_add_geolocalization_fields_to_projects.rb +9 -0
- data/lib/decidim/budgets/admin_engine.rb +3 -0
- data/lib/decidim/budgets/component.rb +7 -6
- data/lib/decidim/budgets/engine.rb +17 -0
- data/lib/decidim/budgets/test/factories.rb +11 -0
- data/lib/decidim/budgets/version.rb +1 -1
- metadata +38 -22
- data/app/services/decidim/budgets/project_search.rb +0 -45
- data/config/locales/gn-PY.yml +0 -1
- data/config/locales/ka-GE.yml +0 -1
- data/config/locales/lo-LA.yml +0 -1
- data/config/locales/oc-FR.yml +0 -1
data/config/locales/no.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
---
|
1
2
|
"no":
|
2
3
|
activemodel:
|
3
4
|
attributes:
|
@@ -104,6 +105,12 @@
|
|
104
105
|
no_components: Det er ingen andre forslag komponenter i dette deltaker området å importere forslagene inn i prosjekter.
|
105
106
|
select_component: Velg en komponent
|
106
107
|
title: Importer forslag
|
108
|
+
reminders:
|
109
|
+
orders:
|
110
|
+
description: Brukere vil motta en e-post med lenker til de budsjettene som de har ventende.
|
111
|
+
title:
|
112
|
+
one: Du er i ferd med å sende en e-postpåminnelse til %{count} bruker
|
113
|
+
other: Du er i ferd med å sende en e-postpåminnelse til %{count} brukere
|
107
114
|
admin_log:
|
108
115
|
budget:
|
109
116
|
create: "%{user_name} opprettet %{resource_name} budsjettet i rommet %{space_name}"
|
@@ -240,6 +247,7 @@
|
|
240
247
|
votes:
|
241
248
|
one: stem
|
242
249
|
other: stemmer
|
250
|
+
you_voted: Du stemte dette
|
243
251
|
project_budget_button:
|
244
252
|
add: Legg til i stemmen din
|
245
253
|
add_descriptive: Legg til prosjektet %{resource_name} til din stemme
|
@@ -249,6 +257,15 @@
|
|
249
257
|
show:
|
250
258
|
budget: Budsjett
|
251
259
|
view_all_projects: Vis alle prosjekter
|
260
|
+
vote_reminder_mailer:
|
261
|
+
vote_reminder:
|
262
|
+
email_budgets: 'Områder hvor du har en uferdig stemme:'
|
263
|
+
email_intro: Du har startet på det deltakende budsjettet, men er ikke ferdig.
|
264
|
+
email_link: Fortsett for å fortsatt stemme
|
265
|
+
email_outro: Husk å fullføre stemmingen. For å stemme, må du først velge forslaget eller forslagene du ønsker å stemme på, og deretter bekrefte stemmen din med "Stemme"-knappen.
|
266
|
+
email_subject:
|
267
|
+
one: Du har en uferdig stemme i deltakende budsjettavstemming
|
268
|
+
other: Du har uferdige stemmer i deltakende budsjettavstemming
|
252
269
|
components:
|
253
270
|
budgets:
|
254
271
|
actions:
|
data/config/locales/om-ET.yml
CHANGED
data/config/locales/pl.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
---
|
1
2
|
pl:
|
2
3
|
activemodel:
|
3
4
|
attributes:
|
@@ -226,6 +227,7 @@ pl:
|
|
226
227
|
few: głosów
|
227
228
|
many: głosów
|
228
229
|
other: głosów
|
230
|
+
you_voted: Zagłosowałeś na
|
229
231
|
project_budget_button:
|
230
232
|
add: Dodaj do swojego głosu
|
231
233
|
add_descriptive: Dodaj projekt %{resource_name} do swojego głosu
|
data/config/locales/pt-BR.yml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
---
|
2
|
+
pt:
|
2
3
|
activemodel:
|
3
4
|
attributes:
|
4
5
|
budget:
|
@@ -217,6 +218,7 @@ pt-BR:
|
|
217
218
|
votes:
|
218
219
|
one: voto
|
219
220
|
other: votos
|
221
|
+
you_voted: Você votou nisto
|
220
222
|
project_budget_button:
|
221
223
|
add: Adicione ao seu voto
|
222
224
|
add_descriptive: Adicione o projeto %{resource_name} ao seu voto
|
data/config/locales/pt.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
---
|
1
2
|
pt:
|
2
3
|
activemodel:
|
3
4
|
attributes:
|
@@ -220,6 +221,7 @@ pt:
|
|
220
221
|
votes:
|
221
222
|
one: Votações
|
222
223
|
other: Votações
|
224
|
+
you_voted: Votou isto
|
223
225
|
project_budget_button:
|
224
226
|
add: Adicionar à sua votação
|
225
227
|
add_descriptive: Adicionar projeto %{resource_name} à sua votação
|
data/config/locales/ro-RO.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
---
|
1
2
|
ro:
|
2
3
|
activemodel:
|
3
4
|
attributes:
|
@@ -13,11 +14,8 @@ ro:
|
|
13
14
|
decidim_scope_id: Domeniu de interes
|
14
15
|
description: Descriere
|
15
16
|
proposal_ids: Propuneri asociate
|
16
|
-
proposals: Propuneri
|
17
17
|
selected: Selectate pentru implementare
|
18
18
|
title: Titlu
|
19
|
-
proposals_import:
|
20
|
-
scope_id: Domeniu de interes
|
21
19
|
activerecord:
|
22
20
|
models:
|
23
21
|
decidim/budgets/project:
|
@@ -247,6 +245,7 @@ ro:
|
|
247
245
|
one: vot
|
248
246
|
few: voturi
|
249
247
|
other: voturi
|
248
|
+
you_voted: Ai votat pentru
|
250
249
|
project_budget_button:
|
251
250
|
add: Adaugă la votul tău
|
252
251
|
add_descriptive: Adaugă proiectul %{resource_name} la votul tău
|
data/config/locales/ru.yml
CHANGED
data/config/locales/si-LK.yml
CHANGED
data/config/locales/sk.yml
CHANGED
data/config/locales/sl.yml
CHANGED
data/config/locales/so-SO.yml
CHANGED
data/config/locales/sr-CS.yml
CHANGED
data/config/locales/sv.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
---
|
1
2
|
sv:
|
2
3
|
activemodel:
|
3
4
|
attributes:
|
@@ -6,7 +7,7 @@ sv:
|
|
6
7
|
description: Beskrivning
|
7
8
|
title: Titel
|
8
9
|
total_budget: Total budget
|
9
|
-
weight:
|
10
|
+
weight: Vikt
|
10
11
|
project:
|
11
12
|
budget_amount: Belopp
|
12
13
|
decidim_category_id: Kategori
|
@@ -87,10 +88,15 @@ sv:
|
|
87
88
|
title: Redigera projekt
|
88
89
|
update: Uppdatera
|
89
90
|
index:
|
91
|
+
actions: Åtgärder
|
92
|
+
cancel: Avbryt
|
93
|
+
deselect_implementation: Avmarkera
|
90
94
|
finished_orders: Avslutade omröstningar
|
91
95
|
pending_orders: Pågående omröstningar
|
96
|
+
select_for_implementation: Välj
|
92
97
|
selected: Valda
|
93
98
|
title: Projekt
|
99
|
+
update: Uppdatera
|
94
100
|
new:
|
95
101
|
create: Skapa
|
96
102
|
title: Nytt projekt
|
@@ -107,6 +113,12 @@ sv:
|
|
107
113
|
no_components: Det finns inga andra förslagskomponenter med förslag i deltagarutrymmet som kan importeras till projekt.
|
108
114
|
select_component: Välj en komponent
|
109
115
|
title: Importera förslag
|
116
|
+
reminders:
|
117
|
+
orders:
|
118
|
+
description: Användarna kommer få ett e-post med länkar till budgetar de har börjat rösta i.
|
119
|
+
title:
|
120
|
+
one: Du är på väg att skicka ett e-postpåminnelse till %{count} användare
|
121
|
+
other: Du är på väg att skicka ett e-postpåminnelse till %{count} användare
|
110
122
|
admin_log:
|
111
123
|
budget:
|
112
124
|
create: "%{user_name} skapade budgeten %{resource_name} i utrymmet %{space_name}"
|
@@ -151,6 +163,7 @@ sv:
|
|
151
163
|
fields:
|
152
164
|
category: Kategori
|
153
165
|
id: ID
|
166
|
+
scope: Omfång
|
154
167
|
title: Titel
|
155
168
|
order_summary_mailer:
|
156
169
|
order_summary:
|
@@ -167,13 +180,10 @@ sv:
|
|
167
180
|
title: Bekräfta röst
|
168
181
|
budget_excess:
|
169
182
|
budget_excess:
|
170
|
-
description: Detta projekt överstiger den maximala budgeten och kan inte tilläggas. Du måste först ta bort ett projekt innan du lägger till ett nytt.
|
171
183
|
title: Maximal budget överskriden
|
172
184
|
close: Stäng
|
173
|
-
description: Detta projekt överstiger den maximala budgeten och kan inte tilläggas. Du måste först ta bort ett projekt innan du lägger till ett nytt.
|
174
185
|
ok: OK
|
175
186
|
projects_excess:
|
176
|
-
description: Du har valt för många projekt. Du måste först ta bort ett projekt innan du lägger till ett nytt.
|
177
187
|
title: Maximalt antal projekt överskridet
|
178
188
|
budget_summary:
|
179
189
|
are_you_sure: Vill du dra tillbaka din röst?
|
@@ -246,6 +256,7 @@ sv:
|
|
246
256
|
votes:
|
247
257
|
one: röst
|
248
258
|
other: röster
|
259
|
+
you_voted: Det här är din röst
|
249
260
|
project_budget_button:
|
250
261
|
add: Lägg till i din röst
|
251
262
|
add_descriptive: Lägg till projekt %{resource_name} till din röst
|
@@ -255,6 +266,15 @@ sv:
|
|
255
266
|
show:
|
256
267
|
budget: Budget
|
257
268
|
view_all_projects: Visa alla projekt
|
269
|
+
vote_reminder_mailer:
|
270
|
+
vote_reminder:
|
271
|
+
email_budgets: 'Områden där du inte har skickat din röst:'
|
272
|
+
email_intro: Du har börjat rösta i medborgarbudgeten men inte skickat den.
|
273
|
+
email_link: Rösta klart
|
274
|
+
email_outro: Kom ihåg att slutföra omröstningen. För att rösta måste du först välja ett eller flera förslag som du vill rösta för och bekräfta din röst med knappen "Rösta".
|
275
|
+
email_subject:
|
276
|
+
one: Du har börjat rösta i medborgarbudgeten men glömt skicka din röst
|
277
|
+
other: Du har börjat rösta i medborgarbudgeten men glömt skicka dina röster
|
258
278
|
components:
|
259
279
|
budgets:
|
260
280
|
actions:
|
data/config/locales/sw-KE.yml
CHANGED
data/config/locales/ti-ER.yml
CHANGED
data/config/locales/tr-TR.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
---
|
1
2
|
tr:
|
2
3
|
activemodel:
|
3
4
|
attributes:
|
@@ -209,6 +210,7 @@ tr:
|
|
209
210
|
votes:
|
210
211
|
one: oy
|
211
212
|
other: oylar
|
213
|
+
you_voted: Buna oy verdin
|
212
214
|
project_budget_button:
|
213
215
|
add: Oyunuza ekleyin
|
214
216
|
add_descriptive: Oyunuza %{resource_name} projesini ekleyin
|
data/config/locales/uk.yml
CHANGED
data/config/locales/val-ES.yml
CHANGED
data/config/locales/vi.yml
CHANGED
data/config/locales/zh-CN.yml
CHANGED
data/config/locales/zh-TW.yml
CHANGED
@@ -14,7 +14,7 @@ class VotesEnabledToVotesChoices < ActiveRecord::Migration[5.2]
|
|
14
14
|
new_steps_settings = component["settings"]["steps"].each_with_object({}) do |(step, config), new_config|
|
15
15
|
votes_value = config["votes_enabled"] ? "enabled" : "disabled"
|
16
16
|
|
17
|
-
new_config[step] = config.merge(
|
17
|
+
new_config[step] = config.merge(votes: votes_value).except("votes_enabled")
|
18
18
|
new_config
|
19
19
|
end
|
20
20
|
component["settings"]["steps"] = new_steps_settings
|
@@ -22,7 +22,7 @@ class VotesEnabledToVotesChoices < ActiveRecord::Migration[5.2]
|
|
22
22
|
elsif default_step.present?
|
23
23
|
votes_value = component["settings"]["default_step"]["votes_enabled"] ? "enabled" : "disabled"
|
24
24
|
|
25
|
-
new_default_step_settings = component["settings"]["default_step"].merge(
|
25
|
+
new_default_step_settings = component["settings"]["default_step"].merge(votes: votes_value).except("votes_enabled")
|
26
26
|
component["settings"]["default_step"] = new_default_step_settings
|
27
27
|
component.save!
|
28
28
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddGeolocalizationFieldsToProjects < ActiveRecord::Migration[6.1]
|
4
|
+
def change
|
5
|
+
add_column :decidim_budgets_projects, :address, :text
|
6
|
+
add_column :decidim_budgets_projects, :latitude, :float
|
7
|
+
add_column :decidim_budgets_projects, :longitude, :float
|
8
|
+
end
|
9
|
+
end
|
@@ -46,7 +46,7 @@ Decidim.register_component(:budgets) do |component|
|
|
46
46
|
|
47
47
|
component.register_stat :orders_count do |components, start_at, end_at|
|
48
48
|
budgets = Decidim::Budgets::Budget.where(component: components)
|
49
|
-
orders = Decidim::Budgets::Order.where(
|
49
|
+
orders = Decidim::Budgets::Order.where(budget: budgets)
|
50
50
|
orders = orders.where("created_at >= ?", start_at) if start_at.present?
|
51
51
|
orders = orders.where("created_at <= ?", end_at) if end_at.present?
|
52
52
|
orders.count
|
@@ -90,6 +90,7 @@ Decidim.register_component(:budgets) do |component|
|
|
90
90
|
settings.attribute :vote_selected_projects_maximum, type: :integer, default: 1
|
91
91
|
settings.attribute :comments_enabled, type: :boolean, default: true
|
92
92
|
settings.attribute :comments_max_length, type: :integer, required: false
|
93
|
+
settings.attribute :geocoding_enabled, type: :boolean, default: false
|
93
94
|
settings.attribute :resources_permissions_enabled, type: :boolean, default: true
|
94
95
|
settings.attribute :announcement, type: :text, translated: true, editor: true
|
95
96
|
|
@@ -123,7 +124,7 @@ Decidim.register_component(:budgets) do |component|
|
|
123
124
|
settings: {
|
124
125
|
landing_page_content: landing_page_content,
|
125
126
|
more_information_modal: Decidim::Faker::Localized.paragraph(sentence_count: 4),
|
126
|
-
workflow:
|
127
|
+
workflow: %w(one random all).sample
|
127
128
|
}
|
128
129
|
)
|
129
130
|
|
@@ -148,7 +149,7 @@ Decidim.register_component(:budgets) do |component|
|
|
148
149
|
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
149
150
|
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
150
151
|
end,
|
151
|
-
budget_amount: Faker::Number.
|
152
|
+
budget_amount: Faker::Number.between(from: Integer(budget.total_budget * 0.7), to: budget.total_budget)
|
152
153
|
)
|
153
154
|
|
154
155
|
attachment_collection = Decidim::AttachmentCollection.create!(
|
@@ -163,7 +164,7 @@ Decidim.register_component(:budgets) do |component|
|
|
163
164
|
attachment_collection: attachment_collection,
|
164
165
|
attached_to: project,
|
165
166
|
content_type: "application/pdf",
|
166
|
-
file: ActiveStorage::Blob.
|
167
|
+
file: ActiveStorage::Blob.create_and_upload!(
|
167
168
|
io: File.open(File.join(__dir__, "seeds", "Exampledocument.pdf")),
|
168
169
|
filename: "Exampledocument.pdf",
|
169
170
|
content_type: "application/pdf",
|
@@ -175,7 +176,7 @@ Decidim.register_component(:budgets) do |component|
|
|
175
176
|
description: Decidim::Faker::Localized.sentence(word_count: 5),
|
176
177
|
attached_to: project,
|
177
178
|
content_type: "image/jpeg",
|
178
|
-
file: ActiveStorage::Blob.
|
179
|
+
file: ActiveStorage::Blob.create_and_upload!(
|
179
180
|
io: File.open(File.join(__dir__, "seeds", "city.jpeg")),
|
180
181
|
filename: "city.jpeg",
|
181
182
|
content_type: "image/jpeg",
|
@@ -187,7 +188,7 @@ Decidim.register_component(:budgets) do |component|
|
|
187
188
|
description: Decidim::Faker::Localized.sentence(word_count: 5),
|
188
189
|
attached_to: project,
|
189
190
|
content_type: "application/pdf",
|
190
|
-
file: ActiveStorage::Blob.
|
191
|
+
file: ActiveStorage::Blob.create_and_upload!(
|
191
192
|
io: File.open(File.join(__dir__, "seeds", "Exampledocument.pdf")),
|
192
193
|
filename: "Exampledocument.pdf",
|
193
194
|
content_type: "application/pdf",
|
@@ -42,6 +42,23 @@ module Decidim
|
|
42
42
|
initializer "decidim_budgets.webpacker.assets_path" do
|
43
43
|
Decidim.register_assets_path File.expand_path("app/packs", root)
|
44
44
|
end
|
45
|
+
|
46
|
+
initializer "decidim_budgets.register_reminders" do
|
47
|
+
Decidim.reminders_registry.register(:orders) do |reminder_registry|
|
48
|
+
reminder_registry.generator_class_name = "Decidim::Budgets::OrderReminderGenerator"
|
49
|
+
reminder_registry.form_class_name = "Decidim::Budgets::Admin::OrderReminderForm"
|
50
|
+
reminder_registry.command_class_name = "Decidim::Budgets::Admin::CreateOrderReminders"
|
51
|
+
|
52
|
+
reminder_registry.settings do |settings|
|
53
|
+
settings.attribute :reminder_times, type: :array, default: [2.hours, 1.week, 2.weeks]
|
54
|
+
end
|
55
|
+
|
56
|
+
reminder_registry.messages do |msg|
|
57
|
+
msg.set(:title) { |count: 0| I18n.t("decidim.budgets.admin.reminders.orders.title", count: count) }
|
58
|
+
msg.set(:description) { I18n.t("decidim.budgets.admin.reminders.orders.description") }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
45
62
|
end
|
46
63
|
end
|
47
64
|
end
|
@@ -12,6 +12,14 @@ FactoryBot.define do
|
|
12
12
|
manifest_name { :budgets }
|
13
13
|
participatory_space { create(:participatory_process, :with_steps, organization: organization) }
|
14
14
|
|
15
|
+
trait :with_geocoding_enabled do
|
16
|
+
settings do
|
17
|
+
{
|
18
|
+
geocoding_enabled: true
|
19
|
+
}
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
15
23
|
trait :with_vote_threshold_percent do
|
16
24
|
transient do
|
17
25
|
vote_rule_threshold_percent_enabled { true }
|
@@ -120,6 +128,9 @@ FactoryBot.define do
|
|
120
128
|
factory :project, class: "Decidim::Budgets::Project" do
|
121
129
|
title { generate_localized_title }
|
122
130
|
description { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
|
131
|
+
address { "#{Faker::Address.street_name}, #{Faker::Address.city}" }
|
132
|
+
latitude { Faker::Address.latitude }
|
133
|
+
longitude { Faker::Address.longitude }
|
123
134
|
budget_amount { Faker::Number.number(digits: 8) }
|
124
135
|
budget { create(:budget) }
|
125
136
|
|