decidim-proposals 0.29.2 → 0.30.0.rc2

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 (196) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/proposals/highlighted_proposals_for_component/show.erb +1 -1
  3. data/app/cells/decidim/proposals/highlighted_proposals_for_component_cell.rb +1 -1
  4. data/app/cells/decidim/proposals/participatory_text_proposal_cell.rb +1 -1
  5. data/app/cells/decidim/proposals/proposal_g/show.erb +13 -0
  6. data/app/cells/decidim/proposals/proposal_g_cell.rb +13 -0
  7. data/app/cells/decidim/proposals/proposal_history_cell.rb +107 -0
  8. data/app/cells/decidim/proposals/proposal_l/show.erb +37 -0
  9. data/app/cells/decidim/proposals/proposal_l_cell.rb +9 -0
  10. data/app/cells/decidim/proposals/proposal_metadata_cell.rb +2 -2
  11. data/app/cells/decidim/proposals/proposal_vote/show.erb +75 -0
  12. data/app/cells/decidim/proposals/proposal_vote_cell.rb +43 -0
  13. data/app/commands/decidim/proposals/accept_coauthorship.rb +62 -0
  14. data/app/commands/decidim/proposals/admin/assign_proposals_to_valuator.rb +14 -0
  15. data/app/commands/decidim/proposals/admin/create_proposal.rb +6 -14
  16. data/app/commands/decidim/proposals/admin/create_proposal_note.rb +20 -11
  17. data/app/commands/decidim/proposals/admin/import_proposals.rb +0 -5
  18. data/app/commands/decidim/proposals/admin/merge_proposals.rb +2 -2
  19. data/app/commands/decidim/proposals/admin/proposal_notes_methods.rb +48 -0
  20. data/app/commands/decidim/proposals/admin/reply_proposal_note.rb +92 -0
  21. data/app/commands/decidim/proposals/admin/split_proposals.rb +2 -2
  22. data/app/commands/decidim/proposals/admin/update_proposal.rb +10 -16
  23. data/app/commands/decidim/proposals/admin/update_proposal_taxonomies.rb +34 -0
  24. data/app/commands/decidim/proposals/cancel_coauthorship.rb +32 -0
  25. data/app/commands/decidim/proposals/create_collaborative_draft.rb +1 -2
  26. data/app/commands/decidim/proposals/create_proposal.rb +1 -2
  27. data/app/commands/decidim/proposals/invite_coauthor.rb +45 -0
  28. data/app/commands/decidim/proposals/publish_collaborative_draft.rb +1 -2
  29. data/app/commands/decidim/proposals/reject_coauthorship.rb +54 -0
  30. data/app/commands/decidim/proposals/update_collaborative_draft.rb +1 -2
  31. data/app/commands/decidim/proposals/update_proposal.rb +1 -2
  32. data/app/controllers/concerns/decidim/proposals/admin/filterable.rb +5 -1
  33. data/app/controllers/concerns/decidim/proposals/admin/needs_interpolations.rb +40 -0
  34. data/app/controllers/decidim/proposals/admin/proposal_answers_controller.rb +55 -2
  35. data/app/controllers/decidim/proposals/admin/proposal_notes_controller.rb +18 -0
  36. data/app/controllers/decidim/proposals/admin/proposals_controller.rb +41 -85
  37. data/app/controllers/decidim/proposals/collaborative_drafts_controller.rb +2 -4
  38. data/app/controllers/decidim/proposals/invite_coauthors_controller.rb +87 -0
  39. data/app/controllers/decidim/proposals/proposals_controller.rb +7 -32
  40. data/app/events/decidim/proposals/accepted_coauthorship_event.rb +8 -0
  41. data/app/events/decidim/proposals/admin/proposal_assigned_to_valuator_event.rb +27 -0
  42. data/app/events/decidim/proposals/admin/proposal_note_created_event.rb +5 -0
  43. data/app/events/decidim/proposals/coauthor_accepted_invite_event.rb +49 -0
  44. data/app/events/decidim/proposals/coauthor_invited_event.rb +45 -0
  45. data/app/events/decidim/proposals/coauthor_rejected_invite_event.rb +8 -0
  46. data/app/events/decidim/proposals/rejected_coauthorship_event.rb +8 -0
  47. data/app/events/decidim/proposals/update_proposal_taxonomies_event.rb +9 -0
  48. data/app/forms/decidim/proposals/admin/proposal_answer_form.rb +1 -0
  49. data/app/forms/decidim/proposals/admin/proposal_base_form.rb +3 -31
  50. data/app/forms/decidim/proposals/admin/proposal_form.rb +11 -6
  51. data/app/forms/decidim/proposals/admin/proposals_import_form.rb +0 -5
  52. data/app/forms/decidim/proposals/collaborative_draft_form.rb +0 -8
  53. data/app/forms/decidim/proposals/proposal_form.rb +5 -32
  54. data/app/helpers/decidim/proposals/admin/proposal_bulk_actions_helper.rb +25 -0
  55. data/app/helpers/decidim/proposals/admin/proposals_helper.rb +0 -1
  56. data/app/helpers/decidim/proposals/application_helper.rb +24 -14
  57. data/app/helpers/decidim/proposals/collaborative_draft_helper.rb +7 -7
  58. data/app/helpers/decidim/proposals/map_helper.rb +0 -18
  59. data/app/helpers/decidim/proposals/proposal_votes_helper.rb +15 -2
  60. data/app/jobs/decidim/proposals/admin/proposal_answer_job.rb +20 -0
  61. data/app/models/decidim/proposals/collaborative_draft.rb +10 -1
  62. data/app/models/decidim/proposals/proposal.rb +66 -5
  63. data/app/models/decidim/proposals/proposal_note.rb +11 -0
  64. data/app/models/decidim/proposals/proposal_state.rb +1 -1
  65. data/app/packs/entrypoints/decidim_proposals.js +1 -0
  66. data/app/packs/entrypoints/decidim_proposals_geocoding.js +2 -0
  67. data/app/packs/src/decidim/proposals/admin/proposals.js +16 -1
  68. data/app/packs/src/decidim/proposals/exit_handler.js +73 -0
  69. data/app/packs/stylesheets/decidim/proposals/proposals.scss +248 -3
  70. data/app/permissions/decidim/proposals/admin/permissions.rb +2 -5
  71. data/app/permissions/decidim/proposals/permissions.rb +42 -0
  72. data/app/presenters/decidim/proposals/admin_log/proposal_presenter.rb +1 -1
  73. data/app/presenters/decidim/proposals/proposal_presenter.rb +1 -1
  74. data/app/queries/decidim/proposals/filtered_proposals.rb +2 -2
  75. data/app/queries/decidim/proposals/metrics/accepted_proposals_metric_manage.rb +2 -2
  76. data/app/queries/decidim/proposals/metrics/endorsements_metric_manage.rb +10 -10
  77. data/app/queries/decidim/proposals/metrics/proposal_followers_metric_measure.rb +4 -4
  78. data/app/queries/decidim/proposals/metrics/proposal_participants_metric_measure.rb +6 -6
  79. data/app/queries/decidim/proposals/metrics/proposals_metric_manage.rb +6 -6
  80. data/app/queries/decidim/proposals/metrics/votes_metric_manage.rb +6 -6
  81. data/app/services/decidim/proposals/proposal_builder.rb +1 -1
  82. data/app/views/decidim/proposals/admin/proposal_notes/_form.html.erb +3 -3
  83. data/app/views/decidim/proposals/admin/proposal_notes/_proposal_note.html.erb +28 -0
  84. data/app/views/decidim/proposals/admin/proposal_notes/_proposal_note_reply.html.erb +9 -0
  85. data/app/views/decidim/proposals/admin/proposal_notes/_proposal_notes.html.erb +4 -28
  86. data/app/views/decidim/proposals/admin/proposal_states/_form.html.erb +1 -1
  87. data/app/views/decidim/proposals/admin/proposals/_actions.html.erb +21 -0
  88. data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +3 -2
  89. data/app/views/decidim/proposals/admin/proposals/_form.html.erb +17 -24
  90. data/app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb +12 -28
  91. data/app/views/decidim/proposals/admin/proposals/_proposals-thead.html.erb +45 -0
  92. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_apply_answer_template.html.erb +22 -0
  93. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_dropdown.html.erb +15 -11
  94. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_taxonomy_change.html.erb +23 -0
  95. data/app/views/decidim/proposals/admin/proposals/index.html.erb +17 -48
  96. data/app/views/decidim/proposals/admin/proposals/manage_trash.html.erb +18 -0
  97. data/app/views/decidim/proposals/admin/proposals/publish_answers.js.erb +1 -1
  98. data/app/views/decidim/proposals/admin/proposals/show.html.erb +14 -26
  99. data/app/views/decidim/proposals/admin/proposals/update_attribute.js.erb +1 -1
  100. data/app/views/decidim/proposals/admin/proposals_imports/new.html.erb +0 -3
  101. data/app/views/decidim/proposals/collaborative_drafts/_collaborative_actions.html.erb +9 -0
  102. data/app/views/decidim/proposals/collaborative_drafts/_collaborative_draft_aside.html.erb +0 -15
  103. data/app/views/decidim/proposals/collaborative_drafts/_edit_form_fields.html.erb +4 -6
  104. data/app/views/decidim/proposals/collaborative_drafts/index.html.erb +6 -2
  105. data/app/views/decidim/proposals/collaborative_drafts/show.html.erb +27 -11
  106. data/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb +29 -9
  107. data/app/views/decidim/proposals/proposals/_actions.html.erb +4 -7
  108. data/app/views/decidim/proposals/proposals/_edit_form_fields.html.erb +17 -22
  109. data/app/views/decidim/proposals/proposals/_exit_modal.html.erb +17 -0
  110. data/app/views/decidim/proposals/proposals/_notification_alert_box.html.erb +1 -0
  111. data/app/views/decidim/proposals/proposals/_proposal_actions.html.erb +19 -0
  112. data/app/views/decidim/proposals/proposals/_proposal_aside.html.erb +9 -32
  113. data/app/views/decidim/proposals/proposals/_proposal_voting_rules.html.erb +33 -0
  114. data/app/views/decidim/proposals/proposals/_remaining_votes_count.html.erb +2 -2
  115. data/app/views/decidim/proposals/proposals/_remaining_votes_notification.html.erb +12 -0
  116. data/app/views/decidim/proposals/proposals/_update_proposal_voting_rules.html.erb +6 -0
  117. data/app/views/decidim/proposals/proposals/_vote_button.html.erb +12 -8
  118. data/app/views/decidim/proposals/proposals/_votes_count.html.erb +2 -1
  119. data/app/views/decidim/proposals/proposals/_voting_rules.html.erb +1 -7
  120. data/app/views/decidim/proposals/proposals/index.html.erb +10 -18
  121. data/app/views/decidim/proposals/proposals/index.js.erb +1 -1
  122. data/app/views/decidim/proposals/proposals/participatory_texts/_proposal_vote_button.html.erb +3 -1
  123. data/app/views/decidim/proposals/proposals/show.html.erb +35 -15
  124. data/config/locales/ar.yml +18 -72
  125. data/config/locales/bg.yml +7 -89
  126. data/config/locales/bs-BA.yml +0 -13
  127. data/config/locales/ca.yml +212 -72
  128. data/config/locales/cs.yml +213 -73
  129. data/config/locales/de.yml +215 -75
  130. data/config/locales/el.yml +8 -82
  131. data/config/locales/en.yml +209 -69
  132. data/config/locales/es-MX.yml +213 -73
  133. data/config/locales/es-PY.yml +213 -73
  134. data/config/locales/es.yml +215 -75
  135. data/config/locales/eu.yml +217 -78
  136. data/config/locales/fi-plain.yml +216 -75
  137. data/config/locales/fi.yml +216 -75
  138. data/config/locales/fr-CA.yml +118 -87
  139. data/config/locales/fr.yml +118 -87
  140. data/config/locales/ga-IE.yml +0 -19
  141. data/config/locales/gl.yml +8 -43
  142. data/config/locales/hu.yml +6 -66
  143. data/config/locales/id-ID.yml +8 -40
  144. data/config/locales/is-IS.yml +0 -14
  145. data/config/locales/it.yml +8 -53
  146. data/config/locales/ja.yml +162 -87
  147. data/config/locales/lt.yml +8 -83
  148. data/config/locales/lv.yml +8 -50
  149. data/config/locales/nl.yml +6 -55
  150. data/config/locales/no.yml +8 -42
  151. data/config/locales/pl.yml +6 -88
  152. data/config/locales/pt-BR.yml +6 -74
  153. data/config/locales/pt.yml +8 -54
  154. data/config/locales/ro-RO.yml +10 -54
  155. data/config/locales/ru.yml +0 -18
  156. data/config/locales/sk.yml +8 -50
  157. data/config/locales/sr-CS.yml +0 -14
  158. data/config/locales/sv.yml +128 -85
  159. data/config/locales/tr-TR.yml +8 -51
  160. data/config/locales/uk.yml +0 -18
  161. data/config/locales/zh-CN.yml +8 -51
  162. data/config/locales/zh-TW.yml +8 -84
  163. data/db/migrate/20171220084719_add_published_at_to_proposals.rb +1 -1
  164. data/db/migrate/20181016132225_add_organization_as_author.rb +1 -1
  165. data/db/migrate/20200120215928_move_proposal_endorsements_to_core_endorsements.rb +1 -1
  166. data/db/migrate/20200827154156_add_commentable_counter_cache_to_proposals.rb +3 -3
  167. data/db/migrate/20210310102839_add_followable_counter_cache_to_proposals.rb +1 -1
  168. data/db/migrate/20240110203504_create_default_proposal_states.rb +1 -1
  169. data/db/migrate/20240404202756_add_valuation_assignments_count_to_decidim_proposals_proposals.rb +1 -1
  170. data/db/migrate/20240617091140_add_email_on_assigned_proposals_to_users.rb +7 -0
  171. data/db/migrate/20240617170052_add_parent_relation_to_decidim_proposal_notes.rb +7 -0
  172. data/db/migrate/20240828103755_add_deleted_at_to_decidim_proposals_proposals.rb +8 -0
  173. data/decidim-proposals.gemspec +1 -1
  174. data/lib/decidim/api/functions/proposal_finder_helper.rb +12 -0
  175. data/lib/decidim/api/functions/proposal_list_helper.rb +12 -0
  176. data/lib/decidim/api/proposal_type.rb +17 -25
  177. data/lib/decidim/api/proposals_type.rb +4 -19
  178. data/lib/decidim/proposals/admin_engine.rb +12 -3
  179. data/lib/decidim/proposals/admin_filter.rb +3 -6
  180. data/lib/decidim/proposals/component.rb +4 -5
  181. data/lib/decidim/proposals/download_your_data_proposal_serializer.rb +15 -0
  182. data/lib/decidim/proposals/engine.rb +5 -0
  183. data/lib/decidim/proposals/import/proposal_creator.rb +4 -4
  184. data/lib/decidim/proposals/proposal_serializer.rb +12 -29
  185. data/lib/decidim/proposals/seeds.rb +21 -17
  186. data/lib/decidim/proposals/test/factories.rb +2 -1
  187. data/lib/decidim/proposals/version.rb +1 -1
  188. data/lib/decidim/proposals.rb +4 -0
  189. metadata +65 -29
  190. data/app/commands/decidim/proposals/admin/update_proposal_category.rb +0 -70
  191. data/app/commands/decidim/proposals/admin/update_proposal_scope.rb +0 -75
  192. data/app/events/decidim/proposals/admin/update_proposal_category_event.rb +0 -11
  193. data/app/events/decidim/proposals/admin/update_proposal_scope_event.rb +0 -11
  194. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_recategorize.html.erb +0 -15
  195. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_scope-change.html.erb +0 -21
  196. data/app/views/decidim/proposals/collaborative_drafts/_actions.html.erb +0 -7
@@ -5,7 +5,6 @@ zh-TW:
5
5
  collaborative_draft:
6
6
  address: 地址
7
7
  body: 內容
8
- category_id: 類別
9
8
  decidim_scope_id: 範圍
10
9
  has_address: 有地址
11
10
  scope_id: 範圍
@@ -18,7 +17,6 @@ zh-TW:
18
17
  answered_at: 回答
19
18
  automatic_hashtags: 已自動添加標籤
20
19
  body: 內容
21
- category_id: 類別
22
20
  decidim_scope_id: 範圍
23
21
  has_address: 有地址
24
22
  scope_id: 範圍
@@ -67,8 +65,6 @@ zh-TW:
67
65
  base:
68
66
  not_official: 非正式
69
67
  models:
70
- decidim/proposals/admin/update_proposal_category_event: 提案類別已更改
71
- decidim/proposals/admin/update_proposal_scope_event: 提案範圍已更改
72
68
  decidim/proposals/creation_enabled_event: 建立提案已啟用
73
69
  decidim/proposals/endorsing_enabled_event: 提案連署功能已啟用
74
70
  decidim/proposals/proposal_mentioned_event: 提案已被提及
@@ -86,15 +82,11 @@ zh-TW:
86
82
  admin:
87
83
  filters:
88
84
  proposals:
89
- category_id_eq:
90
- label: 類別
91
85
  is_emendation_true:
92
86
  label: 類別
93
87
  values:
94
88
  'false': 提案
95
89
  'true': 修正案
96
- scope_id_eq:
97
- label: 範圍
98
90
  state_eq:
99
91
  label: 狀態
100
92
  values:
@@ -113,7 +105,6 @@ zh-TW:
113
105
  actions:
114
106
  amend: 修訂
115
107
  comment: 評論
116
- create: 建立
117
108
  endorse: 連署
118
109
  vote_comment: 投票評論
119
110
  withdraw: 撤回
@@ -136,7 +127,6 @@ zh-TW:
136
127
  random: 隨機
137
128
  recent: 最近
138
129
  with_more_authors: 有更多作者
139
- geocoding_enabled: 地理編碼已啟用
140
130
  new_proposal_body_template: 新提案正文樣板
141
131
  new_proposal_body_template_help: 您可以定義新提案預先填寫的文字
142
132
  new_proposal_help_text: 新提案幫助文本
@@ -144,7 +134,6 @@ zh-TW:
144
134
  participatory_texts_enabled: 參與式文字已啟用
145
135
  participatory_texts_enabled_readonly: 如果已經存在提案,則無法與此設置互動。如果您想要啟用此功能,請創建一個新的“提案組件”,或者如果要禁用此功能,請在“參與式文字”選單中放棄所有已匯入的提案。
146
136
  proposal_answering_enabled: 提案回答已啟用
147
- proposal_edit_before_minutes: 在幾分鐘後,作者可以編輯提案
148
137
  proposal_edit_time: 編輯提案
149
138
  proposal_edit_time_choices:
150
139
  infinite: 允許無限時間編輯提案
@@ -153,8 +142,6 @@ zh-TW:
153
142
  proposal_limit: 參與者可提出提案的上限
154
143
  proposal_wizard_step_1_help_text: 提案向導「創建」步驟說明文字
155
144
  resources_permissions_enabled: 每個提案都可以設定行動權限
156
- scope_id: 範圍
157
- scopes_enabled: 啟用範圍
158
145
  threshold_per_proposal: 每個提案的門檻
159
146
  step:
160
147
  amendment_creation_enabled: 創建修正案已啟用
@@ -192,10 +179,8 @@ zh-TW:
192
179
  proposals:
193
180
  admin:
194
181
  proposal_note_created:
195
- email_intro: 有人在提案「%{resource_title}」上留了一則留言。在<a href="%{admin_proposal_info_url}">管理員面板</a>檢查它。
196
182
  email_outro: 您收到此通知,因為您可以對提案進行評估。
197
183
  email_subject: 有人在提案 %{resource_title} 上留下了一則註記。
198
- notification_title: 有人在提案「<a href="%{resource_path}">%{resource_title}</a>」上留了一則留言。請至<a href="%{admin_proposal_info_path}">管理面板</a>查看。
199
184
  collaborative_draft_access_accepted:
200
185
  email_intro: '%{requester_name} 已經被接受成為 <a href="%{resource_url}">%{resource_title}</a> 協作草稿的貢獻者。'
201
186
  email_outro: 您收到此通知,是因為您是 <a href="%{resource_url}">%{resource_title}</a> 的協作者。
@@ -252,22 +237,14 @@ zh-TW:
252
237
  email_subject: 新增提案「%{resource_title}」至「%{participatory_space_title}」。
253
238
  notification_title: '%{author} 將提案<a href="%{resource_path}">%{resource_title}</a>新增至%{participatory_space_title}.'
254
239
  notification_title_official: 官方提案 <a href="%{resource_path}">%{resource_title}</a> 已經被添加到 %{participatory_space_title}.
255
- proposal_update_category:
256
- email_intro: '管理員已更新您的提案 "%{resource_title}" 的分類,請前往此頁面查看:'
257
- email_subject: '「%{resource_title}」提案的分類已更新'
258
- notification_title: <a href="%{resource_path}">%{resource_title}</a> 提案類別已由管理員更新。
259
- proposal_update_scope:
260
- email_intro: '一位管理員已更新您的提案"%{resource_title}" 的範圍,您可以在此頁面檢查:'
261
- email_subject: '%{resource_title} 提案範圍已更新'
262
- notification_title: <a href="%{resource_path}">%{resource_title}</a> 提案範圍已由管理員更新。
263
240
  voting_enabled:
264
241
  email_outro: 你收到此通知是因為你正在追蹤 %{participatory_space_title}。你可以透過前面的連結停止接收通知。
265
242
  gamification:
266
243
  badges:
267
244
  accepted_proposals:
268
245
  conditions:
269
- - 選擇您有興趣的參與空間並啟用提交提案功能
270
- - 嘗試提出可以實現的提案,這樣它們更有可能被接受。
246
+ - 選擇您有興趣的參與空間並啟用提交提案功能
247
+ - 嘗試提出可以實現的提案,這樣它們更有可能被接受。
271
248
  description: 這個徽章是當你積極參與提出新的提案並且這些提案被接受時授予的。
272
249
  description_another: 這個參與者有 %{score} 個被接受的提案。
273
250
  description_own: 您有 %{score} 個提案被接受。
@@ -277,12 +254,12 @@ zh-TW:
277
254
  unearned_own: 你尚未有任何提案被接受。
278
255
  proposal_votes:
279
256
  conditions:
280
- - 瀏覽並花些時間閱讀其他人的提案
281
- -
257
+ - 瀏覽並花些時間閱讀其他人的提案
258
+ -
282
259
  proposals:
283
260
  conditions:
284
- - 選擇您有興趣的參與空間並啟用提交提案功能
285
- - 提出新的提案
261
+ - 選擇您有興趣的參與空間並啟用提交提案功能
262
+ - 提出新的提案
286
263
  description: 當您積極參與新提案時,將獲得此徽章。
287
264
  description_another: 這個參與者已經創建了 %{score} 個提案。
288
265
  description_own: 您已經建立了 %{score} 個提案。
@@ -322,24 +299,6 @@ zh-TW:
322
299
  proposal_comments: 評論
323
300
  proposals: 提案
324
301
  imports:
325
- help:
326
- answers: |
327
- 匯入文件如果是 CSV 或 Excel 檔案,應包含以下列名,如果是 JSON 檔案,則應包含以下名稱:
328
-
329
- <ul>
330
- <li><b>id:</b>要回答的提案的 ID</li>
331
- <li><b>state:</b>狀態之一,可以是 "接受"、"評估中" 或 "拒絕"</li>
332
- <li><b>answer/en:</b>英文語言的答案。這將取決於您平台的語言設置。</li>
333
- </ul>
334
- proposals: |
335
- 在 CSV 或 Excel 文件的情況下,或在 JSON 文件的情況下,文件必須具有以下列名稱:
336
-
337
- <ul>
338
- <li><b>title/en:</b>英文標題,這取決於您平台的語言配置。</li>
339
- <li><b>body/en:</b>英文正文,這取決於您平台的語言配置。</li>
340
- <li><b>scope/id:</b>範圍的 ID。</li>
341
- <li><b>category/id:</b>類別的 ID。</li>
342
- </ul>
343
302
  label:
344
303
  answers: 從檔案匯入回覆
345
304
  proposals: 從檔案匯入提案
@@ -394,31 +353,23 @@ zh-TW:
394
353
  form:
395
354
  note: 附註
396
355
  submit: 提交
397
- leave_your_note: 留下您的註記
398
356
  title: 私有注解
399
357
  proposals:
400
358
  answer:
401
- invalid: 回答這個提案時出現了問題.
402
359
  success: 提案回覆成功.
403
360
  create:
404
- invalid: 創建提案時發生問題.
405
361
  success: 提案已成功建立.
406
362
  edit:
407
363
  title: 更新提案
408
364
  update: 更新
409
365
  form:
410
- attachment_legend: "(可選) 新增附件"
411
366
  created_in_meeting: 這個提案來自會議
412
- delete_attachment: 刪除附件
413
- select_a_category: 選擇一個類別
414
367
  select_a_meeting: 選擇一個會議
415
368
  index:
416
369
  actions: 操作
417
370
  assign_to_valuator: 分配給評估人員
418
371
  assign_to_valuator_button: 指派
419
372
  cancel: 取消
420
- change_category: 變更類別
421
- change_scope: 變更範圍
422
373
  merge: 合併為新提案
423
374
  merge_button: 合併
424
375
  publish: 發布
@@ -431,7 +382,6 @@ zh-TW:
431
382
  unassign_from_valuator: 取消分派給評估者
432
383
  unassign_from_valuator_button: 取消分配
433
384
  update: 更新
434
- update_scope_button: 更新範圍
435
385
  new:
436
386
  create: 建立
437
387
  title: 建立提案
@@ -453,16 +403,6 @@ zh-TW:
453
403
  remove_assignment: 移除指派
454
404
  remove_assignment_confirmation: 您確定要將評估者從此提案中移除嗎?
455
405
  valuators: 評估者
456
- update_category:
457
- invalid: '這些提案已經擁有 %{subject_name} 類別: %{proposals}。'
458
- select_a_category: 請選擇一個類別。
459
- select_a_proposal: 請選擇一個提案。
460
- success: '已成功將以下提案更新至 %{subject_name} 類別: %{proposals}。'
461
- update_scope:
462
- invalid: '這些提案已經有了 %{subject_name} 的範圍: %{proposals}。'
463
- select_a_proposal: 請選擇一個提案。
464
- select_a_scope: 請選擇一個範圍。
465
- success: '成功將提案更新到 %{subject_name} 的範圍內: %{proposals}。'
466
406
  proposals_imports:
467
407
  create:
468
408
  invalid: 匯入提案時發生問題.
@@ -474,18 +414,14 @@ zh-TW:
474
414
  select_states: 檢查要匯入的提案狀態。
475
415
  proposals_merges:
476
416
  create:
477
- invalid: '由於其中一些提案存在問題,因此無法合併所選提案:'
478
417
  success: 已成功合併提案成為新的提案。
479
418
  proposals_splits:
480
419
  create:
481
- invalid: '由於其中一些提案存在問題,因此無法分割所選提案:'
482
420
  success: 成功將提案拆分為新的提案。
483
421
  valuation_assignments:
484
422
  create:
485
- invalid: 有一個錯誤在指定提案給評估者。
486
423
  success: 提案已成功分配給評估人員.
487
424
  delete:
488
- invalid: 取消指派建議書給評估人員時發生錯誤.
489
425
  success: 評估員已成功取消分配提案.
490
426
  admin_log:
491
427
  proposal:
@@ -540,19 +476,15 @@ zh-TW:
540
476
  error: 建立協作草稿時發生問題。
541
477
  success: 協作草稿建立成功。
542
478
  edit:
543
- attachment_legend: "(可選) 新增附件"
544
479
  back: 返回
545
- select_a_category: 請選擇一個類別
546
480
  send: 發送
547
481
  title: 編輯協作草稿
548
482
  filters:
549
483
  all: 全部
550
484
  amendment: 修正案
551
- category: 類別
552
485
  open: 開啟
553
486
  published: 已發佈
554
487
  related_to: 相關於
555
- scope: 範圍
556
488
  search: 搜尋
557
489
  state: 狀態
558
490
  withdrawn: 已撤回
@@ -590,7 +522,6 @@ zh-TW:
590
522
  error: 無法拒絕作為合作者,請稍後再試。
591
523
  success: "@%{user} 已被成功拒絕成為協作者。"
592
524
  show:
593
- edit: 編輯協作草稿
594
525
  final_proposal: 最終提案
595
526
  final_proposal_help_text: 此草案已完成。請查看最終提案。
596
527
  hidden_authors_count:
@@ -625,14 +556,12 @@ zh-TW:
625
556
  models:
626
557
  proposal:
627
558
  fields:
628
- category: 類別
629
559
  comments: 評論
630
560
  id: ID
631
561
  notes: 備註
632
562
  official_proposal: 正式提案
633
563
  published_answer: 已發布的回答
634
564
  published_at: 發佈於
635
- scope: 範圍
636
565
  state: 狀態
637
566
  title: 標題
638
567
  valuator: 評估者
@@ -650,11 +579,7 @@ zh-TW:
650
579
  description: 當點擊“預覽”按鈕時,座標將會更新,但地址不會更改。
651
580
  instructions: 您可以在地圖上移動點。
652
581
  edit:
653
- add_documents: 新增文件
654
- attachment_legend: "(可選) 新增附件"
655
582
  back: 返回
656
- edit_documents: 編輯文件
657
- select_a_category: 請選擇一個類別
658
583
  send: 發送
659
584
  title: 編輯提案
660
585
  edit_draft:
@@ -665,7 +590,6 @@ zh-TW:
665
590
  activity: 我的活動
666
591
  all: 全部
667
592
  amendment_type: 類別
668
- category: 分類
669
593
  my_proposals: 我的提案
670
594
  origin: 起源
671
595
  related_to: 相關於
@@ -709,7 +633,6 @@ zh-TW:
709
633
  show:
710
634
  answer: 回答
711
635
  changes_at_title: 修正案 "%{title}"
712
- edit_proposal: 編輯提案
713
636
  estimated_cost: 預估成本
714
637
  hidden_endorsers_count:
715
638
  other: "one\n以及其他 %{count} 個人\n\nOther\n以及其他 %{count} 個人"
@@ -723,12 +646,13 @@ zh-TW:
723
646
  proposal_in_evaluation_reason: 這個提案正在被評估中
724
647
  proposal_rejected_reason: '這個提案被拒絕了,因為:'
725
648
  withdraw_confirmation_html: 您確定要撤回此提案嗎?<br><br><strong>此操作無法取消!</strong>
726
- withdraw_proposal: 撤回提案
727
649
  update:
728
650
  title: 更新提案
729
651
  voting_rules:
730
652
  proposal_limit:
731
653
  description: 您最多可以創建 %{limit} 個提案。
654
+ vote_limit:
655
+ description: 您最多可以支持 %{limit} 個提案。
732
656
  wizard_aside:
733
657
  back: 返回
734
658
  back_from_step_1: 返回提案
@@ -4,7 +4,7 @@ class AddPublishedAtToProposals < ActiveRecord::Migration[5.1]
4
4
  def up
5
5
  add_column :decidim_proposals_proposals, :published_at, :datetime, index: true
6
6
  # rubocop:disable Rails/SkipsModelValidations
7
- Decidim::Proposals::Proposal.update_all("published_at = updated_at")
7
+ Decidim::Proposals::Proposal.unscoped.update_all("published_at = updated_at")
8
8
  # rubocop:enable Rails/SkipsModelValidations
9
9
  end
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  class AddOrganizationAsAuthor < ActiveRecord::Migration[5.2]
4
4
  def change
5
- official_proposals = Decidim::Proposals::Proposal.find_each.select do |proposal|
5
+ official_proposals = Decidim::Proposals::Proposal.unscoped.find_each.select do |proposal|
6
6
  proposal.coauthorships.count.zero?
7
7
  end
8
8
 
@@ -26,7 +26,7 @@ class MoveProposalEndorsementsToCoreEndorsements < ActiveRecord::Migration[5.2]
26
26
  )
27
27
  end
28
28
  # update new `decidim_proposals_proposal.endorsements_count` counter cache
29
- Decidim::Proposals::Proposal.select(:id).all.find_each do |proposal|
29
+ Decidim::Proposals::Proposal.unscoped.select(:id).all.find_each do |proposal|
30
30
  Decidim::Proposals::Proposal.reset_counters(proposal.id, :endorsements)
31
31
  end
32
32
  end
@@ -5,8 +5,8 @@ class AddCommentableCounterCacheToProposals < ActiveRecord::Migration[5.2]
5
5
  add_column :decidim_proposals_proposals, :comments_count, :integer, null: false, default: 0, index: true
6
6
  add_column :decidim_proposals_collaborative_drafts, :comments_count, :integer, null: false, default: 0, index: true
7
7
  Decidim::Proposals::Proposal.reset_column_information
8
- Decidim::Proposals::Proposal.find_each(&:update_comments_count)
9
- Decidim::Proposals::CollaborativeDraft.reset_column_information
10
- Decidim::Proposals::CollaborativeDraft.find_each(&:update_comments_count)
8
+ Decidim::Proposals::Proposal.unscoped.find_each(&:update_comments_count)
9
+ Decidim::Proposals::CollaborativeDraft.unscoped.reset_column_information
10
+ Decidim::Proposals::CollaborativeDraft.unscoped.find_each(&:update_comments_count)
11
11
  end
12
12
  end
@@ -7,7 +7,7 @@ class AddFollowableCounterCacheToProposals < ActiveRecord::Migration[5.2]
7
7
  reversible do |dir|
8
8
  dir.up do
9
9
  Decidim::Proposals::Proposal.reset_column_information
10
- Decidim::Proposals::Proposal.find_each do |record|
10
+ Decidim::Proposals::Proposal.unscoped.find_each do |record|
11
11
  record.class.reset_counters(record.id, :follows)
12
12
  end
13
13
  end
@@ -16,7 +16,7 @@ class CreateDefaultProposalStates < ActiveRecord::Migration[6.1]
16
16
  def up
17
17
  CustomProposal.reset_column_information
18
18
  Decidim::Proposals::ProposalState.reset_column_information
19
- Decidim::Component.where(manifest_name: "proposals").find_each do |component|
19
+ Decidim::Component.unscoped.where(manifest_name: "proposals").find_each do |component|
20
20
  admin_user = component.organization.admins.first
21
21
  default_states = Decidim::Proposals.create_default_states!(component, admin_user)
22
22
 
@@ -7,7 +7,7 @@ class AddValuationAssignmentsCountToDecidimProposalsProposals < ActiveRecord::Mi
7
7
  reversible do |dir|
8
8
  dir.up do
9
9
  Decidim::Proposals::Proposal.reset_column_information
10
- Decidim::Proposals::Proposal.find_each do |record|
10
+ Decidim::Proposals::Proposal.unscoped.find_each do |record|
11
11
  Decidim::Proposals::Proposal.reset_counters(record.id, :valuation_assignments)
12
12
  end
13
13
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddEmailOnAssignedProposalsToUsers < ActiveRecord::Migration[7.0]
4
+ def change
5
+ add_column :decidim_users, :email_on_assigned_proposals, :boolean, default: true
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddParentRelationToDecidimProposalNotes < ActiveRecord::Migration[7.0]
4
+ def change
5
+ add_reference :decidim_proposals_proposal_notes, :parent, index: { name: :decidim_proposals_proposal_notes_on_parent_id }
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddDeletedAtToDecidimProposalsProposals < ActiveRecord::Migration[7.0]
4
+ def change
5
+ add_column :decidim_proposals_proposals, :deleted_at, :datetime
6
+ add_index :decidim_proposals_proposals, :deleted_at
7
+ end
8
+ end
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  "homepage_uri" => "https://decidim.org",
20
20
  "source_code_uri" => "https://github.com/decidim/decidim"
21
21
  }
22
- s.required_ruby_version = "~> 3.2.0"
22
+ s.required_ruby_version = "~> 3.3.0"
23
23
 
24
24
  s.name = "decidim-proposals"
25
25
  s.summary = "Decidim proposals module"
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Proposals
5
+ class ProposalFinderHelper < Decidim::Core::ComponentFinderBase
6
+ # only querying published proposals
7
+ def query_scope
8
+ super.published
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Proposals
5
+ class ProposalListHelper < Decidim::Core::ComponentListBase
6
+ # only querying published proposals
7
+ def query_scope
8
+ super.published
9
+ end
10
+ end
11
+ end
12
+ end
@@ -7,8 +7,7 @@ module Decidim
7
7
 
8
8
  implements Decidim::Comments::CommentableInterface
9
9
  implements Decidim::Core::CoauthorableInterface
10
- implements Decidim::Core::CategorizableInterface
11
- implements Decidim::Core::ScopableInterface
10
+ implements Decidim::Core::TaxonomizableInterface
12
11
  implements Decidim::Core::AttachableInterface
13
12
  implements Decidim::Core::FingerprintInterface
14
13
  implements Decidim::Core::AmendableInterface
@@ -17,40 +16,33 @@ module Decidim
17
16
  implements Decidim::Core::EndorsableInterface
18
17
  implements Decidim::Core::TimestampsInterface
19
18
 
20
- field :id, GraphQL::Types::ID, null: false
21
- field :title, Decidim::Core::TranslatedFieldType, "The title for this title", null: true
22
- field :body, Decidim::Core::TranslatedFieldType, "The description for this body", null: true
23
19
  field :address, GraphQL::Types::String, "The physical address (location) of this proposal", null: true
24
- field :coordinates, Decidim::Core::CoordinatesType, "Physical coordinates for this proposal", null: true
25
-
26
- def coordinates
27
- [object.latitude, object.longitude]
28
- end
29
-
30
- field :reference, GraphQL::Types::String, "This proposal's unique reference", null: true
31
- field :state, GraphQL::Types::String, "The answer status in which proposal is in", null: true
32
20
  field :answer, Decidim::Core::TranslatedFieldType, "The answer feedback for the status for this proposal", null: true
33
-
34
21
  field :answered_at, Decidim::Core::DateTimeType, description: "The date and time this proposal was answered", null: true
35
-
36
- field :published_at, Decidim::Core::DateTimeType, description: "The date and time this proposal was published", null: true
37
-
38
- field :participatory_text_level, GraphQL::Types::String, description: "If it is a participatory text, the level indicates the type of paragraph", null: true
39
- field :position, GraphQL::Types::Int, "Position of this proposal in the participatory text", null: true
40
-
41
- field :official, GraphQL::Types::Boolean, "Whether this proposal is official or not", method: :official?, null: true
22
+ field :body, Decidim::Core::TranslatedFieldType, "The description for this body", null: true
23
+ field :coordinates, Decidim::Core::CoordinatesType, "Physical coordinates for this proposal", null: true
42
24
  field :created_in_meeting, GraphQL::Types::Boolean, "Whether this proposal comes from a meeting or not", method: :official_meeting?, null: true
25
+ field :id, GraphQL::Types::ID, "The id of the Proposal", null: false
43
26
  field :meeting, Decidim::Meetings::MeetingType, description: "If the proposal comes from a meeting, the related meeting", null: true
44
-
45
- field :withdrawn_at, Decidim::Core::DateTimeType, description: "The date and time this proposal was withdrawn", null: true
27
+ field :official, GraphQL::Types::Boolean, "Whether this proposal is official or not", method: :official?, null: true
28
+ field :participatory_text_level, GraphQL::Types::String, description: "If it is a participatory text, the level indicates the type of paragraph", null: true
29
+ field :position, GraphQL::Types::Int, "Position of this proposal in the participatory text", null: true
30
+ field :published_at, Decidim::Core::DateTimeType, description: "The date and time this proposal was published", null: true
31
+ field :reference, GraphQL::Types::String, "This proposal's unique reference", null: true
32
+ field :state, GraphQL::Types::String, "The answer status in which proposal is in", null: true
33
+ field :title, Decidim::Core::TranslatedFieldType, "The title for this title", null: true
34
+ field :vote_count, GraphQL::Types::Int, description: "The total amount of votes the proposal has received", null: true
46
35
  field :withdrawn, GraphQL::Types::Boolean, "Whether this proposal has been withdrawn or not", method: :withdrawn?, null: true
36
+ field :withdrawn_at, Decidim::Core::DateTimeType, description: "The date and time this proposal was withdrawn", null: true
37
+
38
+ def coordinates
39
+ [object.latitude, object.longitude]
40
+ end
47
41
 
48
42
  def meeting
49
43
  object.authors.first if object.official_meeting?
50
44
  end
51
45
 
52
- field :vote_count, GraphQL::Types::Int, description: "The total amount of votes the proposal has received", null: true
53
-
54
46
  def vote_count
55
47
  current_component = object.component
56
48
  object.proposal_votes_count unless current_component.current_settings.votes_hidden?
@@ -2,32 +2,17 @@
2
2
 
3
3
  module Decidim
4
4
  module Proposals
5
- class ProposalListHelper < Decidim::Core::ComponentListBase
6
- # only querying published posts
7
- def query_scope
8
- super.published
9
- end
10
- end
11
-
12
- class ProposalFinderHelper < Decidim::Core::ComponentFinderBase
13
- # only querying published posts
14
- def query_scope
15
- super.published
16
- end
17
- end
18
-
19
5
  class ProposalsType < Decidim::Core::ComponentType
20
6
  graphql_name "Proposals"
21
7
  description "A proposals component of a participatory space."
22
8
 
23
- field :proposals, type: Decidim::Proposals::ProposalType.connection_type, description: "List all proposals", connection: true, null: true do
24
- argument :order, Decidim::Proposals::ProposalInputSort, "Provides several methods to order the results", required: false
25
- argument :filter, Decidim::Proposals::ProposalInputFilter, "Provides several methods to filter the results", required: false
26
- end
27
-
28
9
  field :proposal, type: Decidim::Proposals::ProposalType, description: "Finds one proposal", null: true do
29
10
  argument :id, GraphQL::Types::ID, "The ID of the proposal", required: true
30
11
  end
12
+ field :proposals, type: Decidim::Proposals::ProposalType.connection_type, description: "List all proposals", connection: true, null: true do
13
+ argument :filter, Decidim::Proposals::ProposalInputFilter, "Provides several methods to filter the results", required: false
14
+ argument :order, Decidim::Proposals::ProposalInputSort, "Provides several methods to order the results", required: false
15
+ end
31
16
 
32
17
  def proposals(filter: {}, order: {})
33
18
  Decidim::Proposals::ProposalListHelper.new(model_class: Proposal).call(object, { filter:, order: }, context)
@@ -14,17 +14,26 @@ module Decidim
14
14
  routes do
15
15
  resources :proposals, only: [:show, :index, :new, :create, :edit, :update] do
16
16
  resources :valuation_assignments, only: [:destroy]
17
+ member do
18
+ patch :soft_delete
19
+ patch :restore
20
+ end
17
21
  collection do
18
- post :update_category
22
+ post :update_taxonomies
19
23
  post :publish_answers
20
- post :update_scope
24
+ post :update_multiple_answers, controller: "proposal_answers"
25
+ get :manage_trash, controller: "proposals"
21
26
  resource :proposals_import, only: [:new, :create]
22
27
  resource :proposals_merge, only: [:create]
23
28
  resource :proposals_split, only: [:create]
24
29
  resource :valuation_assignment, only: [:create, :destroy]
25
30
  end
26
31
  resources :proposal_answers, only: [:edit, :update]
27
- resources :proposal_notes, only: [:create]
32
+ resources :proposal_notes, only: [:create] do
33
+ member do
34
+ post :reply
35
+ end
36
+ end
28
37
  end
29
38
 
30
39
  resources :proposal_states
@@ -9,8 +9,7 @@ module Decidim
9
9
  :is_emendation_true,
10
10
  :state_eq,
11
11
  :with_any_state,
12
- :scope_id_eq,
13
- :category_id_eq,
12
+ :taxonomies_part_of_contains,
14
13
  :valuator_role_ids_has
15
14
  )
16
15
 
@@ -18,16 +17,14 @@ module Decidim
18
17
  is_emendation_true: %w(true false),
19
18
  state_eq: state_eq_values,
20
19
  with_any_state: %w(state_published state_not_published),
21
- scope_id_eq: scope_ids_hash(scopes.top_level),
22
- category_id_eq: category_ids_hash(categories.first_class),
20
+ taxonomies_part_of_contains: taxonomy_ids_hash(available_root_taxonomies),
23
21
  valuator_role_ids_has: valuator_role_ids
24
22
  )
25
23
 
26
24
  configuration.add_dynamically_translated_filters(
27
- :scope_id_eq,
28
- :category_id_eq,
29
25
  :valuator_role_ids_has,
30
26
  :proposal_state_id_eq,
27
+ :taxonomies_part_of_contains,
31
28
  :state_eq
32
29
  )
33
30
  end
@@ -29,14 +29,13 @@ Decidim.register_component(:proposals) do |component|
29
29
  POSSIBLE_SORT_ORDERS = %w(automatic random recent most_endorsed most_voted most_commented most_followed with_more_authors).freeze
30
30
 
31
31
  component.settings(:global) do |settings|
32
- settings.attribute :scopes_enabled, type: :boolean, default: false
33
- settings.attribute :scope_id, type: :scope
32
+ settings.attribute :taxonomy_filters, type: :taxonomy_filters
34
33
  settings.attribute :vote_limit, type: :integer, default: 0, required: true
35
34
  settings.attribute :minimum_votes_per_user, type: :integer, default: 0, required: true
36
35
  settings.attribute :proposal_limit, type: :integer, default: 0, required: true
37
36
  settings.attribute :proposal_length, type: :integer, default: 500
38
- settings.attribute :proposal_edit_time, type: :enum, default: "limited", choices: -> { %w(limited infinite) }
39
- settings.attribute :proposal_edit_before_minutes, type: :integer, default: 5, required: true
37
+ settings.attribute :proposal_edit_time, type: :enum, default: "limited", choices: -> { %w(infinite limited) }
38
+ settings.attribute :edit_time, type: :integer_with_units, default: [5, "minutes"], required: true, units: %w(minutes hours days)
40
39
  settings.attribute :threshold_per_proposal, type: :integer, default: 0, required: true
41
40
  settings.attribute :can_accumulate_votes_beyond_threshold, type: :boolean, default: false
42
41
  settings.attribute :proposal_answering_enabled, type: :boolean, default: true
@@ -137,7 +136,7 @@ Decidim.register_component(:proposals) do |component|
137
136
  .published
138
137
  .not_hidden
139
138
  .where(component: component_instance)
140
- .includes(:scope, :category, :component)
139
+ .includes(:taxonomies, :component)
141
140
 
142
141
  if space.user_roles(:valuator).where(user:).any?
143
142
  collection.with_valuation_assigned_to(user, space)
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Proposals
5
+ class DownloadYourDataProposalSerializer < Decidim::Proposals::ProposalSerializer
6
+ # Serializes a Proposal for download your data feature
7
+ #
8
+ # Remove the author information as it is the same of the user that
9
+ # requested the data
10
+ def serialize
11
+ super.except!(:author)
12
+ end
13
+ end
14
+ end
15
+ end