decidim-core 0.28.0 → 0.28.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) 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/authorization_modal/show.erb +8 -4
  7. data/app/cells/decidim/authorization_modal_cell.rb +1 -0
  8. data/app/cells/decidim/card_metadata_cell.rb +3 -3
  9. data/app/cells/decidim/coauthorships_cell.rb +1 -1
  10. data/app/cells/decidim/content_blocks/menu_breadcrumb_last_activity_cell.rb +6 -0
  11. data/app/cells/decidim/content_blocks/participatory_space_hero_cell.rb +20 -4
  12. data/app/cells/decidim/content_blocks/participatory_space_hero_settings_form/show.erb +8 -0
  13. data/app/cells/decidim/content_blocks/participatory_space_hero_settings_form_cell.rb +13 -0
  14. data/app/cells/decidim/content_blocks/participatory_space_metadata_cell.rb +1 -1
  15. data/app/cells/decidim/footer_pages_cell.rb +3 -3
  16. data/app/cells/decidim/profile/tabs.erb +3 -2
  17. data/app/cells/decidim/tags_cell.rb +3 -1
  18. data/app/cells/decidim/upload_modal/modal.erb +2 -2
  19. data/app/commands/decidim/create_omniauth_registration.rb +1 -3
  20. data/app/commands/decidim/messaging/reply_to_conversation.rb +3 -0
  21. data/app/commands/decidim/messaging/start_conversation.rb +3 -0
  22. data/app/controllers/concerns/decidim/devise_authentication_methods.rb +36 -0
  23. data/app/controllers/concerns/decidim/paginable.rb +1 -1
  24. data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +1 -22
  25. data/app/controllers/decidim/devise/sessions_controller.rb +1 -24
  26. data/app/events/decidim/welcome_notification_event.rb +6 -9
  27. data/app/helpers/decidim/application_helper.rb +0 -18
  28. data/app/helpers/decidim/cells_paginate_helper.rb +1 -1
  29. data/app/helpers/decidim/check_boxes_tree_helper.rb +6 -6
  30. data/app/helpers/decidim/layout_helper.rb +1 -1
  31. data/app/helpers/decidim/map_helper.rb +1 -1
  32. data/app/helpers/decidim/menu_helper.rb +2 -0
  33. data/app/helpers/decidim/newsletters_helper.rb +83 -16
  34. data/app/helpers/decidim/paginate_helper.rb +1 -1
  35. data/app/helpers/decidim/sanitize_helper.rb +9 -0
  36. data/app/helpers/decidim/social_share_button_helper.rb +1 -1
  37. data/app/helpers/decidim/user_profile_helper.rb +7 -2
  38. data/app/mailers/decidim/messaging/conversation_mailer.rb +3 -72
  39. data/app/models/decidim/push_notification_message.rb +38 -0
  40. data/app/packs/entrypoints/decidim_overrides.scss +2 -0
  41. data/app/packs/images/decidim/.keep +0 -0
  42. data/app/packs/src/decidim/a11y.js +1 -1
  43. data/app/packs/src/decidim/account_form.js +1 -1
  44. data/app/packs/src/decidim/data_consent/consent_manager.test.js +1 -1
  45. data/app/packs/src/decidim/data_consent/index.js +1 -1
  46. data/app/packs/src/decidim/direct_uploads/upload_field.js +1 -1
  47. data/app/packs/src/decidim/direct_uploads/upload_modal.js +10 -6
  48. data/app/packs/src/decidim/editor/extensions/hashtag/index.js +1 -1
  49. data/app/packs/src/decidim/editor/extensions/mention/index.js +1 -1
  50. data/app/packs/src/decidim/editor/extensions/video_embed/index.js +3 -0
  51. data/app/packs/src/decidim/editor/test/editor/create.test.js +1 -1
  52. data/app/packs/src/decidim/editor/test/extensions/bold.test.js +2 -3
  53. data/app/packs/src/decidim/editor/test/extensions/character_count.test.js +2 -2
  54. data/app/packs/src/decidim/editor/test/extensions/decidim_kit.test.js +2 -3
  55. data/app/packs/src/decidim/editor/test/extensions/dialog.test.js +2 -2
  56. data/app/packs/src/decidim/editor/test/extensions/emoji.test.js +2 -2
  57. data/app/packs/src/decidim/editor/test/extensions/hashtag.test.js +2 -2
  58. data/app/packs/src/decidim/editor/test/extensions/heading.test.js +2 -2
  59. data/app/packs/src/decidim/editor/test/extensions/image.test.js +4 -4
  60. data/app/packs/src/decidim/editor/test/extensions/indent.test.js +2 -2
  61. data/app/packs/src/decidim/editor/test/extensions/link.test.js +3 -3
  62. data/app/packs/src/decidim/editor/test/extensions/mention.test.js +2 -2
  63. data/app/packs/src/decidim/editor/test/extensions/ordered_list.test.js +2 -2
  64. data/app/packs/src/decidim/editor/test/extensions/video_embed.test.js +3 -3
  65. data/app/packs/src/decidim/editor/test/helpers.js +5 -4
  66. data/app/packs/src/decidim/editor/test/toolbar/basic.test.js +2 -2
  67. data/app/packs/src/decidim/editor/test/toolbar/content.test.js +2 -2
  68. data/app/packs/src/decidim/editor/test/toolbar/full.test.js +3 -3
  69. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic.js +6 -6
  70. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_block.js +2 -2
  71. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_formatting.js +1 -1
  72. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_indent.js +2 -2
  73. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_link.js +2 -2
  74. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_list.js +2 -2
  75. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_styling.js +2 -2
  76. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_content.js +7 -7
  77. data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_content_styling.js +2 -2
  78. data/app/packs/src/decidim/editor/test/toolbar/shared/context.js +1 -1
  79. data/app/packs/src/decidim/editor/test/utilities/paste_transform.test.js +2 -2
  80. data/app/packs/src/decidim/external_domain_warning.js +13 -0
  81. data/app/packs/src/decidim/external_domain_warning.test.js +1 -1
  82. data/app/packs/src/decidim/external_link.js +48 -9
  83. data/app/packs/src/decidim/external_link.test.js +1 -1
  84. data/app/packs/src/decidim/focus_guard.js +8 -20
  85. data/app/packs/src/decidim/form_filter.component_for_testing.js +1 -1
  86. data/app/packs/src/decidim/form_filter.js +3 -3
  87. data/app/packs/src/decidim/geocoding/attach_input.js +1 -1
  88. data/app/packs/src/decidim/i18n.test.js +1 -1
  89. data/app/packs/src/decidim/index.js +4 -1
  90. data/app/packs/src/decidim/input_hashtags.js +1 -1
  91. data/app/packs/src/decidim/input_mentions.js +1 -1
  92. data/app/packs/src/decidim/input_multiple_mentions.js +1 -1
  93. data/app/packs/src/decidim/sw/index.js +3 -3
  94. data/app/packs/src/decidim/user_registrations.js +1 -1
  95. data/app/packs/src/decidim/vizzs/index.js +1 -1
  96. data/app/packs/stylesheets/decidim/_cards.scss +2 -2
  97. data/app/packs/stylesheets/decidim/_dropdown.scss +2 -2
  98. data/app/packs/stylesheets/decidim/_layout.scss +4 -4
  99. data/app/packs/stylesheets/decidim/application.scss +0 -3
  100. data/app/packs/stylesheets/decidim/decidim_application.scss +4 -0
  101. data/app/packs/stylesheets/decidim/legacy/leaflet.scss +88 -107
  102. data/app/presenters/decidim/admin_log/oauth_application_resource_presenter.rb +1 -1
  103. data/app/presenters/decidim/log/diff_presenter.rb +1 -1
  104. data/app/presenters/decidim/notification_to_mailer_presenter.rb +9 -0
  105. data/app/services/decidim/events_manager.rb +6 -0
  106. data/app/services/decidim/iframe_disabler.rb +4 -0
  107. data/app/services/decidim/push_notification_message_sender.rb +40 -0
  108. data/app/services/decidim/send_push_notification.rb +22 -8
  109. data/app/uploaders/decidim/background_image_uploader.rb +11 -0
  110. data/app/views/decidim/application/_collection.html.erb +2 -2
  111. data/app/views/decidim/application/_document.html.erb +1 -1
  112. data/app/views/decidim/devise/registrations/new.html.erb +2 -2
  113. data/app/views/decidim/notifications_digest_mailer/_email_content.html.erb +7 -0
  114. data/app/views/decidim/offline/show.html.erb +15 -9
  115. data/app/views/layouts/decidim/_head.html.erb +1 -0
  116. data/app/views/layouts/decidim/_js_configuration.html.erb +3 -1
  117. data/app/views/layouts/decidim/footer/_main_social_media_links.html.erb +5 -5
  118. data/app/views/layouts/decidim/footer/_mini.html.erb +2 -2
  119. data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +1 -1
  120. data/config/assets.rb +1 -0
  121. data/config/locales/ar.yml +63 -7
  122. data/config/locales/bg.yml +32 -2
  123. data/config/locales/ca.yml +29 -24
  124. data/config/locales/cs.yml +6 -2
  125. data/config/locales/de.yml +34 -29
  126. data/config/locales/el.yml +3 -6
  127. data/config/locales/en.yml +7 -2
  128. data/config/locales/es-MX.yml +9 -4
  129. data/config/locales/es-PY.yml +9 -4
  130. data/config/locales/es.yml +27 -22
  131. data/config/locales/eu.yml +22 -8
  132. data/config/locales/fi-plain.yml +8 -3
  133. data/config/locales/fi.yml +10 -5
  134. data/config/locales/fr-CA.yml +12 -7
  135. data/config/locales/fr.yml +12 -7
  136. data/config/locales/ga-IE.yml +1 -0
  137. data/config/locales/gl.yml +4 -2
  138. data/config/locales/he-IL.yml +1 -0
  139. data/config/locales/hu.yml +264 -7
  140. data/config/locales/id-ID.yml +0 -2
  141. data/config/locales/it.yml +2 -5
  142. data/config/locales/ja.yml +11 -6
  143. data/config/locales/lb.yml +2 -5
  144. data/config/locales/lt.yml +0 -10
  145. data/config/locales/lv.yml +0 -2
  146. data/config/locales/nl.yml +1 -2
  147. data/config/locales/no.yml +2 -5
  148. data/config/locales/pl.yml +581 -2
  149. data/config/locales/pt-BR.yml +202 -18
  150. data/config/locales/pt.yml +2 -5
  151. data/config/locales/ro-RO.yml +2 -5
  152. data/config/locales/ru.yml +7 -2
  153. data/config/locales/sk.yml +0 -2
  154. data/config/locales/sv.yml +24 -5
  155. data/config/locales/tr-TR.yml +3 -5
  156. data/config/locales/uk.yml +12 -2
  157. data/config/locales/zh-CN.yml +0 -5
  158. data/config/locales/zh-TW.yml +2 -10
  159. data/decidim-core.gemspec +90 -0
  160. data/lib/decidim/asset_router/storage.rb +2 -0
  161. data/lib/decidim/attribute_encryptor.rb +6 -4
  162. data/lib/decidim/attributes/time_with_zone.rb +1 -1
  163. data/lib/decidim/core/engine.rb +7 -6
  164. data/lib/decidim/core/seeds.rb +36 -32
  165. data/lib/decidim/core/test/factories.rb +296 -89
  166. data/lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb +6 -26
  167. data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +8 -26
  168. data/lib/decidim/core/test/shared_examples/has_attachment_collections.rb +8 -6
  169. data/lib/decidim/core/test/shared_examples/has_attachments.rb +8 -8
  170. data/lib/decidim/core/test/shared_examples/has_category.rb +27 -0
  171. data/lib/decidim/core/test/shared_examples/has_reference.rb +1 -1
  172. data/lib/decidim/core/test/shared_examples/has_space_in_mcell_examples.rb +1 -1
  173. data/lib/decidim/core/test/shared_examples/map_examples.rb +3 -0
  174. data/lib/decidim/core/test/shared_examples/resource_endorsed_event_examples.rb +5 -2
  175. data/lib/decidim/core/test/shared_examples/resource_locator_presenter_examples.rb +134 -0
  176. data/lib/decidim/core/test/shared_examples/simple_event.rb +18 -2
  177. data/lib/decidim/core/test.rb +1 -0
  178. data/lib/decidim/core/version.rb +1 -1
  179. data/lib/decidim/core.rb +1 -0
  180. data/lib/decidim/engine_router.rb +17 -4
  181. data/lib/decidim/events/base_event.rb +3 -3
  182. data/lib/decidim/events/simple_event.rb +3 -17
  183. data/lib/decidim/form_builder.rb +8 -2
  184. data/lib/decidim/has_category.rb +1 -1
  185. data/lib/decidim/has_conversations.rb +91 -0
  186. data/lib/decidim/participable.rb +17 -0
  187. data/lib/decidim/upgrade/wysiwyg_migrator.rb +7 -0
  188. data/lib/decidim/view_model.rb +1 -0
  189. data/lib/decidim/webpacker/webpack/.modernizrrc +9 -0
  190. data/lib/premailer/adapter/decidim.rb +5 -4
  191. data/lib/tasks/decidim_reminders_tasks.rake +1 -0
  192. data/lib/tasks/upgrade/decidim_fix_categorization.rake +15 -0
  193. metadata +27 -30
  194. data/app/views/decidim/searches/index.js.erb +0 -7
  195. data/config/brakeman.ignore +0 -37
  196. data/config/environment.rb +0 -3
@@ -22,8 +22,6 @@
22
22
  .leaflet-tile,
23
23
  .leaflet-marker-icon,
24
24
  .leaflet-marker-shadow {
25
- -webkit-user-select: none;
26
- -moz-user-select: none;
27
25
  user-select: none;
28
26
  -webkit-user-drag: none;
29
27
  }
@@ -48,31 +46,50 @@
48
46
  /* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
49
47
 
50
48
  /* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
51
- .leaflet-container .leaflet-overlay-pane svg,
49
+ .leaflet-container .leaflet-overlay-pane svg {
50
+ max-width: none !important;
51
+ max-height: none !important;
52
+ }
53
+
52
54
  .leaflet-container .leaflet-marker-pane img,
53
55
  .leaflet-container .leaflet-shadow-pane img,
54
56
  .leaflet-container .leaflet-tile-pane img,
55
- .leaflet-container img.leaflet-image-layer {
57
+ .leaflet-container img.leaflet-image-layer,
58
+ .leaflet-container .leaflet-tile {
56
59
  max-width: none !important;
60
+ max-height: none !important;
61
+ width: auto;
62
+ padding: 0;
63
+ }
64
+
65
+ .leaflet-container img.leaflet-tile {
66
+ /* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
67
+ mix-blend-mode: plus-lighter;
57
68
  }
58
69
 
59
70
  .leaflet-container.leaflet-touch-zoom {
60
- -ms-touch-action: pan-x pan-y;
61
71
  touch-action: pan-x pan-y;
62
72
  }
63
73
 
64
74
  .leaflet-container.leaflet-touch-drag {
65
- -ms-touch-action: pinch-zoom;
75
+ /* Fallback for FF which does not support pinch-zoom */
76
+ touch-action: none;
66
77
  touch-action: pinch-zoom;
67
78
  }
68
79
 
69
80
  .leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
70
- -ms-touch-action: none;
71
81
  touch-action: none;
72
82
  }
73
83
 
84
+ .leaflet-container {
85
+ -webkit-tap-highlight-color: transparent;
86
+ }
87
+
88
+ .leaflet-container a {
89
+ -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
90
+ }
91
+
74
92
  .leaflet-tile {
75
- filter: inherit;
76
93
  visibility: hidden;
77
94
  }
78
95
 
@@ -83,7 +100,6 @@
83
100
  .leaflet-zoom-box {
84
101
  width: 0;
85
102
  height: 0;
86
- -moz-box-sizing: border-box;
87
103
  box-sizing: border-box;
88
104
  z-index: 800;
89
105
  }
@@ -130,23 +146,11 @@
130
146
  z-index: 200;
131
147
  }
132
148
 
133
- .leaflet-vml-shape {
134
- width: 1px;
135
- height: 1px;
136
- }
137
-
138
- .lvml {
139
- behavior: url(#default#VML);
140
- display: inline-block;
141
- position: absolute;
142
- }
143
-
144
149
  /* control positioning */
145
150
 
146
151
  .leaflet-control {
147
152
  position: relative;
148
153
  z-index: 800;
149
- pointer-events: visiblePainted; /* IE 9-10 does not have auto */
150
154
  pointer-events: auto;
151
155
  }
152
156
 
@@ -200,15 +204,8 @@
200
204
 
201
205
  /* zoom and fade animations */
202
206
 
203
- .leaflet-fade-anim .leaflet-tile {
204
- will-change: opacity;
205
- }
206
-
207
207
  .leaflet-fade-anim .leaflet-popup {
208
208
  opacity: 0;
209
- -webkit-transition: opacity 0.2s linear;
210
- -moz-transition: opacity 0.2s linear;
211
- -o-transition: opacity 0.2s linear;
212
209
  transition: opacity 0.2s linear;
213
210
  }
214
211
 
@@ -217,8 +214,6 @@
217
214
  }
218
215
 
219
216
  .leaflet-zoom-animated {
220
- -webkit-transform-origin: 0 0;
221
- -ms-transform-origin: 0 0;
222
217
  transform-origin: 0 0;
223
218
  }
224
219
 
@@ -227,17 +222,11 @@
227
222
  }
228
223
 
229
224
  .leaflet-zoom-anim .leaflet-zoom-animated {
230
- -webkit-transition: -webkit-transform 0.25s cubic-bezier(0, 0, 0.25, 1);
231
- -moz-transition: -moz-transform 0.25s cubic-bezier(0, 0, 0.25, 1);
232
- -o-transition: -o-transform 0.25s cubic-bezier(0, 0, 0.25, 1);
233
225
  transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1);
234
226
  }
235
227
 
236
228
  .leaflet-zoom-anim .leaflet-tile,
237
229
  .leaflet-pan-anim .leaflet-tile {
238
- -webkit-transition: none;
239
- -moz-transition: none;
240
- -o-transition: none;
241
230
  transition: none;
242
231
  }
243
232
 
@@ -252,8 +241,7 @@
252
241
  }
253
242
 
254
243
  .leaflet-grab {
255
- cursor: -webkit-grab;
256
- cursor: -moz-grab;
244
+ cursor: grab;
257
245
  }
258
246
 
259
247
  .leaflet-crosshair,
@@ -269,9 +257,7 @@
269
257
  .leaflet-dragging .leaflet-grab,
270
258
  .leaflet-dragging .leaflet-grab .leaflet-interactive,
271
259
  .leaflet-dragging .leaflet-marker-draggable {
272
- cursor: move;
273
- cursor: -webkit-grabbing;
274
- cursor: -moz-grabbing;
260
+ cursor: grabbing;
275
261
  }
276
262
 
277
263
  /* marker & overlays interactivity */
@@ -286,7 +272,6 @@
286
272
  .leaflet-marker-icon.leaflet-interactive,
287
273
  .leaflet-image-layer.leaflet-interactive,
288
274
  .leaflet-pane > svg path.leaflet-interactive {
289
- pointer-events: visiblePainted; /* IE 9-10 does not have auto */
290
275
  pointer-events: auto;
291
276
  }
292
277
 
@@ -301,10 +286,6 @@
301
286
  color: #0078a8;
302
287
  }
303
288
 
304
- .leaflet-container a.leaflet-active {
305
- outline: 2px solid orange;
306
- }
307
-
308
289
  .leaflet-zoom-box {
309
290
  border: 2px dotted #38f;
310
291
  background: rgba(255, 255, 255, 0.5);
@@ -312,7 +293,10 @@
312
293
 
313
294
  /* general typography */
314
295
  .leaflet-container {
315
- font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
296
+ font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
297
+ font-size: 12px;
298
+ font-size: 0.75rem;
299
+ line-height: 1.5;
316
300
  }
317
301
 
318
302
  /* general toolbar styles */
@@ -342,7 +326,8 @@
342
326
  display: block;
343
327
  }
344
328
 
345
- .leaflet-bar a:hover {
329
+ .leaflet-bar a:hover,
330
+ .leaflet-bar a:focus {
346
331
  background-color: #f4f4f4;
347
332
  }
348
333
 
@@ -369,6 +354,16 @@
369
354
  line-height: 30px;
370
355
  }
371
356
 
357
+ .leaflet-touch .leaflet-bar a:first-child {
358
+ border-top-left-radius: 2px;
359
+ border-top-right-radius: 2px;
360
+ }
361
+
362
+ .leaflet-touch .leaflet-bar a:last-child {
363
+ border-bottom-left-radius: 2px;
364
+ border-bottom-right-radius: 2px;
365
+ }
366
+
372
367
  /* zoom control */
373
368
 
374
369
  .leaflet-control-zoom-in,
@@ -377,16 +372,9 @@
377
372
  text-indent: 1px;
378
373
  }
379
374
 
380
- .leaflet-control-zoom-out {
381
- font-size: 20px;
382
- }
383
-
384
- .leaflet-touch .leaflet-control-zoom-in {
385
- font-size: 22px;
386
- }
387
-
375
+ .leaflet-touch .leaflet-control-zoom-in,
388
376
  .leaflet-touch .leaflet-control-zoom-out {
389
- font-size: 24px;
377
+ font-size: 22px;
390
378
  }
391
379
 
392
380
  /* layers control */
@@ -423,6 +411,12 @@
423
411
  position: relative;
424
412
  }
425
413
 
414
+ .leaflet-control-layers-list {
415
+ border: 0;
416
+ margin: 0;
417
+ padding: 0;
418
+ }
419
+
426
420
  .leaflet-control-layers-expanded {
427
421
  padding: 6px 10px 6px 6px;
428
422
  color: #333;
@@ -430,7 +424,7 @@
430
424
  }
431
425
 
432
426
  .leaflet-control-layers-scrollbar {
433
- overflow-y: scroll;
427
+ overflow: hidden scroll;
434
428
  padding-right: 5px;
435
429
  }
436
430
 
@@ -442,6 +436,8 @@
442
436
 
443
437
  .leaflet-control-layers label {
444
438
  display: block;
439
+ font-size: 13px;
440
+ font-size: 1.08333em;
445
441
  }
446
442
 
447
443
  .leaflet-control-layers-separator {
@@ -467,19 +463,24 @@
467
463
  .leaflet-control-scale-line {
468
464
  padding: 0 5px;
469
465
  color: #333;
466
+ line-height: 1.4;
470
467
  }
471
468
 
472
469
  .leaflet-control-attribution a {
473
470
  text-decoration: none;
474
471
  }
475
472
 
476
- .leaflet-control-attribution a:hover {
473
+ .leaflet-control-attribution a:hover,
474
+ .leaflet-control-attribution a:focus {
477
475
  text-decoration: underline;
478
476
  }
479
477
 
480
- .leaflet-container .leaflet-control-attribution,
481
- .leaflet-container .leaflet-control-scale {
482
- font-size: 11px;
478
+ .leaflet-attribution-flag {
479
+ display: inline !important;
480
+ vertical-align: baseline !important;
481
+ width: 1em;
482
+ height: 0.6669em;
483
+ margin-right: 0.277em;
483
484
  }
484
485
 
485
486
  .leaflet-left .leaflet-control-scale {
@@ -495,13 +496,10 @@
495
496
  border-top: none;
496
497
  line-height: 1.1;
497
498
  padding: 2px 5px 1px;
498
- font-size: 11px;
499
499
  white-space: nowrap;
500
- overflow: hidden;
501
- -moz-box-sizing: border-box;
502
500
  box-sizing: border-box;
503
- background: #fff;
504
501
  background: rgba(255, 255, 255, 0.5);
502
+ text-shadow: 1px 1px #fff;
505
503
  }
506
504
 
507
505
  .leaflet-control-scale-line:not(:first-child) {
@@ -541,8 +539,11 @@
541
539
  }
542
540
 
543
541
  .leaflet-popup-content {
544
- margin: 13px 19px;
545
- line-height: 1.4;
542
+ margin: 13px 24px 13px 20px;
543
+ line-height: 1.3;
544
+ font-size: 13px;
545
+ font-size: 1.08333em;
546
+ min-height: 1px;
546
547
  }
547
548
 
548
549
  .leaflet-popup-content p {
@@ -554,6 +555,7 @@
554
555
  height: 20px;
555
556
  position: absolute;
556
557
  left: 50%;
558
+ margin-top: -1px;
557
559
  margin-left: -20px;
558
560
  overflow: hidden;
559
561
  pointer-events: none;
@@ -564,10 +566,7 @@
564
566
  height: 17px;
565
567
  padding: 1px;
566
568
  margin: -10px auto 0;
567
- -webkit-transform: rotate(45deg);
568
- -moz-transform: rotate(45deg);
569
- -ms-transform: rotate(45deg);
570
- -o-transform: rotate(45deg);
569
+ pointer-events: auto;
571
570
  transform: rotate(45deg);
572
571
  }
573
572
 
@@ -582,48 +581,23 @@
582
581
  position: absolute;
583
582
  top: 0;
584
583
  right: 0;
585
- padding: 4px 4px 0 0;
586
584
  border: none;
587
585
  text-align: center;
588
- width: 18px;
589
- height: 14px;
586
+ width: 24px;
587
+ height: 24px;
590
588
  font: 16px/14px Tahoma, Verdana, sans-serif;
591
- color: #c3c3c3;
589
+ color: #757575;
592
590
  text-decoration: none;
593
- font-weight: bold;
594
591
  background: transparent;
595
592
  }
596
593
 
597
- .leaflet-container a.leaflet-popup-close-button:hover {
598
- color: #999;
594
+ .leaflet-container a.leaflet-popup-close-button:hover,
595
+ .leaflet-container a.leaflet-popup-close-button:focus {
596
+ color: #585858;
599
597
  }
600
598
 
601
599
  .leaflet-popup-scrolled {
602
600
  overflow: auto;
603
- border-bottom: 1px solid #ddd;
604
- border-top: 1px solid #ddd;
605
- }
606
-
607
- .leaflet-oldie .leaflet-popup-content-wrapper {
608
- zoom: 1;
609
- }
610
-
611
- .leaflet-oldie .leaflet-popup-tip {
612
- width: 24px;
613
- margin: 0 auto;
614
- -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
615
- filter: progid:dximagetransform.microsoft.matrix(M11=.70710678, M12=.70710678, M21=-.70710678, M22=.70710678);
616
- }
617
-
618
- .leaflet-oldie .leaflet-popup-tip-container {
619
- margin-top: -1px;
620
- }
621
-
622
- .leaflet-oldie .leaflet-control-zoom,
623
- .leaflet-oldie .leaflet-control-layers,
624
- .leaflet-oldie .leaflet-popup-content-wrapper,
625
- .leaflet-oldie .leaflet-popup-tip {
626
- border: 1px solid #999;
627
601
  }
628
602
 
629
603
  /* div icon */
@@ -644,15 +618,12 @@
644
618
  border-radius: 3px;
645
619
  color: #222;
646
620
  white-space: nowrap;
647
- -webkit-user-select: none;
648
- -moz-user-select: none;
649
- -ms-user-select: none;
650
621
  user-select: none;
651
622
  pointer-events: none;
652
623
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
653
624
  }
654
625
 
655
- .leaflet-tooltip.leaflet-clickable {
626
+ .leaflet-tooltip.leaflet-interactive {
656
627
  cursor: pointer;
657
628
  pointer-events: auto;
658
629
  }
@@ -722,3 +693,13 @@
722
693
  margin-left: -12px;
723
694
  border-right-color: #fff;
724
695
  }
696
+
697
+ /* Printing */
698
+
699
+ @media print {
700
+ /* Prevent printers from removing background-images of controls. */
701
+ .leaflet-control {
702
+ -webkit-print-color-adjust: exact;
703
+ print-color-adjust: exact;
704
+ }
705
+ }
@@ -11,7 +11,7 @@ module Decidim
11
11
  #
12
12
  # Returns an HTML-safe String.
13
13
  def resource_path
14
- @resource_path ||= h.decidim_admin.oauth_application_path(resource)
14
+ @resource_path ||= h.decidim_system.oauth_application_path(resource)
15
15
  end
16
16
  end
17
17
  end
@@ -42,7 +42,7 @@ module Decidim
42
42
  def present_diff
43
43
  return "".html_safe if changeset.blank?
44
44
 
45
- h.content_tag(:div, class: "logs__log__diff", id: "panel-#{h.dom_id(action_log)}") do
45
+ h.content_tag(:div, class: "logs__log__diff", id: "panel-#{h.dom_id(action_log)}", "aria-hidden": true) do
46
46
  changeset.each do |attribute|
47
47
  h.concat(present_new_value(attribute[:label], attribute[:new_value], attribute[:type]))
48
48
  h.concat(present_previous_value(attribute[:previous_value], attribute[:type])) if options[:show_previous_value?]
@@ -7,11 +7,16 @@ module Decidim
7
7
  class NotificationToMailerPresenter < SimpleDelegator
8
8
  include Decidim::TranslatableAttributes
9
9
 
10
+ EXTENDED_NOTIFICATIONS_CLASSES = [
11
+ "Decidim::Comments::CommentCreatedEvent"
12
+ ].freeze
13
+
10
14
  delegate :url_helpers, to: "Decidim::Core::Engine.routes"
11
15
  delegate :resource_title, to: :event
12
16
  delegate :resource_url, to: :event
13
17
  delegate :email_intro, to: :event
14
18
  delegate :resource_path, to: :event
19
+ delegate :safe_resource_text, to: :event
15
20
 
16
21
  def date_time
17
22
  if frequency == :daily
@@ -21,6 +26,10 @@ module Decidim
21
26
  end
22
27
  end
23
28
 
29
+ def show_extended_information?
30
+ EXTENDED_NOTIFICATIONS_CLASSES.include?(event_class)
31
+ end
32
+
24
33
  private
25
34
 
26
35
  def event
@@ -46,5 +46,11 @@ module Decidim
46
46
  def self.subscribe(event, &)
47
47
  ActiveSupport::Notifications.subscribe(event, &)
48
48
  end
49
+
50
+ def self.subscribe_events!
51
+ subscribe(/^decidim\.events\./) do |event_name, data|
52
+ EventPublisherJob.perform_later(event_name, data)
53
+ end
54
+ end
49
55
  end
50
56
  end
@@ -18,6 +18,10 @@ module Decidim
18
18
 
19
19
  def disable_iframes(node)
20
20
  if node.name == "iframe"
21
+ # Default title for accessibility
22
+ node["title"] = I18n.t("decidim.shared.embed.title") if node["title"].blank?
23
+ # Disable scrollbar for some embed services
24
+ node["scrolling"] = "no"
21
25
  orig_node = node.to_s
22
26
  node.replace(%(<div class="disabled-iframe"><!-- #{orig_node} --></div>))
23
27
  end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ # A wrapper for preparing push notifications messages from conversations
5
+ # It respects the same contract as the Decidim::Messaging::ConversationMailer
6
+ class PushNotificationMessageSender
7
+ include HasConversations
8
+
9
+ def deliver
10
+ SendPushNotification.new.perform(@notification, title)
11
+ end
12
+
13
+ private
14
+
15
+ # rubocop:disable Metrics/ParameterLists
16
+ # rubocop:disable Lint/UnusedMethodArgument
17
+ #
18
+ # There are some parameters thar are not used in the method, but they are needed to
19
+ # keep the same contract as the Decidim::Messaging::ConversationMailer
20
+ def send_notification(from:, to:, conversation:, action:, message: nil, third_party: nil)
21
+ @action = action
22
+ @sender = to
23
+ @third_party = third_party
24
+
25
+ @notification = PushNotificationMessage.new(
26
+ recipient: to,
27
+ conversation:,
28
+ message:
29
+ )
30
+
31
+ self
32
+ end
33
+ # rubocop:enable Lint/UnusedMethodArgument
34
+ # rubocop:enable Metrics/ParameterLists
35
+
36
+ def title
37
+ get_subject(action: @action, sender: @sender, third_party: @third_party)
38
+ end
39
+ end
40
+ end
@@ -14,14 +14,19 @@ module Decidim
14
14
  # Send the push notification. Returns `nil` if the user did not allowed push notifications
15
15
  # or if the subscription to push notifications does not exist
16
16
  #
17
- # Returns the result of the dispatch or nil if user or subscription are empty
18
- def perform(notification)
17
+ # @param notification [Decidim::Notification, Decidim::PushNotificationMessage] the notification to be sent
18
+ # @param title [String] the title of the notification. Optional.
19
+ #
20
+ # @return [Array<Net::HTTPCreated>, nil] the result of the dispatch or nil if user or subscription are empty
21
+ def perform(notification, title = nil)
19
22
  return unless Rails.application.secrets.dig(:vapid, :enabled)
23
+ raise ArgumentError, "Need to provide a title if the notification is a PushNotificationMessage" if notification.is_a?(Decidim::PushNotificationMessage) && title.nil?
24
+
25
+ user = notification.user
20
26
 
21
- I18n.with_locale(notification.user.locale || notification.user.organization.default_locale) do
22
- notification.user.notifications_subscriptions.values.map do |subscription|
23
- message_params = notification_params(Decidim::PushNotificationPresenter.new(notification))
24
- payload = build_payload(message_params, subscription)
27
+ I18n.with_locale(user.locale || user.organization.default_locale) do
28
+ user.notifications_subscriptions.values.map do |subscription|
29
+ payload = build_payload(message_params(notification, title), subscription)
25
30
  # Capture webpush exceptions in order to avoid this call to be repeated by the background job runner
26
31
  # Webpush::Error class is the parent class of all defined errors
27
32
  begin
@@ -36,9 +41,18 @@ module Decidim
36
41
 
37
42
  private
38
43
 
39
- def notification_params(notification)
44
+ def message_params(notification, title = nil)
45
+ case notification
46
+ when Decidim::PushNotificationMessage
47
+ notification_params(notification, title)
48
+ else # when Decidim::Notification
49
+ notification_params(Decidim::PushNotificationPresenter.new(notification))
50
+ end
51
+ end
52
+
53
+ def notification_params(notification, title = nil)
40
54
  {
41
- title: notification.title,
55
+ title: title.presence || notification.title,
42
56
  body: notification.body,
43
57
  icon: notification.icon,
44
58
  data: { url: notification.url }
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ # This class deals with uploading background images to participatory spaces, to be used with the ParticipatorySpaceHero
5
+ # content block.
6
+ class BackgroundImageUploader < RecordImageUploader
7
+ set_variants do
8
+ { default: { resize_to_fit: [1000, 1000] } }
9
+ end
10
+ end
11
+ end
@@ -5,14 +5,14 @@
5
5
  <%= icon "folder-line" %>
6
6
  <%= icon "folder-open-line" %>
7
7
  </span>
8
- <%= translated_attribute(attachment_collection.name) %>
8
+ <%= decidim_escape_translated(attachment_collection.name) %>
9
9
  </span>
10
10
  <%= icon "arrow-down-s-fill" %>
11
11
  <%= icon "arrow-up-s-fill" %>
12
12
  </button>
13
13
 
14
14
  <div id="dropdown-menu-documents-<%= attachment_collection.id %>" class="documents__collection-content" aria-hidden="true">
15
- <p><%= translated_attribute(attachment_collection.description) %></p>
15
+ <p><%= decidim_escape_translated(attachment_collection.description) %></p>
16
16
 
17
17
  <div class="documents__container">
18
18
  <% documents.each do |document| %>
@@ -4,7 +4,7 @@
4
4
  <%= h attachment_title(document) %>
5
5
  <% end %>
6
6
  <% if document.description.present? %>
7
- <div class="card__list-text"><%= translated_attribute(document.description) %></div>
7
+ <div class="card__list-text"><%= decidim_escape_translated(document.description) %></div>
8
8
  <% end %>
9
9
  <div class="card__list-metadata">
10
10
  <span><%= icon "file-text-line" %><%= document.file_type %></span>
@@ -41,7 +41,7 @@
41
41
  </div>
42
42
 
43
43
  <div id="card__tos" class="form__wrapper-block">
44
- <h4 class="h4"><%= t("decidim.devise.registrations.new.tos_title") %></h4>
44
+ <h2 class="h4"><%= t("decidim.devise.registrations.new.tos_title") %></h2>
45
45
 
46
46
  <div class="tos-text">
47
47
  <% terms_of_service_summary_content_blocks.each do |content_block| %>
@@ -53,7 +53,7 @@
53
53
  </div>
54
54
 
55
55
  <div id="card__newsletter" class="form__wrapper-block">
56
- <h4 class="h4"><%= t("decidim.devise.registrations.new.newsletter_title") %></h4>
56
+ <h2 class="h4"><%= t("decidim.devise.registrations.new.newsletter_title") %></h2>
57
57
  <%= f.check_box :newsletter, label: t("decidim.devise.registrations.new.newsletter"), checked: @form.newsletter, label_options: { class: "form__wrapper-checkbox-label" } %>
58
58
  </div>
59
59
 
@@ -8,4 +8,11 @@
8
8
  <%= link_to decidim_sanitize(notification.resource_title, strip_tags: true), notification.resource_url %>
9
9
  </p>
10
10
  <% end %>
11
+ <% if notification.show_extended_information? %>
12
+ <blockquote>
13
+ <p>
14
+ <%= notification.safe_resource_text %>
15
+ </p>
16
+ </blockquote>
17
+ <% end %>
11
18
  </div>
@@ -1,9 +1,15 @@
1
- <div id="offline-fallback-html" style="text-align:center;padding:1rem">
2
- <svg xmlns="http://www.w3.org/2000/svg" width="5rem" height="r5em" viewBox="0 0 25 25">
3
- <path
4
- d="m20.293 4-1.477 1.477A4.473 4.473 0 0 0 11.17 7.33 4.362 4.362 0 0 0 9.5 7a4.486 4.486 0 0 0-4.23 3.01 4.49 4.49 0 0 0 .042 8.971L4 20.293l.707.707L21 4.707zM19.99 8.21a3.936 3.936 0 0 0-.16-.92L8.12 19H18.5a5.497 5.497 0 0 0 1.49-10.79z"
5
- style="fill:#1a181d" />
6
- </svg>
7
- <h3><%= t(".message") %></h3>
8
- <button class="button large button--sc mt-s" onclick="location.reload()"><%= t(".retry") %></button>
9
- </div>
1
+ <% add_decidim_page_title(t("decidim.offline.name")) %>
2
+
3
+ <main id="offline-fallback-html" class="text-center mt-8">
4
+ <div class="flex justify-center">
5
+ <svg xmlns="http://www.w3.org/2000/svg" width="5rem" height="r5em" viewBox="0 0 25 25">
6
+ <path
7
+ d="m20.293 4-1.477 1.477A4.473 4.473 0 0 0 11.17 7.33 4.362 4.362 0 0 0 9.5 7a4.486 4.486 0 0 0-4.23 3.01 4.49 4.49 0 0 0 .042 8.971L4 20.293l.707.707L21 4.707zM19.99 8.21a3.936 3.936 0 0 0-.16-.92L8.12 19H18.5a5.497 5.497 0 0 0 1.49-10.79z"
8
+ style="fill:#1a181d" />
9
+ </svg>
10
+ </div>
11
+ <h1 class="h1"><%= t("decidim.offline.name") %></h1>
12
+ <p class="text-lg mt-4"><%= t(".message_1") %></p>
13
+ <p class="text-lg mt-4"><%= t(".message_2") %></p>
14
+ <button class="button button__secondary button__lg mt-8" onclick="location.reload()"><%= t(".retry") %></button>
15
+ </main>
@@ -27,6 +27,7 @@
27
27
  <link rel="manifest" href="/manifest.webmanifest">
28
28
 
29
29
  <%= prepend_javascript_pack_tag "decidim_core", defer: false %>
30
+ <%= append_stylesheet_pack_tag "decidim_overrides", media: "all" %>
30
31
  <%= stylesheet_pack_tag "decidim_core", media: "all" %>
31
32
  <%= yield :css_content %>
32
33