decidim-proposals 0.27.6 → 0.28.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (278) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/proposals/collaborative_draft_cell.rb +1 -1
  3. data/app/cells/decidim/proposals/collaborative_draft_l_cell.rb +16 -0
  4. data/app/cells/decidim/proposals/collaborative_draft_link_to_proposal/show.erb +4 -12
  5. data/app/cells/decidim/proposals/collaborative_draft_link_to_proposal_cell.rb +0 -29
  6. data/app/cells/decidim/proposals/collaborative_draft_metadata_cell.rb +30 -0
  7. data/app/cells/decidim/proposals/content_blocks/highlighted_proposals_cell.rb +2 -8
  8. data/app/cells/decidim/proposals/cost_report/show.erb +5 -34
  9. data/app/cells/decidim/proposals/cost_report_cell.rb +0 -13
  10. data/app/cells/decidim/proposals/highlighted_proposals_for_component/show.erb +29 -17
  11. data/app/cells/decidim/proposals/highlighted_proposals_for_component_cell.rb +34 -8
  12. data/app/cells/decidim/proposals/irreversible_action_modal/show.erb +9 -17
  13. data/app/cells/decidim/proposals/irreversible_action_modal_cell.rb +7 -9
  14. data/app/cells/decidim/proposals/participatory_text_proposal/buttons.erb +21 -31
  15. data/app/cells/decidim/proposals/participatory_text_proposal/show.erb +5 -9
  16. data/app/cells/decidim/proposals/participatory_text_proposal_cell.rb +0 -9
  17. data/app/cells/decidim/proposals/proposal_activity_cell.rb +1 -12
  18. data/app/cells/decidim/proposals/proposal_cell.rb +6 -1
  19. data/app/cells/decidim/proposals/proposal_l_cell.rb +47 -0
  20. data/app/cells/decidim/proposals/proposal_link_to_collaborative_draft_cell.rb +6 -4
  21. data/app/cells/decidim/proposals/proposal_link_to_rejected_emendation_cell.rb +9 -7
  22. data/app/cells/decidim/proposals/proposal_linked_resources/show.erb +3 -8
  23. data/app/cells/decidim/proposals/proposal_metadata_cell.rb +61 -0
  24. data/app/cells/decidim/proposals/proposal_s_cell.rb +21 -0
  25. data/app/cells/decidim/proposals/proposals_picker/show.erb +13 -13
  26. data/app/cells/decidim/proposals/proposals_picker_cell.rb +15 -38
  27. data/app/commands/decidim/proposals/accept_access_to_collaborative_draft.rb +1 -1
  28. data/app/commands/decidim/proposals/admin/answer_proposal.rb +1 -1
  29. data/app/commands/decidim/proposals/admin/assign_proposals_to_valuator.rb +3 -3
  30. data/app/commands/decidim/proposals/admin/create_proposal.rb +2 -2
  31. data/app/commands/decidim/proposals/admin/create_proposal_note.rb +4 -4
  32. data/app/commands/decidim/proposals/admin/discard_participatory_text.rb +1 -1
  33. data/app/commands/decidim/proposals/admin/import_participatory_text.rb +1 -1
  34. data/app/commands/decidim/proposals/admin/import_proposals.rb +2 -13
  35. data/app/commands/decidim/proposals/admin/merge_proposals.rb +1 -1
  36. data/app/commands/decidim/proposals/admin/notify_proposal_answer.rb +3 -3
  37. data/app/commands/decidim/proposals/admin/publish_answers.rb +1 -1
  38. data/app/commands/decidim/proposals/admin/publish_participatory_text.rb +2 -2
  39. data/app/commands/decidim/proposals/admin/split_proposals.rb +1 -1
  40. data/app/commands/decidim/proposals/admin/unassign_proposals_from_valuator.rb +2 -2
  41. data/app/commands/decidim/proposals/admin/update_participatory_text.rb +1 -1
  42. data/app/commands/decidim/proposals/admin/update_proposal.rb +5 -1
  43. data/app/commands/decidim/proposals/admin/update_proposal_scope.rb +1 -1
  44. data/app/commands/decidim/proposals/create_collaborative_draft.rb +13 -3
  45. data/app/commands/decidim/proposals/create_proposal.rb +14 -5
  46. data/app/commands/decidim/proposals/hashtags_methods.rb +1 -1
  47. data/app/commands/decidim/proposals/publish_proposal.rb +1 -1
  48. data/app/commands/decidim/proposals/reject_access_to_collaborative_draft.rb +1 -1
  49. data/app/commands/decidim/proposals/request_access_to_collaborative_draft.rb +1 -1
  50. data/app/commands/decidim/proposals/unvote_proposal.rb +2 -2
  51. data/app/commands/decidim/proposals/update_collaborative_draft.rb +12 -2
  52. data/app/commands/decidim/proposals/update_proposal.rb +16 -14
  53. data/app/commands/decidim/proposals/vote_proposal.rb +2 -2
  54. data/app/controllers/concerns/decidim/proposals/admin/filterable.rb +4 -13
  55. data/app/controllers/decidim/proposals/admin/proposal_answers_controller.rb +2 -2
  56. data/app/controllers/decidim/proposals/admin/proposal_notes_controller.rb +1 -1
  57. data/app/controllers/decidim/proposals/admin/proposals_controller.rb +2 -2
  58. data/app/controllers/decidim/proposals/collaborative_drafts_controller.rb +3 -9
  59. data/app/controllers/decidim/proposals/proposal_votes_controller.rb +3 -3
  60. data/app/controllers/decidim/proposals/proposals_controller.rb +42 -12
  61. data/app/events/decidim/proposals/accepted_proposal_event.rb +1 -1
  62. data/app/events/decidim/proposals/admin/proposal_note_created_event.rb +1 -1
  63. data/app/events/decidim/proposals/admin/update_proposal_category_event.rb +1 -1
  64. data/app/events/decidim/proposals/admin/update_proposal_scope_event.rb +1 -1
  65. data/app/events/decidim/proposals/collaborative_draft_access_accepted_event.rb +1 -1
  66. data/app/events/decidim/proposals/collaborative_draft_access_rejected_event.rb +1 -1
  67. data/app/events/decidim/proposals/collaborative_draft_access_request_event.rb +1 -1
  68. data/app/events/decidim/proposals/collaborative_draft_access_requested_event.rb +1 -1
  69. data/app/events/decidim/proposals/collaborative_draft_access_requester_accepted_event.rb +1 -1
  70. data/app/events/decidim/proposals/collaborative_draft_access_requester_rejected_event.rb +1 -1
  71. data/app/events/decidim/proposals/collaborative_draft_withdrawn_event.rb +1 -1
  72. data/app/events/decidim/proposals/evaluating_proposal_event.rb +1 -1
  73. data/app/events/decidim/proposals/proposal_endorsed_event.rb +1 -1
  74. data/app/events/decidim/proposals/proposal_mentioned_event.rb +1 -1
  75. data/app/events/decidim/proposals/publish_proposal_event.rb +1 -1
  76. data/app/events/decidim/proposals/rejected_proposal_event.rb +1 -1
  77. data/app/forms/decidim/proposals/admin/import_participatory_text_form.rb +1 -1
  78. data/app/forms/decidim/proposals/admin/proposal_base_form.rb +2 -2
  79. data/app/forms/decidim/proposals/admin/proposal_form.rb +1 -1
  80. data/app/forms/decidim/proposals/admin/proposals_fork_form.rb +1 -1
  81. data/app/forms/decidim/proposals/admin/valuation_assignment_form.rb +1 -1
  82. data/app/forms/decidim/proposals/proposal_form.rb +9 -27
  83. data/app/helpers/decidim/proposals/admin/proposal_bulk_actions_helper.rb +1 -1
  84. data/app/helpers/decidim/proposals/admin/proposals_helper.rb +13 -13
  85. data/app/helpers/decidim/proposals/application_helper.rb +79 -27
  86. data/app/helpers/decidim/proposals/collaborative_draft_helper.rb +44 -4
  87. data/app/helpers/decidim/proposals/map_helper.rb +3 -4
  88. data/app/helpers/decidim/proposals/participatory_texts_helper.rb +1 -9
  89. data/app/helpers/decidim/proposals/proposal_cells_helper.rb +1 -1
  90. data/app/helpers/decidim/proposals/proposal_votes_helper.rb +2 -24
  91. data/app/helpers/decidim/proposals/proposal_wizard_helper.rb +14 -81
  92. data/app/helpers/decidim/proposals/proposals_helper.rb +0 -12
  93. data/app/jobs/decidim/proposals/hide_all_created_by_author_job.rb +20 -0
  94. data/app/jobs/decidim/proposals/notify_proposals_mentioned_job.rb +1 -1
  95. data/app/jobs/decidim/proposals/settings_change_job.rb +2 -2
  96. data/app/models/decidim/proposals/collaborative_draft.rb +4 -16
  97. data/app/models/decidim/proposals/proposal.rb +33 -16
  98. data/app/models/decidim/proposals/proposal_vote.rb +3 -3
  99. data/app/models/decidim/proposals/valuation_assignment.rb +1 -2
  100. data/app/packs/documents/decidim/proposals/participatory_texts/participatory_text.md +9 -4
  101. data/app/packs/entrypoints/decidim_proposals.js +4 -0
  102. data/app/packs/entrypoints/decidim_proposals_admin.js +0 -1
  103. data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_accepted_proposals.svg +68 -1
  104. data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_proposal_votes.svg +34 -1
  105. data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_proposals.svg +64 -1
  106. data/app/packs/src/decidim/proposals/add_proposal.js +25 -39
  107. data/app/packs/src/decidim/proposals/admin/proposals.js +0 -7
  108. data/app/packs/src/decidim/proposals/choose_proposals.js +20 -0
  109. data/app/packs/stylesheets/decidim/proposals/proposals.scss +97 -0
  110. data/app/permissions/decidim/proposals/admin/permissions.rb +3 -3
  111. data/app/permissions/decidim/proposals/permissions.rb +1 -10
  112. data/app/presenters/decidim/proposals/admin_log/proposal_note_presenter.rb +2 -2
  113. data/app/presenters/decidim/proposals/admin_log/proposal_presenter.rb +2 -2
  114. data/app/presenters/decidim/proposals/admin_log/valuation_assignment_presenter.rb +2 -2
  115. data/app/presenters/decidim/proposals/proposal_presenter.rb +6 -2
  116. data/app/services/decidim/proposals/diff_renderer.rb +3 -3
  117. data/app/services/decidim/proposals/proposal_builder.rb +6 -6
  118. data/app/views/decidim/proposals/admin/participatory_texts/_article-preview.html.erb +2 -4
  119. data/app/views/decidim/proposals/admin/participatory_texts/_bulk-actions.html.erb +2 -2
  120. data/app/views/decidim/proposals/admin/participatory_texts/index.html.erb +58 -46
  121. data/app/views/decidim/proposals/admin/participatory_texts/new_import.html.erb +31 -33
  122. data/app/views/decidim/proposals/admin/proposal_answers/_form.html.erb +17 -11
  123. data/app/views/decidim/proposals/admin/proposal_notes/_form.html.erb +5 -6
  124. data/app/views/decidim/proposals/admin/proposal_notes/_proposal_notes.html.erb +28 -36
  125. data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +27 -30
  126. data/app/views/decidim/proposals/admin/proposals/_documents.html.erb +13 -0
  127. data/app/views/decidim/proposals/admin/proposals/_endorsers.html.erb +25 -0
  128. data/app/views/decidim/proposals/admin/proposals/_form.html.erb +70 -90
  129. data/app/views/decidim/proposals/admin/proposals/_meetings.html.erb +13 -0
  130. data/app/views/decidim/proposals/admin/proposals/_photos.html.erb +13 -0
  131. data/app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb +31 -25
  132. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_assign_to_valuator.html.erb +3 -3
  133. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_dropdown.html.erb +3 -2
  134. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_merge.html.erb +4 -4
  135. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_publish_answers.html.erb +3 -3
  136. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_recategorize.html.erb +3 -3
  137. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_scope-change.html.erb +4 -8
  138. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_split.html.erb +3 -3
  139. data/app/views/decidim/proposals/admin/proposals/bulk_actions/_unassign_from_valuator.html.erb +3 -3
  140. data/app/views/decidim/proposals/admin/proposals/edit.html.erb +17 -7
  141. data/app/views/decidim/proposals/admin/proposals/index.html.erb +50 -63
  142. data/app/views/decidim/proposals/admin/proposals/new.html.erb +16 -6
  143. data/app/views/decidim/proposals/admin/proposals/publish_answers.js.erb +2 -2
  144. data/app/views/decidim/proposals/admin/proposals/show.html.erb +204 -162
  145. data/app/views/decidim/proposals/admin/proposals/update_attribute.js.erb +5 -6
  146. data/app/views/decidim/proposals/admin/proposals_imports/new.html.erb +48 -34
  147. data/app/views/decidim/proposals/collaborative_drafts/_accept_request_access_form.html.erb +1 -1
  148. data/app/views/decidim/proposals/collaborative_drafts/_actions.html.erb +7 -0
  149. data/app/views/decidim/proposals/collaborative_drafts/_collaborative_draft_aside.html.erb +53 -0
  150. data/app/views/decidim/proposals/collaborative_drafts/_collaborative_drafts.html.erb +12 -13
  151. data/app/views/decidim/proposals/collaborative_drafts/_collaborator_requests.html.erb +8 -12
  152. data/app/views/decidim/proposals/collaborative_drafts/_edit_form_fields.html.erb +26 -54
  153. data/app/views/decidim/proposals/collaborative_drafts/_reject_request_access_form.html.erb +1 -3
  154. data/app/views/decidim/proposals/collaborative_drafts/_request_access_form.html.erb +1 -1
  155. data/app/views/decidim/proposals/collaborative_drafts/edit.html.erb +23 -25
  156. data/app/views/decidim/proposals/collaborative_drafts/index.html.erb +30 -22
  157. data/app/views/decidim/proposals/collaborative_drafts/index.js.erb +0 -5
  158. data/app/views/decidim/proposals/collaborative_drafts/new.html.erb +22 -18
  159. data/app/views/decidim/proposals/collaborative_drafts/show.html.erb +39 -109
  160. data/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb +2 -2
  161. data/app/views/decidim/proposals/proposals/_actions.html.erb +13 -0
  162. data/app/views/decidim/proposals/proposals/_edit_form_fields.html.erb +31 -70
  163. data/app/views/decidim/proposals/proposals/_linked_proposals.html.erb +3 -35
  164. data/app/views/decidim/proposals/proposals/_proposal_aside.html.erb +40 -0
  165. data/app/views/decidim/proposals/proposals/_proposals.html.erb +18 -39
  166. data/app/views/decidim/proposals/proposals/_proposals_picker.html.erb +5 -0
  167. data/app/views/decidim/proposals/proposals/_remaining_votes_count.html.erb +3 -3
  168. data/app/views/decidim/proposals/proposals/_vote_button.html.erb +16 -17
  169. data/app/views/decidim/proposals/proposals/_votes_count.html.erb +3 -6
  170. data/app/views/decidim/proposals/proposals/_voting_rules.html.erb +28 -41
  171. data/app/views/decidim/proposals/proposals/_wizard_header.html.erb +19 -25
  172. data/app/views/decidim/proposals/proposals/compare.html.erb +17 -16
  173. data/app/views/decidim/proposals/proposals/complete.html.erb +26 -21
  174. data/app/views/decidim/proposals/proposals/edit.html.erb +32 -27
  175. data/app/views/decidim/proposals/proposals/edit_draft.html.erb +21 -19
  176. data/app/views/decidim/proposals/proposals/index.html.erb +56 -47
  177. data/app/views/decidim/proposals/proposals/index.js.erb +0 -5
  178. data/app/views/decidim/proposals/proposals/new.html.erb +30 -35
  179. data/app/views/decidim/proposals/proposals/participatory_texts/_proposal_vote_button.html.erb +5 -5
  180. data/app/views/decidim/proposals/proposals/participatory_texts/_view_index.html.erb +15 -8
  181. data/app/views/decidim/proposals/proposals/participatory_texts/participatory_text.html.erb +32 -15
  182. data/app/views/decidim/proposals/proposals/preview.html.erb +37 -34
  183. data/app/views/decidim/proposals/proposals/show.html.erb +90 -108
  184. data/app/views/decidim/proposals/versions/show.html.erb +13 -5
  185. data/config/assets.rb +0 -1
  186. data/config/brakeman.ignore +31 -56
  187. data/config/locales/ar.yml +21 -157
  188. data/config/locales/bg.yml +2 -184
  189. data/config/locales/ca.yml +87 -145
  190. data/config/locales/cs.yml +74 -134
  191. data/config/locales/de.yml +71 -129
  192. data/config/locales/el.yml +57 -121
  193. data/config/locales/en.yml +76 -134
  194. data/config/locales/es-MX.yml +75 -133
  195. data/config/locales/es-PY.yml +75 -133
  196. data/config/locales/es.yml +82 -140
  197. data/config/locales/eu.yml +74 -132
  198. data/config/locales/fi-plain.yml +68 -126
  199. data/config/locales/fi.yml +67 -125
  200. data/config/locales/fr-CA.yml +72 -131
  201. data/config/locales/fr.yml +76 -135
  202. data/config/locales/ga-IE.yml +0 -39
  203. data/config/locales/gl.yml +10 -130
  204. data/config/locales/hu.yml +43 -148
  205. data/config/locales/id-ID.yml +8 -114
  206. data/config/locales/is-IS.yml +3 -60
  207. data/config/locales/it.yml +12 -145
  208. data/config/locales/ja.yml +78 -141
  209. data/config/locales/lb.yml +0 -5
  210. data/config/locales/lt.yml +64 -126
  211. data/config/locales/lv.yml +12 -144
  212. data/config/locales/nl.yml +14 -147
  213. data/config/locales/no.yml +10 -134
  214. data/config/locales/pl.yml +15 -177
  215. data/config/locales/pt-BR.yml +13 -199
  216. data/config/locales/pt.yml +10 -142
  217. data/config/locales/ro-RO.yml +12 -146
  218. data/config/locales/ru.yml +4 -70
  219. data/config/locales/sk.yml +18 -145
  220. data/config/locales/sr-CS.yml +0 -23
  221. data/config/locales/sv.yml +25 -145
  222. data/config/locales/tr-TR.yml +14 -148
  223. data/config/locales/uk.yml +4 -70
  224. data/config/locales/zh-CN.yml +8 -135
  225. data/config/locales/zh-TW.yml +34 -107
  226. data/db/migrate/20170307085300_migrate_proposal_reports_data_to_reports.rb +1 -1
  227. data/db/migrate/20230427105700_change_states_on_collaborative_drafts.rb +34 -0
  228. data/db/migrate/20230427105700_change_states_on_proposals.rb +34 -0
  229. data/lib/decidim/api/proposals_type.rb +2 -2
  230. data/lib/decidim/proposals/component.rb +11 -289
  231. data/lib/decidim/proposals/doc_to_markdown.rb +0 -4
  232. data/lib/decidim/proposals/engine.rb +43 -7
  233. data/lib/decidim/proposals/import/proposal_answer_creator.rb +1 -1
  234. data/lib/decidim/proposals/import/proposal_creator.rb +10 -10
  235. data/lib/decidim/proposals/markdown_to_proposals.rb +8 -2
  236. data/lib/decidim/proposals/proposal_serializer.rb +4 -5
  237. data/lib/decidim/proposals/seeds.rb +278 -0
  238. data/lib/decidim/proposals/test/factories.rb +105 -72
  239. data/lib/decidim/proposals/valuatable.rb +1 -2
  240. data/lib/decidim/proposals/version.rb +1 -1
  241. metadata +57 -69
  242. data/app/cells/decidim/proposals/collaborative_draft_m/footer.erb +0 -6
  243. data/app/cells/decidim/proposals/collaborative_draft_m/tags.erb +0 -1
  244. data/app/cells/decidim/proposals/collaborative_draft_m_cell.rb +0 -44
  245. data/app/cells/decidim/proposals/content_blocks/highlighted_proposals/elements.erb +0 -5
  246. data/app/cells/decidim/proposals/content_blocks/highlighted_proposals/heading.erb +0 -1
  247. data/app/cells/decidim/proposals/proposal_link_to_rejected_emendation/show.erb +0 -9
  248. data/app/cells/decidim/proposals/proposal_m/footer.erb +0 -26
  249. data/app/cells/decidim/proposals/proposal_m/tags.erb +0 -1
  250. data/app/cells/decidim/proposals/proposal_m_cell.rb +0 -151
  251. data/app/cells/decidim/proposals/proposal_tags/show.erb +0 -33
  252. data/app/cells/decidim/proposals/proposal_tags_cell.rb +0 -35
  253. data/app/cells/decidim/proposals/proposals_picker/proposals.erb +0 -12
  254. data/app/controllers/concerns/decidim/proposals/admin/picker.rb +0 -21
  255. data/app/controllers/decidim/proposals/widgets_controller.rb +0 -29
  256. data/app/helpers/decidim/proposals/admin/filterable_helper.rb +0 -17
  257. data/app/helpers/decidim/proposals/admin/proposals_picker_helper.rb +0 -30
  258. data/app/packs/src/decidim/proposals/admin/proposals_picker.js +0 -50
  259. data/app/packs/stylesheets/decidim/proposals/_proposals.scss +0 -1
  260. data/app/packs/stylesheets/decidim/proposals/proposals/_preview.scss +0 -3
  261. data/app/views/decidim/proposals/collaborative_drafts/_count.html.erb +0 -1
  262. data/app/views/decidim/proposals/collaborative_drafts/_filters.html.erb +0 -32
  263. data/app/views/decidim/proposals/collaborative_drafts/_filters_small_view.html.erb +0 -18
  264. data/app/views/decidim/proposals/collaborative_drafts/_new_collaborative_draft_button.html.erb +0 -11
  265. data/app/views/decidim/proposals/collaborative_drafts/_wizard_aside.html.erb +0 -13
  266. data/app/views/decidim/proposals/collaborative_drafts/_wizard_header.html.erb +0 -14
  267. data/app/views/decidim/proposals/proposals/_count.html.erb +0 -1
  268. data/app/views/decidim/proposals/proposals/_dynamic_map_instructions.html.erb +0 -4
  269. data/app/views/decidim/proposals/proposals/_filters.html.erb +0 -48
  270. data/app/views/decidim/proposals/proposals/_filters_small_view.html.erb +0 -18
  271. data/app/views/decidim/proposals/proposals/_proposal_similar.html.erb +0 -22
  272. data/app/views/decidim/proposals/proposals/_wizard_aside.html.erb +0 -20
  273. data/app/views/decidim/proposals/proposals/participatory_texts/_index.html.erb +0 -19
  274. data/app/views/decidim/proposals/versions/index.html.erb +0 -16
  275. data/config/locales/he-IL.yml +0 -1
  276. data/db/migrate/20240404202756_add_valuation_assignments_count_to_decidim_proposals_proposals.rb +0 -16
  277. data/decidim-proposals.gemspec +0 -40
  278. data/lib/decidim/proposals/test/capybara_proposals_picker.rb +0 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85856f36076b1726e3bfe1f049f46968909f1acd6ded28784a020abe858dddbd
4
- data.tar.gz: 9329f0d81040190473850146061ebcf3778c669cec4b22a3d1778cc01b568b03
3
+ metadata.gz: f4261c8defc7335c582aafffe209f651b972ca1e3302dad3844ef31e53324f14
4
+ data.tar.gz: 17ea361750db85baad4063d0f1bb400548f9e07fd39a15e41a78d474908692d8
5
5
  SHA512:
6
- metadata.gz: 2aff02ae9dfbf6e0f0d87014e79344a4ec1e995af11a4d51196702506de9cdc2c356276a096a0b25fbe96060945d56cc56a6e1dc3e06803f490d7267b5b331cf
7
- data.tar.gz: 1dd27d121005ba63c91f56db70f540f265ef3a4579e0de837a5307f2acda20a54281d0c67621deb0e0465e9c87c20a2daf901f85a4fd7e2b92ef3ebcb56f674e
6
+ metadata.gz: 76c72ecf3698d323fa6cc2beef6c08624108789fcad59e85a2afed9eba97f6e868abe01e03aea32cb06f84f1bb45ae04eadecdc0dcab14cdf93b0e2e1f5242d1
7
+ data.tar.gz: 54515a7042a4327fb35efb96ba26e7f9ea22c41fa6a00752ab85a8d71a466d17e73b8a59a8bc0a5f0b1f5066b26f162ef6e621e1c4656813ebd6230f48d40752
@@ -18,7 +18,7 @@ module Decidim
18
18
  private
19
19
 
20
20
  def card_size
21
- "decidim/proposals/collaborative_draft_m"
21
+ "decidim/proposals/collaborative_draft_l"
22
22
  end
23
23
 
24
24
  def resource_path
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "cell/partial"
4
+
5
+ module Decidim
6
+ module Proposals
7
+ # This cell renders a proposal with its L-size card.
8
+ class CollaborativeDraftLCell < Decidim::CardLCell
9
+ private
10
+
11
+ def metadata_cell
12
+ "decidim/proposals/collaborative_draft_metadata"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,13 +1,5 @@
1
- <div>
2
- <%= link_header %>
3
- </div>
4
-
5
- <div>
6
- <%= link_help_text %>
7
- </div>
8
-
9
- <%= link_to_resource %>
10
-
11
- <div class="mt-xs">
12
- <%= link_to_versions %>
1
+ <div class="flex flex-col gap-2 items-center">
2
+ <h3 class="h3"><%= t("final_proposal", scope: "decidim.proposals.collaborative_drafts.show") %></h3>
3
+ <p class="text-center text-gray-2"><%= t("final_proposal_help_text", scope: "decidim.proposals.collaborative_drafts.show") %></p>
4
+ <%= link_to t("published_proposal", scope: "decidim.proposals.collaborative_drafts.show"), resource_locator(@proposal).path, class: "button button__lg button__secondary w-full mt-4" %>
13
5
  </div>
@@ -16,35 +16,6 @@ module Decidim
16
16
  @proposal ||= model.linked_resources(:proposal, "created_from_collaborative_draft").first
17
17
  end
18
18
 
19
- def link_to_resource
20
- link_to resource_locator(proposal).path, class: "button secondary light expanded button--sc mt-s" do
21
- t("published_proposal", scope: "decidim.proposals.collaborative_drafts.show")
22
- end
23
- end
24
-
25
- def link_header
26
- tag.strong(class: "text-large") do
27
- t("final_proposal", scope: "decidim.proposals.collaborative_drafts.show")
28
- end
29
- end
30
-
31
- def link_help_text
32
- tag.span(class: "text-medium") do
33
- t("final_proposal_help_text", scope: "decidim.proposals.collaborative_drafts.show")
34
- end
35
- end
36
-
37
- def link_to_versions
38
- @path ||= decidim_proposals.collaborative_draft_versions_path(
39
- collaborative_draft_id: model.id
40
- )
41
- link_to @path, class: "text-medium" do
42
- tag.u do
43
- t("version_history", scope: "decidim.proposals.collaborative_drafts.show")
44
- end
45
- end
46
- end
47
-
48
19
  def decidim
49
20
  Decidim::Core::Engine.routes.url_helpers
50
21
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Proposals
5
+ # This cell renders metadata for an instance of a CollaborativeDraft
6
+ class CollaborativeDraftMetadataCell < Decidim::CardMetadataCell
7
+ include Decidim::Proposals::ApplicationHelper
8
+
9
+ delegate :state, to: :model
10
+
11
+ def initialize(*)
12
+ super
13
+
14
+ @items.prepend(*collaborative_draft_items)
15
+ end
16
+
17
+ private
18
+
19
+ def collaborative_draft_items
20
+ [coauthors_item, comments_count_item, endorsements_count_item, state_item]
21
+ end
22
+
23
+ def state_item
24
+ return if state.blank?
25
+
26
+ { text: content_tag(:span, humanize_collaborative_draft_state(state), class: "label #{collaborative_drafts_state_class(state)}") }
27
+ end
28
+ end
29
+ end
30
+ end
@@ -3,16 +3,10 @@
3
3
  module Decidim
4
4
  module Proposals
5
5
  module ContentBlocks
6
- class HighlightedProposalsCell < Decidim::ContentBlocks::HighlightedElementsCell
7
- def base_relation
8
- @base_relation ||= Decidim::Proposals::Proposal.published.not_hidden.except_withdrawn.where(component: published_components)
9
- end
10
-
6
+ class HighlightedProposalsCell < Decidim::ContentBlocks::HighlightedElementsWithCellForListCell
11
7
  private
12
8
 
13
- def limit
14
- Decidim::Proposals.config.process_group_highlighted_proposals_limit
15
- end
9
+ def list_cell_path = "decidim/proposals/highlighted_proposals_for_component"
16
10
  end
17
11
  end
18
12
  end
@@ -1,35 +1,6 @@
1
- <div id="proposal-costs" class="card card--secondary" data-toggler=".expanded-text">
2
- <div class="card__content">
3
- <div class="mb-s">
4
- <div class="data-title">
5
- <h3 class="data-title__over">
6
- <%= t("decidim.proposals.proposals.show.estimated_cost") %>
7
- </h3>
8
- <div>
9
- <strong class="data-title__main">
10
- <%= cost %>
11
- </strong>
12
- </div>
13
- <div class="data-title__sub">
14
- <%= execution_period %>
15
- </div>
16
- </div>
17
- </div>
18
- <div id="execution-cost-short" class="text-toggle__short">
19
- <%= cost_report_short %>
20
- <% if needs_text_toggle? %>
21
- <button class="muted-link" data-toggle="proposal-costs">
22
- <%= t("decidim.proposals.proposals.show.read_more") %>
23
- </button>
24
- <% end %>
25
- </div>
26
- <% if needs_text_toggle? %>
27
- <div id="execution-cost-long" class="text-toggle__long">
28
- <%= cost_report %>
29
- <button class="muted-link" data-toggle="proposal-costs">
30
- <%= t("decidim.proposals.proposals.show.read_less") %>
31
- </button>
32
- </div>
33
- <% end %>
34
- </div>
1
+ <div id="proposal-costs" class="proposal__cost">
2
+ <h2 class="h4"><%= t("decidim.proposals.proposals.show.estimated_cost") %></h2>
3
+ <div class="h2"><%= cost %></div>
4
+ <div class="proposal__cost-period"><%= execution_period %></div>
5
+ <%= cost_report %>
35
6
  </div>
@@ -21,19 +21,6 @@ module Decidim
21
21
  decidim_sanitize_editor(translated_attribute(model.cost_report).html_safe)
22
22
  end
23
23
 
24
- def needs_text_toggle?
25
- cost_report != cost_report_short
26
- end
27
-
28
- def cost_report_short
29
- decidim_sanitize_editor(
30
- html_truncate(
31
- translated_attribute(model.cost_report).html_safe,
32
- length: 200
33
- )
34
- )
35
- end
36
-
37
24
  def execution_period
38
25
  decidim_sanitize_editor(translated_attribute(model.execution_period).html_safe)
39
26
  end
@@ -1,19 +1,31 @@
1
- <section class="section row collapse highlighted_proposals">
2
- <h3 class="section-heading">
3
- <%= decidim_escape_translated(model.name) %> <a href="<%= main_component_path(model) %>" class="text-small"><%= t("decidim.participatory_spaces.highlighted_proposals.see_all", count: proposals_count) %></a>
4
- </h3>
1
+ <div class="content-block__title">
2
+ <h2 class="h2 decorator">
3
+ <%= single_component? ? translated_attribute(model.name) : t("decidim.components.proposals.name") %>
4
+ </h2>
5
+ <div class="label text-lg"><%= proposals_count %></div>
6
+ <% if single_component? %>
7
+ <%= link_to decidim_proposals.root_path, class: "button button__sm button__text-secondary" do %>
8
+ <span><%= t("decidim.participatory_spaces.highlighted_proposals.see_all") %></span>
9
+ <%= icon "arrow-right-line" %>
10
+ <% end %>
11
+ <% end %>
12
+ </div>
5
13
 
6
- <%= cell(
7
- "decidim/collapsible_list",
8
- proposals_to_render,
9
- cell_options: {},
10
- list_class: "row small-up-1 medium-up-2 card-grid",
11
- size: proposals_count
12
- ) %>
14
+ <div class="flex items-start justify-between">
15
+ <div class="grow space-y-6">
16
+ <span class="content-block__span">
17
+ <%= t("decidim.participatory_spaces.highlighted_proposals.last") %>
18
+ </span>
13
19
 
14
- <%= link_to(
15
- t("decidim.participatory_spaces.highlighted_proposals.see_all", count: proposals_count),
16
- main_component_path(model),
17
- class: "button button--sc hollow button--right"
18
- ) %>
19
- </section>
20
+ <% proposals_to_render.each do |p| %>
21
+ <%= card_for p, link_whole_card: true, title_tag: :h3, **options.slice(:show_space) %>
22
+ <% end %>
23
+ </div>
24
+
25
+ <% if single_component? %>
26
+ <%= link_to decidim_proposals.new_proposal_path, class: "button button__sm md:button__lg button__secondary" do %>
27
+ <span><%= t("decidim.proposals.actions.new") %></span>
28
+ <%= icon "add-line" %>
29
+ <% end %>
30
+ <% end %>
31
+ </div>
@@ -9,25 +9,47 @@ module Decidim
9
9
  # view hook.
10
10
  class HighlightedProposalsForComponentCell < Decidim::ViewModel
11
11
  include Decidim::ComponentPathHelper
12
+ include Decidim::CardHelper
12
13
 
13
14
  def show
14
- render unless proposals_count.zero?
15
+ render unless items_blank?
16
+ end
17
+
18
+ def items_blank?
19
+ proposals_count.zero?
15
20
  end
16
21
 
17
22
  private
18
23
 
24
+ def proposals_count
25
+ @proposals_count ||= base_relation.size
26
+ end
27
+
19
28
  def proposals
20
- @proposals ||= Decidim::Proposals::Proposal.published.not_hidden.except_withdrawn
21
- .where(component: model)
22
- .order_randomly((rand * 2) - 1)
29
+ @proposals ||= case options[:order]
30
+ when "recent"
31
+ base_relation.order_by_most_recent
32
+ else
33
+ base_relation.order_randomly(random_seed)
34
+ end
23
35
  end
24
36
 
25
- def proposals_to_render
26
- @proposals_to_render ||= proposals.includes([:amendable, :category, :component, :scope]).limit(Decidim::Proposals.config.participatory_space_highlighted_proposals_limit)
37
+ def base_relation
38
+ Decidim::Proposals::Proposal.published.not_hidden.except_withdrawn.where(component: model)
27
39
  end
28
40
 
29
- def proposals_count
30
- @proposals_count ||= proposals.count
41
+ def decidim_proposals
42
+ return unless single_component?
43
+
44
+ Decidim::EngineRouter.main_proxy(model)
45
+ end
46
+
47
+ def single_component?
48
+ @single_component ||= model.is_a?(Decidim::Component)
49
+ end
50
+
51
+ def proposals_to_render
52
+ @proposals_to_render ||= proposals.includes([:amendable, :category, :component, :scope]).limit(Decidim::Proposals.config.participatory_space_highlighted_proposals_limit)
31
53
  end
32
54
 
33
55
  def cache_hash
@@ -37,6 +59,10 @@ module Decidim
37
59
  hash << I18n.locale.to_s
38
60
  hash.join(Decidim.cache_key_separator)
39
61
  end
62
+
63
+ def random_seed
64
+ (rand * 2) - 1
65
+ end
40
66
  end
41
67
  end
42
68
  end
@@ -1,27 +1,19 @@
1
1
  <%= button_reveal_modal %>
2
2
 
3
- <div id="<%= modal_id %>" class="reveal" data-reveal aria-labelledby="<%= modal_id %>-title" aria-hidden="true" role="dialog">
4
- <div class="reveal__header">
5
- <h3 id="<%= modal_id %>-title" class="reveal__title">
3
+ <%= decidim_modal id: modal_id do %>
4
+ <div data-dialog-container>
5
+ <%= icon "draft-line" %>
6
+ <h3 class="h3" id="dialog-title-<%= modal_id %>" tabindex="-1" data-dialog-title>
6
7
  <%= modal_title %>
7
8
  </h3>
8
9
 
9
- <button class="close-button" data-close aria-label="<%= close_label %>" type="button">
10
- <span aria-hidden="true">&times;</span>
11
- </button>
10
+ <p>
11
+ <%= modal_body %>
12
+ </p>
12
13
  </div>
13
14
 
14
- <div class="row">
15
- <div>
16
- <p>
17
- <%= modal_body %>
18
- </p>
19
- </div>
20
- </div>
21
-
22
- <div class="row">
15
+ <div data-dialog-actions>
23
16
  <%= button_cancel %>
24
-
25
17
  <%= button_continue %>
26
18
  </div>
27
- </div>
19
+ <% end %>
@@ -33,11 +33,11 @@ module Decidim
33
33
  end
34
34
 
35
35
  def button_reveal_modal
36
- data = { open: modal_id }
36
+ data = { "dialog-open": modal_id }
37
37
  label = t(action, scope: "decidim.proposals.collaborative_drafts.show")
38
- css = publish? ? "button expanded button--sc" : "secondary"
38
+ css = publish? ? "button button__lg button__secondary w-full" : "text-secondary"
39
39
 
40
- button_tag label, type: "button", class: css, data: data
40
+ button_tag label, type: "button", class: css, data:
41
41
  end
42
42
 
43
43
  def modal_title
@@ -51,8 +51,8 @@ module Decidim
51
51
  def button_continue
52
52
  label = t("ok", scope: "decidim.proposals.collaborative_drafts.collaborative_draft.#{action}.irreversible_action_modal")
53
53
  path = resource_path action
54
- css = "button expanded"
55
- button_to label, path, class: css, form_class: "columns medium-6"
54
+ css = "button button__lg button__secondary"
55
+ button_to label, path, class: css
56
56
  end
57
57
 
58
58
  def close_label
@@ -60,10 +60,8 @@ module Decidim
60
60
  end
61
61
 
62
62
  def button_cancel
63
- tag.div(class: "columns medium-6") do
64
- button_tag type: "button", class: "clear button secondary expanded", "data-close": "" do
65
- close_label
66
- end
63
+ button_tag type: "button", class: "button button__lg button__transparent-secondary", "data-dialog-close": modal_id do
64
+ close_label
67
65
  end
68
66
  end
69
67
 
@@ -1,33 +1,23 @@
1
- <div class="columns mediumlarge-4 hidden-section p-sm">
2
- <div class="medium-8">
3
- <%= follow_button_for(model, true) %>
4
- <% if amendmendment_creation_enabled? || visible_emendations.any? %>
5
- <div class="button-group button-group--collapse mb-s row collapse amend-buttons">
6
- <%= link_to resource_amendments_path, class: "column medium-4 button light secondary" do %>
7
- <%= visible_emendations.count %>
8
- <% end %>
9
- <%= action_authorized_link_to :amend, amend_resource_path, resource: model, data: { "redirect_url" => amend_resource_path }, class: "column button hollow secondary button--sc", disabled: amend_button_disabled? do %>
10
- <%= t("amend", scope: "decidim.proposals.participatory_text_proposal.buttons") %>
11
- <% end %>
12
- </div>
1
+ <% if amendmendment_creation_enabled? || visible_emendations.any? %>
2
+ <%= link_to amend_resource_path, disabled: amend_button_disabled?, class: "proposal-participatory__button" do %>
3
+ <%= icon "chat-1-line" %>
4
+ <span><%= t("amend", scope: "decidim.proposals.participatory_text_proposal.buttons") %></span>
5
+ <div class="label"><%= visible_emendations.count %></div>
6
+ <% end %>
7
+ <% end %>
8
+
9
+ <% if component_settings.comments_enabled? %>
10
+ <% if current_settings.comments_blocked? %>
11
+ <%= content_tag :button, disabled: true, class: "proposal-participatory__button" do %>
12
+ <%= icon "chat-1-line" %>
13
+ <span><%= t("comment", scope: "decidim.proposals.participatory_text_proposal.buttons") %></span>
14
+ <div class="label"><%= model.comments_count %></div>
13
15
  <% end %>
14
- <% if component_settings.comments_enabled? %>
15
- <div class="button-group button-group--collapse row collapse comment-buttons">
16
- <% if current_settings.comments_blocked? %>
17
- <%= content_tag :button, class: "column medium-4 button light secondary" do %>
18
- <%= icon "comment-square", class: "icon--small", aria_label: t("comments", scope: "decidim.proposals.participatory_text_proposal.buttons"), role: "img" %>
19
- <%= model.comments_count %>
20
- <% end %>
21
- <%= content_tag :button, t("comment", scope: "decidim.proposals.participatory_text_proposal.buttons"), class: "column button hollow secondary button--sc disabled", disabled: true, title: t("comment", scope: "decidim.proposals.participatory_text_proposal.buttons") %>
22
- <% else %>
23
- <%= link_to resource_comments_path, class: "column medium-4 button light secondary" do %>
24
- <%= icon "comment-square", class: "icon--small", aria_label: t("comments", scope: "decidim.proposals.participatory_text_proposal.buttons"), role: "img" %> <%= model.comments_count %>
25
- <% end %>
26
- <%= action_authorized_link_to :comment, resource_comments_path, resource: model, class: "column button hollow secondary button--sc" do %>
27
- <%= t("comment", scope: "decidim.proposals.participatory_text_proposal.buttons") %>
28
- <% end %>
29
- <% end %>
30
- </div>
16
+ <% else %>
17
+ <%= link_to resource_comments_path, class: "proposal-participatory__button" do %>
18
+ <%= icon "chat-1-line" %>
19
+ <span><%= t("comment", scope: "decidim.proposals.participatory_text_proposal.buttons") %></span>
20
+ <div class="label"><%= model.comments_count %></div>
31
21
  <% end %>
32
- </div>
33
- </div>
22
+ <% end %>
23
+ <% end %>
@@ -1,9 +1,5 @@
1
- <div class="row hover-section">
2
- <div class="columns mediumlarge-8">
3
- <%= link_to resource_path, class: "card__link--block pt-s pb-s" do %>
4
- <%= title %>
5
- <%= body %>
6
- <% end %>
7
- </div>
8
- <%= render :buttons %>
9
- </div>
1
+ <section id="<%= dom_id(model) %>" class="proposal-participatory__section">
2
+ <%= link_to section_title, resource_path, class: "proposal-participatory__title" %>
3
+ <div class="proposal-participatory__text"><%= body %></div>
4
+ <div class="flex"><%= render :buttons %></div>
5
+ </section>
@@ -18,15 +18,6 @@ module Decidim
18
18
 
19
19
  private
20
20
 
21
- def title
22
- case model.participatory_text_level
23
- when "section"
24
- "<h5><strong>#{section_title}</strong></h5>"
25
- else
26
- "<h6><strong>#{section_title}</strong></h6>"
27
- end
28
- end
29
-
30
21
  def section_title
31
22
  decidim_html_escape(present(model).title).html_safe
32
23
  end
@@ -5,18 +5,7 @@ module Decidim
5
5
  # A cell to display when actions happen on a proposal.
6
6
  class ProposalActivityCell < ActivityCell
7
7
  def title
8
- case action
9
- when "update"
10
- I18n.t(
11
- "decidim.proposals.last_activity.proposal_updated_at_html",
12
- link: participatory_space_link
13
- )
14
- else
15
- I18n.t(
16
- "decidim.proposals.last_activity.new_proposal_at_html",
17
- link: participatory_space_link
18
- )
19
- end
8
+ action == "update" ? I18n.t("decidim.proposals.last_activity.proposal_updated") : I18n.t("decidim.proposals.last_activity.new_proposal")
20
9
  end
21
10
 
22
11
  def resource_link_text
@@ -18,7 +18,12 @@ module Decidim
18
18
  private
19
19
 
20
20
  def card_size
21
- "decidim/proposals/proposal_m"
21
+ case @options[:size]
22
+ when :s
23
+ "decidim/proposals/proposal_s"
24
+ else
25
+ "decidim/proposals/proposal_l"
26
+ end
22
27
  end
23
28
 
24
29
  def resource_path
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "cell/partial"
4
+
5
+ module Decidim
6
+ module Proposals
7
+ # This cell renders the List (:l) proposal card
8
+ # for an instance of a Proposal
9
+ class ProposalLCell < Decidim::CardLCell
10
+ delegate :component_settings, to: :controller
11
+
12
+ alias proposal model
13
+
14
+ def title
15
+ present(proposal).title(html_escape: true)
16
+ end
17
+
18
+ private
19
+
20
+ def metadata_cell
21
+ "decidim/proposals/proposal_metadata"
22
+ end
23
+
24
+ def cache_hash
25
+ hash = []
26
+ hash << I18n.locale.to_s
27
+ hash << model.cache_key_with_version
28
+ hash << model.proposal_votes_count
29
+ hash << model.endorsements_count
30
+ hash << model.comments_count
31
+ hash << Digest::MD5.hexdigest(model.component.cache_key_with_version)
32
+ hash << Digest::MD5.hexdigest(resource_image_path) if resource_image_path
33
+ hash << render_space? ? 1 : 0
34
+ if current_user
35
+ hash << current_user.cache_key_with_version
36
+ hash << current_user.follows?(model) ? 1 : 0
37
+ end
38
+ hash << model.follows_count
39
+ hash << Digest::MD5.hexdigest(model.authors.map(&:cache_key_with_version).to_s)
40
+ hash << (model.must_render_translation?(model.organization) ? 1 : 0) if model.respond_to?(:must_render_translation?)
41
+ hash << model.component.participatory_space.active_step.id if model.component.participatory_space.try(:active_step)
42
+
43
+ hash.join(Decidim.cache_key_separator)
44
+ end
45
+ end
46
+ end
47
+ end
@@ -12,10 +12,12 @@ module Decidim
12
12
  @linked_resource ||= model.linked_resources(:collaborative_draft, "created_from_collaborative_draft").first
13
13
  end
14
14
 
15
- def link_to_resource
16
- link_to resource_locator(linked_resource).path, class: "link" do
17
- t("link_to_collaborative_draft_text", scope: "decidim.proposals.proposals.show")
18
- end
15
+ def link_to_resource_url
16
+ resource_locator(linked_resource).path
17
+ end
18
+
19
+ def link_to_resource_text
20
+ t("link_to_collaborative_draft_text", scope: "decidim.proposals.proposals.show")
19
21
  end
20
22
 
21
23
  def link_help_text
@@ -12,13 +12,15 @@ module Decidim
12
12
  @linked_resource ||= model.linked_promoted_resource
13
13
  end
14
14
 
15
- def link_to_resource
16
- link_to resource_locator(linked_resource).path, class: "link" do
17
- if model.emendation?
18
- t("link_to_proposal_from_emendation_text", scope: "decidim.proposals.proposals.show")
19
- else
20
- t("link_to_promoted_emendation_text", scope: "decidim.proposals.proposals.show")
21
- end
15
+ def link_to_resource_url
16
+ resource_locator(linked_resource).path
17
+ end
18
+
19
+ def link_to_resource_text
20
+ if model.emendation?
21
+ t("link_to_proposal_from_emendation_text", scope: "decidim.proposals.proposals.show")
22
+ else
23
+ t("link_to_promoted_emendation_text", scope: "decidim.proposals.proposals.show")
22
24
  end
23
25
  end
24
26
 
@@ -1,9 +1,4 @@
1
- <div class="text-center mt-sm">
2
- <%= link_to_resource %>
3
-
4
- <div class="text-center">
5
- <small>
6
- <%= link_help_text %>
7
- </small>
8
- </div>
1
+ <div class="text-center space-y-4">
2
+ <span class="block text-gray-2 text-xs"><%= link_help_text %></span>
3
+ <%= link_to link_to_resource_text, link_to_resource_url, class: "text-secondary hover:underline block" %>
9
4
  </div>