decidim-budgets 0.26.10 → 0.27.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/budgets/budgets_header/show.erb +1 -1
  3. data/app/cells/decidim/budgets/order_activity_cell.rb +29 -0
  4. data/app/commands/decidim/budgets/add_line_item.rb +4 -2
  5. data/app/commands/decidim/budgets/admin/create_budget.rb +1 -1
  6. data/app/commands/decidim/budgets/admin/create_order_reminders.rb +66 -0
  7. data/app/commands/decidim/budgets/admin/create_project.rb +5 -2
  8. data/app/commands/decidim/budgets/admin/destroy_budget.rb +1 -1
  9. data/app/commands/decidim/budgets/admin/destroy_project.rb +1 -1
  10. data/app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb +6 -6
  11. data/app/commands/decidim/budgets/admin/update_budget.rb +1 -1
  12. data/app/commands/decidim/budgets/admin/update_project.rb +5 -2
  13. data/app/commands/decidim/budgets/admin/update_project_category.rb +48 -0
  14. data/app/commands/decidim/budgets/admin/update_project_scope.rb +54 -0
  15. data/app/commands/decidim/budgets/admin/update_project_selection.rb +56 -0
  16. data/app/commands/decidim/budgets/cancel_order.rb +1 -1
  17. data/app/commands/decidim/budgets/checkout.rb +10 -3
  18. data/app/commands/decidim/budgets/remove_line_item.rb +1 -1
  19. data/app/controllers/decidim/budgets/admin/application_controller.rb +2 -0
  20. data/app/controllers/decidim/budgets/admin/attachment_collections_controller.rb +1 -3
  21. data/app/controllers/decidim/budgets/admin/attachments_controller.rb +1 -7
  22. data/app/controllers/decidim/budgets/admin/budgets_controller.rb +1 -1
  23. data/app/controllers/decidim/budgets/admin/projects_controller.rb +149 -1
  24. data/app/controllers/decidim/budgets/line_items_controller.rb +2 -2
  25. data/app/controllers/decidim/budgets/orders_controller.rb +1 -1
  26. data/app/controllers/decidim/budgets/projects_controller.rb +15 -19
  27. data/app/forms/decidim/budgets/admin/budget_form.rb +3 -4
  28. data/app/forms/decidim/budgets/admin/order_reminder_form.rb +75 -0
  29. data/app/forms/decidim/budgets/admin/project_form.rb +19 -3
  30. data/app/helpers/decidim/budgets/admin/project_bulk_actions_helper.rb +20 -0
  31. data/app/helpers/decidim/budgets/projects_helper.rb +29 -0
  32. data/app/jobs/decidim/budgets/send_vote_reminder_job.rb +16 -0
  33. data/app/mailers/decidim/budgets/vote_reminder_mailer.rb +39 -0
  34. data/app/models/decidim/budgets/order.rb +2 -4
  35. data/app/models/decidim/budgets/project.rb +14 -10
  36. data/app/packs/entrypoints/decidim_budgets_admin.js +1 -0
  37. data/app/packs/src/decidim/budgets/admin/projects.js +143 -0
  38. data/app/permissions/decidim/budgets/admin/permissions.rb +8 -3
  39. data/app/queries/decidim/budgets/filtered_projects.rb +1 -1
  40. data/app/serializers/decidim/budgets/{data_portability_budgets_order_serializer.rb → download_your_data_budgets_order_serializer.rb} +2 -2
  41. data/app/services/decidim/budgets/order_reminder_generator.rb +85 -0
  42. data/app/views/decidim/budgets/admin/budgets/_form.html.erb +1 -1
  43. data/app/views/decidim/budgets/admin/budgets/edit.html.erb +0 -1
  44. data/app/views/decidim/budgets/admin/budgets/index.html.erb +3 -1
  45. data/app/views/decidim/budgets/admin/budgets/new.html.erb +0 -1
  46. data/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb +13 -0
  47. data/app/views/decidim/budgets/admin/projects/_form.html.erb +6 -0
  48. data/app/views/decidim/budgets/admin/projects/_project-tr.html.erb +50 -0
  49. data/app/views/decidim/budgets/admin/projects/bulk_actions/_change-selected.html.erb +15 -0
  50. data/app/views/decidim/budgets/admin/projects/bulk_actions/_dropdown.html.erb +36 -0
  51. data/app/views/decidim/budgets/admin/projects/bulk_actions/_recategorize.html.erb +15 -0
  52. data/app/views/decidim/budgets/admin/projects/bulk_actions/_scope-change.html.erb +25 -0
  53. data/app/views/decidim/budgets/admin/projects/edit.html.erb +0 -1
  54. data/app/views/decidim/budgets/admin/projects/index.html.erb +6 -55
  55. data/app/views/decidim/budgets/admin/projects/new.html.erb +0 -1
  56. data/app/views/decidim/budgets/admin/projects/update_attribute.js.erb +26 -0
  57. data/app/views/decidim/budgets/admin/proposals_imports/new.html.erb +0 -1
  58. data/app/views/decidim/budgets/order_summary_mailer/order_summary.html.erb +0 -1
  59. data/app/views/decidim/budgets/projects/_filters.html.erb +4 -4
  60. data/app/views/decidim/budgets/projects/index.html.erb +28 -1
  61. data/app/views/decidim/budgets/projects/show.html.erb +7 -2
  62. data/app/views/decidim/budgets/vote_reminder_mailer/vote_reminder.html.erb +21 -0
  63. data/config/assets.rb +2 -1
  64. data/config/locales/am-ET.yml +1 -0
  65. data/config/locales/ar.yml +5 -1
  66. data/config/locales/bg.yml +1 -0
  67. data/config/locales/ca.yml +48 -5
  68. data/config/locales/cs.yml +53 -8
  69. data/config/locales/da.yml +1 -0
  70. data/config/locales/de.yml +50 -16
  71. data/config/locales/el.yml +3 -33
  72. data/config/locales/en.yml +46 -4
  73. data/config/locales/eo.yml +1 -0
  74. data/config/locales/es-MX.yml +46 -6
  75. data/config/locales/es-PY.yml +49 -6
  76. data/config/locales/es.yml +50 -7
  77. data/config/locales/et.yml +1 -0
  78. data/config/locales/eu.yml +46 -62
  79. data/config/locales/fi-plain.yml +47 -4
  80. data/config/locales/fi.yml +93 -50
  81. data/config/locales/fr-CA.yml +47 -5
  82. data/config/locales/fr.yml +48 -6
  83. data/config/locales/ga-IE.yml +2 -1
  84. data/config/locales/gl.yml +11 -0
  85. data/config/locales/hr.yml +1 -0
  86. data/config/locales/hu.yml +21 -149
  87. data/config/locales/id-ID.yml +2 -1
  88. data/config/locales/is-IS.yml +4 -2
  89. data/config/locales/it.yml +4 -2
  90. data/config/locales/ja.yml +44 -5
  91. data/config/locales/ko.yml +1 -0
  92. data/config/locales/lb.yml +5 -5
  93. data/config/locales/lt.yml +1 -338
  94. data/config/locales/lv.yml +2 -1
  95. data/config/locales/mt.yml +1 -0
  96. data/config/locales/nl.yml +16 -30
  97. data/config/locales/no.yml +18 -1
  98. data/config/locales/om-ET.yml +1 -0
  99. data/config/locales/pl.yml +3 -24
  100. data/config/locales/pt-BR.yml +4 -21
  101. data/config/locales/pt.yml +3 -3
  102. data/config/locales/ro-RO.yml +2 -3
  103. data/config/locales/ru.yml +2 -1
  104. data/config/locales/si-LK.yml +1 -0
  105. data/config/locales/sk.yml +2 -1
  106. data/config/locales/sl.yml +1 -0
  107. data/config/locales/so-SO.yml +1 -0
  108. data/config/locales/sr-CS.yml +1 -0
  109. data/config/locales/sv.yml +26 -7
  110. data/config/locales/sw-KE.yml +1 -0
  111. data/config/locales/ti-ER.yml +1 -0
  112. data/config/locales/tr-TR.yml +3 -3
  113. data/config/locales/uk.yml +3 -2
  114. data/config/locales/val-ES.yml +1 -0
  115. data/config/locales/vi.yml +1 -0
  116. data/config/locales/zh-CN.yml +1 -3
  117. data/config/locales/zh-TW.yml +1 -326
  118. data/db/migrate/20200804175222_votes_enabled_to_votes_choices.rb +2 -2
  119. data/db/migrate/20220428072638_add_geolocalization_fields_to_projects.rb +9 -0
  120. data/lib/decidim/budgets/admin_engine.rb +3 -0
  121. data/lib/decidim/budgets/component.rb +7 -6
  122. data/lib/decidim/budgets/engine.rb +17 -0
  123. data/lib/decidim/budgets/test/factories.rb +11 -0
  124. data/lib/decidim/budgets/version.rb +1 -1
  125. data/lib/decidim/budgets/workflows/all.rb +1 -1
  126. data/lib/decidim/budgets/workflows/base.rb +1 -1
  127. metadata +38 -27
  128. data/app/services/decidim/budgets/project_search.rb +0 -45
  129. data/config/environment.rb +0 -3
  130. data/config/locales/fa-IR.yml +0 -1
  131. data/config/locales/gn-PY.yml +0 -1
  132. data/config/locales/ka-GE.yml +0 -1
  133. data/config/locales/kaa.yml +0 -11
  134. data/config/locales/lo-LA.yml +0 -1
  135. data/config/locales/oc-FR.yml +0 -1
  136. data/config/locales/sq-AL.yml +0 -1
  137. data/config/locales/th-TH.yml +0 -1
@@ -1,327 +1,2 @@
1
+ ---
1
2
  zh-TW:
2
- activemodel:
3
- attributes:
4
- budget:
5
- decidim_scope_id: 範圍
6
- description: 說明
7
- title: 標題
8
- total_budget: 總預算
9
- weight: 排序位置
10
- project:
11
- budget_amount: 預算金額
12
- decidim_category_id: 類別
13
- decidim_scope_id: 範圍
14
- description: 說明
15
- proposal_ids: 相關提案
16
- proposals: 提案
17
- selected: 選定實施
18
- title: 標題
19
- proposals_import:
20
- scope_id: 範圍
21
- activerecord:
22
- models:
23
- decidim/budgets/project:
24
- other: 專案
25
- decidim:
26
- admin:
27
- filters:
28
- projects:
29
- category_id_eq:
30
- label: 類別
31
- scope_id_eq:
32
- label: 範圍
33
- selected_at_null:
34
- label: 已選取
35
- values:
36
- 'false': 選定實施
37
- 'true': 未選擇實施
38
- budgets:
39
- actions:
40
- attachment_collections: 資料夾
41
- attachments: 附件
42
- confirm_destroy: 你確定要刪除這個專案嗎?
43
- destroy: 刪除
44
- edit: 編輯
45
- edit_projects: 管理專案
46
- import: 將提案匯入專案
47
- new: 新增 %{name}
48
- preview: 預覽
49
- title: 操作
50
- admin:
51
- budgets:
52
- create:
53
- invalid: 建立預算時發生問題
54
- success: 預算已成功建立
55
- destroy:
56
- invalid: 刪除此預算時出現問題
57
- success: 預算已成功刪除
58
- edit:
59
- title: 編輯預算
60
- update: 更新預算
61
- index:
62
- finished_orders: 已完成投票
63
- pending_orders: 待審核投票
64
- title: 預算
65
- users_with_finished_orders: 已完成投票的使用者
66
- users_with_pending_orders: 仍在等待投票的使用者
67
- new:
68
- create: 建立預算
69
- title: 新增預算
70
- update:
71
- invalid: 此預算更新時出了問題
72
- success: 預算已成功更新
73
- exports:
74
- projects: 專案
75
- models:
76
- budget:
77
- name: 預算
78
- project:
79
- name: 專案
80
- projects:
81
- create:
82
- invalid: 這個專案創建時出了問題
83
- success: 專案建立成功
84
- destroy:
85
- success: 專案刪除成功
86
- edit:
87
- title: 編輯專案
88
- update: 更新
89
- index:
90
- finished_orders: 已完成投票
91
- pending_orders: 待審核投票
92
- selected: 已選取
93
- title: 專案
94
- new:
95
- create: 建立
96
- title: 新專案
97
- update:
98
- invalid: 更新此專案時出現問題
99
- success: 專案更新成功
100
- proposals_imports:
101
- create:
102
- invalid: 將提案匯入專案時出現問題
103
- success: "%{number} 個提案已成功匯入專案"
104
- new:
105
- create: 將提案匯入專案
106
- default_budget: 預設預算
107
- import_all_accepted_proposals: 導入所有已接受的提案
108
- no_components: 在此參與空間中沒有其他提案元件可以將提案匯入到專案中。
109
- origin_component_id: 原始元件
110
- select_component: 請選擇一個組件
111
- title: 導入提案
112
- admin_log:
113
- budget:
114
- create: "%{user_name} 在 %{space_name} 空間創建了 %{resource_name} 預算。"
115
- delete: "%{user_name} 刪除了 %{space_name} 空間中的 %{resource_name} 預算"
116
- update: "%{user_name} 在 %{space_name} 空間更新了 %{resource_name} 預算"
117
- project:
118
- create: "%{user_name} 在 %{space_name} 空間中創建了 %{resource_name} 專案"
119
- delete: "%{user_name} 刪除了 %{space_name} 空間中的 %{resource_name} 專案。"
120
- update: "%{user_name} 更新了 %{space_name} 空間中的 %{resource_name} 專案。"
121
- budget:
122
- view: 查看所有預算專案
123
- budget_information_modal:
124
- back_to: 返回 %{component_name}
125
- close_modal: 關閉視窗
126
- continue: 繼續
127
- more_information: 更多資訊
128
- budget_list_item:
129
- voting_finished: 您已在此預算中投票
130
- voting_started: 你已經開始在這個預算中投票了
131
- budgets_list:
132
- cancel_order:
133
- more_than_one: 刪除您對於 %{name} 的投票並重新開始
134
- only_one: 刪除您的投票並重新開始。
135
- finished_message: 您已完成投票流程。感謝您的參與!
136
- highlighted_cta: 在 %{name} 上投票
137
- if_change_opinion: 如果您改變了主意,您可以
138
- my_budgets: 我的預算
139
- progress: 完成投票
140
- show: 檢視專案
141
- vote: 投票
142
- voted_on: 你已經對 %{links} 投票
143
- limit_announcement:
144
- cant_vote: 你無法在這個預算中進行投票。<a href="%{landing_path}">嘗試在其他預算中投票</a>。
145
- limit_reached: 您在 %{links} 上有進行中的投票。若要對此預算進行投票,您必須<a href="%{landing_path}">刪除您目前的投票並重新開始</a>。
146
- models:
147
- budget:
148
- fields:
149
- name: 姓名
150
- projects_count: 專案數量
151
- total_budget: 總預算
152
- project:
153
- fields:
154
- category: 類別
155
- id: ID
156
- title: 標題
157
- order_summary_mailer:
158
- order_summary:
159
- selected_projects: '你選擇的專案如下:'
160
- subject: 您已經在 %{space_name} 參與空間投票
161
- voted_on_space: 您已對「%{space_name}」參與空間的「%{budget_name}」預算進行投票。
162
- voted_on_space_with_scope: 您已在%{scope_type} 的%{scope_name} 中,對%{space_name} 參與空間的%{budget_name} 預算進行了投票。
163
- projects:
164
- budget_confirm:
165
- are_you_sure: 如果您改變了主意,稍後可以更改您的選票。
166
- cancel: 撤銷
167
- confirm: 確認
168
- description: 這些是您選擇納入預算的專案
169
- title: 確認投票
170
- budget_excess:
171
- budget_excess:
172
- description: 這個專案超出了預算上限,無法被加入。如果您願意,您可以刪除您已經選擇的一個專案,以便能夠根據您的偏好再次進行投票。
173
- title: 已超過最高預算
174
- close: 關閉
175
- description: 這個專案超出了預算上限,無法被加入。如果您願意,您可以刪除您已經選擇的一個專案,以便能夠根據您的偏好再次進行投票。
176
- ok: 好的
177
- projects_excess:
178
- description: 這個專案超出了最大項目數限制,無法被添加。如果你想的話,可以刪除你已經選擇的一個專案,以便根據你的偏好再次投票
179
- title: 超過最大專案數量
180
- budget_summary:
181
- are_you_sure: 您確定要取消您的投票嗎?
182
- assigned: '已指派:'
183
- cancel_order: 刪除你的投票並重新開始
184
- checked_out:
185
- description: 你已經對預算表決投票了。如果你改變了主意,你可以%{cancel_link}。
186
- title: 預算投票完成
187
- minimum_projects_rule:
188
- description: 您認為我們應該撥款給哪些專案?請選擇至少 %{minimum_number} 個您想要的專案,並根據您的偏好進行投票,以定義預算。
189
- instruction: "<li>請選擇至少 %{minimum_number} 個您認為應該分配預算的項目,並根據您的喜好進行投票以定義預算。</li>"
190
- projects_rule:
191
- description: 你認為我們應該為哪些專案分配預算?請至少選擇 %{minimum_number} 個專案,最多可選擇 %{maximum_number} 個項目,並根據你的喜好投票以定義預算。
192
- instruction: "<li>請至少選擇 %{minimum_number} 個至多 %{maximum_number} 個您想要的項專案,並根據您的喜好進行投票以定義預算。</li>"
193
- projects_rule_maximum_only:
194
- description: 你認為我們應該為哪些專案分配預算?請選擇最多 %{maximum_number} 個專案,根據你的喜好進行投票,來定義預算。
195
- instruction: "\"<li>選擇最多 %{maximum_number} 個您想為其分配預算的專案,並根據您的喜好進行投票,以定義預算。</li>"
196
- rules:
197
- title: 預算規則
198
- title: 你決定預算
199
- total_budget: 總預算
200
- total_projects: 總票數
201
- vote_threshold_percent_rule:
202
- description: 您覺得我們應該為哪些專案分配預算?為您想要的專案分配至少 %{minimum_budget} 的預算,並按照您的喜好進行投票以定義預算。
203
- instruction: "\"<li>指派至少 %{minimum_budget} 的預算給您想支持的專案,然後根據您的喜好進行投票以制定預算。</li>"
204
- count:
205
- projects_count:
206
- other: "%{count} 專案"
207
- exit_modal:
208
- cancel: 返回投票
209
- close_modal: 關閉視窗
210
- exit: 退出投票
211
- message: 您的投票尚未被註冊,因為您尚未完成投票程序。您確定要退出投票嗎?
212
- title: 您尚未投票
213
- filters:
214
- category: 類別
215
- scope: 範圍
216
- search: 搜尋
217
- status: 狀態
218
- status_values:
219
- all: 全部
220
- not_selected: 未選擇
221
- selected: 已選取
222
- filters_small_view:
223
- close_modal: 關閉視窗
224
- filter: 篩選
225
- filter_by: 篩選條件
226
- unfold: 展開
227
- order_progress:
228
- vote: 投票
229
- order_selected_projects:
230
- remove: 移除
231
- selected_projects:
232
- other: 已選擇的專案
233
- view: 檢視
234
- orders:
235
- highest_cost: 最高成本
236
- label: 專案排序方式
237
- lowest_cost: 最低成本
238
- most_voted: 最高票
239
- random: 隨機順序
240
- selected: 已選取
241
- project:
242
- add: 將專案 %{resource_name} 加入您的投票
243
- remove: 從您的投票中移除專案 %{resource_name}
244
- selected: 已選取
245
- view: 檢視
246
- votes:
247
- other: 投票
248
- you_voted: 你已投票支持此
249
- project_budget_button:
250
- add: 加入您的投票
251
- add_descriptive: 將專案 %{resource_name} 加入您的投票
252
- added: 加入您的投票
253
- added_descriptive: 將專案 %{resource_name} 加入您的投票
254
- projects_for: 專案 %{name}
255
- show:
256
- budget: 預算
257
- view_all_projects: 檢視所有專案
258
- components:
259
- budgets:
260
- actions:
261
- comment: 評論
262
- vote: 投票
263
- name: 預算
264
- settings:
265
- global:
266
- announcement: 公告
267
- comments_enabled: 啟用評論功能
268
- comments_max_length: 評論字數最大長度(若要使用預設值請輸入0)
269
- form:
270
- errors:
271
- budget_voting_rule_only_one: 僅能啟用一個投票規則
272
- budget_voting_rule_required: 必須啟用一種投票規則
273
- landing_page_content: 預算網頁首頁
274
- more_information_modal: 更多資訊彈出式視窗
275
- projects_per_page: 每頁顯示專案
276
- resources_permissions_enabled: 可為每個專案設定動作權限
277
- scope_id: 範圍
278
- scopes_enabled: 啟用範圍
279
- title: 標題
280
- total_budget: 總預算
281
- vote_minimum_budget_projects_number: 最少需要投票的專案數量
282
- vote_rule_minimum_budget_projects_enabled: '啟用規則:投票時需要投票的最少專案數量'
283
- vote_rule_selected_projects_enabled: '啟用規則:最少和最多投票方案數量限制'
284
- vote_rule_threshold_percent_enabled: '啟用規則: 最低預算百分比'
285
- vote_selected_projects_maximum: 最多可以選擇的專案數量
286
- vote_selected_projects_minimum: 最少可以選擇的專案數量
287
- vote_threshold_percent: 投票門檻百分比
288
- workflow: 工作流程
289
- workflow_choices:
290
- all: '全部投票:允許參與者投票所有預算。'
291
- one: '僅限投一票: 參與者可以在任意預算中投票,但僅限投一票。'
292
- step:
293
- announcement: 公告
294
- comments_blocked: 留言已封鎖
295
- highlighted_heading: 突顯標題
296
- landing_page_content: 預算網頁首頁
297
- list_heading: 標題清單
298
- more_information_modal: 更多資訊彈出式視窗
299
- show_votes: 顯示投票
300
- title: 標題
301
- votes: 投票
302
- votes_choices:
303
- disabled: 投票已停用
304
- enabled: 已啟用投票
305
- finished: 投票已結束
306
- events:
307
- budgets:
308
- budget_published:
309
- email_intro: '現在 %{participatory_space_title} 的 %{resource_title} 預算已啟動,您可以從此頁面查看:'
310
- email_outro: 你收到此通知是因為你正在追蹤 %{participatory_space_title}。你可以透過前面的連結停止接收通知。
311
- email_subject: '%{participatory_space_title}」現在啟用了「%{resource_title}」預算。'
312
- notification_title: <a href="%{resource_path}">%{resource_title}</a> 預算現在已經在 %{participatory_space_title} 上啟動
313
- orders:
314
- checkout:
315
- error: 處理您的投票時出現問題。
316
- success: 您的投票已成功接受
317
- destroy:
318
- error: 取消您的投票時出現問題
319
- success: 您的投票已成功取消
320
- resource_links:
321
- included_proposals:
322
- project_proposal: 此專案中包括的提案
323
- statistics:
324
- orders_count: 支援
325
- projects_count: 專案
326
- index:
327
- confirmed_orders_count: 投票數
@@ -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("votes": votes_value).except("votes_enabled")
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("votes": votes_value).except("votes_enabled")
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
@@ -15,6 +15,9 @@ module Decidim
15
15
  resources :budgets do
16
16
  resources :projects do
17
17
  collection do
18
+ post :update_category
19
+ post :update_scope
20
+ post :update_selected
18
21
  resource :proposals_import, only: [:new, :create]
19
22
  end
20
23
  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(component: budgets)
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: Decidim::Budgets.workflows.keys.sample
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.number(digits: 8)
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.create_after_upload!(
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.create_after_upload!(
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.create_after_upload!(
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
 
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-budgets version.
5
5
  module Budgets
6
6
  def self.version
7
- "0.26.10"
7
+ "0.27.0.rc1"
8
8
  end
9
9
  end
10
10
  end
@@ -11,7 +11,7 @@ module Decidim
11
11
  end
12
12
 
13
13
  # Users can vote in all budgets with this workflow.
14
- def vote_allowed?(resource, consider_progress: true) # rubocop:disable Lint/UnusedMethodArgument
14
+ def vote_allowed?(resource, _consider_progress: true)
15
15
  !voted?(resource)
16
16
  end
17
17
  end
@@ -40,7 +40,7 @@ module Decidim
40
40
  # Using `false` allow UI to offer users to discard votes in progress to start voting in another resource.
41
41
  #
42
42
  # Returns Boolean.
43
- def vote_allowed?(_resource, consider_progress: true) # rubocop:disable Lint/UnusedMethodArgument
43
+ def vote_allowed?(_resource, _consider_progress: true)
44
44
  raise StandardError, "Not implemented"
45
45
  end
46
46