decidim-core 0.26.10 → 0.27.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-core might be problematic. Click here for more details.

Files changed (643) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/cells/decidim/amendable/announcement_cell.rb +4 -9
  4. data/app/cells/decidim/announcement_cell.rb +2 -2
  5. data/app/cells/decidim/author_cell.rb +1 -1
  6. data/app/cells/decidim/card_m_cell.rb +1 -1
  7. data/app/cells/decidim/collapsible_list/show.erb +1 -1
  8. data/app/cells/decidim/content_blocks/cta/show.erb +1 -1
  9. data/app/cells/decidim/content_blocks/cta_cell.rb +1 -1
  10. data/app/cells/decidim/content_blocks/footer_sub_hero/show.erb +1 -1
  11. data/app/cells/decidim/content_blocks/hero/show.erb +2 -2
  12. data/app/cells/decidim/content_blocks/highlighted_content_banner/show.erb +5 -5
  13. data/app/cells/decidim/content_blocks/highlighted_elements_cell.rb +1 -1
  14. data/app/cells/decidim/content_blocks/how_to_participate/show.erb +1 -1
  15. data/app/cells/decidim/content_blocks/last_activity/show.erb +1 -1
  16. data/app/cells/decidim/content_blocks/last_activity_cell.rb +3 -3
  17. data/app/cells/decidim/content_blocks/stats_cell.rb +4 -5
  18. data/app/cells/decidim/content_blocks/sub_hero/show.erb +1 -1
  19. data/app/cells/decidim/content_blocks/sub_hero_cell.rb +1 -1
  20. data/app/cells/decidim/data_consent/category.erb +64 -0
  21. data/app/cells/decidim/data_consent/dialog.erb +29 -0
  22. data/app/cells/decidim/data_consent/modal.erb +39 -0
  23. data/app/cells/decidim/data_consent/show.erb +3 -0
  24. data/app/cells/decidim/data_consent_cell.rb +21 -0
  25. data/app/cells/decidim/follow_button_cell.rb +5 -7
  26. data/app/cells/decidim/newsletter_templates/base_cell.rb +0 -8
  27. data/app/cells/decidim/newsletter_templates/basic_only_text/show.erb +4 -4
  28. data/app/cells/decidim/newsletter_templates/image_text_cta/show.erb +4 -4
  29. data/app/cells/decidim/profile_sidebar_cell.rb +1 -1
  30. data/app/cells/decidim/search_results_cell.rb +1 -1
  31. data/app/cells/decidim/tos_page/refuse_btn_modal.erb +1 -1
  32. data/app/cells/decidim/upload_modal/files.erb +52 -0
  33. data/app/cells/decidim/upload_modal/modal.erb +49 -0
  34. data/app/cells/decidim/upload_modal/show.erb +3 -0
  35. data/app/cells/decidim/upload_modal_cell.rb +205 -0
  36. data/app/cells/decidim/user_conversation/reply.erb +1 -1
  37. data/app/cells/decidim/user_conversations/add_conversation_users.erb +5 -3
  38. data/app/cells/decidim/version_cell.rb +3 -14
  39. data/app/cells/decidim/versions_list_cell.rb +3 -14
  40. data/app/cells/decidim/versions_list_item_cell.rb +2 -13
  41. data/app/commands/decidim/accept_group_invitation.rb +1 -1
  42. data/app/commands/decidim/accept_user_group_join_request.rb +1 -1
  43. data/app/commands/decidim/amendable/accept.rb +1 -1
  44. data/app/commands/decidim/amendable/create_draft.rb +1 -1
  45. data/app/commands/decidim/amendable/destroy_draft.rb +1 -1
  46. data/app/commands/decidim/amendable/promote.rb +1 -1
  47. data/app/commands/decidim/amendable/publish_draft.rb +1 -1
  48. data/app/commands/decidim/amendable/reject.rb +1 -1
  49. data/app/commands/decidim/amendable/update_draft.rb +1 -1
  50. data/app/commands/decidim/amendable/withdraw.rb +1 -1
  51. data/app/commands/decidim/attachment_methods.rb +3 -2
  52. data/app/commands/decidim/create_editor_image.rb +1 -1
  53. data/app/commands/decidim/create_follow.rb +1 -1
  54. data/app/commands/decidim/create_omniauth_registration.rb +2 -3
  55. data/app/commands/decidim/create_registration.rb +1 -2
  56. data/app/commands/decidim/create_report.rb +1 -1
  57. data/app/commands/decidim/create_user_group.rb +2 -2
  58. data/app/commands/decidim/create_user_report.rb +5 -3
  59. data/app/commands/decidim/delete_follow.rb +1 -1
  60. data/app/commands/decidim/demote_membership.rb +1 -1
  61. data/app/commands/decidim/destroy_account.rb +1 -1
  62. data/app/commands/decidim/endorse_resource.rb +1 -3
  63. data/app/commands/decidim/gallery_methods.rb +45 -10
  64. data/app/commands/decidim/invite_user.rb +1 -3
  65. data/app/commands/decidim/invite_user_again.rb +1 -1
  66. data/app/commands/decidim/invite_user_to_group.rb +1 -1
  67. data/app/commands/decidim/join_user_group.rb +1 -1
  68. data/app/commands/decidim/leave_user_group.rb +8 -2
  69. data/app/commands/decidim/messaging/reply_to_conversation.rb +2 -2
  70. data/app/commands/decidim/messaging/start_conversation.rb +2 -2
  71. data/app/commands/decidim/multiple_attachments_methods.rb +44 -5
  72. data/app/commands/decidim/promote_membership.rb +1 -1
  73. data/app/commands/decidim/reject_group_invitation.rb +1 -1
  74. data/app/commands/decidim/reject_user_group_join_request.rb +1 -1
  75. data/app/commands/decidim/remove_user_from_group.rb +1 -1
  76. data/app/commands/decidim/resend_confirmation_instructions.rb +18 -0
  77. data/app/commands/decidim/search.rb +10 -9
  78. data/app/commands/decidim/unendorse_resource.rb +2 -2
  79. data/app/commands/decidim/unsubscribe_settings.rb +1 -1
  80. data/app/commands/decidim/update_account.rb +2 -2
  81. data/app/commands/decidim/update_notifications_settings.rb +3 -2
  82. data/app/commands/decidim/update_password.rb +31 -0
  83. data/app/commands/decidim/update_user_group.rb +2 -2
  84. data/app/commands/decidim/update_user_interests.rb +1 -1
  85. data/app/commands/decidim/validate_upload.rb +15 -0
  86. data/app/controllers/concerns/decidim/devise_controllers.rb +0 -1
  87. data/app/controllers/concerns/decidim/filter_resource.rb +23 -24
  88. data/app/controllers/concerns/decidim/force_authentication.rb +1 -2
  89. data/app/controllers/concerns/decidim/http_caching_disabler.rb +1 -1
  90. data/app/controllers/concerns/decidim/needs_password_change.rb +43 -0
  91. data/app/controllers/concerns/decidim/needs_tos_accepted.rb +3 -3
  92. data/app/controllers/concerns/decidim/orderable.rb +1 -1
  93. data/app/controllers/concerns/decidim/participatory_space_context.rb +2 -2
  94. data/app/controllers/concerns/decidim/resource_versions_concern.rb +0 -4
  95. data/app/controllers/decidim/account_controller.rb +45 -0
  96. data/app/controllers/decidim/application_controller.rb +1 -1
  97. data/app/controllers/decidim/authorization_modals_controller.rb +1 -1
  98. data/app/controllers/decidim/devise/invitations_controller.rb +4 -9
  99. data/app/controllers/decidim/devise/passwords_controller.rb +33 -0
  100. data/app/controllers/decidim/devise/registrations_controller.rb +3 -5
  101. data/app/controllers/decidim/devise/sessions_controller.rb +2 -0
  102. data/app/controllers/decidim/{data_portability_controller.rb → download_your_data_controller.rb} +8 -8
  103. data/app/controllers/decidim/groups_controller.rb +5 -5
  104. data/app/controllers/decidim/last_activities_controller.rb +7 -9
  105. data/app/controllers/decidim/links_controller.rb +11 -10
  106. data/app/controllers/decidim/manifests_controller.rb +11 -0
  107. data/app/controllers/decidim/newsletters_controller.rb +1 -1
  108. data/app/controllers/decidim/notifications_subscriptions_controller.rb +16 -0
  109. data/app/controllers/decidim/offline_controller.rb +7 -0
  110. data/app/controllers/decidim/profiles_controller.rb +2 -2
  111. data/app/controllers/decidim/searches_controller.rb +4 -3
  112. data/app/controllers/decidim/short_links_controller.rb +35 -0
  113. data/app/controllers/decidim/upload_validations_controller.rb +44 -0
  114. data/app/controllers/decidim/user_activities_controller.rb +32 -16
  115. data/app/controllers/decidim/user_interests_controller.rb +0 -2
  116. data/app/controllers/decidim/user_timeline_controller.rb +7 -9
  117. data/app/events/decidim/change_nickname_event.rb +21 -0
  118. data/app/events/decidim/resource_endorsed_event.rb +1 -2
  119. data/app/forms/decidim/account_form.rb +4 -4
  120. data/app/forms/decidim/amendable/form.rb +1 -2
  121. data/app/forms/decidim/form.rb +1 -1
  122. data/app/forms/decidim/messaging/conversation_form.rb +1 -1
  123. data/app/forms/decidim/notifications_settings_form.rb +16 -2
  124. data/app/forms/decidim/password_form.rb +10 -0
  125. data/app/forms/decidim/registration_form.rb +3 -3
  126. data/app/forms/decidim/upload_validation_form.rb +54 -0
  127. data/app/forms/decidim/user_group_form.rb +1 -1
  128. data/app/forms/decidim/user_interest_scope_form.rb +1 -1
  129. data/app/forms/decidim/user_interests_form.rb +1 -1
  130. data/app/forms/translatable_presence_validator.rb +2 -2
  131. data/app/forms/url_validator.rb +1 -1
  132. data/app/helpers/decidim/application_helper.rb +2 -2
  133. data/app/helpers/decidim/attachments_helper.rb +1 -1
  134. data/app/helpers/decidim/cells_helper.rb +0 -1
  135. data/app/helpers/decidim/cells_paginate_helper.rb +1 -1
  136. data/app/helpers/decidim/datalist_select_helper.rb +40 -0
  137. data/app/helpers/decidim/decidim_form_helper.rb +1 -1
  138. data/app/helpers/decidim/external_domain_helper.rb +3 -14
  139. data/app/helpers/decidim/filters_helper.rb +1 -5
  140. data/app/helpers/decidim/followable_helper.rb +1 -1
  141. data/app/helpers/decidim/icon_helper.rb +4 -4
  142. data/app/helpers/decidim/layout_helper.rb +19 -16
  143. data/app/helpers/decidim/map_helper.rb +12 -8
  144. data/app/helpers/decidim/meta_tags_helper.rb +0 -2
  145. data/app/helpers/decidim/newsletters_helper.rb +0 -1
  146. data/app/helpers/decidim/notifications_settings_helper.rb +15 -0
  147. data/app/helpers/decidim/passwords_helper.rb +41 -0
  148. data/app/helpers/decidim/resource_helper.rb +0 -2
  149. data/app/helpers/decidim/sanitize_helper.rb +6 -15
  150. data/app/helpers/decidim/searches_helper.rb +6 -6
  151. data/app/helpers/decidim/short_link_helper.rb +28 -0
  152. data/app/helpers/decidim/translations_helper.rb +2 -2
  153. data/app/jobs/decidim/{data_portability_export_job.rb → download_your_data_export_job.rb} +5 -8
  154. data/app/jobs/decidim/email_notifications_digest_generator_job.rb +21 -0
  155. data/app/jobs/decidim/notification_generator_for_recipient_job.rb +5 -3
  156. data/app/jobs/decidim/open_data_job.rb +0 -2
  157. data/app/jobs/decidim/reminder_generator_job.rb +12 -0
  158. data/app/jobs/decidim/resend_confirmation_instructions_job.rb +11 -0
  159. data/app/jobs/decidim/user_report_job.rb +2 -2
  160. data/app/mailers/concerns/decidim/multitenant_asset_host.rb +11 -3
  161. data/app/mailers/decidim/application_mailer.rb +1 -1
  162. data/app/mailers/decidim/block_user_mailer.rb +8 -7
  163. data/app/mailers/decidim/export_mailer.rb +2 -2
  164. data/app/mailers/decidim/newsletter_mailer.rb +5 -12
  165. data/app/mailers/decidim/newsletters_opt_in_mailer.rb +7 -5
  166. data/app/mailers/decidim/notification_mailer.rb +0 -1
  167. data/app/mailers/decidim/notifications_digest_mailer.rb +23 -0
  168. data/app/mailers/decidim/user_report_mailer.rb +10 -11
  169. data/app/models/decidim/action_log.rb +95 -11
  170. data/app/models/decidim/amendment.rb +0 -1
  171. data/app/models/decidim/area.rb +1 -2
  172. data/app/models/decidim/area_type.rb +5 -0
  173. data/app/models/decidim/attachment.rb +6 -0
  174. data/app/models/decidim/attachment_collection.rb +5 -0
  175. data/app/models/decidim/category.rb +9 -4
  176. data/app/models/decidim/coauthorship.rb +0 -2
  177. data/app/models/decidim/contextual_help_section.rb +5 -1
  178. data/app/models/decidim/follow.rb +2 -2
  179. data/app/models/decidim/gamification/badge_score.rb +0 -1
  180. data/app/models/decidim/identity.rb +2 -2
  181. data/app/models/decidim/messaging/conversation.rb +4 -4
  182. data/app/models/decidim/messaging/message.rb +1 -2
  183. data/app/models/decidim/messaging/participation.rb +0 -2
  184. data/app/models/decidim/messaging/receipt.rb +0 -2
  185. data/app/models/decidim/newsletter.rb +0 -28
  186. data/app/models/decidim/notification.rb +5 -2
  187. data/app/models/decidim/oauth_application.rb +12 -1
  188. data/app/models/decidim/organization.rb +7 -13
  189. data/app/models/decidim/participatory_space_private_user.rb +4 -2
  190. data/app/models/decidim/permission_action.rb +1 -0
  191. data/app/models/decidim/reminder.rb +10 -0
  192. data/app/models/decidim/reminder_delivery.rb +7 -0
  193. data/app/models/decidim/reminder_record.rb +29 -0
  194. data/app/models/decidim/report.rb +2 -2
  195. data/app/models/decidim/scope.rb +3 -4
  196. data/app/models/decidim/scope_type.rb +1 -24
  197. data/app/models/decidim/share_token.rb +0 -2
  198. data/app/models/decidim/short_link.rb +162 -0
  199. data/app/models/decidim/user.rb +35 -13
  200. data/app/models/decidim/user_base_entity.rb +1 -4
  201. data/app/models/decidim/user_block.rb +2 -2
  202. data/app/models/decidim/user_group.rb +4 -4
  203. data/app/models/decidim/user_moderation.rb +0 -2
  204. data/app/models/decidim/user_report.rb +2 -2
  205. data/app/packs/entrypoints/decidim_core.js +2 -2
  206. data/app/packs/entrypoints/decidim_sw.js +1 -0
  207. data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_invitations.svg +1 -0
  208. data/app/packs/src/decidim/autocomplete.js +298 -0
  209. data/app/packs/src/decidim/cookie_consent/consent_manager.js +133 -0
  210. data/app/packs/src/decidim/cookie_consent/cookie_consent.js +103 -0
  211. data/app/packs/src/decidim/datalist_select.js +36 -0
  212. data/app/packs/src/decidim/direct_uploads/upload_field.js +117 -0
  213. data/app/packs/src/decidim/direct_uploads/upload_modal.js +264 -0
  214. data/app/packs/src/decidim/direct_uploads/upload_utility.js +49 -0
  215. data/app/packs/src/decidim/direct_uploads/uploader.js +89 -0
  216. data/app/packs/src/decidim/editor/linebreak_module.js +8 -0
  217. data/app/packs/src/decidim/editor.js +33 -70
  218. data/app/packs/src/decidim/external_domain_warning.js +1 -1
  219. data/app/packs/src/decidim/external_link.js +14 -3
  220. data/app/packs/src/decidim/external_link.test.js +64 -0
  221. data/app/packs/src/decidim/form_filter.component.test.js +5 -148
  222. data/app/packs/src/decidim/form_filter.js +4 -26
  223. data/app/packs/src/decidim/geocoding/attach_input.js +1 -4
  224. data/app/packs/src/decidim/geocoding/provider/here.js +21 -17
  225. data/app/packs/src/decidim/geocoding/provider/photon.js +1 -1
  226. data/app/packs/src/decidim/geocoding.js +10 -35
  227. data/app/packs/src/decidim/identity_selector_dialog.js +1 -1
  228. data/app/packs/src/decidim/impersonation.js +3 -3
  229. data/app/packs/src/decidim/input_character_counter.js +177 -7
  230. data/app/packs/src/decidim/input_multiple_mentions.js +87 -187
  231. data/app/packs/src/decidim/map/controller/drag_marker.js +2 -0
  232. data/app/packs/src/decidim/map/controller/markers.js +1 -0
  233. data/app/packs/src/decidim/map/controller/static.js +1 -0
  234. data/app/packs/src/decidim/map/controller.js +2 -0
  235. data/app/packs/src/decidim/map/factory.js +1 -4
  236. data/app/packs/src/decidim/map/icon.js +3 -1
  237. data/app/packs/src/decidim/map/legacy.js +1 -0
  238. data/app/packs/src/decidim/map/provider/default.js +0 -2
  239. data/app/packs/src/decidim/map/provider/here.js +1 -2
  240. data/app/packs/src/decidim/map/svg-icon.js +248 -0
  241. data/app/packs/src/decidim/security/selfxss_warning.js +5 -1
  242. data/app/packs/src/decidim/session_timeouter.js +15 -15
  243. data/app/packs/src/decidim/sw/a2hs.js +28 -0
  244. data/app/packs/src/decidim/sw/index.js +3 -0
  245. data/app/packs/src/decidim/sw/loader.js +18 -0
  246. data/app/packs/src/decidim/sw/push-permissions.js +87 -0
  247. data/app/packs/src/decidim/sw/sw.js +80 -0
  248. data/app/packs/src/decidim/vizzs/areachart.js +33 -28
  249. data/app/packs/src/decidim/vizzs/linechart.js +23 -18
  250. data/app/packs/src/decidim/vizzs/rowchart.js +15 -11
  251. data/app/packs/stylesheets/decidim/_editor.scss +0 -129
  252. data/app/packs/stylesheets/decidim/email.scss +66 -7
  253. data/app/packs/stylesheets/decidim/extras/_quill.scss +6 -0
  254. data/app/packs/stylesheets/decidim/layouts/_user.scss +8 -0
  255. data/app/packs/stylesheets/decidim/modules/_autocomplete.scss +99 -0
  256. data/app/packs/stylesheets/decidim/modules/_buttons.scss +6 -10
  257. data/app/packs/stylesheets/decidim/modules/_cards.scss +1 -3
  258. data/app/packs/stylesheets/decidim/modules/_comments.scss +0 -26
  259. data/app/packs/stylesheets/decidim/modules/_cookie-consent.scss +115 -0
  260. data/app/packs/stylesheets/decidim/modules/_footer.scss +4 -0
  261. data/app/packs/stylesheets/decidim/modules/_forms.scss +0 -5
  262. data/app/packs/stylesheets/decidim/modules/_input-multiple-mentions.scss +29 -2
  263. data/app/packs/stylesheets/decidim/modules/_modules.scss +3 -1
  264. data/app/packs/stylesheets/decidim/modules/_reveal.scss +15 -0
  265. data/app/packs/stylesheets/decidim/modules/_upload_modal.scss +143 -0
  266. data/app/packs/stylesheets/decidim/utils/_fontface.scss +3 -0
  267. data/app/packs/stylesheets/decidim/vizzs/_linechart.scss +2 -2
  268. data/app/packs/stylesheets/decidim/vizzs/_rowchart.scss +2 -2
  269. data/app/permissions/decidim/permissions.rb +4 -8
  270. data/app/presenters/decidim/admin_log/area_type_presenter.rb +34 -0
  271. data/app/presenters/decidim/admin_log/attachment_collection_presenter.rb +35 -0
  272. data/app/presenters/decidim/admin_log/attachment_presenter.rb +27 -0
  273. data/app/presenters/decidim/admin_log/category_presenter.rb +36 -0
  274. data/app/presenters/decidim/admin_log/component_presenter.rb +35 -3
  275. data/app/presenters/decidim/admin_log/contextual_help_section_presenter.rb +33 -0
  276. data/app/presenters/decidim/admin_log/organization_presenter.rb +9 -4
  277. data/app/presenters/decidim/admin_log/scope_type_presenter.rb +34 -0
  278. data/app/presenters/decidim/admin_log/user_group_presenter.rb +1 -1
  279. data/app/presenters/decidim/admin_log/user_moderation_presenter.rb +1 -1
  280. data/app/presenters/decidim/home_stats_presenter.rb +8 -13
  281. data/app/presenters/decidim/log/base_presenter.rb +1 -1
  282. data/app/presenters/decidim/menu_item_presenter.rb +1 -1
  283. data/app/presenters/decidim/metric_charts_presenter.rb +7 -1
  284. data/app/presenters/decidim/nil_presenter.rb +3 -1
  285. data/app/presenters/decidim/notification_presenter.rb +1 -1
  286. data/app/presenters/decidim/notification_to_mailer_presenter.rb +39 -0
  287. data/app/presenters/decidim/notifications_digest_presenter.rb +42 -0
  288. data/app/presenters/decidim/official_author_presenter.rb +4 -0
  289. data/app/presenters/decidim/organization_presenter.rb +22 -0
  290. data/app/presenters/decidim/push_notification_presenter.rb +24 -0
  291. data/app/presenters/decidim/stats_presenter.rb +9 -8
  292. data/app/presenters/decidim/user_group_presenter.rb +1 -1
  293. data/app/presenters/decidim/user_presenter.rb +5 -13
  294. data/app/presenters/decidim/validation_errors_presenter.rb +1 -1
  295. data/app/queries/decidim/messaging/user_conversations.rb +1 -1
  296. data/app/queries/decidim/metric_manage.rb +1 -1
  297. data/app/queries/decidim/metrics/users_metric_manage.rb +6 -6
  298. data/app/queries/decidim/own_activities.rb +11 -0
  299. data/app/queries/decidim/participatory_processes_with_user_role.rb +1 -1
  300. data/app/{services/decidim/activity_search.rb → queries/decidim/public_activities.rb} +35 -78
  301. data/app/queries/decidim/public_components.rb +1 -1
  302. data/app/queries/decidim/similar_emendations.rb +1 -1
  303. data/app/queries/decidim/stats_users_count.rb +1 -1
  304. data/app/queries/decidim/user_groups/accepted_memberships.rb +1 -1
  305. data/app/queries/decidim/user_groups/accepted_user_groups.rb +1 -1
  306. data/app/queries/decidim/user_groups/accepted_users.rb +1 -1
  307. data/app/queries/decidim/user_groups/admin_memberships.rb +1 -1
  308. data/app/queries/decidim/user_groups/invited_memberships.rb +1 -1
  309. data/app/queries/decidim/user_groups/manageable_user_groups.rb +1 -1
  310. data/app/queries/decidim/user_groups/member_memberships.rb +1 -1
  311. data/app/scrubbers/decidim/user_input_scrubber.rb +5 -32
  312. data/app/services/decidim/{data_portability_exporter.rb → download_your_data_exporter.rb} +6 -6
  313. data/app/services/decidim/email_notification_generator.rb +2 -2
  314. data/app/services/decidim/engine_resolver.rb +66 -0
  315. data/app/services/decidim/events_manager.rb +1 -1
  316. data/app/services/decidim/iframe_disabler.rb +31 -0
  317. data/app/services/decidim/notification_generator_for_recipient.rb +1 -1
  318. data/app/services/decidim/notifications_digest_sending_decider.rb +18 -0
  319. data/app/services/decidim/notifications_subscriptions_persistor.rb +37 -0
  320. data/app/services/decidim/open_data_exporter.rb +1 -1
  321. data/app/services/decidim/resource_search.rb +17 -164
  322. data/app/services/decidim/send_push_notification.rb +59 -0
  323. data/app/services/decidim/traceability.rb +1 -2
  324. data/app/uploaders/decidim/application_uploader.rb +2 -12
  325. data/app/uploaders/decidim/cw/attachment_uploader.rb +1 -1
  326. data/app/uploaders/decidim/cw/{data_portability_uploader.rb → download_your_data_uploader.rb} +3 -3
  327. data/app/uploaders/decidim/cw/image_uploader.rb +2 -2
  328. data/app/uploaders/decidim/organization_favicon_uploader.rb +3 -2
  329. data/app/validators/etiquette_validator.rb +3 -7
  330. data/app/validators/passthru_validator.rb +29 -21
  331. data/app/validators/password_validator.rb +25 -4
  332. data/app/validators/uploader_image_dimensions_validator.rb +1 -1
  333. data/app/views/decidim/account/_account_notification.js.erb +20 -0
  334. data/app/views/decidim/account/_password_fields.html.erb +2 -2
  335. data/app/views/decidim/account/cancel_email_change.js.erb +6 -0
  336. data/app/views/decidim/account/resend_confirmation_instructions.erb +1 -0
  337. data/app/views/decidim/account/show.html.erb +19 -6
  338. data/app/views/decidim/application/{_attachments.html.erb → _attachments.erb} +2 -2
  339. data/app/views/decidim/application/_collection.html.erb +1 -1
  340. data/app/views/decidim/application/{_documents.html.erb → _documents.erb} +2 -2
  341. data/app/views/decidim/devise/confirmations/new.html.erb +1 -1
  342. data/app/views/decidim/devise/invitations/edit.html.erb +3 -4
  343. data/app/views/decidim/devise/omniauth_registrations/new.html.erb +3 -3
  344. data/app/views/decidim/devise/passwords/edit.html.erb +7 -5
  345. data/app/views/decidim/devise/passwords/new.html.erb +1 -1
  346. data/app/views/decidim/devise/registrations/edit.html.erb +41 -0
  347. data/app/views/decidim/devise/registrations/new.html.erb +5 -5
  348. data/app/views/decidim/devise/sessions/new.html.erb +2 -2
  349. data/app/views/decidim/{data_portability → download_your_data}/show.html.erb +2 -2
  350. data/app/views/decidim/export_mailer/download_your_data_export.html.erb +7 -0
  351. data/app/views/decidim/last_activities/index.html.erb +1 -1
  352. data/app/views/decidim/links/_modal.html.erb +1 -1
  353. data/app/views/decidim/links/new.html.erb +1 -1
  354. data/app/views/decidim/manifests/show.json.erb +31 -0
  355. data/app/views/decidim/messaging/conversations/_add_conversation_users.html.erb +5 -3
  356. data/app/views/decidim/messaging/conversations/_conversation.html.erb +5 -1
  357. data/app/views/decidim/messaging/conversations/_reply.html.erb +1 -1
  358. data/app/views/decidim/messaging/conversations/_start.html.erb +1 -3
  359. data/app/views/decidim/messaging/conversations/create.js.erb +1 -0
  360. data/app/views/decidim/newsletter_mailer/newsletter.html.erb +3 -3
  361. data/app/views/decidim/newsletters/show.html.erb +1 -1
  362. data/app/views/decidim/notification_mailer/event_received.html.erb +1 -1
  363. data/app/views/decidim/notifications_digest_mailer/_email_content.html.erb +11 -0
  364. data/app/views/decidim/notifications_digest_mailer/digest_mail.erb +27 -0
  365. data/app/views/decidim/notifications_settings/show.html.erb +79 -52
  366. data/app/views/decidim/offline/show.html.erb +9 -0
  367. data/app/views/decidim/pages/_standalone.html.erb +1 -1
  368. data/app/views/decidim/pages/_tabbed.html.erb +1 -1
  369. data/app/views/decidim/reported_mailer/hide.html.erb +1 -1
  370. data/app/views/decidim/reported_mailer/report.html.erb +1 -1
  371. data/app/views/decidim/scopes/picker.html.erb +1 -1
  372. data/app/views/decidim/searches/_filters.html.erb +2 -2
  373. data/app/views/decidim/shared/participatory_space_filters/_filters.html.erb +3 -3
  374. data/app/views/decidim/user_interests/show.html.erb +13 -11
  375. data/app/views/decidim/user_report_mailer/notify.html.erb +10 -3
  376. data/app/views/devise/mailer/confirmation_instructions.html.erb +3 -1
  377. data/app/views/layouts/decidim/_application.html.erb +6 -3
  378. data/app/views/layouts/decidim/_cookie_warning.html.erb +8 -8
  379. data/app/views/layouts/decidim/_decidim_javascript.html.erb +12 -0
  380. data/app/views/layouts/decidim/_head.html.erb +4 -2
  381. data/app/views/layouts/decidim/_js_configuration.html.erb +5 -1
  382. data/app/views/layouts/decidim/_mailer_logo.html.erb +2 -2
  383. data/app/views/layouts/decidim/_main_footer.html.erb +1 -0
  384. data/app/views/layouts/decidim/_offline_banner.html.erb +11 -0
  385. data/app/views/layouts/decidim/newsletter_base.html.erb +2 -2
  386. data/app/views/layouts/decidim/widget.html.erb +2 -2
  387. data/config/assets.rb +1 -0
  388. data/config/locales/am-ET.yml +1 -0
  389. data/config/locales/ar.yml +86 -461
  390. data/config/locales/bg.yml +57 -32
  391. data/config/locales/ca.yml +246 -85
  392. data/config/locales/cs.yml +256 -97
  393. data/config/locales/da.yml +1 -3
  394. data/config/locales/de.yml +93 -159
  395. data/config/locales/el.yml +53 -137
  396. data/config/locales/en.yml +220 -59
  397. data/config/locales/eo.yml +8 -13
  398. data/config/locales/es-MX.yml +234 -73
  399. data/config/locales/es-PY.yml +236 -75
  400. data/config/locales/es.yml +244 -83
  401. data/config/locales/et.yml +1 -3
  402. data/config/locales/eu.yml +416 -479
  403. data/config/locales/fi-plain.yml +222 -61
  404. data/config/locales/fi.yml +236 -75
  405. data/config/locales/fr-CA.yml +218 -71
  406. data/config/locales/fr.yml +224 -77
  407. data/config/locales/ga-IE.yml +15 -9
  408. data/config/locales/gl.yml +112 -35
  409. data/config/locales/hr.yml +1 -3
  410. data/config/locales/hu.yml +106 -266
  411. data/config/locales/id-ID.yml +61 -35
  412. data/config/locales/is-IS.yml +12 -23
  413. data/config/locales/it.yml +66 -41
  414. data/config/locales/ja.yml +235 -83
  415. data/config/locales/ko.yml +1 -0
  416. data/config/locales/lb.yml +57 -38
  417. data/config/locales/lt.yml +1 -1788
  418. data/config/locales/lv.yml +55 -28
  419. data/config/locales/mt.yml +1 -0
  420. data/config/locales/nl.yml +81 -39
  421. data/config/locales/no.yml +84 -41
  422. data/config/locales/om-ET.yml +1 -0
  423. data/config/locales/pl.yml +127 -46
  424. data/config/locales/pt-BR.yml +52 -80
  425. data/config/locales/pt.yml +54 -35
  426. data/config/locales/ro-RO.yml +55 -43
  427. data/config/locales/ru.yml +35 -29
  428. data/config/locales/si-LK.yml +1 -0
  429. data/config/locales/sk.yml +62 -45
  430. data/config/locales/sl.yml +6 -1
  431. data/config/locales/so-SO.yml +1 -0
  432. data/config/locales/sr-CS.yml +1 -10
  433. data/config/locales/sv.yml +127 -55
  434. data/config/locales/sw-KE.yml +1 -0
  435. data/config/locales/ti-ER.yml +1 -0
  436. data/config/locales/tr-TR.yml +55 -40
  437. data/config/locales/uk.yml +30 -30
  438. data/config/locales/val-ES.yml +1 -0
  439. data/config/locales/vi.yml +1 -0
  440. data/config/locales/zh-CN.yml +53 -33
  441. data/config/locales/zh-TW.yml +1 -1721
  442. data/config/routes.rb +19 -22
  443. data/db/migrate/20180508111710_add_accepted_tos_version_field_to_users.rb +1 -0
  444. data/db/migrate/20181030090144_destroy_deleted_users_follows.rb +2 -1
  445. data/db/migrate/20181204110723_remove_following_users_count_from_users.rb +2 -11
  446. data/db/migrate/20181214101250_add_notification_types_to_users.rb +1 -6
  447. data/db/migrate/20190412131728_fix_user_names.rb +2 -9
  448. data/db/migrate/20200211173227_add_direct_message_types_to_users.rb +1 -6
  449. data/db/migrate/20210302150803_invalidate_all_sessions_for_deleted_users.rb +3 -10
  450. data/db/migrate/20210310120640_add_followable_counter_cache_to_users.rb +3 -13
  451. data/db/migrate/20210831181634_add_service_name_to_active_storage_blobs.active_storage.rb +22 -0
  452. data/db/migrate/20210831181635_create_active_storage_variant_records.active_storage.rb +14 -0
  453. data/db/migrate/20211208155453_create_decidim_reminders.rb +11 -0
  454. data/db/migrate/20211209121025_create_decidim_reminder_records.rb +11 -0
  455. data/db/migrate/20211209121040_create_decidim_reminder_deliveries.rb +10 -0
  456. data/db/migrate/20220118121921_change_required_description_categories.rb +7 -0
  457. data/db/migrate/20220127113419_add_notification_settings_to_users.rb +7 -0
  458. data/db/migrate/20220203121137_add_notifications_sending_frequency_to_users.rb +7 -0
  459. data/db/migrate/20220215172439_add_digest_sent_at_to_users.rb +7 -0
  460. data/db/migrate/20220323195258_add_index_to_decidim_users_notifications_sending_frequency.rb +7 -0
  461. data/db/migrate/20220427142214_drop_emails_on_notifications_flag_from_user.rb +15 -0
  462. data/db/migrate/20220518094535_add_previous_passwords_to_users.rb +20 -0
  463. data/db/migrate/20220524195530_create_decidim_short_links.rb +23 -0
  464. data/db/seeds.rb +17 -19
  465. data/lib/decidim/acts_as_tree.rb +47 -0
  466. data/lib/decidim/api/input_sorts/component_input_sort.rb +2 -1
  467. data/lib/decidim/api/interfaces/authorable_interface.rb +6 -5
  468. data/lib/decidim/api/types/localized_string_type.rb +0 -9
  469. data/lib/decidim/api/types/translated_field_type.rb +5 -20
  470. data/lib/decidim/asset_router.rb +80 -0
  471. data/lib/decidim/attachment_attributes.rb +8 -8
  472. data/lib/decidim/attribute_object/form.rb +174 -0
  473. data/lib/decidim/attribute_object/model.rb +148 -0
  474. data/lib/decidim/attribute_object/nested_validator.rb +22 -0
  475. data/lib/decidim/attribute_object/type_map.rb +14 -0
  476. data/lib/decidim/attribute_object/type_resolver.rb +91 -0
  477. data/lib/decidim/attribute_object.rb +26 -0
  478. data/lib/decidim/attributes/array.rb +62 -0
  479. data/lib/decidim/attributes/blob.rb +20 -0
  480. data/lib/decidim/attributes/clean_string.rb +12 -6
  481. data/lib/decidim/attributes/hash.rb +36 -0
  482. data/lib/decidim/attributes/integer.rb +17 -0
  483. data/lib/decidim/attributes/localized_date.rb +8 -14
  484. data/lib/decidim/attributes/model.rb +24 -0
  485. data/lib/decidim/attributes/object.rb +28 -0
  486. data/lib/decidim/attributes/symbol.rb +23 -0
  487. data/lib/decidim/attributes/time_with_zone.rb +7 -17
  488. data/lib/decidim/attributes.rb +29 -0
  489. data/lib/decidim/authorable.rb +21 -6
  490. data/lib/decidim/authorization_form_builder.rb +9 -11
  491. data/lib/decidim/carrier_wave_migrator_service.rb +15 -15
  492. data/lib/decidim/coauthorable.rb +22 -4
  493. data/lib/decidim/command.rb +44 -0
  494. data/lib/decidim/common_passwords.rb +1 -1
  495. data/lib/decidim/component_manifest.rb +5 -5
  496. data/lib/decidim/component_validator.rb +2 -2
  497. data/lib/decidim/content_block_manifest.rb +1 -1
  498. data/lib/decidim/content_parsers/hashtag_parser.rb +2 -2
  499. data/lib/decidim/content_parsers/resource_parser.rb +1 -1
  500. data/lib/decidim/content_parsers/user_group_parser.rb +1 -1
  501. data/lib/decidim/content_parsers/user_parser.rb +4 -4
  502. data/lib/decidim/content_renderers/hashtag_renderer.rb +1 -1
  503. data/lib/decidim/content_renderers/link_renderer.rb +2 -2
  504. data/lib/decidim/content_renderers/user_group_renderer.rb +1 -1
  505. data/lib/decidim/content_renderers/user_renderer.rb +1 -1
  506. data/lib/decidim/controller_helpers.rb +41 -0
  507. data/lib/decidim/core/engine.rb +35 -19
  508. data/lib/decidim/core/test/factories.rb +54 -21
  509. data/lib/decidim/core/test/shared_examples/admin_resource_gallery_examples.rb +16 -4
  510. data/lib/decidim/core/test/shared_examples/amendable/amendment_form_examples.rb +1 -1
  511. data/lib/decidim/core/test/shared_examples/authorable_interface_examples.rb +15 -2
  512. data/lib/decidim/core/test/shared_examples/coauthorable_interface_examples.rb +2 -2
  513. data/lib/decidim/core/test/shared_examples/comments_examples.rb +203 -60
  514. data/lib/decidim/core/test/shared_examples/errors.rb +0 -2
  515. data/lib/decidim/core/test/shared_examples/localised_email.rb +1 -1
  516. data/lib/decidim/core/test/shared_examples/logo_email.rb +1 -1
  517. data/lib/decidim/core/test/shared_examples/map_examples.rb +3 -6
  518. data/lib/decidim/core/test/shared_examples/preview_component_with_share_token_examples.rb +0 -6
  519. data/lib/decidim/core/test/shared_examples/resource_search_examples.rb +120 -40
  520. data/lib/decidim/core/test/shared_examples/resourceable.rb +0 -6
  521. data/lib/decidim/core/test/shared_examples/rich_text_editor_examples.rb +3 -7
  522. data/lib/decidim/core/test/shared_examples/searchable_participatory_space_examples.rb +1 -1
  523. data/lib/decidim/core/test/shared_examples/searchable_resources_shared_context.rb +1 -1
  524. data/lib/decidim/core/test/shared_examples/system_endorse_resource_examples.rb +3 -3
  525. data/lib/decidim/core/test/shared_examples/translated_event_examples.rb +2 -2
  526. data/lib/decidim/core/test/shared_examples/with_endorsable_permissions_examples.rb +1 -1
  527. data/lib/decidim/core/test.rb +0 -4
  528. data/lib/decidim/core/version.rb +1 -1
  529. data/lib/decidim/core.rb +106 -55
  530. data/lib/decidim/{data_portability.rb → download_your_data.rb} +3 -3
  531. data/lib/decidim/{data_portability_serializers/data_portability_conversation_serializer.rb → download_your_data_serializers/download_your_data_conversation_serializer.rb} +2 -2
  532. data/lib/decidim/{data_portability_serializers/data_portability_follow_serializer.rb → download_your_data_serializers/download_your_data_follow_serializer.rb} +2 -2
  533. data/lib/decidim/{data_portability_serializers/data_portability_identity_serializer.rb → download_your_data_serializers/download_your_data_identity_serializer.rb} +2 -2
  534. data/lib/decidim/{data_portability_serializers/data_portability_notification_serializer.rb → download_your_data_serializers/download_your_data_notification_serializer.rb} +2 -2
  535. data/lib/decidim/{data_portability_serializers/data_portability_participatory_space_private_user_serializer.rb → download_your_data_serializers/download_your_data_participatory_space_private_user_serializer.rb} +2 -2
  536. data/lib/decidim/{data_portability_serializers/data_portability_report_serializer.rb → download_your_data_serializers/download_your_data_report_serializer.rb} +2 -2
  537. data/lib/decidim/{data_portability_serializers/data_portability_user_group_serializer.rb → download_your_data_serializers/download_your_data_user_group_serializer.rb} +2 -2
  538. data/lib/decidim/{data_portability_serializers/data_portability_user_serializer.rb → download_your_data_serializers/download_your_data_user_serializer.rb} +3 -3
  539. data/lib/decidim/download_your_data_serializers.rb +23 -0
  540. data/lib/decidim/endorsable.rb +1 -1
  541. data/lib/decidim/engine_router.rb +7 -1
  542. data/lib/decidim/env.rb +56 -0
  543. data/lib/decidim/event_recorder.rb +25 -0
  544. data/lib/decidim/events/base_event.rb +10 -14
  545. data/lib/decidim/events/simple_event.rb +6 -5
  546. data/lib/decidim/exporters/export_data.rb +1 -1
  547. data/lib/decidim/exporters/export_manifest.rb +2 -1
  548. data/lib/decidim/exporters.rb +1 -10
  549. data/lib/decidim/file_validator_humanizer.rb +24 -1
  550. data/lib/decidim/filterable_resource.rb +55 -0
  551. data/lib/decidim/fingerprint_calculator.rb +2 -4
  552. data/lib/decidim/form_builder.rb +174 -145
  553. data/lib/decidim/gamification/badge.rb +2 -3
  554. data/lib/decidim/gamification/badge_scorer.rb +1 -0
  555. data/lib/decidim/has_area.rb +27 -0
  556. data/lib/decidim/has_attachments.rb +2 -2
  557. data/lib/decidim/has_category.rb +36 -0
  558. data/lib/decidim/has_resource_permission.rb +2 -0
  559. data/lib/decidim/importers/import_manifest.rb +3 -21
  560. data/lib/decidim/jsonb_attributes.rb +6 -4
  561. data/lib/decidim/manifest_messages.rb +23 -0
  562. data/lib/decidim/map/autocomplete.rb +6 -4
  563. data/lib/decidim/map/frontend.rb +2 -2
  564. data/lib/decidim/map/provider/dynamic_map/here.rb +1 -46
  565. data/lib/decidim/map/provider/geocoding/here.rb +5 -5
  566. data/lib/decidim/map/provider/here.rb +3 -0
  567. data/lib/decidim/map/provider/osm.rb +3 -0
  568. data/lib/decidim/map.rb +4 -4
  569. data/lib/decidim/menu.rb +1 -1
  570. data/lib/decidim/metric_manifest.rb +2 -2
  571. data/lib/decidim/nicknamizable.rb +1 -1
  572. data/lib/decidim/notification_setting_manifest.rb +19 -0
  573. data/lib/decidim/organization_settings.rb +8 -7
  574. data/lib/decidim/participatory_space_context_manifest.rb +2 -2
  575. data/lib/decidim/participatory_space_manifest.rb +2 -2
  576. data/lib/decidim/participatory_space_resourceable.rb +1 -7
  577. data/lib/decidim/processes_file_locally.rb +31 -0
  578. data/lib/decidim/publicable.rb +0 -4
  579. data/lib/decidim/query.rb +84 -0
  580. data/lib/decidim/record_encryptor.rb +29 -8
  581. data/lib/decidim/reminder_manifest.rb +75 -0
  582. data/lib/decidim/reminder_registry.rb +67 -0
  583. data/lib/decidim/resource_manifest.rb +1 -1
  584. data/lib/decidim/resourceable.rb +15 -5
  585. data/lib/decidim/scopable.rb +15 -0
  586. data/lib/decidim/settings_manifest.rb +4 -4
  587. data/lib/decidim/spring.rb +16 -0
  588. data/lib/decidim/translatable_attributes.rb +13 -16
  589. data/lib/decidim/url_option_resolver.rb +50 -0
  590. data/lib/decidim/view_hooks.rb +1 -1
  591. data/lib/decidim/view_model.rb +5 -1
  592. data/lib/decidim/webpacker/thread_safe_compiler.rb +30 -0
  593. data/lib/decidim/webpacker/webpack/custom.js +15 -3
  594. data/lib/decidim/webpacker/webpacker.yml +1 -1
  595. data/lib/decidim/webpacker.rb +2 -0
  596. data/lib/devise/models/decidim_validatable.rb +1 -1
  597. data/lib/tasks/decidim_active_storage_migration_tasks.rake +1 -3
  598. data/lib/tasks/{decidim_data_portability_tasks.rake → decidim_download_your_data_tasks.rake} +9 -9
  599. data/lib/tasks/decidim_mailers_tasks.rake +23 -0
  600. data/lib/tasks/decidim_metrics_tasks.rake +1 -1
  601. data/lib/tasks/decidim_pwa_tasks.rake +18 -0
  602. data/lib/tasks/decidim_reminders_tasks.rake +17 -0
  603. data/lib/tasks/decidim_tasks.rake +6 -1
  604. data/lib/tasks/decidim_webpacker_tasks.rake +1 -1
  605. data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +51 -0
  606. metadata +186 -105
  607. data/app/controllers/decidim/cookie_policy_controller.rb +0 -24
  608. data/app/helpers/decidim/cookies_helper.rb +0 -11
  609. data/app/packs/src/decidim/editor/clipboard_override.js +0 -147
  610. data/app/packs/src/decidim/editor/clipboard_utilities.js +0 -119
  611. data/app/packs/src/decidim/vizzs/renders.js +0 -9
  612. data/app/packs/src/decidim/vizzs.js +0 -1
  613. data/app/packs/stylesheets/decidim/modules/_cookie-bar.scss +0 -26
  614. data/app/scrubbers/decidim/admin_input_scrubber.rb +0 -27
  615. data/app/services/decidim/home_activity_search.rb +0 -80
  616. data/app/services/decidim/participatory_space_search.rb +0 -54
  617. data/app/views/decidim/cookie_policy/accept.js.erb +0 -3
  618. data/app/views/decidim/export_mailer/data_portability_export.html.erb +0 -7
  619. data/app/views/decidim/links/_invalid_url_modal.html.erb +0 -17
  620. data/app/views/decidim/links/invalid_url.js.erb +0 -24
  621. data/config/environment.rb +0 -3
  622. data/config/locales/fa-IR.yml +0 -1
  623. data/config/locales/gn-PY.yml +0 -4
  624. data/config/locales/ka-GE.yml +0 -4
  625. data/config/locales/kaa.yml +0 -5
  626. data/config/locales/lo-LA.yml +0 -1
  627. data/config/locales/oc-FR.yml +0 -3
  628. data/config/locales/sq-AL.yml +0 -1
  629. data/config/locales/th-TH.yml +0 -1
  630. data/db/migrate/20231027142329_change_default_value_for_decidim_endorsements.rb +0 -11
  631. data/lib/decidim/core/test/shared_examples/editor_shared_examples.rb +0 -10
  632. data/lib/decidim/core/test/shared_examples/mcell_examples.rb +0 -17
  633. data/lib/decidim/core/test/shared_examples/resource_endorsed_event_examples.rb +0 -60
  634. data/lib/decidim/core/test/shared_examples/versions_controller_examples.rb +0 -40
  635. data/lib/decidim/data_portability_serializers.rb +0 -23
  636. data/lib/decidim/dependency_resolver.rb +0 -278
  637. data/lib/decidim/middleware/rails_cookies.rb +0 -23
  638. data/lib/tasks/upgrade/decidim_deduplicate_endorsements.rake +0 -53
  639. data/lib/tasks/upgrade/decidim_user_moderation.rake +0 -14
  640. /data/app/packs/src/decidim/vizzs/{metrics.js → index.js} +0 -0
  641. /data/app/views/decidim/application/{_document.html.erb → _document.erb} +0 -0
  642. /data/app/views/decidim/application/{_photos.html.erb → _photos.erb} +0 -0
  643. /data/app/views/decidim/{data_portability → download_your_data}/export.html.erb +0 -0
@@ -1,177 +1,30 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Decidim
4
- # This is the base class to be used by other search services.
5
- # Searchlight documentation: https://github.com/nathanl/searchlight
6
- class ResourceSearch < Searchlight::Search
7
- attr_reader :user, :organization, :component
4
+ # This is the base class to be used by other search services. This helps the
5
+ # searches to work with context attributes that are not passed from the user
6
+ # interface.
7
+ class ResourceSearch < Ransack::Search
8
+ attr_reader :user, :organization, :component, :search_context
8
9
 
9
- # Initialize the Searchlight::Search base class with the options provided.
10
- #
11
- # scope - The scope used to create the base query
12
- # options - A hash of options to modify the search. These options will be
13
- # converted to methods by SearchLight so they can be used on filter
14
- # methods. (Default {})
15
- def initialize(scope, options = {})
16
- super(options)
17
- @scope = scope
10
+ def initialize(object, params = {}, options = {})
18
11
  @user = options[:current_user] || options[:user]
19
12
  @component = options[:component]
20
13
  @organization = options[:organization] || component&.organization
21
- end
22
-
23
- # Public: Companion method to `search_search_text` which defines the
24
- # attributes where we should search for text values in a model.
25
- def self.text_search_fields(*fields)
26
- @text_search_fields = fields if fields.any?
27
- @text_search_fields
28
- end
29
-
30
- # Handle the search_text filter. We have to cast the JSONB columns
31
- # into a `text` type so that we can search.
32
- def search_search_text
33
- return query unless self.class.text_search_fields.any?
34
-
35
- fields = self.class.text_search_fields.dup
36
-
37
- text_query = query.where(localized_search_text_in("#{query.model_name.plural}.#{fields.shift}"), text: "%#{search_text}%")
38
-
39
- fields.each do |field|
40
- text_query = text_query.or(query.where(localized_search_text_in("#{query.model_name.plural}.#{field}"), text: "%#{search_text}%"))
41
- end
42
- text_query
43
- end
44
-
45
- # Creates the SearchLight base query.
46
- # Check if the option component was provided.
47
- def base_query
48
- raise "Missing component" unless component
49
-
50
- @scope.where(component: component)
51
- end
52
-
53
- # Handle the category_id filter
54
- def search_category_id
55
- return query if category_ids.include?("all")
56
-
57
- query
58
- .includes(:categorization)
59
- .where(decidim_categorizations: { decidim_category_id: all_category_ids })
60
- end
61
-
62
- # Handles the scope_ids filter. When we want to show only those that do not
63
- # have a scope_ids set, we cannot pass an empty String or nil because Searchlight
64
- # will automatically filter out these params, so the method will not be used.
65
- # Instead, we need to pass a fake ID and then convert it inside. In this case,
66
- # in order to select those elements that do not have a scope_ids set we use
67
- # `"global"` as parameter, and in the method we do the needed changes to search
68
- # properly.
69
- def search_scope_id
70
- return query if scope_ids.include?("all")
71
-
72
- clean_scope_ids = scope_ids
73
-
74
- conditions = []
75
- conditions << "#{query.model_name.plural}.decidim_scope_id IS NULL" if clean_scope_ids.delete("global")
76
- conditions.concat(["? = ANY(decidim_scopes.part_of)"] * clean_scope_ids.count) if clean_scope_ids.any?
77
-
78
- query.includes(:scope).references(:decidim_scopes).where(Arel.sql(conditions.join(" OR ")).to_s, *clean_scope_ids.map(&:to_i))
79
- end
80
-
81
- # Handle the origin filter.
82
- def search_origin
83
- renamed_origin = Array(origin).map do |search_value|
84
- "#{search_value}_origin"
85
- end
86
- apply_scopes(%w(official_origin citizens_origin user_group_origin meeting_origin), renamed_origin)
87
- end
88
-
89
- # We overwrite the `results` method to ensure we only return unique
90
- # results. We can't use `#uniq` because it returns an Array and we're
91
- # adding scopes in the controller, and `#distinct` doesn't work here
92
- # because in the later scopes we're ordering by `RANDOM()` in a DB level,
93
- # and `SELECT DISTINCT` doesn't work with `RANDOM()` sorting, so we need
94
- # to perform two queries.
95
- #
96
- # The correct behaviour is backed by tests.
97
- def results
98
- base_query.model.where(id: super.pluck(:id))
99
- end
100
-
101
- private
102
-
103
- # Private: To be used by classes that inherit from ResourceSearch.
104
- #
105
- # This method is useful when the values of the filters match the names of
106
- # defined scopes in a model, it applies those scopes that are included in
107
- # the search values.
108
- #
109
- # Example:
110
- # Consider you want to filter by state, and your model has an `open` and
111
- # a `closed` ActiveRecord scope.
112
- #
113
- # def search_state
114
- # apply_scopes(%w(open closed), state)
115
- # end
116
- #
117
- # In this scenario, the `state` variable has the input by the use, who
118
- # has selected which states they want to see. `states` here is an array
119
- # of strings.
120
- #
121
- # Returns an ActiveRecord::Relation.
122
- def apply_scopes(scopes, search_values)
123
- search_values = Array(search_values)
124
-
125
- conditions = scopes.map do |scope|
126
- search_values.member?(scope.to_s) ? query.try(scope) : nil
127
- end.compact
128
-
129
- return query unless conditions.any?
130
-
131
- scoped_query = query.where(id: conditions.shift)
132
-
133
- conditions.each do |condition|
134
- scoped_query = scoped_query.or(query.where(id: condition))
135
- end
136
-
137
- scoped_query
138
- end
139
-
140
- # Private: Creates an array of category ids.
141
- # It contains categories' subcategories ids as well.
142
- def all_category_ids
143
- cat_ids = category_ids.without("without")
144
-
145
- component
146
- .categories
147
- .where(id: cat_ids)
148
- .or(component.categories.where(parent_id: cat_ids))
149
- .pluck(:id).tap { |ids| ids.prepend(nil) if category_ids.include?("without") }
150
- end
151
-
152
- # Private: Returns an array with checked category ids.
153
- def category_ids
154
- Array(category_id)
155
- end
14
+ @search_context = options[:search_context] || :participants
15
+ configure(options)
156
16
 
157
- # Private: Returns an array with checked scope ids.
158
- def scope_ids
159
- if scope_id.is_a?(Hash)
160
- scope_id.values
161
- else
162
- Array(scope_id)
163
- end
17
+ # The super method calls the build method in the super class, which can be
18
+ # overridden by the individual search implementations, so call this as the
19
+ # last thing at the initialize method. The params are passed to the
20
+ # build method as the only argument.
21
+ super
164
22
  end
165
23
 
166
- # Internal: builds the needed query to search for a text in the organization's
167
- # available locales. Note that it is intended to be used as follows:
168
- #
169
- # Example:
170
- # Resource.where(localized_search_text_for(:title, text: "my_query"))
171
- #
172
- # The Hash with the `:text` key is required or it won't work.
173
- def localized_search_text_in(field)
174
- organization.available_locales.map { |l| "#{field} ->> '#{l}' ILIKE :text" }.join(" OR ")
24
+ def configure(options)
25
+ # This can be overridden by the search implementations in order to set
26
+ # extra variables based on the options passed to the search class before
27
+ # calling the build method below.
175
28
  end
176
29
  end
177
30
  end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "webpush"
4
+
5
+ module Decidim
6
+ # This class generates a notification based on the given event, for the given
7
+ # resource/recipient couple. It is intended to be used by the
8
+ # `Decidim::NotificationGenerator` class, which schedules a job for each recipient
9
+ # of the event, so that we can easily control which jobs fail.
10
+
11
+ class SendPushNotification
12
+ include ActionView::Helpers::UrlHelper
13
+
14
+ # Send the push notification. Returns `nil` if the user didn't allowed push notifications
15
+ # or if the subscription to push notifications doesn't exist
16
+ #
17
+ # Returns the result of the dispatch or nil if user or subscription are empty
18
+ def perform(notification)
19
+ return unless Rails.application.secrets.vapid[:enabled]
20
+
21
+ notification.user.notifications_subscriptions.values.map do |subscription|
22
+ message_params = notification_params(Decidim::PushNotificationPresenter.new(notification))
23
+ payload = build_payload(message_params, subscription)
24
+ # Capture webpush exceptions in order to avoid this call to be repeated by the background job runner
25
+ # Webpush::Error class is the parent class of all defined errors
26
+ begin
27
+ Webpush.payload_send(**payload)
28
+ rescue Webpush::Error => e
29
+ Rails.logger.warn("[ERROR] Push notification delivery failed due to #{e.message}")
30
+ nil
31
+ end
32
+ end.compact
33
+ end
34
+
35
+ private
36
+
37
+ def notification_params(notification)
38
+ {
39
+ title: notification.title,
40
+ body: notification.body,
41
+ icon: notification.icon,
42
+ data: { url: notification.url }
43
+ }
44
+ end
45
+
46
+ def build_payload(message_params, subscription)
47
+ {
48
+ message: JSON.generate(message_params),
49
+ endpoint: subscription["endpoint"],
50
+ p256dh: subscription["p256dh"],
51
+ auth: subscription["auth"],
52
+ vapid: {
53
+ public_key: Rails.application.secrets.vapid[:public_key],
54
+ private_key: Rails.application.secrets.vapid[:private_key]
55
+ }
56
+ }
57
+ end
58
+ end
59
+ end
@@ -64,7 +64,7 @@ module Decidim
64
64
  result = block_given? ? yield : nil
65
65
  loggable_resource = resource.is_a?(Class) ? result : resource
66
66
  log(action, author, loggable_resource, extra_log_info)
67
- return result
67
+ result
68
68
  end
69
69
  end
70
70
  end
@@ -117,7 +117,6 @@ module Decidim
117
117
  return unless user.is_a?(Decidim::User)
118
118
  # If the record is not valid, it may not yet have an ID causing an
119
119
  # exception when trying to save the log record.
120
- return if resource.nil?
121
120
  return unless resource.valid?
122
121
 
123
122
  Decidim::ActionLogger.log(
@@ -47,11 +47,7 @@ module Decidim
47
47
  return unless attached?
48
48
 
49
49
  representable = variant(key)
50
- if representable.is_a? ActiveStorage::Attached
51
- Rails.application.routes.url_helpers.rails_blob_url(representable.blob, **protocol_option.merge(options))
52
- else
53
- Rails.application.routes.url_helpers.rails_representation_url(representable, **protocol_option.merge(options))
54
- end
50
+ AssetRouter.new(representable).url(**options)
55
51
  end
56
52
 
57
53
  def path(options = {})
@@ -68,18 +64,12 @@ module Decidim
68
64
  def remote_url=(url)
69
65
  uri = URI.parse(url)
70
66
  filename = File.basename(uri.path)
71
- file = URI.open(url)
67
+ file = URI.parse(url).open
72
68
  model.send(mounted_as).attach(io: file, filename: filename)
73
69
  rescue URI::InvalidURIError
74
70
  model.errors.add(mounted_as, :invalid)
75
71
  end
76
72
 
77
- def protocol_option
78
- return {} unless Rails.application.config.force_ssl
79
-
80
- { protocol: "https" }
81
- end
82
-
83
73
  class << self
84
74
  # Each class inherits variants from parents and can define their own
85
75
  # variants with the set_variants class method
@@ -47,7 +47,7 @@ module Decidim::Cw
47
47
  return unless image?(self)
48
48
 
49
49
  manipulate! do |image|
50
- raise CarrierWave::IntegrityError, I18n.t("carrierwave.errors.image_too_big") if image.dimensions.any? { |dimension| dimension > max_image_height_or_width }
50
+ raise CarrierWave::IntegrityError, I18n.t("carrierwave.errors.file_resolution_too_large") if image.dimensions.any? { |dimension| dimension > max_image_height_or_width }
51
51
 
52
52
  image
53
53
  end
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Decidim::Cw
4
- # This class deals with saving data portability Zip Files to App
5
- class DataPortabilityUploader < ApplicationUploader
4
+ # This class deals with saving download your data Zip Files to App
5
+ class DownloadYourDataUploader < ApplicationUploader
6
6
  # Override the directory where uploaded files will be stored.
7
7
  def store_dir
8
- default_path = "uploads/data-portability/"
8
+ default_path = "uploads/download-your-data/"
9
9
 
10
10
  return File.join(Decidim.base_uploads_path, default_path) if Decidim.base_uploads_path.present?
11
11
 
@@ -48,14 +48,14 @@ module Decidim::Cw
48
48
  # See https://hackerone.com/reports/390
49
49
  def validate_dimensions
50
50
  manipulate! do |image|
51
- validation_error!(I18n.t("carrierwave.errors.image_too_big")) if image.dimensions.any? { |dimension| dimension > max_image_height_or_width }
51
+ validation_error!(I18n.t("carrierwave.errors.file_resolution_too_large")) if image.dimensions.any? { |dimension| dimension > max_image_height_or_width }
52
52
  image
53
53
  end
54
54
  end
55
55
 
56
56
  def validate_size
57
57
  manipulate! do |image|
58
- validation_error!(I18n.t("carrierwave.errors.image_too_big")) if image.size > maximum_upload_size
58
+ validation_error!(I18n.t("carrierwave.errors.file_size_too_large")) if image.size > maximum_upload_size
59
59
  image
60
60
  end
61
61
  end
@@ -4,8 +4,9 @@ module Decidim
4
4
  # This class deals with uploading an organization's favicon.
5
5
  class OrganizationFaviconUploader < ImageUploader
6
6
  SIZES = {
7
- big: 152,
8
- medium: 64,
7
+ huge: 512,
8
+ big: 192,
9
+ medium: 180,
9
10
  small: 32
10
11
  }.freeze
11
12
 
@@ -3,16 +3,12 @@
3
3
  # This validator takes care of ensuring the validated content is
4
4
  # respectful, doesn't use caps, and overall is meaningful.
5
5
  class EtiquetteValidator < ActiveModel::EachValidator
6
- include ActionView::Helpers::SanitizeHelper
7
-
8
6
  def validate_each(record, attribute, value)
9
7
  return if value.blank?
10
8
 
11
- text_value = strip_tags(value)
12
-
13
- validate_caps(record, attribute, text_value)
14
- validate_marks(record, attribute, text_value)
15
- validate_caps_first(record, attribute, text_value)
9
+ validate_caps(record, attribute, value)
10
+ validate_marks(record, attribute, value)
11
+ validate_caps_first(record, attribute, value)
16
12
  end
17
13
 
18
14
  private
@@ -18,6 +18,9 @@
18
18
  # validates :image, passthru: { to: Person, attribute: :avatar_image }
19
19
  # end
20
20
  class PassthruValidator < ActiveModel::EachValidator
21
+ # record - Form object (e.g. Decidim::UploadValidationForm)
22
+ # attribute - The attribute to validate (e.g. :avatar)
23
+ # value - Blob's signed id (e.g. "eyJfcmFpbHMi...")
21
24
  def validate_each(record, attribute, value)
22
25
  return unless target_class
23
26
 
@@ -25,12 +28,20 @@ class PassthruValidator < ActiveModel::EachValidator
25
28
 
26
29
  # Create a dummy record for which the validations are actually run on
27
30
  dummy = validation_record(record)
31
+ if dummy.respond_to?(dummy_attr) && !(value.class <= ActiveStorage::Attached)
32
+ dummy.public_send("#{dummy_attr}=", value)
33
+ value = dummy.public_send(dummy_attr)
34
+ elsif dummy.respond_to? :file
35
+ dummy.public_send("file=", value)
36
+ value = dummy.public_send(:file)
37
+ end
28
38
 
29
39
  target_validators(attribute).each do |validator|
30
40
  next unless validator.is_a?(ActiveModel::EachValidator)
31
41
  next unless check_validator_conditions(dummy, validator)
32
42
 
33
43
  dummy.errors.clear
44
+
34
45
  validator.validate_each(dummy, dummy_attr, value)
35
46
  dummy.errors[dummy_attr].each do |err|
36
47
  record.errors.add(attribute, err)
@@ -67,13 +78,12 @@ class PassthruValidator < ActiveModel::EachValidator
67
78
  end
68
79
 
69
80
  def target_instance(record)
70
- instance_attributes = begin
71
- if options[:with].respond_to?(:call)
72
- options[:with].call(record)
73
- else
74
- options[:with] || {}
75
- end
76
- end
81
+ instance_attributes = if options[:with].respond_to?(:call)
82
+ options[:with].call(record)
83
+ else
84
+ options[:with] || {}
85
+ end
86
+
77
87
  instance_attributes.each do |key, val|
78
88
  instance_attributes[key] = val.call(record) if val.respond_to?(:call)
79
89
  end
@@ -85,24 +95,22 @@ class PassthruValidator < ActiveModel::EachValidator
85
95
 
86
96
  def check_validator_conditions(record, validator)
87
97
  if (condition = validator.options[:if])
88
- if_result = begin
89
- if condition.respond_to?(:call)
90
- condition.call(record)
91
- else
92
- record.public_send(condition)
93
- end
94
- end
98
+ if_result = if condition.respond_to?(:call)
99
+ condition.call(record)
100
+ else
101
+ record.public_send(condition)
102
+ end
103
+
95
104
  return false unless if_result
96
105
  end
97
106
 
98
107
  if (condition = validator.options[:unless])
99
- unless_result = begin
100
- if condition.respond_to?(:call)
101
- condition.call(record)
102
- else
103
- record.public_send(condition)
104
- end
105
- end
108
+ unless_result = if condition.respond_to?(:call)
109
+ condition.call(record)
110
+ else
111
+ record.public_send(condition)
112
+ end
113
+
106
114
  return false if unless_result
107
115
  end
108
116
 
@@ -6,6 +6,8 @@ class PasswordValidator < ActiveModel::EachValidator
6
6
  MAX_LENGTH = 256
7
7
  MIN_UNIQUE_CHARACTERS = 5
8
8
  IGNORE_SIMILARITY_SHORTER_THAN = 4
9
+ ADMIN_MINIMUM_LENGTH = Decidim.config.admin_password_min_length
10
+ ADMIN_REPETITION_TIMES = Decidim.config.admin_password_repetition_times
9
11
  VALIDATION_METHODS = [
10
12
  :password_too_short?,
11
13
  :password_too_long?,
@@ -15,9 +17,16 @@ class PasswordValidator < ActiveModel::EachValidator
15
17
  :email_included_in_password?,
16
18
  :domain_included_in_password?,
17
19
  :password_too_common?,
18
- :blacklisted?
20
+ :blacklisted?,
21
+ :password_repeated?
19
22
  ].freeze
20
23
 
24
+ def self.minimum_length_for(record)
25
+ return ADMIN_MINIMUM_LENGTH if record.try(:admin?) && Decidim.config.admin_password_strong
26
+
27
+ MINIMUM_LENGTH
28
+ end
29
+
21
30
  # Check if user's password is strong enough
22
31
  #
23
32
  # record - Instance of a form (e.g. Decidim::RegistrationForm) or model
@@ -35,7 +44,7 @@ class PasswordValidator < ActiveModel::EachValidator
35
44
  return true if strong?
36
45
 
37
46
  @weak_password_reasons.each do |reason|
38
- record.errors[attribute] << get_message(reason)
47
+ record.errors.add attribute, get_message(reason)
39
48
  end
40
49
 
41
50
  false
@@ -67,7 +76,7 @@ class PasswordValidator < ActiveModel::EachValidator
67
76
  end
68
77
 
69
78
  def password_too_short?
70
- value.length < MINIMUM_LENGTH
79
+ value.length < self.class.minimum_length_for(record)
71
80
  end
72
81
 
73
82
  def password_too_long?
@@ -82,7 +91,7 @@ class PasswordValidator < ActiveModel::EachValidator
82
91
  return false if !record.respond_to?(:name) || record.name.blank?
83
92
  return true if value.include?(record.name.delete(" "))
84
93
 
85
- record.name.split(" ").each do |part|
94
+ record.name.split.each do |part|
86
95
  next if part.length < IGNORE_SIMILARITY_SHORTER_THAN
87
96
 
88
97
  return true if value.include?(part)
@@ -129,4 +138,16 @@ class PasswordValidator < ActiveModel::EachValidator
129
138
  def password_too_common?
130
139
  Decidim::CommonPasswords.instance.passwords.include?(value)
131
140
  end
141
+
142
+ def password_repeated?
143
+ return false unless Decidim.config.admin_password_strong
144
+ return false unless record.try(:admin?)
145
+ return false unless record.try(:encrypted_password_changed?)
146
+
147
+ [record.encrypted_password_was, *record.previous_passwords].compact_blank.take(ADMIN_REPETITION_TIMES).each do |encrypted_password|
148
+ return true if Devise::Encryptor.compare(Decidim::User, encrypted_password, value)
149
+ end
150
+
151
+ false
152
+ end
132
153
  end
@@ -28,7 +28,7 @@ class UploaderImageDimensionsValidator < ActiveModel::Validations::FileContentTy
28
28
  return unless uploader.validable_dimensions
29
29
  return if (image = extract_image(file)).blank?
30
30
 
31
- record.errors.add attribute, I18n.t("carrierwave.errors.image_too_big") if image.dimensions.any? { |dimension| dimension > uploader.max_image_height_or_width }
31
+ record.errors.add attribute, I18n.t("carrierwave.errors.file_resolution_too_large") if image.dimensions.any? { |dimension| dimension > uploader.max_image_height_or_width }
32
32
  end
33
33
 
34
34
  def extract_image(file)
@@ -0,0 +1,20 @@
1
+ var existingNotification = document.querySelector("main > .flash.callout");
2
+ if (existingNotification) {
3
+ existingNotification.classList.add("hide");
4
+ }
5
+
6
+ var accountNotification = document.querySelector(".account-notification");
7
+ document.querySelector("main").prepend(accountNotification);
8
+
9
+ if (accountNotification.querySelector(".account-message")) {
10
+ accountNotification.querySelector(".account-message").remove();
11
+ }
12
+ var messageDiv = document.createElement("div");
13
+ messageDiv.classList.add("account-message");
14
+
15
+ accountNotification.appendChild(messageDiv);
16
+ messageDiv.innerHTML = <%== @text.to_json %>;
17
+
18
+ accountNotification.classList.add("<%= @alert_class %>");
19
+ accountNotification.classList.remove("hide");
20
+ accountNotification.removeAttribute("style");
@@ -1,2 +1,2 @@
1
- <%= form.password_field :password, value: form.object.password, autocomplete: "off", help_text: t("devise.passwords.edit.password_help", minimun_characters: ::PasswordValidator::MINIMUM_LENGTH) %>
2
- <%= form.password_field :password_confirmation, value: form.object.password_confirmation, autocomplete: "off" %>
1
+ <%= form.password_field :password, password_field_options_for(current_user).merge(value: form.object.password) %>
2
+ <%= form.password_field :password_confirmation, password_field_options_for(current_user).except(:help_text).merge(value: form.object.password_confirmation) %>
@@ -0,0 +1,6 @@
1
+ <%= render partial: "account_notification" %>
2
+
3
+ if ("<%= @alert_class %>" === "success") {
4
+ document.querySelector("#email-change-pending").classList.add("hide");
5
+ document.querySelector("#user_email").disabled = false;
6
+ }
@@ -0,0 +1 @@
1
+ <%= render partial: "account_notification" %>
@@ -1,20 +1,33 @@
1
+ <%= alert_box("", "account-notification hide", true) %>
1
2
  <% add_decidim_page_title(t("profile", scope: "layouts.decidim.user_menu")) %>
2
3
  <% content_for(:subtitle) { t("profile", scope: "layouts.decidim.user_menu") } %>
3
4
 
4
5
  <div class="row">
5
- <%= decidim_form_for(@account, url: account_path, method: :put, html: { autocomplete: "off" }) do |f| %>
6
- <input autocomplete="off" name="hidden" type="password" style="display:none;">
6
+ <%= decidim_form_for(@account, url: account_path, method: :put, html: { autocomplete: "on" }) do |f| %>
7
7
  <div class="columns large-4">
8
8
  <%= f.upload :avatar %>
9
9
  </div>
10
10
 
11
11
  <div class="columns large-8 end">
12
+ <% if current_user.unconfirmed_email.present? %>
13
+ <div id="email-change-pending" class="callout secondary">
14
+ <p><strong><%= t("decidim.account.email_change.title") %></strong></p>
15
+ <p><%= t("decidim.account.email_change.body1", unconfirmed_email: current_user.unconfirmed_email) %></p>
16
+ <p>
17
+ <%== t(
18
+ "decidim.account.email_change.body2",
19
+ resend_link: link_to(t("decidim.account.email_change.send_again"), resend_confirmation_instructions_account_path, role: :button, method: :post, remote: true),
20
+ cancel_link: link_to(t("decidim.account.email_change.cancel"), cancel_email_change_account_path, role: :button, method: :post, remote: true)) %>
21
+ </p>
22
+ </div>
23
+ <% end %>
24
+
12
25
  <%= form_required_explanation %>
13
26
 
14
- <%= f.text_field :name %>
15
- <%= f.text_field :nickname %>
16
- <%= f.email_field :email %>
17
- <%= f.url_field :personal_url %>
27
+ <%= f.text_field :name, autocomplete: "name" %>
28
+ <%= f.text_field :nickname, autocomplete: "nickname" %>
29
+ <%= f.email_field :email, disabled: current_user.unconfirmed_email.present?, autocomplete: "email" %>
30
+ <%= f.url_field :personal_url, autocomplete: "url" %>
18
31
  <%= f.text_area :about, rows: 5 %>
19
32
 
20
33
  <%= f.collection_select(
@@ -1,12 +1,12 @@
1
1
  <% if attached_to.attachments.any? %>
2
2
  <div class="row attachments">
3
3
  <div class="columns large-12">
4
- <%= render partial: "decidim/application/documents.html", locals: { documents: attached_to.documents } %>
4
+ <%= render partial: "decidim/application/documents", locals: { documents: attached_to.documents } %>
5
5
  </div>
6
6
  </div>
7
7
  <div class="row attachments">
8
8
  <div class="columns large-12">
9
- <%= render partial: "decidim/application/photos.html", locals: { photos: attached_to.photos } %>
9
+ <%= render partial: "decidim/application/photos", locals: { photos: attached_to.photos } %>
10
10
  </div>
11
11
  </div>
12
12
  <% end %>
@@ -12,7 +12,7 @@
12
12
 
13
13
  <div class="card card--list">
14
14
  <% documents.each do |document| %>
15
- <%= render partial: "decidim/application/document.html", locals: { document: document } %>
15
+ <%= render partial: "decidim/application/document", locals: { document: document } %>
16
16
  <% end %>
17
17
  </div>
18
18
  </div>