decidim-budgets 0.30.2 → 0.31.0.rc1
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/cells/decidim/budgets/budget_list_item/show.erb +19 -9
- data/app/cells/decidim/budgets/budget_list_item/vote_action.erb +2 -2
- data/app/cells/decidim/budgets/budget_list_item_cell.rb +44 -10
- data/app/cells/decidim/budgets/budgets_list/card_list.erb +0 -2
- data/app/cells/decidim/budgets/budgets_list/main_list.erb +2 -2
- data/app/cells/decidim/budgets/budgets_list/show.erb +3 -3
- data/app/cells/decidim/budgets/budgets_list/voted.erb +12 -10
- data/app/cells/decidim/budgets/budgets_list_cell.rb +22 -0
- data/app/cells/decidim/budgets/project_budget_amount_cell.rb +14 -0
- data/app/cells/decidim/budgets/project_l/extra_data.erb +8 -2
- data/app/cells/decidim/budgets/project_l/metadata.erb +1 -1
- data/app/cells/decidim/budgets/project_l_cell.rb +2 -4
- data/app/cells/decidim/budgets/project_metadata_cell.rb +11 -19
- data/app/cells/decidim/budgets/project_selected_status_cell.rb +1 -11
- data/app/cells/decidim/budgets/project_vote_button/show.erb +5 -5
- data/app/cells/decidim/budgets/project_vote_button_cell.rb +14 -9
- data/app/cells/decidim/budgets/project_votes_count_cell.rb +8 -14
- data/app/commands/decidim/budgets/cancel_order.rb +5 -0
- data/app/controllers/decidim/budgets/admin/budgets_controller.rb +2 -2
- data/app/controllers/decidim/budgets/admin/projects_controller.rb +2 -2
- data/app/controllers/decidim/budgets/admin/proposals_imports_controller.rb +1 -1
- data/app/controllers/decidim/budgets/application_controller.rb +13 -1
- data/app/controllers/decidim/budgets/budgets_controller.rb +1 -3
- data/app/controllers/decidim/budgets/line_items_controller.rb +19 -0
- data/app/controllers/decidim/budgets/orders_controller.rb +20 -0
- data/app/controllers/decidim/budgets/projects_controller.rb +3 -1
- data/app/forms/decidim/budgets/admin/component_form.rb +4 -30
- data/app/helpers/decidim/budgets/application_helper.rb +1 -0
- data/app/helpers/decidim/budgets/projects_helper.rb +11 -7
- data/app/models/decidim/budgets/order.rb +2 -2
- data/app/packs/entrypoints/decidim_budgets.js +1 -0
- data/app/packs/src/decidim/budgets/admin/projects.js +2 -2
- data/app/packs/src/decidim/budgets/budgetSummaryBackdrop.js +41 -0
- data/app/packs/src/decidim/budgets/exit_handler.js +7 -2
- data/app/packs/src/decidim/budgets/progressFixed.js +1 -1
- data/app/packs/src/decidim/budgets/projects.js +1 -1
- data/app/packs/stylesheets/budgets.scss +57 -37
- data/app/permissions/decidim/budgets/permissions.rb +17 -13
- data/app/presenters/decidim/budgets/project_presenter.rb +2 -4
- data/app/views/decidim/budgets/admin/budgets/_actions.html.erb +65 -18
- data/app/views/decidim/budgets/admin/budgets/_budget-tr.html.erb +4 -4
- data/app/views/decidim/budgets/admin/budgets/_form.html.erb +1 -1
- data/app/views/decidim/budgets/admin/budgets/index.html.erb +14 -11
- data/app/views/decidim/budgets/admin/budgets/manage_trash.html.erb +2 -1
- data/app/views/decidim/budgets/admin/projects/_actions.html.erb +66 -22
- data/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb +15 -17
- data/app/views/decidim/budgets/admin/projects/_form.html.erb +1 -1
- data/app/views/decidim/budgets/admin/projects/_project-tr.html.erb +7 -7
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_dropdown.html.erb +23 -30
- data/app/views/decidim/budgets/admin/projects/index.html.erb +2 -2
- data/app/views/decidim/budgets/admin/projects/manage_trash.html.erb +2 -1
- data/app/views/decidim/budgets/line_items/update_budget.js.erb +6 -5
- data/app/views/decidim/budgets/orders/status.html.erb +30 -30
- data/app/views/decidim/budgets/projects/_addition_selector.html.erb +1 -1
- data/app/views/decidim/budgets/projects/_budget_summary.html.erb +5 -1
- data/app/views/decidim/budgets/projects/_exit_modal.html.erb +1 -1
- data/app/views/decidim/budgets/projects/_project.html.erb +5 -1
- data/app/views/decidim/budgets/projects/_project_budget_button.html.erb +1 -9
- data/app/views/decidim/budgets/projects/_projects.html.erb +3 -1
- data/app/views/decidim/budgets/projects/index.html.erb +28 -6
- data/app/views/decidim/budgets/projects/order_progress_summary/_content.html.erb +30 -0
- data/app/views/decidim/budgets/projects/order_progress_summary/_content_responsive.html.erb +56 -0
- data/app/views/decidim/budgets/projects/order_progress_summary/_progress_box.html.erb +43 -0
- data/app/views/decidim/budgets/projects/order_progress_summary/_progress_box_buttons.html.erb +12 -0
- data/app/views/decidim/budgets/projects/order_progress_summary/_progress_box_sticky.html.erb +25 -0
- data/app/views/decidim/budgets/projects/show.html.erb +30 -17
- data/config/assets.rb +2 -2
- data/config/locales/ar.yml +0 -8
- data/config/locales/bg.yml +2 -18
- data/config/locales/ca-IT.yml +26 -14
- data/config/locales/ca.yml +26 -14
- data/config/locales/cs.yml +10 -18
- data/config/locales/de.yml +26 -14
- data/config/locales/el.yml +0 -7
- data/config/locales/en.yml +26 -14
- data/config/locales/es-MX.yml +26 -14
- data/config/locales/es-PY.yml +26 -14
- data/config/locales/es.yml +25 -13
- data/config/locales/eu.yml +26 -14
- data/config/locales/fi-plain.yml +26 -14
- data/config/locales/fi.yml +26 -14
- data/config/locales/fr-CA.yml +26 -14
- data/config/locales/fr.yml +26 -14
- data/config/locales/ga-IE.yml +0 -5
- data/config/locales/gl.yml +0 -7
- data/config/locales/hu.yml +2 -18
- data/config/locales/id-ID.yml +0 -7
- data/config/locales/is-IS.yml +0 -6
- data/config/locales/it.yml +0 -7
- data/config/locales/ja.yml +26 -14
- data/config/locales/kaa.yml +0 -1
- data/config/locales/ko.yml +0 -5
- data/config/locales/lb.yml +0 -7
- data/config/locales/lt.yml +2 -18
- data/config/locales/lv.yml +0 -7
- data/config/locales/nl.yml +0 -7
- data/config/locales/no.yml +0 -7
- data/config/locales/pl.yml +2 -18
- data/config/locales/pt-BR.yml +2 -18
- data/config/locales/pt.yml +0 -7
- data/config/locales/ro-RO.yml +7 -7
- data/config/locales/ru.yml +0 -7
- data/config/locales/sk.yml +0 -7
- data/config/locales/sq-AL.yml +0 -3
- data/config/locales/sv.yml +25 -13
- data/config/locales/tr-TR.yml +0 -8
- data/config/locales/uk.yml +0 -7
- data/config/locales/zh-CN.yml +0 -8
- data/config/locales/zh-TW.yml +0 -7
- data/db/migrate/20250912110212_move_voting_rules_to_radio_buttons.rb +22 -0
- data/lib/decidim/api/budget_type.rb +7 -0
- data/lib/decidim/api/project_type.rb +29 -1
- data/lib/decidim/budgets/budget_order_pdf.rb +73 -0
- data/lib/decidim/budgets/component.rb +26 -13
- data/lib/decidim/budgets/engine.rb +3 -11
- data/lib/decidim/budgets/seeds.rb +16 -5
- data/lib/decidim/budgets/test/factories.rb +3 -18
- data/lib/decidim/budgets/version.rb +1 -1
- data/lib/decidim/budgets/workflows/base.rb +0 -14
- data/lib/decidim/budgets.rb +1 -5
- metadata +22 -16
- data/app/queries/decidim/budgets/metrics/budget_followers_metric_measure.rb +0 -32
- data/app/queries/decidim/budgets/metrics/budget_participants_metric_measure.rb +0 -27
- data/app/views/decidim/budgets/projects/_order_progress_summary_content.html.erb +0 -122
- /data/app/views/decidim/budgets/projects/{_order_progress_progressbar_marks_right.html.erb → order_progress_summary/_progressbar_marks_right.html.erb} +0 -0
data/config/locales/pt.yml
CHANGED
@@ -21,10 +21,7 @@ pt:
|
|
21
21
|
decidim:
|
22
22
|
budgets:
|
23
23
|
actions:
|
24
|
-
attachment_collections: Pastas
|
25
|
-
attachments: Anexos
|
26
24
|
edit: Editar
|
27
|
-
edit_projects: Gerir projectos
|
28
25
|
import: Importar propostas para projetos
|
29
26
|
preview: Pré-visualização
|
30
27
|
title: Ações
|
@@ -45,8 +42,6 @@ pt:
|
|
45
42
|
exports:
|
46
43
|
projects: Projectos
|
47
44
|
models:
|
48
|
-
budget:
|
49
|
-
name: Orçamento
|
50
45
|
project:
|
51
46
|
name: Projeto
|
52
47
|
projects:
|
@@ -121,7 +116,6 @@ pt:
|
|
121
116
|
title: Projectos máximos excedidos
|
122
117
|
budget_summary:
|
123
118
|
are_you_sure: Tem a certeza de que deseja cancelar o seu voto?
|
124
|
-
cancel_order: elimine o seu voto e comece de novo
|
125
119
|
checked_out:
|
126
120
|
title: Votação do orçamento concluída
|
127
121
|
count:
|
@@ -206,6 +200,5 @@ pt:
|
|
206
200
|
project_proposal: Propostas incluídas neste projecto
|
207
201
|
statistics:
|
208
202
|
orders_count: Suportes
|
209
|
-
projects_count: Projetos
|
210
203
|
index:
|
211
204
|
confirmed_orders_count: Contagem de votos
|
data/config/locales/ro-RO.yml
CHANGED
@@ -33,10 +33,7 @@ ro:
|
|
33
33
|
'true': Implementare refuzată
|
34
34
|
budgets:
|
35
35
|
actions:
|
36
|
-
attachment_collections: Dosare
|
37
|
-
attachments: Atașamente
|
38
36
|
edit: Editare
|
39
|
-
edit_projects: Gestionați proiectele
|
40
37
|
import: Importă propuneri în proiecte
|
41
38
|
preview: Previzualizare
|
42
39
|
send_voting_reminders: Trimite memento-uri de votare
|
@@ -58,8 +55,6 @@ ro:
|
|
58
55
|
exports:
|
59
56
|
projects: Proiecte
|
60
57
|
models:
|
61
|
-
budget:
|
62
|
-
name: Buget
|
63
58
|
project:
|
64
59
|
name: Proiect
|
65
60
|
projects:
|
@@ -119,7 +114,10 @@ ro:
|
|
119
114
|
title: Titlu
|
120
115
|
order:
|
121
116
|
status:
|
117
|
+
share_text: "Tocmai am votat pentru proiectele mele favorite în %{space_name}! 🎉Votați acum: %{component_url}"
|
122
118
|
title: Votul tău a fost acceptat cu succes
|
119
|
+
order_pdf:
|
120
|
+
text: Ați votat în %{space_name}, pentru următoarele proiecte
|
123
121
|
order_summary_mailer:
|
124
122
|
order_summary:
|
125
123
|
selected_projects: 'Proiectele pe care le-ai selectat sunt:'
|
@@ -140,7 +138,7 @@ ro:
|
|
140
138
|
title: Numărul maxim de proiecte a fost depășit
|
141
139
|
budget_summary:
|
142
140
|
are_you_sure: Sigur dorești să îți anulezi votul?
|
143
|
-
cancel_order:
|
141
|
+
cancel_order: Ștergeți votul dumneavoastră
|
144
142
|
checked_out:
|
145
143
|
title: Votul pentru buget a fost finalizat
|
146
144
|
count:
|
@@ -177,6 +175,7 @@ ro:
|
|
177
175
|
add: Adaugă la votul tău
|
178
176
|
added: Adăugat la votul tău
|
179
177
|
projects_for: Proiecte pentru %{name}
|
178
|
+
select_projects: Adaugați proiecte
|
180
179
|
show:
|
181
180
|
budget: Buget
|
182
181
|
components:
|
@@ -232,6 +231,7 @@ ro:
|
|
232
231
|
project_proposal: Propuneri incluse în acest proiect
|
233
232
|
statistics:
|
234
233
|
orders_count: Voturi
|
235
|
-
projects_count:
|
234
|
+
projects_count: Bugete
|
235
|
+
projects_count_tooltip: Numărul de proiecte bugetare participative și totalul voturilor exprimate asupra acestora.
|
236
236
|
index:
|
237
237
|
confirmed_orders_count: Numărul de voturi
|
data/config/locales/ru.yml
CHANGED
@@ -16,16 +16,12 @@ ru:
|
|
16
16
|
decidim:
|
17
17
|
budgets:
|
18
18
|
actions:
|
19
|
-
attachment_collections: Папки
|
20
|
-
attachments: Прикрепленные файлы
|
21
19
|
edit: Редактировать
|
22
20
|
import: Внести в проекты позаимствованные предложения
|
23
21
|
preview: Предпросмотр
|
24
22
|
title: Действия
|
25
23
|
admin:
|
26
24
|
models:
|
27
|
-
budget:
|
28
|
-
name: Бюджет
|
29
25
|
project:
|
30
26
|
name: Проект
|
31
27
|
projects:
|
@@ -68,7 +64,6 @@ ru:
|
|
68
64
|
ok: Хорошо
|
69
65
|
budget_summary:
|
70
66
|
are_you_sure: Вы действительно хотите отменить свой голос?
|
71
|
-
cancel_order: удалить свой голос и начать все сначала
|
72
67
|
checked_out:
|
73
68
|
title: Голосование по бюджету завершено
|
74
69
|
count:
|
@@ -102,7 +97,5 @@ ru:
|
|
102
97
|
show_votes: Показать голоса
|
103
98
|
votes_choices:
|
104
99
|
enabled: Голосование включено
|
105
|
-
statistics:
|
106
|
-
projects_count: Проекты
|
107
100
|
index:
|
108
101
|
confirmed_orders_count: Количество голосов
|
data/config/locales/sk.yml
CHANGED
@@ -16,16 +16,12 @@ sk:
|
|
16
16
|
decidim:
|
17
17
|
budgets:
|
18
18
|
actions:
|
19
|
-
attachment_collections: Priečinky
|
20
|
-
attachments: Prílohy
|
21
19
|
edit: Upraviť
|
22
20
|
import: Importovať návrhy do projektov
|
23
21
|
preview: Ukážka
|
24
22
|
title: Akcie
|
25
23
|
admin:
|
26
24
|
models:
|
27
|
-
budget:
|
28
|
-
name: Rozpočet
|
29
25
|
project:
|
30
26
|
name: Projekt
|
31
27
|
projects:
|
@@ -72,7 +68,6 @@ sk:
|
|
72
68
|
ok: OK
|
73
69
|
budget_summary:
|
74
70
|
are_you_sure: Naozaj chcete zrušiť svoj hlas?
|
75
|
-
cancel_order: vymažte svoj hlas a začnite odznova
|
76
71
|
checked_out:
|
77
72
|
title: Hlasovanie o rozpočte dokončené
|
78
73
|
count:
|
@@ -115,7 +110,5 @@ sk:
|
|
115
110
|
show_votes: Zobraziť hlasy
|
116
111
|
votes_choices:
|
117
112
|
enabled: Hlasovanie povolené
|
118
|
-
statistics:
|
119
|
-
projects_count: Projekty
|
120
113
|
index:
|
121
114
|
confirmed_orders_count: Počet hlasov
|
data/config/locales/sq-AL.yml
CHANGED
@@ -32,10 +32,7 @@ sq:
|
|
32
32
|
'true': Nuk është përzgjedhur për zbatim
|
33
33
|
budgets:
|
34
34
|
actions:
|
35
|
-
attachment_collections: Dosjet
|
36
|
-
attachments: Bashkëngjitjet
|
37
35
|
edit: Përpuno
|
38
|
-
edit_projects: Menaxho projektet
|
39
36
|
import: Importo propozimet ne projekte
|
40
37
|
new_budget: Buxhet i ri
|
41
38
|
new_project: Projekt i ri
|
data/config/locales/sv.yml
CHANGED
@@ -42,15 +42,15 @@ sv:
|
|
42
42
|
'true': Inte valda för genomförande
|
43
43
|
taxonomies_part_of_contains:
|
44
44
|
label: Kategorisering
|
45
|
+
tooltips:
|
46
|
+
deleted_projects_info: Kan inte ta bort detta projekt
|
45
47
|
budgets:
|
46
48
|
actions:
|
47
|
-
attachment_collections: Mappar
|
48
|
-
attachments: Bilagor
|
49
49
|
confirm_delete_budget: Är du säker på att du vill ta bort budgeten?
|
50
50
|
confirm_delete_project: Är du säker på att du vill radera projektet?
|
51
51
|
deleted_budgets_info: Raderade budgetar kan återställas från papperskorgen.
|
52
52
|
edit: Redigera
|
53
|
-
edit_projects:
|
53
|
+
edit_projects: Lägg till projekt
|
54
54
|
import: Importera förslag till projekt
|
55
55
|
new_budget: Ny budget
|
56
56
|
new_project: Nytt projekt
|
@@ -84,8 +84,6 @@ sv:
|
|
84
84
|
exports:
|
85
85
|
projects: Projekt
|
86
86
|
models:
|
87
|
-
budget:
|
88
|
-
name: Budget
|
89
87
|
project:
|
90
88
|
name: Projekt
|
91
89
|
projects:
|
@@ -179,6 +177,7 @@ sv:
|
|
179
177
|
cancel_order:
|
180
178
|
more_than_one: dra tillbaka din röst på %{name} och börja om
|
181
179
|
only_one: dra tillbaka din röst och börja om.
|
180
|
+
completed: Slutförd
|
182
181
|
count:
|
183
182
|
one: "%{count} budget"
|
184
183
|
other: "%{count} budgetar"
|
@@ -186,6 +185,7 @@ sv:
|
|
186
185
|
finished_message: Du har avslutat omröstningen. Tack för ditt deltagande!
|
187
186
|
highlighted_cta: Rösta på %{name}
|
188
187
|
if_change_opinion: Om du har ändrat dig kan du
|
188
|
+
incomplete: Ofullständig
|
189
189
|
orders:
|
190
190
|
highest_cost: Högst kostnad
|
191
191
|
label: Sortera budgetar efter
|
@@ -193,6 +193,8 @@ sv:
|
|
193
193
|
random: Slumpvis ordning
|
194
194
|
progress: Avsluta omröstning
|
195
195
|
remove_vote: Ta bort röst
|
196
|
+
see_projects: Visa projekt
|
197
|
+
see_results: Visa resultat
|
196
198
|
show: Visa projekt
|
197
199
|
vote: Rösta
|
198
200
|
voted_budgets: Budgetar som röstats i
|
@@ -223,6 +225,7 @@ sv:
|
|
223
225
|
pending_to_vote_budgets:
|
224
226
|
one: Du kan rösta i en till budget
|
225
227
|
other: Du kan rösta i fler budgetar
|
228
|
+
share_text: "Jag röstade just på mina favoritprojekt i %{space_name}! 🎉 Rösta nu: %{component_url}"
|
226
229
|
share_vote: Dela din röst
|
227
230
|
title: Din röst har tagits emot
|
228
231
|
view_votes:
|
@@ -231,12 +234,16 @@ sv:
|
|
231
234
|
votes_count:
|
232
235
|
one: Din röst på %{budget_name} har redan registrerats.
|
233
236
|
other: Dina %{count} röster för %{budget_name} har redan registrerats.
|
237
|
+
order_pdf:
|
238
|
+
text: Du har röstat på följande projekt i %{space_name}
|
239
|
+
title: Din röst har tagits emot.
|
234
240
|
order_summary_mailer:
|
235
241
|
order_summary:
|
236
242
|
selected_projects: 'Du har valt följande projekt:'
|
237
243
|
subject: Du har röstat i %{space_name}
|
238
244
|
voted_on_space: Du har röstat på budgeten %{budget_name} i %{space_name}.
|
239
245
|
projects:
|
246
|
+
back_to_budgets: Tillbaka till budgetar
|
240
247
|
budget_confirm:
|
241
248
|
are_you_sure: Om du ändrar dig kan du ändra rösten senare.
|
242
249
|
cancel: Avbryt
|
@@ -254,7 +261,7 @@ sv:
|
|
254
261
|
title: Maximalt antal projekt överskridet
|
255
262
|
budget_summary:
|
256
263
|
are_you_sure: Vill du dra tillbaka din röst?
|
257
|
-
cancel_order:
|
264
|
+
cancel_order: Dra tillbaka din röst
|
258
265
|
checked_out:
|
259
266
|
description: Du har redan röstat i budgeten. Om du har ändrat dig kan du ta bort din röst.
|
260
267
|
title: Budgetomröstning slutförd
|
@@ -280,18 +287,16 @@ sv:
|
|
280
287
|
assigned: Valda
|
281
288
|
budget: Budget
|
282
289
|
dynamic_help:
|
283
|
-
keep_adding_projects: Fortsätt lägga till projekt
|
284
290
|
minimum_reached: Du har uppnått den lägsta gränsen för att kunna rösta
|
285
|
-
start_adding_projects: Börja lägga till projekt
|
286
291
|
minimum: Minst
|
287
292
|
minimum_projects_rule:
|
288
|
-
description: Välj minst %{minimum_number} projekt
|
293
|
+
description: "<b>Välj minst %{minimum_number} projekt</b> som du vill rösta på."
|
289
294
|
projects_rule:
|
290
|
-
description: Välj minst %{minimum_number} och som mest %{maximum_number} projekt
|
295
|
+
description: "<b>Välj minst %{minimum_number} och som mest %{maximum_number} projekt</b> som du vill rösta på."
|
291
296
|
projects_rule_maximum_only:
|
292
|
-
description: Välj upp till %{maximum_number} projekt
|
297
|
+
description: "Välj upp till %{maximum_number} projekt</b> som du vill rösta på."
|
293
298
|
vote_threshold_percent_rule:
|
294
|
-
description: Tilldela minst %{minimum_budget}
|
299
|
+
description: "<b>Tilldela minst %{minimum_budget}</b> åt de projekt du vill rösta på inom budgeten."
|
295
300
|
orders:
|
296
301
|
highest_cost: Högst kostnad
|
297
302
|
label: Sortera projekt efter
|
@@ -319,6 +324,7 @@ sv:
|
|
319
324
|
select_projects: Välj projekt
|
320
325
|
show:
|
321
326
|
budget: Budget
|
327
|
+
votes: Röster
|
322
328
|
prompt: Välj budget
|
323
329
|
vote_reminder_mailer:
|
324
330
|
vote_reminder:
|
@@ -363,6 +369,11 @@ sv:
|
|
363
369
|
vote_selected_projects_maximum: Maximalt antal projekt att välja
|
364
370
|
vote_selected_projects_minimum: Minsta antal projekt att välja
|
365
371
|
vote_threshold_percent: Tröskelvärde för röster i procent
|
372
|
+
voting_rule: Omröstningsregel
|
373
|
+
voting_rule_choices:
|
374
|
+
minimum_projects: Minsta antal projekt att rösta på
|
375
|
+
selected_projects: Minsta och högsta antal projekt som ska röstas på
|
376
|
+
threshold_percent: Minsta del av budgeten i procent
|
366
377
|
workflow: Arbetsflöde
|
367
378
|
workflow_choices:
|
368
379
|
all: 'Rösta på alla: låt deltagare att rösta i alla budgetar.'
|
@@ -436,6 +447,7 @@ sv:
|
|
436
447
|
project_proposal: Förslag som ingår i projektet
|
437
448
|
statistics:
|
438
449
|
orders_count: Stöd
|
439
|
-
projects_count:
|
450
|
+
projects_count: Budgetar
|
451
|
+
projects_count_tooltip: Antalet projekt och det totala antalet röster.
|
440
452
|
index:
|
441
453
|
confirmed_orders_count: Antal röster
|
data/config/locales/tr-TR.yml
CHANGED
@@ -20,10 +20,7 @@ tr:
|
|
20
20
|
decidim:
|
21
21
|
budgets:
|
22
22
|
actions:
|
23
|
-
attachment_collections: Klasörler
|
24
|
-
attachments: Ekler
|
25
23
|
edit: Düzenle
|
26
|
-
edit_projects: Projeleri Yönet
|
27
24
|
import: Teklifleri projelere aktarın
|
28
25
|
new_budget: Yeni Bütçe
|
29
26
|
new_project: Yeni proje
|
@@ -42,8 +39,6 @@ tr:
|
|
42
39
|
exports:
|
43
40
|
projects: Projeler
|
44
41
|
models:
|
45
|
-
budget:
|
46
|
-
name: Bütçe
|
47
42
|
project:
|
48
43
|
name: proje
|
49
44
|
projects:
|
@@ -120,7 +115,6 @@ tr:
|
|
120
115
|
title: Maksimum proje sınırını aştı
|
121
116
|
budget_summary:
|
122
117
|
are_you_sure: Oyunuzu iptal etmek istediğinizden emin misiniz?
|
123
|
-
cancel_order: oyunuzu silin ve baştan başlayın
|
124
118
|
checked_out:
|
125
119
|
title: Bütçe oyu tamamlandı
|
126
120
|
count:
|
@@ -199,7 +193,5 @@ tr:
|
|
199
193
|
email_outro: Bu bildirimi, %{participatory_space_title} adlı kişiyi takip ettiğiniz için aldınız. Önceki bağlantıyı izleyerek bildirim almayı durdurabilirsiniz.
|
200
194
|
email_subject: '%{resource_title} bütçesi artık %{participatory_space_title} için aktif.'
|
201
195
|
notification_title: <a href="%{resource_path}">%{resource_title} </a> bütçesi artık %{participatory_space_title} için aktif.
|
202
|
-
statistics:
|
203
|
-
projects_count: Projeler
|
204
196
|
index:
|
205
197
|
confirmed_orders_count: Oy sayısı
|
data/config/locales/uk.yml
CHANGED
@@ -16,16 +16,12 @@ uk:
|
|
16
16
|
decidim:
|
17
17
|
budgets:
|
18
18
|
actions:
|
19
|
-
attachment_collections: Теки
|
20
|
-
attachments: Вкладені файли
|
21
19
|
edit: Редагувати
|
22
20
|
import: Внести до проектів запозичені пропозиції
|
23
21
|
preview: Попередній перегляд
|
24
22
|
title: Дії
|
25
23
|
admin:
|
26
24
|
models:
|
27
|
-
budget:
|
28
|
-
name: Бюджет
|
29
25
|
project:
|
30
26
|
name: Проект
|
31
27
|
projects:
|
@@ -68,7 +64,6 @@ uk:
|
|
68
64
|
ok: Гаразд
|
69
65
|
budget_summary:
|
70
66
|
are_you_sure: Ви дійсно бажаєте скасувати ваш голос?
|
71
|
-
cancel_order: видалити ваш голос і почати все спочатку
|
72
67
|
checked_out:
|
73
68
|
title: Голосування щодо бюджету завершено
|
74
69
|
count:
|
@@ -101,7 +96,5 @@ uk:
|
|
101
96
|
show_votes: Показати голоси
|
102
97
|
votes_choices:
|
103
98
|
enabled: Голосування увімкнене
|
104
|
-
statistics:
|
105
|
-
projects_count: Проекти
|
106
99
|
index:
|
107
100
|
confirmed_orders_count: Кількість голосів
|
data/config/locales/zh-CN.yml
CHANGED
@@ -18,10 +18,7 @@ zh-CN:
|
|
18
18
|
decidim:
|
19
19
|
budgets:
|
20
20
|
actions:
|
21
|
-
attachment_collections: 文件夹
|
22
|
-
attachments: 附件
|
23
21
|
edit: 编辑
|
24
|
-
edit_projects: 管理项目
|
25
22
|
import: 导入提案到项目
|
26
23
|
preview: 预览
|
27
24
|
title: 行动
|
@@ -36,8 +33,6 @@ zh-CN:
|
|
36
33
|
create: 创建预算
|
37
34
|
title: 新预算
|
38
35
|
models:
|
39
|
-
budget:
|
40
|
-
name: 三. 预算
|
41
36
|
project:
|
42
37
|
name: 项目
|
43
38
|
projects:
|
@@ -107,7 +102,6 @@ zh-CN:
|
|
107
102
|
ok: 好的
|
108
103
|
budget_summary:
|
109
104
|
are_you_sure: 您确定要取消您的投票吗?
|
110
|
-
cancel_order: 删除您的投票并开始
|
111
105
|
checked_out:
|
112
106
|
title: 预算投票完成
|
113
107
|
count:
|
@@ -180,7 +174,5 @@ zh-CN:
|
|
180
174
|
email_outro: 您收到此通知是因为您正在关注 %{participatory_space_title}。您可以停止收到跟随上一个链接的通知。
|
181
175
|
email_subject: '%{resource_title} 的预算现在在 %{participatory_space_title} 处于活动状态。'
|
182
176
|
notification_title: <a href="%{resource_path}">%{resource_title}</a> 预算现在已经在 %{participatory_space_title} 中生效。
|
183
|
-
statistics:
|
184
|
-
projects_count: 项目
|
185
177
|
index:
|
186
178
|
confirmed_orders_count: 所得票数
|
data/config/locales/zh-TW.yml
CHANGED
@@ -31,10 +31,7 @@ zh-TW:
|
|
31
31
|
'true': 未選擇實施
|
32
32
|
budgets:
|
33
33
|
actions:
|
34
|
-
attachment_collections: 資料夾
|
35
|
-
attachments: 附件
|
36
34
|
edit: 編輯
|
37
|
-
edit_projects: 管理專案
|
38
35
|
import: 將提案匯入專案
|
39
36
|
preview: 預覽
|
40
37
|
send_voting_reminders: 發送投票提醒
|
@@ -62,8 +59,6 @@ zh-TW:
|
|
62
59
|
exports:
|
63
60
|
projects: 專案
|
64
61
|
models:
|
65
|
-
budget:
|
66
|
-
name: 預算
|
67
62
|
project:
|
68
63
|
name: 專案
|
69
64
|
projects:
|
@@ -174,7 +169,6 @@ zh-TW:
|
|
174
169
|
title: 超過最大專案數量
|
175
170
|
budget_summary:
|
176
171
|
are_you_sure: 您確定要取消您的投票嗎?
|
177
|
-
cancel_order: 刪除你的投票並重新開始
|
178
172
|
checked_out:
|
179
173
|
description: 你已經對預算表決投票了。如果你改變了主意,你可以%{cancel_link}。
|
180
174
|
title: 預算投票完成
|
@@ -287,6 +281,5 @@ zh-TW:
|
|
287
281
|
project_proposal: 此專案中包括的提案
|
288
282
|
statistics:
|
289
283
|
orders_count: 支援
|
290
|
-
projects_count: 專案
|
291
284
|
index:
|
292
285
|
confirmed_orders_count: 投票數
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class MoveVotingRulesToRadioButtons < ActiveRecord::Migration[7.2]
|
4
|
+
class Component < ApplicationRecord
|
5
|
+
self.table_name = :decidim_components
|
6
|
+
end
|
7
|
+
|
8
|
+
def change
|
9
|
+
budgets_components = Component.where(manifest_name: "budgets")
|
10
|
+
|
11
|
+
budgets_components.each do |component|
|
12
|
+
settings = component["settings"]["global"]
|
13
|
+
|
14
|
+
settings["voting_rule"] = "threshold_percent" if settings["vote_rule_threshold_percent_enabled"]
|
15
|
+
settings["voting_rule"] = "minimum_projects" if settings["vote_rule_minimum_budget_projects_enabled"]
|
16
|
+
settings["voting_rule"] = "selected_projects" if settings["vote_rule_selected_projects_enabled"]
|
17
|
+
|
18
|
+
component["settings"]["global"] = settings
|
19
|
+
component.save
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -5,6 +5,7 @@ module Decidim
|
|
5
5
|
class BudgetType < Decidim::Api::Types::BaseObject
|
6
6
|
implements Decidim::Core::TimestampsInterface
|
7
7
|
implements Decidim::Core::TraceableInterface
|
8
|
+
implements Decidim::Core::TaxonomizableInterface
|
8
9
|
|
9
10
|
description "A budget"
|
10
11
|
|
@@ -13,6 +14,12 @@ module Decidim
|
|
13
14
|
field :projects, [Decidim::Budgets::ProjectType, { null: true }], "The projects for this budget", null: false
|
14
15
|
field :title, Decidim::Core::TranslatedFieldType, "The title for this budget", null: false
|
15
16
|
field :total_budget, GraphQL::Types::Int, "The total budget", null: false, camelize: false
|
17
|
+
field :url, String, "The URL for this budget", null: false
|
18
|
+
field :weight, GraphQL::Types::Int, "The weight for this budget", null: false
|
19
|
+
|
20
|
+
def url
|
21
|
+
Decidim::EngineRouter.main_proxy(object.component).budget_url(object)
|
22
|
+
end
|
16
23
|
|
17
24
|
def self.authorized?(object, context)
|
18
25
|
super && object.visible?
|
@@ -7,15 +7,43 @@ module Decidim
|
|
7
7
|
implements Decidim::Core::TaxonomizableInterface
|
8
8
|
implements Decidim::Core::AttachableInterface
|
9
9
|
implements Decidim::Comments::CommentableInterface
|
10
|
+
implements Decidim::Core::AttachableCollectionInterface
|
11
|
+
implements Decidim::Core::FollowableInterface
|
12
|
+
implements Decidim::Core::LocalizableInterface
|
13
|
+
implements Decidim::Core::TimestampsInterface
|
14
|
+
implements Decidim::Core::ReferableInterface
|
15
|
+
implements Decidim::Core::TraceableInterface
|
10
16
|
|
11
17
|
description "A project"
|
12
18
|
|
13
19
|
field :budget_amount, GraphQL::Types::Int, "The budget amount for this project", null: true, camelize: false
|
20
|
+
field :budget_url, String, "The URL for the budget", null: false
|
21
|
+
field :confirmed_votes, Integer, "The number of confirmed votes this project has received", null: true
|
14
22
|
field :description, Decidim::Core::TranslatedFieldType, "The description for this project", null: true
|
15
23
|
field :id, GraphQL::Types::ID, "The internal ID for this project", null: false
|
16
|
-
field :
|
24
|
+
field :related_proposals, [Decidim::Proposals::ProposalType, { null: true }], "The related proposals", null: true
|
17
25
|
field :selected, GraphQL::Types::Boolean, "Whether this proposal is selected or not", method: :selected?, null: true
|
26
|
+
field :selected_at, Decidim::Core::DateTimeType, "The date when the project was selected", null: true
|
18
27
|
field :title, Decidim::Core::TranslatedFieldType, "The title for this project", null: true
|
28
|
+
field :url, String, "The URL for this project", null: false
|
29
|
+
|
30
|
+
def confirmed_votes
|
31
|
+
return unless object.component.current_settings.show_votes?
|
32
|
+
|
33
|
+
object.confirmed_orders_count
|
34
|
+
end
|
35
|
+
|
36
|
+
def related_proposals
|
37
|
+
object.linked_resources(:proposals, "included_proposals")
|
38
|
+
end
|
39
|
+
|
40
|
+
def url
|
41
|
+
object.resource_locator.url
|
42
|
+
end
|
43
|
+
|
44
|
+
def budget_url
|
45
|
+
Decidim::EngineRouter.main_proxy(object.component).budget_url(object.budget)
|
46
|
+
end
|
19
47
|
|
20
48
|
def self.authorized?(object, context)
|
21
49
|
context[:project] = object
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "hexapdf"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Budgets
|
7
|
+
class OrderPDF
|
8
|
+
include Decidim::TranslatableAttributes
|
9
|
+
include Decidim::ResourceHelper
|
10
|
+
|
11
|
+
delegate :document, to: :composer
|
12
|
+
|
13
|
+
attr_reader :order
|
14
|
+
|
15
|
+
def initialize(order)
|
16
|
+
@order = order
|
17
|
+
end
|
18
|
+
|
19
|
+
def render
|
20
|
+
composer.styles(**styles)
|
21
|
+
|
22
|
+
add_content
|
23
|
+
|
24
|
+
::Decidim::Exporters::ExportData.new(composer.write_to_string, "pdf")
|
25
|
+
end
|
26
|
+
|
27
|
+
def composer
|
28
|
+
@composer ||= ::HexaPDF::Composer.new(page_orientation: :portrait, page_size: :A4)
|
29
|
+
end
|
30
|
+
|
31
|
+
def styles
|
32
|
+
{
|
33
|
+
h1: { font: bold_font, text_align: :left, font_size: 15 },
|
34
|
+
text: { font:, text_align: :left, font_size: 10 }
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
def add_content
|
39
|
+
composer.text(I18n.t("decidim.budgets.order_pdf.title"), style: :h1, position: [30, 700])
|
40
|
+
composer.text(I18n.t("decidim.budgets.order_pdf.text", space_name:), style: :text, position: [30, 670])
|
41
|
+
order.projects.each_with_index do |project, index|
|
42
|
+
composer.text("- #{translated_attribute(project.title)}", style: :text, position: [30, 650 - (index * 20)])
|
43
|
+
end
|
44
|
+
|
45
|
+
composer.text(component_url, style: :text, position: [30, 650 - (order.projects.count * 20) - 10])
|
46
|
+
end
|
47
|
+
|
48
|
+
def space_name
|
49
|
+
translated_attribute(budget.participatory_space.title)
|
50
|
+
end
|
51
|
+
|
52
|
+
def component_url
|
53
|
+
Decidim::ResourceLocatorPresenter.new(budget).url
|
54
|
+
end
|
55
|
+
|
56
|
+
def budget
|
57
|
+
@budget ||= order.budget
|
58
|
+
end
|
59
|
+
|
60
|
+
def font
|
61
|
+
@font ||= load_font("source-sans-pro-v21-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-regular.ttf")
|
62
|
+
end
|
63
|
+
|
64
|
+
def bold_font
|
65
|
+
@bold_font ||= load_font("source-sans-pro-v21-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-700.ttf")
|
66
|
+
end
|
67
|
+
|
68
|
+
def load_font(path)
|
69
|
+
document.fonts.add(Decidim::Core::Engine.root.join("app/packs/fonts/decidim/").join(path))
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|