decidim-core 0.28.0 → 0.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/activity_cell.rb +2 -2
  3. data/app/cells/decidim/address/online.erb +27 -9
  4. data/app/cells/decidim/address/show.erb +27 -12
  5. data/app/cells/decidim/address_cell.rb +29 -0
  6. data/app/cells/decidim/announcement/show.erb +2 -2
  7. data/app/cells/decidim/author/show.erb +5 -5
  8. data/app/cells/decidim/authorization_modal/show.erb +8 -4
  9. data/app/cells/decidim/authorization_modal_cell.rb +1 -0
  10. data/app/cells/decidim/card/show.erb +1 -1
  11. data/app/cells/decidim/card_metadata/show.erb +2 -2
  12. data/app/cells/decidim/card_metadata_cell.rb +3 -3
  13. data/app/cells/decidim/coauthorships_cell.rb +1 -1
  14. data/app/cells/decidim/content_blocks/menu_breadcrumb_last_activity_cell.rb +6 -0
  15. data/app/cells/decidim/content_blocks/participatory_space_hero_cell.rb +20 -4
  16. data/app/cells/decidim/content_blocks/participatory_space_hero_settings_form/show.erb +8 -0
  17. data/app/cells/decidim/content_blocks/participatory_space_hero_settings_form_cell.rb +13 -0
  18. data/app/cells/decidim/content_blocks/participatory_space_metadata_cell.rb +1 -1
  19. data/app/cells/decidim/data_consent/category.erb +1 -1
  20. data/app/cells/decidim/footer_pages_cell.rb +3 -3
  21. data/app/cells/decidim/nav_links/show.erb +2 -2
  22. data/app/cells/decidim/notification/moderated.erb +12 -0
  23. data/app/cells/decidim/notification_cell.rb +5 -1
  24. data/app/cells/decidim/profile/details.erb +1 -1
  25. data/app/cells/decidim/profile/tabs.erb +3 -2
  26. data/app/cells/decidim/progress_bar/show.erb +1 -1
  27. data/app/cells/decidim/progress_bar_cell.rb +2 -0
  28. data/app/cells/decidim/report_button/flag_modal.erb +5 -1
  29. data/app/cells/decidim/resource_types_filter/show.erb +3 -3
  30. data/app/cells/decidim/statistic/show.erb +2 -2
  31. data/app/cells/decidim/tags_cell.rb +3 -1
  32. data/app/cells/decidim/upload_modal/modal.erb +1 -2
  33. data/app/commands/decidim/create_omniauth_registration.rb +1 -3
  34. data/app/commands/decidim/messaging/reply_to_conversation.rb +3 -0
  35. data/app/commands/decidim/messaging/start_conversation.rb +3 -0
  36. data/app/controllers/concerns/decidim/devise_authentication_methods.rb +36 -0
  37. data/app/controllers/concerns/decidim/force_authentication.rb +1 -1
  38. data/app/controllers/concerns/decidim/paginable.rb +1 -1
  39. data/app/controllers/concerns/decidim/use_organization_time_zone.rb +1 -1
  40. data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +1 -22
  41. data/app/controllers/decidim/devise/sessions_controller.rb +1 -24
  42. data/app/controllers/decidim/gamification/badges_controller.rb +2 -0
  43. data/app/controllers/decidim/links_controller.rb +15 -2
  44. data/app/events/decidim/welcome_notification_event.rb +6 -9
  45. data/app/helpers/concerns/decidim/flash_helper_extensions.rb +2 -2
  46. data/app/helpers/decidim/application_helper.rb +0 -18
  47. data/app/helpers/decidim/cells_paginate_helper.rb +1 -1
  48. data/app/helpers/decidim/check_boxes_tree_helper.rb +7 -8
  49. data/app/helpers/decidim/layout_helper.rb +1 -1
  50. data/app/helpers/decidim/map_helper.rb +1 -1
  51. data/app/helpers/decidim/menu_helper.rb +2 -0
  52. data/app/helpers/decidim/newsletters_helper.rb +83 -16
  53. data/app/helpers/decidim/paginate_helper.rb +1 -1
  54. data/app/helpers/decidim/sanitize_helper.rb +9 -0
  55. data/app/helpers/decidim/social_share_button_helper.rb +1 -1
  56. data/app/helpers/decidim/user_profile_helper.rb +7 -2
  57. data/app/mailers/decidim/application_mailer.rb +40 -6
  58. data/app/mailers/decidim/messaging/conversation_mailer.rb +3 -72
  59. data/app/models/decidim/push_notification_message.rb +38 -0
  60. data/app/packs/entrypoints/decidim_overrides.scss +2 -0
  61. data/app/packs/images/decidim/.keep +0 -0
  62. data/app/packs/src/decidim/a11y.js +15 -1
  63. data/app/packs/src/decidim/abide_form_validator_fixer.js +44 -0
  64. data/app/packs/src/decidim/account_form.js +1 -1
  65. data/app/packs/src/decidim/data_consent/consent_manager.test.js +1 -1
  66. data/app/packs/src/decidim/data_consent/index.js +1 -1
  67. data/app/packs/src/decidim/direct_uploads/upload_field.js +1 -1
  68. data/app/packs/src/decidim/direct_uploads/upload_modal.js +5 -5
  69. data/app/packs/src/decidim/editor/extensions/hashtag/index.js +1 -1
  70. data/app/packs/src/decidim/editor/extensions/mention/index.js +1 -1
  71. data/app/packs/src/decidim/editor/extensions/video_embed/index.js +3 -0
  72. data/app/packs/src/decidim/editor/test/editor/create.test.js +1 -1
  73. data/app/packs/src/decidim/editor/test/extensions/bold.test.js +2 -3
  74. data/app/packs/src/decidim/editor/test/extensions/character_count.test.js +2 -2
  75. data/app/packs/src/decidim/editor/test/extensions/decidim_kit.test.js +2 -3
  76. data/app/packs/src/decidim/editor/test/extensions/dialog.test.js +2 -2
  77. data/app/packs/src/decidim/editor/test/extensions/emoji.test.js +2 -2
  78. data/app/packs/src/decidim/editor/test/extensions/hashtag.test.js +2 -2
  79. data/app/packs/src/decidim/editor/test/extensions/heading.test.js +2 -2
  80. data/app/packs/src/decidim/editor/test/extensions/image.test.js +4 -4
  81. data/app/packs/src/decidim/editor/test/extensions/indent.test.js +2 -2
  82. data/app/packs/src/decidim/editor/test/extensions/link.test.js +3 -3
  83. data/app/packs/src/decidim/editor/test/extensions/mention.test.js +2 -2
  84. data/app/packs/src/decidim/editor/test/extensions/ordered_list.test.js +2 -2
  85. data/app/packs/src/decidim/editor/test/extensions/video_embed.test.js +3 -3
  86. data/app/packs/src/decidim/editor/test/helpers.js +5 -4
  87. data/app/packs/src/decidim/editor/test/toolbar/basic.test.js +2 -2
  88. data/app/packs/src/decidim/editor/test/toolbar/content.test.js +2 -2
  89. data/app/packs/src/decidim/editor/test/toolbar/full.test.js +3 -3
  90. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic.js +6 -6
  91. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_block.js +2 -2
  92. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_formatting.js +1 -1
  93. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_indent.js +2 -2
  94. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_link.js +2 -2
  95. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_list.js +2 -2
  96. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_styling.js +2 -2
  97. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_content.js +7 -7
  98. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_content_styling.js +2 -2
  99. data/app/packs/src/decidim/editor/test/toolbar/shared/context.js +1 -1
  100. data/app/packs/src/decidim/editor/test/utilities/paste_transform.test.js +2 -2
  101. data/app/packs/src/decidim/external_domain_warning.js +13 -0
  102. data/app/packs/src/decidim/external_domain_warning.test.js +1 -1
  103. data/app/packs/src/decidim/external_link.js +48 -9
  104. data/app/packs/src/decidim/external_link.test.js +1 -1
  105. data/app/packs/src/decidim/focus_guard.js +8 -20
  106. data/app/packs/src/decidim/form_filter.component_for_testing.js +1 -1
  107. data/app/packs/src/decidim/form_filter.js +3 -3
  108. data/app/packs/src/decidim/geocoding/attach_input.js +1 -1
  109. data/app/packs/src/decidim/i18n.test.js +1 -1
  110. data/app/packs/src/decidim/index.js +33 -2
  111. data/app/packs/src/decidim/input_hashtags.js +1 -1
  112. data/app/packs/src/decidim/input_mentions.js +1 -1
  113. data/app/packs/src/decidim/input_multiple_mentions.js +1 -1
  114. data/app/packs/src/decidim/sw/index.js +3 -3
  115. data/app/packs/src/decidim/user_registrations.js +1 -1
  116. data/app/packs/src/decidim/vizzs/index.js +1 -1
  117. data/app/packs/stylesheets/decidim/_accordion.scss +2 -2
  118. data/app/packs/stylesheets/decidim/_cards.scss +4 -4
  119. data/app/packs/stylesheets/decidim/_dropdown.scss +2 -2
  120. data/app/packs/stylesheets/decidim/_layout.scss +7 -7
  121. data/app/packs/stylesheets/decidim/_modal_update.scss +1 -3
  122. data/app/packs/stylesheets/decidim/application.scss +0 -3
  123. data/app/packs/stylesheets/decidim/decidim_application.scss +4 -0
  124. data/app/packs/stylesheets/decidim/legacy/leaflet.scss +88 -107
  125. data/app/presenters/decidim/admin_log/oauth_application_resource_presenter.rb +1 -1
  126. data/app/presenters/decidim/admin_log/organization_presenter.rb +1 -1
  127. data/app/presenters/decidim/log/diff_presenter.rb +1 -1
  128. data/app/presenters/decidim/log/resource_presenter.rb +7 -1
  129. data/app/presenters/decidim/notification_to_mailer_presenter.rb +9 -0
  130. data/app/services/decidim/events_manager.rb +6 -0
  131. data/app/services/decidim/iframe_disabler.rb +4 -0
  132. data/app/services/decidim/log/diff_changeset_calculator.rb +1 -1
  133. data/app/services/decidim/push_notification_message_sender.rb +40 -0
  134. data/app/services/decidim/send_push_notification.rb +22 -8
  135. data/app/uploaders/decidim/background_image_uploader.rb +11 -0
  136. data/app/views/decidim/account/show.html.erb +2 -2
  137. data/app/views/decidim/application/_collection.html.erb +2 -2
  138. data/app/views/decidim/application/_document.html.erb +3 -3
  139. data/app/views/decidim/devise/registrations/new.html.erb +2 -2
  140. data/app/views/decidim/endorsements/update_buttons_and_counters.js.erb +2 -1
  141. data/app/views/decidim/gamification/badges/index.html.erb +34 -33
  142. data/app/views/decidim/links/_modal.html.erb +1 -1
  143. data/app/views/decidim/links/new.html.erb +3 -1
  144. data/app/views/decidim/manifests/show.json.erb +1 -1
  145. data/app/views/decidim/messaging/conversations/create.js.erb +1 -1
  146. data/app/views/decidim/notifications_digest_mailer/_email_content.html.erb +7 -0
  147. data/app/views/decidim/notifications_settings/show.html.erb +6 -6
  148. data/app/views/decidim/offline/show.html.erb +15 -9
  149. data/app/views/decidim/pages/_tabbed.html.erb +2 -2
  150. data/app/views/decidim/searches/_filters.html.erb +2 -2
  151. data/app/views/decidim/shared/_filters.html.erb +2 -2
  152. data/app/views/decidim/shared/_orders.html.erb +2 -2
  153. data/app/views/decidim/shared/filters/_collection.html.erb +5 -3
  154. data/app/views/decidim/shared/filters/_dropdown_label.html.erb +21 -19
  155. data/app/views/layouts/decidim/_head.html.erb +1 -0
  156. data/app/views/layouts/decidim/_js_configuration.html.erb +3 -1
  157. data/app/views/layouts/decidim/_wrapper.html.erb +1 -1
  158. data/app/views/layouts/decidim/footer/_main_links.html.erb +3 -1
  159. data/app/views/layouts/decidim/footer/_main_social_media_links.html.erb +5 -5
  160. data/app/views/layouts/decidim/footer/_mini.html.erb +2 -2
  161. data/app/views/layouts/decidim/header/_main_links_desktop.html.erb +4 -2
  162. data/app/views/layouts/decidim/header/_menu_breadcrumb_items.html.erb +2 -0
  163. data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +1 -1
  164. data/app/views/layouts/decidim/shared/_layout_user_profile.html.erb +2 -2
  165. data/config/assets.rb +1 -0
  166. data/config/locales/ar.yml +60 -8
  167. data/config/locales/bg.yml +909 -2
  168. data/config/locales/ca.yml +31 -24
  169. data/config/locales/cs.yml +7 -3
  170. data/config/locales/de.yml +37 -30
  171. data/config/locales/el.yml +11 -7
  172. data/config/locales/en.yml +10 -3
  173. data/config/locales/es-MX.yml +17 -10
  174. data/config/locales/es-PY.yml +17 -10
  175. data/config/locales/es.yml +59 -52
  176. data/config/locales/eu.yml +26 -10
  177. data/config/locales/fi-plain.yml +11 -4
  178. data/config/locales/fi.yml +14 -7
  179. data/config/locales/fr-CA.yml +14 -7
  180. data/config/locales/fr.yml +14 -7
  181. data/config/locales/ga-IE.yml +9 -0
  182. data/config/locales/gl.yml +5 -2
  183. data/config/locales/he-IL.yml +1 -0
  184. data/config/locales/hu.yml +264 -8
  185. data/config/locales/id-ID.yml +0 -2
  186. data/config/locales/it.yml +9 -6
  187. data/config/locales/ja.yml +14 -7
  188. data/config/locales/kaa.yml +5 -0
  189. data/config/locales/lb.yml +9 -6
  190. data/config/locales/lt.yml +8 -12
  191. data/config/locales/lv.yml +8 -3
  192. data/config/locales/nl.yml +8 -3
  193. data/config/locales/no.yml +9 -6
  194. data/config/locales/pl.yml +616 -2
  195. data/config/locales/pt-BR.yml +202 -19
  196. data/config/locales/pt.yml +9 -6
  197. data/config/locales/ro-RO.yml +10 -5
  198. data/config/locales/ru.yml +15 -2
  199. data/config/locales/sk.yml +8 -3
  200. data/config/locales/sl.yml +8 -0
  201. data/config/locales/sv.yml +32 -6
  202. data/config/locales/tr-TR.yml +24 -9
  203. data/config/locales/uk.yml +22 -2
  204. data/config/locales/zh-CN.yml +0 -6
  205. data/config/locales/zh-TW.yml +10 -11
  206. data/decidim-core.gemspec +90 -0
  207. data/lib/decidim/asset_router/storage.rb +2 -0
  208. data/lib/decidim/attribute_encryptor.rb +6 -4
  209. data/lib/decidim/attributes/time_with_zone.rb +1 -1
  210. data/lib/decidim/core/engine.rb +7 -6
  211. data/lib/decidim/core/seeds.rb +37 -33
  212. data/lib/decidim/core/test/factories.rb +296 -89
  213. data/lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb +6 -26
  214. data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +8 -26
  215. data/lib/decidim/core/test/shared_examples/comments_examples.rb +76 -6
  216. data/lib/decidim/core/test/shared_examples/has_attachment_collections.rb +8 -6
  217. data/lib/decidim/core/test/shared_examples/has_attachments.rb +8 -8
  218. data/lib/decidim/core/test/shared_examples/has_category.rb +27 -0
  219. data/lib/decidim/core/test/shared_examples/has_reference.rb +1 -1
  220. data/lib/decidim/core/test/shared_examples/has_space_in_mcell_examples.rb +1 -1
  221. data/lib/decidim/core/test/shared_examples/logo_email.rb +2 -2
  222. data/lib/decidim/core/test/shared_examples/map_examples.rb +3 -0
  223. data/lib/decidim/core/test/shared_examples/resource_endorsed_event_examples.rb +5 -2
  224. data/lib/decidim/core/test/shared_examples/resource_locator_presenter_examples.rb +134 -0
  225. data/lib/decidim/core/test/shared_examples/simple_event.rb +18 -2
  226. data/lib/decidim/core/test.rb +1 -0
  227. data/lib/decidim/core/version.rb +1 -1
  228. data/lib/decidim/core.rb +7 -1
  229. data/lib/decidim/engine_router.rb +17 -4
  230. data/lib/decidim/events/base_event.rb +7 -3
  231. data/lib/decidim/events/simple_event.rb +3 -17
  232. data/lib/decidim/form_builder.rb +8 -2
  233. data/lib/decidim/has_category.rb +1 -1
  234. data/lib/decidim/has_conversations.rb +91 -0
  235. data/lib/decidim/organization_settings.rb +10 -2
  236. data/lib/decidim/participable.rb +17 -0
  237. data/lib/decidim/upgrade/wysiwyg_migrator.rb +7 -0
  238. data/lib/decidim/view_model.rb +1 -0
  239. data/lib/decidim/webpacker/webpack/.modernizrrc +9 -0
  240. data/lib/premailer/adapter/decidim.rb +5 -4
  241. data/lib/tasks/decidim_reminders_tasks.rake +1 -0
  242. data/lib/tasks/upgrade/decidim_fix_categorization.rake +15 -0
  243. metadata +26 -27
  244. data/app/views/decidim/searches/index.js.erb +0 -7
  245. data/config/brakeman.ignore +0 -37
  246. data/config/environment.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5b30446f8e883cb4610be652a64155471870ba9271583ce5b7061105f8d0c68
4
- data.tar.gz: 300643e7aaf06cde799abae047625d5e73217f9669addea64be65b81ca56a194
3
+ metadata.gz: 524ec4d380f620c07119a6ccbee1b28408f6072799aa32cd74a1836f1ede5070
4
+ data.tar.gz: 4e1b60ce9a2cb9e340b0db3a22f66b326ade8f05cb8551352b39fe4198a06bbb
5
5
  SHA512:
6
- metadata.gz: 9bf0e3704aecce6bbf26a5603990f07a2d05b44f1d06cec5f8804b563a71e322cd225ebdaf5b487f001eaa485173b09c07643495e3d58b374ad03e59b0505f8c
7
- data.tar.gz: f24a8579f4ce4916b9786c4775cb3e865de4da331860a9105768163d868b0b8fc7191d738c23d9c0e8942a924d2c8c681c2f6db8b09aae6942d233e711d38f3e
6
+ metadata.gz: c8ff8135707ab3ae9aa1d483cd41d104385c079e8dcbd575c3c618ae05c524c345b340bd4b82c47eccf533dc98e187985ba76ddb2293332977449ed8af95b4b3
7
+ data.tar.gz: 9188473aa2d7c440f2aa773e9e08824b2c847f8a29a6d1d1ff75900e9a2fd325f860d80d8faad5d2498dc594f20b92ad9e8f7e6b98551ba9f68ffe24a879dcc1
@@ -39,9 +39,9 @@ module Decidim
39
39
 
40
40
  case resource_title
41
41
  when String
42
- resource_title
42
+ decidim_html_escape(resource_title)
43
43
  when Hash
44
- translated_attribute(resource_title)
44
+ decidim_escape_translated(resource_title)
45
45
  end
46
46
  end
47
47
 
@@ -1,9 +1,27 @@
1
- <div class="address__container">
2
- <%= icon "map-pin-line" %>
3
- <div class="address">
4
- <div class="address__location"><%= t(model.type_of_meeting, scope: "decidim.meetings.meetings.filters.type_values") %></div>
5
- <a href="<%= model.online_meeting_url %>" target="_blank" rel="noopener noreferrer" class="address__hints underline break-all">
6
- <%= model.online_meeting_url %>
7
- </a>
8
- </div>
9
- </div>
1
+ <ul>
2
+ <li class="mb-4">
3
+ <div class="address__container">
4
+ <%= icon "map-pin-line" %>
5
+ <div class="address">
6
+ <div class="address__location"><%= t(model.type_of_meeting, scope: "decidim.meetings.meetings.filters.type_values") %></div>
7
+ <% if display_online_meeting_url? %>
8
+ <a href="<%= model.online_meeting_url %>" target="_blank" rel="noopener noreferrer" class="address__hints underline break-all">
9
+ <%= model.online_meeting_url %>
10
+ <% end %>
11
+ </a>
12
+ </div>
13
+ </div>
14
+ </li>
15
+ <% if display_start_and_end_time? %>
16
+ <li>
17
+ <div class="address__container">
18
+ <%= icon "time-line" %>
19
+ <div class="address">
20
+ <div class="address__location">
21
+ <%= start_and_end_time %>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </li>
26
+ <% end %>
27
+ </ul>
@@ -1,14 +1,29 @@
1
- <div class="address__container">
2
- <%= icon "map-pin-line" %>
3
- <div class="address">
4
- <% if has_location? %>
5
- <div class="address__location"><%= location %></div>
6
- <% end %>
1
+ <ul>
2
+ <li class="mb-4">
3
+ <div class="address__container">
4
+ <%= icon "map-pin-line" %>
5
+ <div class="address">
6
+ <% if has_location? %>
7
+ <div class="address__location"><%= location %></div>
8
+ <% end %>
7
9
 
8
- <div class="address__address"><%= address %></div>
10
+ <div class="address__address"><%= address %></div>
9
11
 
10
- <% if has_location_hints? %>
11
- <div class="address__hints"><%= location_hints %></div>
12
- <% end %>
13
- </div>
14
- </div>
12
+ <% if has_location_hints? %>
13
+ <div class="address__hints"><%= location_hints %></div>
14
+ <% end %>
15
+ </div>
16
+ </div>
17
+ </li>
18
+ <% if display_start_and_end_time? %>
19
+ <li>
20
+ <div class="address__container">
21
+ <%= icon "time-line" %>
22
+ <div class="address">
23
+ <div class="address__location">
24
+ <%= start_and_end_time %>
25
+ </div>
26
+ </div>
27
+ </li>
28
+ <% end %>
29
+ </ul>
@@ -32,5 +32,34 @@ module Decidim
32
32
  def address
33
33
  decidim_sanitize(translated_attribute(model.address))
34
34
  end
35
+
36
+ def display_start_and_end_time?
37
+ model.respond_to?(:start_time) && model.respond_to?(:end_time)
38
+ end
39
+
40
+ def start_and_end_time
41
+ <<~HTML
42
+ #{with_tooltip(l(model.start_time, format: :tooltip)) { start_time }}
43
+ -
44
+ #{with_tooltip(l(model.end_time, format: :tooltip)) { end_time }}
45
+ HTML
46
+ end
47
+
48
+ def display_online_meeting_url?
49
+ return true unless model.respond_to?(:online?)
50
+ return true unless model.respond_to?(:iframe_access_level_allowed_for_user?)
51
+
52
+ model.online? && model.iframe_access_level_allowed_for_user?(current_user)
53
+ end
54
+
55
+ private
56
+
57
+ def start_time
58
+ l model.start_time, format: "%H:%M %p"
59
+ end
60
+
61
+ def end_time
62
+ l model.end_time, format: "%H:%M %p %Z"
63
+ end
35
64
  end
36
65
  end
@@ -5,7 +5,7 @@
5
5
  </div>
6
6
  <% end %>
7
7
 
8
- <span class="flash__message">
8
+ <div class="flash__message">
9
9
  <%= text %>
10
- </span>
10
+ </div>
11
11
  <% end %>
@@ -1,16 +1,16 @@
1
1
  <% data = has_tooltip? ? { tooltip: render(:profile_minicard).html_safe } : nil %>
2
- <div class="author" data-author>
3
- <%= content_tag :div, class: "author__container#{" is-compact" if layout == :compact}", data: do %>
2
+ <span class="author" data-author>
3
+ <%= content_tag :span, class: "author__container#{" is-compact" if layout == :compact}", data: do %>
4
4
  <% if layout == :compact %>
5
5
  <%= render :avatar %>
6
6
 
7
- <div>
7
+ <span>
8
8
  <%= render :name %>
9
9
 
10
10
  <% context_actions.each do |action| %>
11
11
  <%= render action %>
12
12
  <% end %>
13
- </div>
13
+ </span>
14
14
  <% elsif layout == :avatar %>
15
15
  <%= render :avatar %>
16
16
  <% else %>
@@ -24,4 +24,4 @@
24
24
  <%= render action %>
25
25
  <% end %>
26
26
  <% end %>
27
- </div>
27
+ </span>
@@ -1,6 +1,10 @@
1
- <div data-dialog-container>
2
- <%= icon "lock-line" %>
3
- <h2 id="dialog-title-authorizationModal" tabindex="-1" data-dialog-title><%= title %></h2>
1
+ <% add_decidim_page_title(title) %>
2
+
3
+ <main data-dialog-container class="text-center mt-8">
4
+ <div class="flex justify-center">
5
+ <%= icon "lock-line", class: "w-20 h-20" %>
6
+ </div>
7
+ <h1 tabindex="-1" class="h1" data-dialog-title><%= title %></h1>
4
8
  <div>
5
9
  <div class="authorization-modal__verification-container">
6
10
  <% verifications.each do |verification| %>
@@ -25,4 +29,4 @@
25
29
  <% end %>
26
30
  </div>
27
31
  </div>
28
- </div>
32
+ </main>
@@ -3,6 +3,7 @@
3
3
  module Decidim
4
4
  class AuthorizationModalCell < Decidim::ViewModel
5
5
  include LayoutHelper
6
+ include Decidim::MetaTagsHelper
6
7
 
7
8
  delegate :authorize_action_path, to: :controller
8
9
 
@@ -1,5 +1,5 @@
1
1
  <div class="py-4 space-y-2">
2
- <a href="" class="text-lg text-secondary font-semibold hover:underline"><%= title %></a>
2
+ <a href="" class="text-lg text-secondary font-semibold hover:underline"><%= decidim_html_escape(title) %></a>
3
3
  <div class="flex items-center divide-x divide-gray-3">
4
4
  <% metadata.first(4).each do |item| %>
5
5
  <div class="flex items-center gap-1 px-4 lg:px-6 first:pl-0 last:pr-0 max-w-xs">
@@ -3,12 +3,12 @@
3
3
  <% hook_output = render_hook(item[:hook]) %>
4
4
  <% next if hook_output.blank? %>
5
5
 
6
- <%= content_tag :span, data: item[:data_attributes] do %>
6
+ <%= content_tag :div, data: item[:data_attributes] do %>
7
7
  <%= icon item[:icon] if item[:icon].present? %>
8
8
  <%= hook_output %>
9
9
  <% end %>
10
10
  <% else %>
11
- <%= content_tag :span, data: item[:data_attributes] do %>
11
+ <%= content_tag :div, data: item[:data_attributes] do %>
12
12
  <%= icon item[:icon] if item[:icon].present? %>
13
13
  <% if item[:text].present? %>
14
14
  <%= link_to_if enable_links? && item.has_key?(:url), item[:text], item[:url] %>
@@ -75,7 +75,7 @@ module Decidim
75
75
 
76
76
  {
77
77
  cell: "decidim/coauthorships",
78
- args: [resource, { stack: true }]
78
+ args: [resource, { stack: true, context_actions: [] }]
79
79
  }
80
80
  end
81
81
 
@@ -105,11 +105,11 @@ module Decidim
105
105
  }
106
106
  end
107
107
 
108
- def duration_item
108
+ def start_date_item
109
109
  return if dates_blank?
110
110
 
111
111
  {
112
- text: distance_of_time_in_words(start_date, end_date, scope: "datetime.distance_in_words.short"),
112
+ text: I18n.l(start_date, format: "%H:%M %p %Z"),
113
113
  icon: "time-line"
114
114
  }
115
115
  end
@@ -16,7 +16,7 @@ module Decidim
16
16
  cell(
17
17
  "decidim/collapsible_authors",
18
18
  presenters_for_identities(model),
19
- options
19
+ options.merge(from: model)
20
20
  )
21
21
  end
22
22
  end
@@ -5,6 +5,12 @@ module Decidim
5
5
  # A cell to be rendered as a content block with the latest activities performed
6
6
  # in a Decidim Organization.
7
7
  class MenuBreadcrumbLastActivityCell < LastActivityCell
8
+ def show
9
+ return if current_user.blank? && current_organization&.force_users_to_authenticate_before_access_organization
10
+
11
+ super
12
+ end
13
+
8
14
  private
9
15
 
10
16
  def activities
@@ -7,19 +7,35 @@ module Decidim
7
7
  include Decidim::TranslationsHelper
8
8
  include Decidim::TwitterSearchHelper
9
9
 
10
- attr_reader :cta_text, :cta_path
10
+ delegate :title, :hashtag, :attached_uploader, to: :resource
11
11
 
12
- delegate :title, :subtitle, :attached_uploader, :hashtag, to: :resource
12
+ def cta_text
13
+ return unless model
14
+
15
+ @cta_text ||= translated_attribute(model.settings.button_text).presence
16
+ end
17
+
18
+ def cta_path
19
+ return unless model
20
+
21
+ @cta_path ||= translated_attribute(model.settings.button_url).presence
22
+ end
13
23
 
14
24
  def title_text
15
- translated_attribute(title)
25
+ decidim_escape_translated(title)
16
26
  end
17
27
 
18
28
  def subtitle_text
19
- translated_attribute(subtitle)
29
+ return unless resource.respond_to?(:subtitle)
30
+
31
+ decidim_escape_translated(resource.subtitle)
20
32
  end
21
33
 
34
+ # If it is called from the landing page content block, use the background image defined there
35
+ # Else, use the banner image defined in the space (for assemblies)
22
36
  def image_path
37
+ return model.images_container.attached_uploader(:background_image).path if model.respond_to?(:images_container)
38
+
23
39
  attached_uploader(:banner_image).path
24
40
  end
25
41
 
@@ -0,0 +1,8 @@
1
+ <% form.fields_for :settings, form.object.settings do |settings_fields| %>
2
+ <%= settings_fields.translated :text_field, :button_text, label: t("decidim.content_blocks.cta_settings_form.button_text") %>
3
+ <%= settings_fields.translated :text_field, :button_url, label: t("decidim.content_blocks.cta_settings_form.button_url") %>
4
+ <% end %>
5
+
6
+ <% form.fields_for :images, form.object.images do |images_fields| %>
7
+ <%= images_fields.upload :background_image, label: t("decidim.content_blocks.cta_settings_form.background_image") %>
8
+ <% end %>
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ContentBlocks
5
+ class ParticipatorySpaceHeroSettingsFormCell < Decidim::ViewModel
6
+ alias form model
7
+
8
+ def content_block
9
+ options[:content_block]
10
+ end
11
+ end
12
+ end
13
+ end
@@ -11,7 +11,7 @@ module Decidim
11
11
 
12
12
  def metadata_valued_items
13
13
  metadata_items.filter_map do |item|
14
- next if (value = translated_attribute(presented_space.send(item))).blank?
14
+ next if (value = decidim_escape_translated(presented_space.send(item))).blank?
15
15
 
16
16
  {
17
17
  title: t(item, scope: translations_scope),
@@ -2,7 +2,7 @@
2
2
  <div class="cookies__category-trigger">
3
3
  <label for="dc-<%= category[:slug] %>" class="cookies__category-toggle">
4
4
  <input
5
- <%= %(checked="checked") if category[:mandatory] %>
5
+ <%== %(checked="checked") if category[:mandatory] %>
6
6
  id="dc-<%= category[:slug] %>"
7
7
  type="checkbox"
8
8
  name="<%= category[:slug] %>"
@@ -42,7 +42,7 @@ module Decidim
42
42
  .static_pages_accessible_for(current_user)
43
43
  .where(show_in_footer: true, topic_id: nil)
44
44
  .where.not(slug: "terms-and-conditions").map do |page|
45
- { title: translated_attribute(page.title), path: decidim.page_path(page) }
45
+ { title: decidim_escape_translated(page.title), path: decidim.page_path(page) }
46
46
  end
47
47
  end
48
48
 
@@ -51,9 +51,9 @@ module Decidim
51
51
  next if (topic_pages = topic.accessible_pages_for(current_user).where(show_in_footer: true)).blank?
52
52
 
53
53
  {
54
- title: translated_attribute(topic.title),
54
+ title: decidim_escape_translated(topic.title),
55
55
  pages: topic_pages.map do |page|
56
- { title: translated_attribute(page.title), path: decidim.page_path(page) }
56
+ { title: decidim_escape_translated(page.title), path: decidim.page_path(page) }
57
57
  end
58
58
  }
59
59
  end.compact
@@ -1,10 +1,10 @@
1
1
  <div class="participatory-space__nav-container">
2
- <button id="dropdown-trigger-participatory-space" data-component="dropdown" data-target="dropdown-menu-participatory-space" data-auto-close="true" data-disabled-md="true" data-scroll-to-menu="true">
2
+ <button id="dropdown-trigger-participatory-space" data-component="dropdown" data-target="dropdown-menu-participatory-space" data-auto-close="true" data-scroll-to-menu="true">
3
3
  <span><%= t("decidim.searches.filters.jump_to") %></span>
4
4
  <%= icon "arrow-down-s-line" %>
5
5
  <%= icon "arrow-up-s-line" %>
6
6
  </button>
7
- <ul id="dropdown-menu-participatory-space" class="participatory-space__nav">
7
+ <ul id="dropdown-menu-participatory-space" class="participatory-space__nav" aria-hidden="true">
8
8
  <% model.each do |item| %>
9
9
  <li>
10
10
  <%= link_to item[:url], class: "participatory-space__nav-item" do %>
@@ -0,0 +1,12 @@
1
+ <div class="notification" data-notification>
2
+ <div class="notification__wrapper">
3
+ <div class="notification__time" title="<%= l(notification.created_at) %>"> <%= notification.created_at_in_words %></div>
4
+ <div class="notification__snippet">
5
+ <span class="notification__snippet-title text-gray"><%= t("decidim.notifications.show.moderated") %></span>
6
+ </div>
7
+ </div>
8
+ <%= link_to model, remote: true, method: :delete, class: "notification__button", data: { "notification-read": "" } do %>
9
+ <span class="sr-only md:not-sr-only"><%= t("mark_as_read", scope: "layouts.decidim.notifications_dashboard") %></span>
10
+ <%= icon "check-line", class: "fill-current" %>
11
+ <% end %>
12
+ </div>
@@ -9,7 +9,11 @@ module Decidim
9
9
  include Decidim::SanitizeHelper
10
10
 
11
11
  def show
12
- render :show
12
+ if notification.event_class_instance.try(:hidden_resource?)
13
+ render :moderated
14
+ else
15
+ render :show
16
+ end
13
17
  end
14
18
 
15
19
  def notification_title
@@ -9,7 +9,7 @@
9
9
  <%= icon detail[:icon] %>
10
10
  <span>
11
11
  <% if detail[:url].present? %>
12
- <%= link_to(detail[:url], detail[:text]) %>
12
+ <%= link_to(detail[:url], detail[:text], rel: "nofollow noopener noreferrer") %>
13
13
  <% else %>
14
14
  <%= detail[:text] %>
15
15
  <% end %>
@@ -1,6 +1,7 @@
1
1
  <% tab_items.each do |tab_item| %>
2
- <li class="profile__tab<%= " is-active" if is_active_link?(tab_item[:path]) %>">
3
- <%= link_to tab_item[:path], title: tab_item[:text], class: "profile__tab-item" do %>
2
+ <% active_link = is_active_link?(tab_item[:path]) %>
3
+ <li class="profile__tab<%= " is-active" if active_link %>">
4
+ <%= link_to tab_item[:path], title: tab_item[:text], class: "profile__tab-item", aria: { current: active_link ? "page" : nil } do %>
4
5
  <%= icon tab_item[:icon] %>
5
6
  <span><%= tab_item[:text] %></span>
6
7
  <% if tab_item[:count].present? %>
@@ -7,7 +7,7 @@
7
7
  <%= content_tag :div, units_name_text, class: "progress-bar__units" if units_name %>
8
8
 
9
9
  <% if total != 0 %>
10
- <div class="progress-bar" role="progressbar" tabindex="0" aria-label="<%= units_name.present? ? units_name_text : t("decidim.shared.progress") %>" aria-valuenow="<%= percentage %>" aria-valuemin="0" aria-valuetext="<%= percentage %> %" aria-valuemax="<%= total %>">
10
+ <div class="progress-bar" role="progressbar" aria-label="<%= units_name.present? ? units_name_text : t("decidim.shared.progress") %>" aria-valuenow="<%= number_with_precision(percentage, separator: ".", precision: 2) %>" aria-valuemin="0" aria-valuemax="100" aria-valuetext="<%= number_to_percentage(percentage, precision: 2) %>">
11
11
  <div style="width: <%= percentage %>%"></div>
12
12
  </div>
13
13
  <% end %>
@@ -29,6 +29,8 @@ module Decidim
29
29
  # total: 10,
30
30
  # )
31
31
  class ProgressBarCell < Decidim::ViewModel
32
+ include ActionView::Helpers::NumberHelper
33
+
32
34
  private
33
35
 
34
36
  def element_id
@@ -34,11 +34,15 @@
34
34
  <%= f.check_box :hide,
35
35
  label: t("decidim.shared.flag_modal.hide_content"),
36
36
  include_hidden: false,
37
+ id: hide_checkbox_id,
37
38
  data: {
38
39
  label_action: t("decidim.shared.flag_modal.hide"),
39
40
  label_report: t("decidim.shared.flag_modal.report"),
40
41
  hide: "true"
41
- }, id: hide_checkbox_id %>
42
+ },
43
+ label_options: {
44
+ for: hide_checkbox_id
45
+ } %>
42
46
  <% end %>
43
47
  <% end %>
44
48
 
@@ -1,5 +1,5 @@
1
1
  <div id="<%= id %>" class="filter-container">
2
- <button id="dropdown-trigger-resource" data-component="dropdown" data-target="dropdown-menu-resource" data-auto-close="true" data-disabled-md="true">
2
+ <button id="dropdown-trigger-resource" data-component="dropdown" data-target="dropdown-menu-resource" data-auto-close="true">
3
3
  <% resource_types.each do |resource_type| %>
4
4
  <span data-value="<%= resource_type[0] %>" class="<%= "is-active" if filter_param == resource_type[0] %>">
5
5
  <%= text_with_resource_icon(*resource_type) %>
@@ -8,7 +8,7 @@
8
8
  <%= icon "arrow-down-s-line" %>
9
9
  <%= icon "arrow-up-s-line" %>
10
10
  </button>
11
- <%= filter_form_for filter, form_path, class: "new_filter", id: "dropdown-menu-resource" do |form| %>
11
+ <%= filter_form_for filter, form_path, :class => "new_filter", :id => "dropdown-menu-resource", "aria-hidden" => true do |form| %>
12
12
  <%= form.collection_radio_buttons(
13
13
  filter_param_key,
14
14
  resource_types,
@@ -16,7 +16,7 @@
16
16
  :last,
17
17
  { checked: filter_param }
18
18
  ) do |builder|
19
- builder.label { builder.radio_button(class: "reset-defaults", hidden: true) + content_tag(:div, text_with_resource_icon(builder.value, builder.text), class: "filter") }
19
+ builder.label { builder.radio_button(class: "reset-defaults", hidden: true) + content_tag(:span, text_with_resource_icon(builder.value, builder.text), class: "filter") }
20
20
  end %>
21
21
  <% end %>
22
22
  </div>
@@ -1,7 +1,7 @@
1
1
  <div class="statistic <%= stat_dom_class %>" data-statistic>
2
- <h3 class="statistic__title" title="<%= stat_title %>">
2
+ <span class="statistic__title" title="<%= stat_title %>">
3
3
  <%= stat_title %>
4
- </h3>
4
+ </span>
5
5
  <span class="statistic__number">
6
6
  <%= stat_number %>
7
7
  </span>
@@ -9,6 +9,8 @@ module Decidim
9
9
  # <%= cell("decidim/category", model.category, context: {resource: model}) %>
10
10
  #
11
11
  class TagsCell < Decidim::ViewModel
12
+ include Decidim::SanitizeHelper
13
+
12
14
  def show
13
15
  render if category? || scope?
14
16
  end
@@ -69,7 +71,7 @@ module Decidim
69
71
  end
70
72
 
71
73
  def category_name
72
- model.category.translated_name
74
+ decidim_html_escape model.category.translated_name
73
75
  end
74
76
 
75
77
  def category_path
@@ -60,8 +60,7 @@
60
60
  <%= t("decidim.shared.confirm_modal.cancel") %>
61
61
  </button>
62
62
  <button type="button" class="button button__sm md:button__lg button__secondary" data-dropzone-save data-dialog-close="<%= modal_id %>" disabled>
63
- <%= t("next", scope: "decidim.messaging.conversations.index") %>
64
- <%= icon "arrow-right-line", class: "fill-current" %>
63
+ <%= t("save", scope: "decidim.forms.upload.labels") %>
65
64
  </button>
66
65
  </div>
67
66
  <% end %>
@@ -57,13 +57,11 @@ module Decidim
57
57
  # to be marked confirmed.
58
58
  @user.skip_confirmation! if !@user.confirmed? && @user.email == verified_email
59
59
  else
60
- generated_password = SecureRandom.hex
61
-
62
60
  @user.email = (verified_email || form.email)
63
61
  @user.name = form.name
64
62
  @user.nickname = form.normalized_nickname
65
63
  @user.newsletter_notifications_at = nil
66
- @user.password = generated_password
64
+ @user.password = SecureRandom.hex
67
65
  if form.avatar_url.present?
68
66
  url = URI.parse(form.avatar_url)
69
67
  filename = File.basename(url.path)
@@ -54,11 +54,13 @@ module Decidim
54
54
  notify(manager) do
55
55
  ConversationMailer.new_group_message(sender, manager, conversation, message, recipient).deliver_later
56
56
  end
57
+ Decidim::PushNotificationMessageSender.new.new_group_message(sender, manager, conversation, message, recipient).deliver
57
58
  end
58
59
  else
59
60
  notify(recipient) do
60
61
  ConversationMailer.new_message(sender, recipient, conversation, message).deliver_later
61
62
  end
63
+ Decidim::PushNotificationMessageSender.new.new_message(sender, recipient, conversation, message).deliver
62
64
  end
63
65
  end
64
66
  end
@@ -68,6 +70,7 @@ module Decidim
68
70
  notify(recipient) do
69
71
  ConversationMailer.comanagers_new_message(sender, recipient, conversation, message, form.context.current_user).deliver_later
70
72
  end
73
+ Decidim::PushNotificationMessageSender.new.comanagers_new_message(sender, recipient, conversation, message, form.context.current_user).deliver
71
74
  end
72
75
  end
73
76
 
@@ -54,11 +54,13 @@ module Decidim
54
54
  notify(manager) do
55
55
  ConversationMailer.new_group_conversation(originator, manager, conversation, recipient).deliver_later
56
56
  end
57
+ Decidim::PushNotificationMessageSender.new.new_group_conversation(originator, manager, conversation, recipient).deliver
57
58
  end
58
59
  else
59
60
  notify(recipient) do
60
61
  ConversationMailer.new_conversation(originator, recipient, conversation).deliver_later
61
62
  end
63
+ Decidim::PushNotificationMessageSender.new.new_conversation(originator, recipient, conversation).deliver
62
64
  end
63
65
  end
64
66
  end
@@ -68,6 +70,7 @@ module Decidim
68
70
  notify(recipient) do
69
71
  ConversationMailer.comanagers_new_conversation(originator, recipient, conversation, form.context.current_user).deliver_later
70
72
  end
73
+ Decidim::PushNotificationMessageSender.new.comanagers_new_conversation(originator, recipient, conversation, form.context.current_user).deliver
71
74
  end
72
75
  end
73
76