decidim-budgets 0.27.10 → 0.28.0.rc4

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.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/stylesheets/decidim/budgets/budget/_budget-vote-button.scss +5 -5
  4. data/app/cells/decidim/budgets/base_cell.rb +1 -1
  5. data/app/cells/decidim/budgets/budget_cell.rb +6 -1
  6. data/app/cells/decidim/budgets/budget_information_modal/show.erb +14 -26
  7. data/app/cells/decidim/budgets/budget_list_item/projects_count.erb +6 -0
  8. data/app/cells/decidim/budgets/budget_list_item/show.erb +35 -30
  9. data/app/cells/decidim/budgets/budget_list_item/vote_action.erb +13 -0
  10. data/app/cells/decidim/budgets/budget_list_item_cell.rb +24 -1
  11. data/app/cells/decidim/budgets/budget_metadata_cell.rb +29 -0
  12. data/app/cells/decidim/budgets/budget_s_cell.rb +15 -0
  13. data/app/cells/decidim/budgets/budgets_header/show.erb +2 -6
  14. data/app/cells/decidim/budgets/budgets_list/card_list.erb +8 -13
  15. data/app/cells/decidim/budgets/budgets_list/main_list.erb +5 -0
  16. data/app/cells/decidim/budgets/budgets_list/show.erb +12 -16
  17. data/app/cells/decidim/budgets/budgets_list/voted.erb +8 -44
  18. data/app/cells/decidim/budgets/budgets_list_cell.rb +34 -0
  19. data/app/cells/decidim/budgets/limit_announcement/show.erb +3 -0
  20. data/app/cells/decidim/budgets/limit_announcement_cell.rb +2 -2
  21. data/app/cells/decidim/budgets/order_activity_cell.rb +1 -4
  22. data/app/cells/decidim/budgets/project_cell.rb +6 -1
  23. data/app/cells/decidim/budgets/project_l/extra_data.erb +6 -0
  24. data/app/cells/decidim/budgets/project_l/metadata.erb +4 -0
  25. data/app/cells/decidim/budgets/project_l_cell.rb +38 -0
  26. data/app/cells/decidim/budgets/project_metadata_cell.rb +78 -0
  27. data/app/cells/decidim/budgets/project_s_cell.rb +21 -0
  28. data/app/cells/decidim/budgets/project_tags/show.erb +1 -0
  29. data/app/cells/decidim/budgets/project_vote_button/show.erb +21 -15
  30. data/app/cells/decidim/budgets/project_vote_button_cell.rb +69 -1
  31. data/app/cells/decidim/budgets/project_voted_hint_cell.rb +1 -1
  32. data/app/cells/decidim/budgets/project_votes_count_cell.rb +9 -8
  33. data/app/commands/decidim/budgets/admin/create_project.rb +0 -1
  34. data/app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb +1 -1
  35. data/app/commands/decidim/budgets/admin/update_project.rb +1 -2
  36. data/app/commands/decidim/budgets/admin/update_project_scope.rb +1 -1
  37. data/app/commands/decidim/budgets/admin/update_project_selection.rb +1 -1
  38. data/app/commands/decidim/budgets/admin/update_projects_budget.rb +57 -0
  39. data/app/controllers/concerns/decidim/budgets/admin/filterable.rb +1 -1
  40. data/app/controllers/concerns/decidim/budgets/needs_current_order.rb +2 -2
  41. data/app/controllers/decidim/budgets/admin/budgets_controller.rb +5 -5
  42. data/app/controllers/decidim/budgets/admin/projects_controller.rb +52 -10
  43. data/app/controllers/decidim/budgets/admin/proposals_imports_controller.rb +1 -1
  44. data/app/controllers/decidim/budgets/application_controller.rb +0 -4
  45. data/app/controllers/decidim/budgets/budgets_controller.rb +9 -0
  46. data/app/controllers/decidim/budgets/line_items_controller.rb +10 -16
  47. data/app/controllers/decidim/budgets/orders_controller.rb +7 -2
  48. data/app/controllers/decidim/budgets/projects_controller.rb +51 -4
  49. data/app/forms/decidim/budgets/admin/project_form.rb +1 -1
  50. data/app/helpers/decidim/budgets/application_helper.rb +4 -0
  51. data/app/helpers/decidim/budgets/projects_helper.rb +89 -33
  52. data/app/jobs/decidim/budgets/send_vote_reminder_job.rb +1 -1
  53. data/app/mailers/decidim/budgets/order_summary_mailer.rb +1 -1
  54. data/app/mailers/decidim/budgets/vote_reminder_mailer.rb +1 -1
  55. data/app/models/decidim/budgets/budget.rb +1 -0
  56. data/app/models/decidim/budgets/project.rb +17 -7
  57. data/app/packs/entrypoints/decidim_budgets.js +2 -0
  58. data/app/packs/src/decidim/budgets/exit_handler.js +11 -8
  59. data/app/packs/src/decidim/budgets/progressFixed.js +25 -11
  60. data/app/packs/src/decidim/budgets/projects.js +15 -10
  61. data/app/packs/stylesheets/budgets.scss +273 -0
  62. data/app/presenters/decidim/budgets/admin_log/budget_presenter.rb +2 -2
  63. data/app/presenters/decidim/budgets/admin_log/project_presenter.rb +2 -2
  64. data/app/services/decidim/budgets/order_reminder_generator.rb +4 -4
  65. data/app/views/decidim/budgets/admin/budgets/_form.html.erb +17 -12
  66. data/app/views/decidim/budgets/admin/budgets/edit.html.erb +16 -6
  67. data/app/views/decidim/budgets/admin/budgets/index.html.erb +58 -64
  68. data/app/views/decidim/budgets/admin/budgets/new.html.erb +16 -6
  69. data/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb +19 -10
  70. data/app/views/decidim/budgets/admin/projects/_form.html.erb +31 -35
  71. data/app/views/decidim/budgets/admin/projects/_project-tr.html.erb +15 -13
  72. data/app/views/decidim/budgets/admin/projects/bulk_actions/_budget-change.html.erb +22 -0
  73. data/app/views/decidim/budgets/admin/projects/bulk_actions/_change-selected.html.erb +3 -3
  74. data/app/views/decidim/budgets/admin/projects/bulk_actions/_dropdown.html.erb +8 -2
  75. data/app/views/decidim/budgets/admin/projects/bulk_actions/_recategorize.html.erb +3 -3
  76. data/app/views/decidim/budgets/admin/projects/bulk_actions/_scope-change.html.erb +5 -8
  77. data/app/views/decidim/budgets/admin/projects/edit.html.erb +16 -6
  78. data/app/views/decidim/budgets/admin/projects/index.html.erb +26 -31
  79. data/app/views/decidim/budgets/admin/projects/new.html.erb +16 -6
  80. data/app/views/decidim/budgets/admin/projects/update_attribute.js.erb +8 -4
  81. data/app/views/decidim/budgets/admin/proposals_imports/new.html.erb +40 -28
  82. data/app/views/decidim/budgets/budgets/index.html.erb +21 -3
  83. data/app/views/decidim/budgets/budgets/index.js.erb +6 -0
  84. data/app/views/decidim/budgets/line_items/update_budget.js.erb +21 -11
  85. data/app/views/decidim/budgets/projects/_addition_selector.html.erb +16 -0
  86. data/app/views/decidim/budgets/projects/_budget_confirm.html.erb +42 -31
  87. data/app/views/decidim/budgets/projects/_budget_excess.html.erb +12 -12
  88. data/app/views/decidim/budgets/projects/_budget_summary.html.erb +2 -75
  89. data/app/views/decidim/budgets/projects/_exit_modal.html.erb +15 -18
  90. data/app/views/decidim/budgets/projects/_linked_projects.html.erb +3 -12
  91. data/app/views/decidim/budgets/projects/_order.html.erb +1 -0
  92. data/app/views/decidim/budgets/projects/_order_progress_progressbar_marks_right.html.erb +10 -0
  93. data/app/views/decidim/budgets/projects/_order_progress_summary_content.html.erb +113 -0
  94. data/app/views/decidim/budgets/projects/_order_total_budget.html.erb +6 -7
  95. data/app/views/decidim/budgets/projects/_project.html.erb +2 -1
  96. data/app/views/decidim/budgets/projects/_project_budget_button.html.erb +11 -19
  97. data/app/views/decidim/budgets/projects/_projects.html.erb +8 -6
  98. data/app/views/decidim/budgets/projects/_projects_count.html.erb +5 -0
  99. data/app/views/decidim/budgets/projects/_projects_list.html.erb +3 -0
  100. data/app/views/decidim/budgets/projects/index.html.erb +58 -55
  101. data/app/views/decidim/budgets/projects/index.js.erb +5 -4
  102. data/app/views/decidim/budgets/projects/show.html.erb +78 -51
  103. data/config/assets.rb +0 -1
  104. data/config/locales/ar.yml +0 -50
  105. data/config/locales/bg.yml +0 -381
  106. data/config/locales/ca.yml +75 -84
  107. data/config/locales/cs.yml +73 -82
  108. data/config/locales/de.yml +76 -85
  109. data/config/locales/el.yml +34 -72
  110. data/config/locales/en.yml +79 -88
  111. data/config/locales/es-MX.yml +73 -82
  112. data/config/locales/es-PY.yml +73 -82
  113. data/config/locales/es.yml +75 -84
  114. data/config/locales/eu.yml +74 -86
  115. data/config/locales/fi-plain.yml +75 -84
  116. data/config/locales/fi.yml +79 -88
  117. data/config/locales/fr-CA.yml +74 -86
  118. data/config/locales/fr.yml +78 -90
  119. data/config/locales/ga-IE.yml +0 -12
  120. data/config/locales/gl.yml +0 -58
  121. data/config/locales/hu.yml +58 -81
  122. data/config/locales/id-ID.yml +0 -38
  123. data/config/locales/is-IS.yml +0 -22
  124. data/config/locales/it.yml +0 -84
  125. data/config/locales/ja.yml +69 -81
  126. data/config/locales/ko.yml +0 -54
  127. data/config/locales/lb.yml +0 -85
  128. data/config/locales/lt.yml +59 -82
  129. data/config/locales/lv.yml +0 -44
  130. data/config/locales/nl.yml +0 -96
  131. data/config/locales/no.yml +0 -84
  132. data/config/locales/pl.yml +0 -167
  133. data/config/locales/pt-BR.yml +9 -141
  134. data/config/locales/pt.yml +0 -85
  135. data/config/locales/ro-RO.yml +0 -95
  136. data/config/locales/ru.yml +0 -41
  137. data/config/locales/sk.yml +0 -44
  138. data/config/locales/sq-AL.yml +0 -52
  139. data/config/locales/sr-CS.yml +0 -4
  140. data/config/locales/sv.yml +42 -150
  141. data/config/locales/tr-TR.yml +2 -82
  142. data/config/locales/uk.yml +0 -41
  143. data/config/locales/zh-CN.yml +0 -65
  144. data/config/locales/zh-TW.yml +13 -59
  145. data/lib/decidim/budgets/admin_engine.rb +3 -2
  146. data/lib/decidim/budgets/component.rb +4 -90
  147. data/lib/decidim/budgets/engine.rb +30 -10
  148. data/lib/decidim/budgets/project_serializer.rb +3 -3
  149. data/lib/decidim/budgets/seeds.rb +69 -0
  150. data/lib/decidim/budgets/test/factories.rb +23 -37
  151. data/lib/decidim/budgets/version.rb +1 -1
  152. data/lib/decidim/budgets/workflows/base.rb +1 -1
  153. metadata +46 -42
  154. data/app/cells/decidim/budgets/budget_m/data.erb +0 -12
  155. data/app/cells/decidim/budgets/budget_m/footer.erb +0 -5
  156. data/app/cells/decidim/budgets/budget_m_cell.rb +0 -16
  157. data/app/cells/decidim/budgets/project_list_item/project_data.erb +0 -19
  158. data/app/cells/decidim/budgets/project_list_item/project_image.erb +0 -5
  159. data/app/cells/decidim/budgets/project_list_item/project_text.erb +0 -23
  160. data/app/cells/decidim/budgets/project_list_item/show.erb +0 -5
  161. data/app/cells/decidim/budgets/project_list_item_cell.rb +0 -70
  162. data/app/cells/decidim/budgets/project_m/data.erb +0 -12
  163. data/app/cells/decidim/budgets/project_m/footer.erb +0 -5
  164. data/app/cells/decidim/budgets/project_m_cell.rb +0 -22
  165. data/app/packs/stylesheets/decidim/budgets/_budgets.scss +0 -3
  166. data/app/packs/stylesheets/decidim/budgets/budget/_budget-list.scss +0 -198
  167. data/app/packs/stylesheets/decidim/budgets/budget/_budget-meter.scss +0 -83
  168. data/app/packs/stylesheets/decidim/budgets/budget/_progress.scss +0 -19
  169. data/app/views/decidim/budgets/admin/projects/proposals_picker.html.erb +0 -1
  170. data/app/views/decidim/budgets/projects/_filters.html.erb +0 -30
  171. data/app/views/decidim/budgets/projects/_filters_small_view.html.erb +0 -18
  172. data/app/views/decidim/budgets/projects/_order_progress.html.erb +0 -32
  173. data/app/views/decidim/budgets/projects/_order_selected_projects.html.erb +0 -27
  174. data/config/locales/he-IL.yml +0 -1
  175. data/decidim-budgets.gemspec +0 -34
  176. data/lib/decidim/budgets/seeds/city.jpeg +0 -0
@@ -28,17 +28,10 @@ zh-CN:
28
28
  edit: 编辑
29
29
  edit_projects: 管理项目
30
30
  import: 导入提案到项目
31
- new: 新建 %{name}
32
31
  preview: 预览
33
32
  title: 行动
34
33
  admin:
35
34
  budgets:
36
- create:
37
- invalid: 创建此预算时出现问题
38
- success: 预算创建成功
39
- destroy:
40
- invalid: 删除这个预算时出错
41
- success: 预算已成功删除
42
35
  edit:
43
36
  title: 编辑预算
44
37
  update: 更新预算
@@ -47,20 +40,12 @@ zh-CN:
47
40
  new:
48
41
  create: 创建预算
49
42
  title: 新预算
50
- update:
51
- invalid: 更新这个预算时出现问题
52
- success: 预算已成功更新
53
43
  models:
54
44
  budget:
55
45
  name: 三. 预算
56
46
  project:
57
47
  name: 项目
58
48
  projects:
59
- create:
60
- invalid: 创建此项目时出现问题
61
- success: 项目创建成功
62
- destroy:
63
- success: 工程删除成功
64
49
  edit:
65
50
  title: 编辑项目
66
51
  update: 更新
@@ -72,13 +57,7 @@ zh-CN:
72
57
  new:
73
58
  create: 创建
74
59
  title: 新建项目
75
- update:
76
- invalid: 更新此项目时出现问题
77
- success: 项目已成功更新
78
60
  proposals_imports:
79
- create:
80
- invalid: 将建议导入项目时遇到问题
81
- success: "%{number} 个建议已成功导入到项目"
82
61
  new:
83
62
  create: 导入提案到项目
84
63
  no_components: 在这个参与性空间中,没有其他提案组成部分可以将提案导入项目。
@@ -92,8 +71,6 @@ zh-CN:
92
71
  create: "%{user_name} 在 %{space_name} 空间中创建了 %{resource_name} 项目"
93
72
  delete: "%{user_name} 在 %{space_name} 空间中删除了 %{resource_name} 项目"
94
73
  update: "%{user_name} 在 %{resource_name} 空间更新 %{space_name} 项目"
95
- budget:
96
- view: 查看所有预算项目
97
74
  budget_information_modal:
98
75
  back_to: 返回 %{component_name}
99
76
  close_modal: 关闭模式
@@ -103,13 +80,8 @@ zh-CN:
103
80
  cancel_order:
104
81
  more_than_one: 删除您对 %{name} 的投票并开始
105
82
  only_one: 删除您的投票并重新开始
106
- finished_message: 您已经完成投票过程。感谢您的参与!
107
83
  highlighted_cta: 对 %{name} 投票
108
- if_change_opinion: 如果你改变了主意,你可以:
109
- my_budgets: 我的预算
110
- voted_on: 您已对 %{links} 投票
111
84
  limit_announcement:
112
- cant_vote: 您不能对此预算进行投票。 <a href="%{landing_path}">请尝试另一个预算</a>。
113
85
  limit_reached: 您在 %{links}有活跃的投票。要对此预算进行投票,您必须 <a href="%{landing_path}">删除您的投票并开始于</a> 开始投票。
114
86
  models:
115
87
  budget:
@@ -119,7 +91,6 @@ zh-CN:
119
91
  total_budget: 预算总额
120
92
  project:
121
93
  fields:
122
- scope: 范围
123
94
  title: 标题
124
95
  order_summary_mailer:
125
96
  order_summary:
@@ -136,22 +107,15 @@ zh-CN:
136
107
  budget_excess:
137
108
  budget_excess:
138
109
  title: 超出最大预算
139
- close: 关闭
140
110
  ok: 好的
141
111
  budget_summary:
142
112
  are_you_sure: 您确定要取消您的投票吗?
143
- assigned: '已指派:'
144
113
  cancel_order: 删除您的投票并开始
145
114
  checked_out:
146
- description: 您已经投票给了预算。如果您改变了主意,您可以 %{cancel_link}。
147
115
  title: 预算投票完成
148
- title: 您决定预算
149
- total_budget: 预算总额
150
116
  count:
151
117
  projects_count:
152
118
  other: "%{count} 个项目"
153
- exit_modal:
154
- close_modal: 关闭模式
155
119
  filters:
156
120
  category: 类别
157
121
  scope: 范围
@@ -161,18 +125,6 @@ zh-CN:
161
125
  all: 所有的
162
126
  not_selected: 未选择
163
127
  selected: 已选择
164
- filters_small_view:
165
- close_modal: 关闭模式
166
- filter: 筛选器
167
- filter_by: 筛选方式
168
- unfold: 展开...
169
- order_progress:
170
- vote: 投票
171
- order_selected_projects:
172
- remove: 删除
173
- selected_projects:
174
- other: 已选择的项目
175
- view: 查看
176
128
  orders:
177
129
  highest_cost: 最高成本
178
130
  label: 项目订购方式
@@ -181,21 +133,15 @@ zh-CN:
181
133
  random: 随机顺序
182
134
  selected: 已选择
183
135
  project:
184
- add: 将项目 %{resource_name} 添加到您的投票
185
- remove: 从您的投票中删除项目 %{resource_name}
186
136
  selected: 已选择
187
- view: 查看
188
137
  votes:
189
138
  other: 投票
190
139
  project_budget_button:
191
140
  add: 添加到您的投票
192
- add_descriptive: 将项目 %{resource_name} 添加到您的投票
193
141
  added: 添加到您的投票
194
- added_descriptive: 项目 %{resource_name} 添加到您的投票
195
142
  projects_for: '%{name} 的项目'
196
143
  show:
197
144
  budget: 三. 预算
198
- view_all_projects: 查看所有项目
199
145
  components:
200
146
  budgets:
201
147
  actions:
@@ -206,10 +152,6 @@ zh-CN:
206
152
  announcement: 通 知
207
153
  comments_enabled: 评论已启用
208
154
  comments_max_length: 评论最大长度 (默认值留0)
209
- form:
210
- errors:
211
- budget_voting_rule_only_one: 只能启用一个投票规则
212
- budget_voting_rule_required: 需要一个投票规则
213
155
  landing_page_content: 预算登陆页
214
156
  more_information_modal: 更多信息模式
215
157
  projects_per_page: 每页项目数
@@ -245,12 +187,5 @@ zh-CN:
245
187
  email_outro: 您收到此通知是因为您正在关注 %{participatory_space_title}。您可以停止收到跟随上一个链接的通知。
246
188
  email_subject: '%{resource_title} 的预算现在在 %{participatory_space_title} 处于活动状态。'
247
189
  notification_title: <a href="%{resource_path}">%{resource_title}</a> 预算现在已经在 %{participatory_space_title} 中生效。
248
- orders:
249
- checkout:
250
- error: 处理您的投票时出现问题
251
- success: 您的投票已被接受
252
- destroy:
253
- error: 取消投票时出现问题
254
- success: 您的投票已成功取消
255
190
  index:
256
191
  confirmed_orders_count: 所得票数
@@ -45,14 +45,13 @@ zh-TW:
45
45
  edit: 編輯
46
46
  edit_projects: 管理專案
47
47
  import: 將提案匯入專案
48
- new: 新增 %{name}
49
48
  preview: 預覽
50
49
  send_voting_reminders: 發送投票提醒
51
50
  title: 操作
52
51
  admin:
53
52
  budgets:
54
53
  create:
55
- invalid: 建立預算時發生問題
54
+ invalid: 建立預算時發生問題。
56
55
  success: 預算已成功建立
57
56
  destroy:
58
57
  invalid: 刪除此預算時出現問題
@@ -107,10 +106,10 @@ zh-TW:
107
106
  title: 新專案
108
107
  update:
109
108
  invalid: 更新此專案時出現問題
110
- success: 專案更新成功
109
+ success: 專案更新成功。
111
110
  update_category:
112
111
  invalid: '這些專案已經擁有了 %{subject_name} 類別: %{projects}'
113
- select_a_category: 請選擇一個類別
112
+ select_a_category: 請選擇一個類別。
114
113
  select_a_project: 請選擇一個專案
115
114
  success: '已成功將以下專案更新至 %{subject_name} 類別: %{projects}。'
116
115
  update_scope:
@@ -129,8 +128,8 @@ zh-TW:
129
128
  unselected: '這些專案已經成功從實施中取消選擇: %{projects}。'
130
129
  proposals_imports:
131
130
  create:
132
- invalid: 將提案匯入專案時出現問題
133
- success: "%{number} 個提案已成功匯入專案"
131
+ invalid: 將提案匯入專案時出現問題。
132
+ success: "%{number} 個提案已成功匯入專案。"
134
133
  new:
135
134
  create: 將提案匯入專案
136
135
  default_budget: 預設預算
@@ -138,7 +137,6 @@ zh-TW:
138
137
  no_components: 在此參與空間中沒有其他提案元件可以將提案匯入到專案中。
139
138
  origin_component_id: 原始元件
140
139
  select_component: 請選擇一個組件
141
- title: 導入提案
142
140
  reminders:
143
141
  orders:
144
142
  description: 使用者將會收到一封電子郵件,內含連結至他們有待處理訂單的預算。
@@ -153,16 +151,11 @@ zh-TW:
153
151
  create: "%{user_name} 在 %{space_name} 空間中創建了 %{resource_name} 專案"
154
152
  delete: "%{user_name} 刪除了 %{space_name} 空間中的 %{resource_name} 專案。"
155
153
  update: "%{user_name} 更新了 %{space_name} 空間中的 %{resource_name} 專案。"
156
- budget:
157
- view: 查看所有預算專案
158
154
  budget_information_modal:
159
155
  back_to: 返回 %{component_name}
160
156
  close_modal: 關閉視窗
161
157
  continue: 繼續
162
158
  more_information: 更多資訊
163
- budget_list_item:
164
- voting_finished: 您已在此預算中投票
165
- voting_started: 你已經開始在這個預算中投票了
166
159
  budgets_list:
167
160
  cancel_order:
168
161
  more_than_one: 刪除您對於 %{name} 的投票並重新開始
@@ -170,13 +163,12 @@ zh-TW:
170
163
  finished_message: 您已完成投票流程。感謝您的參與!
171
164
  highlighted_cta: 在 %{name} 上投票
172
165
  if_change_opinion: 如果您改變了主意,您可以
173
- my_budgets: 我的預算
174
166
  progress: 完成投票
175
167
  show: 檢視專案
176
168
  vote: 投票
177
- voted_on: 你已經對 %{links} 投票
169
+ voted_on: 你已經對 %{links} 投票。
178
170
  last_activity:
179
- new_vote_at_html: "<span>在%{link} 有新的預算投票</span>"
171
+ new_vote_at: 新預算投票於
180
172
  limit_announcement:
181
173
  cant_vote: 你無法在這個預算中進行投票。<a href="%{landing_path}">嘗試在其他預算中投票</a>。
182
174
  limit_reached: 您在 %{links} 上有進行中的投票。若要對此預算進行投票,您必須<a href="%{landing_path}">刪除您目前的投票並重新開始</a>。
@@ -190,7 +182,6 @@ zh-TW:
190
182
  fields:
191
183
  category: 類別
192
184
  id: ID
193
- scope: 範圍
194
185
  title: 標題
195
186
  order_summary_mailer:
196
187
  order_summary:
@@ -209,7 +200,6 @@ zh-TW:
209
200
  budget_excess:
210
201
  description: 這個專案超出了預算上限,無法被加入。如果您願意,您可以刪除您已經選擇的一個專案,以便能夠根據您的偏好再次進行投票。
211
202
  title: 已超過最高預算
212
- close: 關閉
213
203
  description: 這個專案超出了預算上限,無法被加入。如果您願意,您可以刪除您已經選擇的一個專案,以便能夠根據您的偏好再次進行投票。
214
204
  ok: 好的
215
205
  projects_excess:
@@ -217,34 +207,15 @@ zh-TW:
217
207
  title: 超過最大專案數量
218
208
  budget_summary:
219
209
  are_you_sure: 您確定要取消您的投票嗎?
220
- assigned: '已指派:'
221
210
  cancel_order: 刪除你的投票並重新開始
222
211
  checked_out:
223
212
  description: 你已經對預算表決投票了。如果你改變了主意,你可以%{cancel_link}。
224
213
  title: 預算投票完成
225
- minimum_projects_rule:
226
- description: 您認為我們應該撥款給哪些專案?請選擇至少 %{minimum_number} 個您想要的專案,並根據您的偏好進行投票,以定義預算。
227
- instruction: "<li>請選擇至少 %{minimum_number} 個您認為應該分配預算的項目,並根據您的喜好進行投票以定義預算。</li>"
228
- projects_rule:
229
- description: 你認為我們應該為哪些專案分配預算?請至少選擇 %{minimum_number} 個專案,最多可選擇 %{maximum_number} 個項目,並根據你的喜好投票以定義預算。
230
- instruction: "<li>請至少選擇 %{minimum_number} 個至多 %{maximum_number} 個您想要的項專案,並根據您的喜好進行投票以定義預算。</li>"
231
- projects_rule_maximum_only:
232
- description: 你認為我們應該為哪些專案分配預算?請選擇最多 %{maximum_number} 個專案,根據你的喜好進行投票,來定義預算。
233
- instruction: "\"<li>選擇最多 %{maximum_number} 個您想為其分配預算的專案,並根據您的喜好進行投票,以定義預算。</li>"
234
- rules:
235
- title: 預算規則
236
- title: 你決定預算
237
- total_budget: 總預算
238
- total_projects: 總票數
239
- vote_threshold_percent_rule:
240
- description: 您覺得我們應該為哪些專案分配預算?為您想要的專案分配至少 %{minimum_budget} 的預算,並按照您的喜好進行投票以定義預算。
241
- instruction: "\"<li>指派至少 %{minimum_budget} 的預算給您想支持的專案,然後根據您的喜好進行投票以制定預算。</li>"
242
214
  count:
243
215
  projects_count:
244
216
  other: "%{count} 專案"
245
217
  exit_modal:
246
218
  cancel: 返回投票
247
- close_modal: 關閉視窗
248
219
  exit: 退出投票
249
220
  message: 您的投票尚未被註冊,因為您尚未完成投票程序。您確定要退出投票嗎?
250
221
  title: 您尚未投票
@@ -257,20 +228,6 @@ zh-TW:
257
228
  all: 全部
258
229
  not_selected: 未選擇
259
230
  selected: 已選取
260
- filters_small_view:
261
- close_modal: 關閉視窗
262
- filter: 篩選
263
- filter_by: 篩選條件
264
- unfold: 展開
265
- index:
266
- view_project: 檢視專案
267
- order_progress:
268
- vote: 投票
269
- order_selected_projects:
270
- remove: 移除
271
- selected_projects:
272
- other: 已選擇的專案
273
- view: 檢視
274
231
  orders:
275
232
  highest_cost: 最高成本
276
233
  label: 專案排序方式
@@ -279,22 +236,20 @@ zh-TW:
279
236
  random: 隨機順序
280
237
  selected: 已選取
281
238
  project:
282
- add: 將專案 %{resource_name} 加入您的投票
283
- remove: 從您的投票中移除專案 %{resource_name}
239
+ add: 將專案 %{resource_name} 添加到您的投票中。
240
+ remove: 從您的投票中移除專案 %{resource_name}
284
241
  selected: 已選取
285
- view: 檢視
286
242
  votes:
287
243
  other: 投票
288
244
  you_voted: 你已投票支持此
289
245
  project_budget_button:
290
246
  add: 加入您的投票
291
- add_descriptive: 將專案 %{resource_name} 加入您的投票
247
+ add_descriptive: 將專案 %{resource_name} 加入您的投票。
292
248
  added: 加入您的投票
293
- added_descriptive: 將專案 %{resource_name} 加入您的投票
249
+ added_descriptive: 將專案 %{resource_name} 加入您的投票。
294
250
  projects_for: 專案 %{name}
295
251
  show:
296
252
  budget: 預算
297
- view_all_projects: 檢視所有專案
298
253
  vote_reminder_mailer:
299
254
  vote_reminder:
300
255
  email_budgets: '您有尚未完成投票的領域:'
@@ -316,7 +271,7 @@ zh-TW:
316
271
  comments_max_length: 評論字數最大長度(若要使用預設值請輸入0)
317
272
  form:
318
273
  errors:
319
- budget_voting_rule_only_one: 僅能啟用一個投票規則
274
+ budget_voting_rule_only_one: 僅能啟用一個投票規則。
320
275
  budget_voting_rule_required: 必須啟用一種投票規則
321
276
  geocoding_enabled: 地理編碼已啟用
322
277
  landing_page_content: 預算網頁首頁
@@ -362,10 +317,9 @@ zh-TW:
362
317
  orders:
363
318
  checkout:
364
319
  error: 處理您的投票時出現問題。
365
- success: 您的投票已成功接受
366
320
  destroy:
367
321
  error: 取消您的投票時出現問題
368
- success: 您的投票已成功取消
322
+ success: 您的投票已成功取消。
369
323
  resource_links:
370
324
  included_proposals:
371
325
  project_proposal: 此專案中包括的提案
@@ -18,6 +18,7 @@ module Decidim
18
18
  post :update_category
19
19
  post :update_scope
20
20
  post :update_selected
21
+ post :update_budget
21
22
  resource :proposals_import, only: [:new, :create]
22
23
  end
23
24
  end
@@ -26,8 +27,8 @@ module Decidim
26
27
  resources :projects, exclude: [:index, :new, :create, :edit, :update, :destroy] do
27
28
  get :proposals_picker, on: :collection
28
29
 
29
- resources :attachment_collections
30
- resources :attachments
30
+ resources :attachment_collections, except: [:show]
31
+ resources :attachments, except: [:show]
31
32
  end
32
33
 
33
34
  root to: "budgets#index"
@@ -1,11 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "decidim/components/namer"
4
-
5
3
  Decidim.register_component(:budgets) do |component|
6
4
  component.engine = Decidim::Budgets::Engine
7
5
  component.admin_engine = Decidim::Budgets::AdminEngine
8
6
  component.icon = "media/images/decidim_budgets.svg"
7
+ component.icon_key = "coin-line"
9
8
  component.stylesheet = "decidim/budgets/budgets"
10
9
  component.permissions_class_name = "Decidim::Budgets::Permissions"
11
10
  component.component_form_class_name = "Decidim::Budgets::Admin::ComponentForm"
@@ -19,7 +18,7 @@ Decidim.register_component(:budgets) do |component|
19
18
  component.actions = %w(vote comment)
20
19
 
21
20
  component.on(:before_destroy) do |instance|
22
- raise StandardError, "Can't remove this component" if Decidim::Budgets::Budget.where(component: instance).any?
21
+ raise StandardError, "Cannot remove this component" if Decidim::Budgets::Budget.where(component: instance).any?
23
22
  end
24
23
 
25
24
  component.register_resource(:budget) do |resource|
@@ -110,93 +109,8 @@ Decidim.register_component(:budgets) do |component|
110
109
  end
111
110
 
112
111
  component.seeds do |participatory_space|
113
- landing_page_content = Decidim::Faker::Localized.localized do
114
- "<h2>#{::Faker::Lorem.sentence}</h2>" \
115
- "<p>#{::Faker::Lorem.paragraph}</p>" \
116
- "<p>#{::Faker::Lorem.paragraph}</p>"
117
- end
112
+ require "decidim/budgets/seeds"
118
113
 
119
- component = Decidim::Component.create!(
120
- name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :budgets).i18n_name,
121
- manifest_name: :budgets,
122
- published_at: Time.current,
123
- participatory_space: participatory_space,
124
- settings: {
125
- landing_page_content: landing_page_content,
126
- more_information_modal: Decidim::Faker::Localized.paragraph(sentence_count: 4),
127
- workflow: Decidim::Budgets.workflows.keys.sample
128
- }
129
- )
130
-
131
- rand(1...3).times do
132
- Decidim::Budgets::Budget.create!(
133
- component: component,
134
- title: Decidim::Faker::Localized.sentence(word_count: 2),
135
- description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
136
- Decidim::Faker::Localized.paragraph(sentence_count: 3)
137
- end,
138
- total_budget: Faker::Number.number(digits: 8)
139
- )
140
- end
141
-
142
- Decidim::Budgets::Budget.where(component: component).each do |budget|
143
- rand(2...4).times do
144
- project = Decidim::Budgets::Project.create!(
145
- budget: budget,
146
- scope: participatory_space.organization.scopes.sample,
147
- category: participatory_space.categories.sample,
148
- title: Decidim::Faker::Localized.sentence(word_count: 2),
149
- description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
150
- Decidim::Faker::Localized.paragraph(sentence_count: 3)
151
- end,
152
- budget_amount: Faker::Number.between(from: Integer(budget.total_budget * 0.7), to: budget.total_budget)
153
- )
154
-
155
- attachment_collection = Decidim::AttachmentCollection.create!(
156
- name: Decidim::Faker::Localized.word,
157
- description: Decidim::Faker::Localized.sentence(word_count: 5),
158
- collection_for: project
159
- )
160
-
161
- Decidim::Attachment.create!(
162
- title: Decidim::Faker::Localized.sentence(word_count: 2),
163
- description: Decidim::Faker::Localized.sentence(word_count: 5),
164
- attachment_collection: attachment_collection,
165
- attached_to: project,
166
- content_type: "application/pdf",
167
- file: ActiveStorage::Blob.create_and_upload!(
168
- io: File.open(File.join(__dir__, "seeds", "Exampledocument.pdf")),
169
- filename: "Exampledocument.pdf",
170
- content_type: "application/pdf",
171
- metadata: nil
172
- )
173
- )
174
- Decidim::Attachment.create!(
175
- title: Decidim::Faker::Localized.sentence(word_count: 2),
176
- description: Decidim::Faker::Localized.sentence(word_count: 5),
177
- attached_to: project,
178
- content_type: "image/jpeg",
179
- file: ActiveStorage::Blob.create_and_upload!(
180
- io: File.open(File.join(__dir__, "seeds", "city.jpeg")),
181
- filename: "city.jpeg",
182
- content_type: "image/jpeg",
183
- metadata: nil
184
- )
185
- )
186
- Decidim::Attachment.create!(
187
- title: Decidim::Faker::Localized.sentence(word_count: 2),
188
- description: Decidim::Faker::Localized.sentence(word_count: 5),
189
- attached_to: project,
190
- content_type: "application/pdf",
191
- file: ActiveStorage::Blob.create_and_upload!(
192
- io: File.open(File.join(__dir__, "seeds", "Exampledocument.pdf")),
193
- filename: "Exampledocument.pdf",
194
- content_type: "application/pdf",
195
- metadata: nil
196
- )
197
- )
198
- Decidim::Comments::Seed.comments_for(project)
199
- end
200
- end
114
+ Decidim::Budgets::Seeds.new(participatory_space:).call
201
115
  end
202
116
  end
@@ -20,8 +20,18 @@ module Decidim
20
20
  resource :line_item, only: [:create, :destroy]
21
21
  end
22
22
  end
23
+ scope "/budgets" do
24
+ root to: "budgets#index"
25
+ end
26
+ get "/", to: redirect("budgets", status: 301)
27
+ end
23
28
 
24
- root to: "budgets#index"
29
+ initializer "decidim_budgets.register_icons" do
30
+ Decidim.icons.register(name: "Decidim::Budgets::Budget", icon: "coin-line", description: "Budget", category: "activity", engine: :budgets)
31
+ Decidim.icons.register(name: "Decidim::Budgets::Project", icon: "coin-line", description: "Project (Budgets)", category: "activity", engine: :budgets)
32
+ Decidim.icons.register(name: "Decidim::Budgets::Order", icon: "check-double-fill", description: "Budget voting", category: "activity", engine: :budgets)
33
+
34
+ Decidim.icons.register(name: "git-pull-request-line", icon: "git-pull-request-line", category: "system", description: "", engine: :budgets)
25
35
  end
26
36
 
27
37
  initializer "decidim_budgets.add_cells_view_paths" do
@@ -44,18 +54,28 @@ module Decidim
44
54
  end
45
55
 
46
56
  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"
57
+ config.after_initialize do
58
+ Decidim.reminders_registry.register(:orders) do |reminder_registry|
59
+ reminder_registry.generator_class_name = "Decidim::Budgets::OrderReminderGenerator"
60
+ reminder_registry.form_class_name = "Decidim::Budgets::Admin::OrderReminderForm"
61
+ reminder_registry.command_class_name = "Decidim::Budgets::Admin::CreateOrderReminders"
62
+
63
+ reminder_registry.settings do |settings|
64
+ settings.attribute :reminder_times, type: :array, default: [2.hours, 1.week, 2.weeks]
65
+ end
51
66
 
52
- reminder_registry.settings do |settings|
53
- settings.attribute :reminder_times, type: :array, default: [2.hours, 1.week, 2.weeks]
67
+ reminder_registry.messages do |msg|
68
+ msg.set(:title) { |count: 0| I18n.t("decidim.budgets.admin.reminders.orders.title", count:) }
69
+ msg.set(:description) { I18n.t("decidim.budgets.admin.reminders.orders.description") }
70
+ end
54
71
  end
72
+ end
73
+ end
55
74
 
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") }
75
+ initializer "decidim_budgets.authorization_transfer" do
76
+ config.to_prepare do
77
+ Decidim::AuthorizationTransfer.register(:budgets) do |transfer|
78
+ transfer.move_records(Decidim::Budgets::Order, :decidim_user_id)
59
79
  end
60
80
  end
61
81
  end
@@ -37,9 +37,9 @@ module Decidim
37
37
  comments: project.comments_count,
38
38
  created_at: project.created_at,
39
39
  url: project.polymorphic_resource_url({}),
40
- related_proposals: related_proposals,
41
- related_proposal_titles: related_proposal_titles,
42
- related_proposal_urls: related_proposal_urls
40
+ related_proposals:,
41
+ related_proposal_titles:,
42
+ related_proposal_urls:
43
43
  }
44
44
  end
45
45
 
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "decidim/components/namer"
4
+ require "decidim/seeds"
5
+
6
+ module Decidim
7
+ module Budgets
8
+ class Seeds < Decidim::Seeds
9
+ attr_reader :participatory_space
10
+
11
+ def initialize(participatory_space:)
12
+ @participatory_space = participatory_space
13
+ end
14
+
15
+ def call
16
+ landing_page_content = Decidim::Faker::Localized.localized do
17
+ "<h2>#{::Faker::Lorem.sentence}</h2>" \
18
+ "<p>#{::Faker::Lorem.paragraph}</p>" \
19
+ "<p>#{::Faker::Lorem.paragraph}</p>"
20
+ end
21
+
22
+ component = Decidim::Component.create!(
23
+ name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :budgets).i18n_name,
24
+ manifest_name: :budgets,
25
+ published_at: Time.current,
26
+ participatory_space:,
27
+ settings: {
28
+ landing_page_content:,
29
+ more_information_modal: Decidim::Faker::Localized.paragraph(sentence_count: 4),
30
+ workflow: Decidim::Budgets.workflows.keys.sample
31
+ }
32
+ )
33
+
34
+ rand(1...3).times do
35
+ Decidim::Budgets::Budget.create!(
36
+ component:,
37
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
38
+ description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
39
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
40
+ end,
41
+ total_budget: ::Faker::Number.number(digits: 8)
42
+ )
43
+ end
44
+
45
+ Decidim::Budgets::Budget.where(component:).each do |budget|
46
+ rand(2...4).times do
47
+ project = Decidim::Budgets::Project.create!(
48
+ budget:,
49
+ scope: participatory_space.organization.scopes.sample,
50
+ category: participatory_space.categories.sample,
51
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
52
+ description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
53
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
54
+ end,
55
+ budget_amount: ::Faker::Number.between(from: Integer(budget.total_budget * 0.7), to: budget.total_budget)
56
+ )
57
+
58
+ attachment_collection = create_attachment_collection(collection_for: project)
59
+ create_attachment(attached_to: project, filename: "Exampledocument.pdf", attachment_collection:)
60
+ create_attachment(attached_to: project, filename: "city.jpeg")
61
+ create_attachment(attached_to: project, filename: "Exampledocument.pdf")
62
+
63
+ Decidim::Comments::Seed.comments_for(project)
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end