decidim-meetings 0.25.0 → 0.26.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/meetings/content_blocks/highlighted_meetings/heading.erb +1 -1
  3. data/app/cells/decidim/meetings/content_blocks/highlighted_meetings_cell.rb +1 -1
  4. data/app/cells/decidim/meetings/content_blocks/{upcoming_events → upcoming_meetings}/show.erb +6 -6
  5. data/app/cells/decidim/meetings/content_blocks/{upcoming_events_cell.rb → upcoming_meetings_cell.rb} +11 -10
  6. data/app/cells/decidim/meetings/highlighted_meetings_for_component_cell.rb +1 -1
  7. data/app/cells/decidim/meetings/join_meeting_button_cell.rb +1 -1
  8. data/app/cells/decidim/meetings/meeting_list_item_cell.rb +10 -0
  9. data/app/cells/decidim/meetings/meeting_m_cell.rb +48 -0
  10. data/app/cells/decidim/meetings/meeting_s_cell.rb +22 -0
  11. data/app/cells/decidim/meetings/meetings_map_cell.rb +6 -0
  12. data/app/cells/decidim/meetings/online_meeting_cell.rb +23 -8
  13. data/app/cells/decidim/meetings/online_meeting_link/show.erb +2 -2
  14. data/app/cells/decidim/meetings/online_meeting_link_cell.rb +1 -5
  15. data/app/cells/decidim/meetings/public_participants_list_cell.rb +1 -0
  16. data/app/cells/decidim/meetings/question_responses_cell.rb +1 -1
  17. data/app/commands/decidim/meetings/admin/create_meeting.rb +11 -1
  18. data/app/commands/decidim/meetings/admin/publish_meeting.rb +3 -1
  19. data/app/commands/decidim/meetings/admin/update_meeting.rb +8 -2
  20. data/app/commands/decidim/meetings/create_meeting.rb +14 -2
  21. data/app/commands/decidim/meetings/update_meeting.rb +5 -2
  22. data/app/commands/decidim/meetings/withdraw_meeting.rb +39 -0
  23. data/app/controllers/concerns/decidim/meetings/filterable.rb +33 -0
  24. data/app/controllers/decidim/meetings/directory/application_controller.rb +16 -0
  25. data/app/controllers/decidim/meetings/directory/meetings_controller.rb +31 -20
  26. data/app/controllers/decidim/meetings/live_events_controller.rb +7 -1
  27. data/app/controllers/decidim/meetings/meetings_controller.rb +19 -17
  28. data/app/events/decidim/meetings/close_meeting_event.rb +1 -3
  29. data/app/events/decidim/meetings/create_meeting_event.rb +2 -4
  30. data/app/events/decidim/meetings/meeting_event.rb +37 -0
  31. data/app/events/decidim/meetings/meeting_registrations_enabled_event.rb +1 -3
  32. data/app/events/decidim/meetings/meeting_registrations_over_percentage_event.rb +2 -4
  33. data/app/events/decidim/meetings/registration_code_validated_event.rb +2 -4
  34. data/app/events/decidim/meetings/upcoming_meeting_event.rb +1 -3
  35. data/app/events/decidim/meetings/update_meeting_event.rb +1 -3
  36. data/app/forms/decidim/meetings/admin/close_meeting_form.rb +1 -1
  37. data/app/forms/decidim/meetings/admin/meeting_copy_form.rb +4 -13
  38. data/app/forms/decidim/meetings/admin/meeting_form.rb +34 -46
  39. data/app/forms/decidim/meetings/base_meeting_form.rb +59 -0
  40. data/app/forms/decidim/meetings/close_meeting_form.rb +6 -6
  41. data/app/forms/decidim/meetings/meeting_form.rb +30 -46
  42. data/app/helpers/decidim/meetings/application_helper.rb +13 -1
  43. data/app/helpers/decidim/meetings/directory/application_helper.rb +150 -0
  44. data/app/helpers/decidim/meetings/meeting_cells_helper.rb +4 -1
  45. data/app/helpers/decidim/meetings/meetings_helper.rb +3 -0
  46. data/app/models/decidim/meetings/meeting.rb +54 -2
  47. data/app/packs/src/decidim/meetings/admin/meetings_form.js +27 -11
  48. data/app/packs/src/decidim/meetings/meetings_form.js +19 -0
  49. data/app/packs/src/decidim/meetings/meetings_polls.js +31 -26
  50. data/app/permissions/decidim/meetings/permissions.rb +9 -1
  51. data/app/presenters/decidim/meetings/meeting_edition_presenter.rb +14 -0
  52. data/app/presenters/decidim/meetings/meeting_presenter.rb +13 -6
  53. data/app/services/decidim/meetings/directory/meeting_search.rb +53 -0
  54. data/app/services/decidim/meetings/meeting_iframe_embedder.rb +1 -1
  55. data/app/services/decidim/meetings/meeting_search.rb +15 -2
  56. data/app/views/decidim/meetings/admin/meeting_copies/_form.html.erb +16 -1
  57. data/app/views/decidim/meetings/admin/meeting_copies/new.html.erb +1 -1
  58. data/app/views/decidim/meetings/admin/meetings/_form.html.erb +15 -3
  59. data/app/views/decidim/meetings/directory/meetings/_filters.html.erb +34 -0
  60. data/app/views/decidim/meetings/directory/meetings/index.html.erb +1 -18
  61. data/app/views/decidim/meetings/meetings/_filters.html.erb +2 -0
  62. data/app/views/decidim/meetings/meetings/_filters_small_view.html.erb +3 -3
  63. data/app/views/decidim/meetings/meetings/_form.html.erb +14 -3
  64. data/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +1 -1
  65. data/app/views/decidim/meetings/meetings/_meetings.html.erb +18 -0
  66. data/app/views/decidim/meetings/meetings/index.html.erb +1 -0
  67. data/app/views/decidim/meetings/meetings/show.html.erb +12 -13
  68. data/config/locales/ar.yml +2 -9
  69. data/config/locales/ca.yml +44 -16
  70. data/config/locales/cs.yml +41 -13
  71. data/config/locales/de.yml +56 -9
  72. data/config/locales/el.yml +2 -9
  73. data/config/locales/en.yml +41 -13
  74. data/config/locales/es-MX.yml +40 -12
  75. data/config/locales/es-PY.yml +41 -13
  76. data/config/locales/es.yml +41 -13
  77. data/config/locales/eu.yml +27 -13
  78. data/config/locales/fi-plain.yml +41 -13
  79. data/config/locales/fi.yml +41 -13
  80. data/config/locales/fr-CA.yml +48 -13
  81. data/config/locales/fr.yml +70 -35
  82. data/config/locales/ga-IE.yml +2 -7
  83. data/config/locales/gl.yml +28 -9
  84. data/config/locales/hu.yml +2 -9
  85. data/config/locales/id-ID.yml +2 -9
  86. data/config/locales/it.yml +4 -16
  87. data/config/locales/ja.yml +45 -17
  88. data/config/locales/lb-LU.yml +210 -0
  89. data/config/locales/lb.yml +2 -11
  90. data/config/locales/lv.yml +2 -9
  91. data/config/locales/nl.yml +33 -9
  92. data/config/locales/no.yml +2 -9
  93. data/config/locales/pl.yml +17 -12
  94. data/config/locales/pt-BR.yml +3 -10
  95. data/config/locales/pt.yml +2 -15
  96. data/config/locales/ro-RO.yml +194 -100
  97. data/config/locales/ru.yml +0 -8
  98. data/config/locales/sk.yml +2 -9
  99. data/config/locales/sl.yml +0 -3
  100. data/config/locales/sv.yml +83 -9
  101. data/config/locales/tr-TR.yml +3 -10
  102. data/config/locales/val-ES.yml +1 -0
  103. data/config/locales/zh-CN.yml +2 -9
  104. data/db/migrate/20210519133705_add_comments_availability_columns_to_meetings_table.rb +14 -0
  105. data/db/migrate/20210727085318_add_state_field_to_meeting.rb +7 -0
  106. data/db/migrate/20210903143040_add_iframe_access_level_to_decidim_meetings.rb +7 -0
  107. data/db/migrate/20210922140454_transform_show_embedded_iframe_column.rb +15 -0
  108. data/db/migrate/20210928095036_rename_upcoming_events_content_block_to_upcoming_meetings.rb +13 -0
  109. data/lib/decidim/api/meeting_type.rb +2 -1
  110. data/lib/decidim/meetings/component.rb +15 -6
  111. data/lib/decidim/meetings/directory_engine.rb +3 -3
  112. data/lib/decidim/meetings/engine.rb +8 -1
  113. data/lib/decidim/meetings/meeting_serializer.rb +2 -2
  114. data/lib/decidim/meetings/test/factories.rb +24 -3
  115. data/lib/decidim/meetings/test/notifications_handling.rb +39 -0
  116. data/lib/decidim/meetings/test/translated_event.rb +22 -0
  117. data/lib/decidim/meetings/version.rb +1 -1
  118. data/lib/decidim/meetings.rb +5 -0
  119. metadata +39 -22
@@ -16,9 +16,6 @@ sl:
16
16
  meetings:
17
17
  index:
18
18
  title: Sestanki
19
- content_blocks:
20
- upcoming_events:
21
- upcoming_events: Prihajajoči dogodki
22
19
  directory:
23
20
  meetings:
24
21
  index:
@@ -30,10 +30,12 @@ sv:
30
30
  organizer_gid: Skapa som
31
31
  organizer_id: Organisatör
32
32
  private_meeting: Privat möte
33
+ registration_email_custom_content: Custom text i anmälningse-post
33
34
  registration_form_enabled: Registreringsformulär aktiverat
34
35
  registration_terms: Registreringsvillkor
35
36
  registration_url: URL för anmälan
36
37
  registrations_enabled: Registreringar aktiverade
38
+ show_embedded_iframe: Visa integrerad iframe för denna URL
37
39
  start_time: Starttid
38
40
  title: Titel
39
41
  transparent: Transparent
@@ -71,23 +73,32 @@ sv:
71
73
  admin:
72
74
  filters:
73
75
  meetings:
76
+ category_id_eq:
77
+ label: Kategori
74
78
  closed_at_present:
75
79
  label: Status
76
80
  values:
77
81
  'false': Öppna
82
+ 'true': Stängda
78
83
  is_upcoming_true:
79
84
  label: Datum
80
85
  values:
81
86
  'false': Tidigare
87
+ 'true': Kommande
82
88
  origin_eq:
89
+ label: Ursprung
83
90
  values:
91
+ citizen: Medborgare
92
+ official: Officiell
84
93
  user_group: Användargrupper
85
94
  scope_id_eq:
86
95
  label: Omfång
87
96
  type_eq:
97
+ label: Mötestyp
88
98
  values:
89
99
  hybrid: Båda
90
100
  in_person: Fysiska
101
+ online: Online
91
102
  meeting_copies:
92
103
  create:
93
104
  error: Det gick inte att duplicera mötet.
@@ -99,6 +110,7 @@ sv:
99
110
  components:
100
111
  meetings:
101
112
  actions:
113
+ comment: Kommentera
102
114
  join: Gå med
103
115
  name: Möten
104
116
  settings:
@@ -109,10 +121,12 @@ sv:
109
121
  creation_enabled_for_participants: Deltagarna kan skapa möten
110
122
  default_registration_terms: Villkor för standardregistrering
111
123
  enable_pads_creation: Aktivera skapande av memo
124
+ maps_enabled: Karta aktiverad
112
125
  registration_code_enabled: Registreringskod aktiverad
113
126
  resources_permissions_enabled: Åtgärdsbehörigheter kan ställas in för varje möte
114
127
  scope_id: Omfång
115
128
  scopes_enabled: Omfång aktiverade
129
+ terms_and_conditions_url_for_meeting_creators: Adress till användarvillkor för mötesförfattare
116
130
  step:
117
131
  announcement: Meddelande
118
132
  comments_blocked: Kommentarer blockerade
@@ -132,6 +146,7 @@ sv:
132
146
  email_subject: Mötet "%{resource_title}" stängdes
133
147
  notification_title: Mötet <a href="%{resource_path}">%{resource_title}</a> stängdes.
134
148
  meeting_created:
149
+ button_text: Anmäl till mötet
135
150
  email_intro: Mötet "%{resource_title}" har lagts till i "%{participatory_space_title}" som du följer.
136
151
  email_outro: Du har fått det här meddelandet eftersom du följer "%{participatory_space_title}". Du kan avfölja det vid föregående länk.
137
152
  email_subject: Nytt möte har lagts till i %{participatory_space_title}
@@ -163,6 +178,9 @@ sv:
163
178
  email_outro: Du har fått det här meddelandet eftersom du följer mötet "%{resource_title}". Du kan sluta följa det på föregående länk.
164
179
  email_subject: Mötet "%{resource_title}" börjar om färre än 48 timmar.
165
180
  notification_title: Mötet <a href="%{resource_path}">%{resource_title}</a> startar inom mindre än 48 timmar.
181
+ forms:
182
+ meetings:
183
+ attendees_count_help_text: Glöm inte att inkludera det totala antalet deltagare på ditt evenemang. Det är viktigt att hålla koll på hur många människor, oavsett om de deltog fysiskt eller online.
166
184
  gamification:
167
185
  badges:
168
186
  attended_meetings:
@@ -225,6 +243,7 @@ sv:
225
243
  invalid: Det gick inte att uppdatera dagordningen
226
244
  success: Dagordning uppdaterad
227
245
  exports:
246
+ answers: Svar
228
247
  meeting_comments: Kommentarer
229
248
  meetings: Möten
230
249
  registrations: Registreringar
@@ -265,6 +284,7 @@ sv:
265
284
  success: Mötet avslutades
266
285
  create:
267
286
  invalid: Det gick inte att skapa mötet
287
+ success: Mötet har skapats men är ännu inte publicerat, du måste publicera det manuellt.
268
288
  destroy:
269
289
  invalid:
270
290
  proposals_count:
@@ -277,7 +297,12 @@ sv:
277
297
  form:
278
298
  address_help: 'Adress: anger en plats för Geocoder'
279
299
  available_slots_help: Lämna det till 0 om du har obegränsade platser
300
+ disclaimer: 'Disclaimer: När du använder ett externt anmälningssystem är du medveten om att administratörerna för %{organization} inte är ansvariga för de data som tillhandahålls av användarna till den externa tjänsten.'
280
301
  location_help: 'Plats: meddelande till användarna som anger mötesplats'
302
+ location_hints_help: 'Tips för att hitta platsen: ytterligare information. Exempel: våningen om det är ett fysiskt möte eller möteslösenordet om det är ett online möte.'
303
+ online_meeting_url_help: 'Länk: tillåt deltagare att koppla sig direct till ditt möte'
304
+ registration_email_help: Denna text kommer att synas i mitten av e-postet för registreringsbekräftelse, efter registreringskod.
305
+ registration_url_help: 'Länk: tillåt deltagare att registrera sig på en extern tjänst'
281
306
  select_a_meeting_type: Välj mötestyp
282
307
  select_a_registration_type: Välj en registreringsmetod
283
308
  index:
@@ -285,6 +310,9 @@ sv:
285
310
  new:
286
311
  create: Skapa
287
312
  title: Skapa möte
313
+ publish:
314
+ invalid: Det gick inte att publicera det här mötet
315
+ success: Mötet har publicerats
288
316
  service:
289
317
  description: Beskrivning
290
318
  down: Ned
@@ -295,9 +323,18 @@ sv:
295
323
  services:
296
324
  add_service: Lägg till service
297
325
  services: Tjänster
326
+ unpublish:
327
+ invalid: Det gick inte att avpublicera det här mötet
328
+ success: Mötet har avpublicerats
298
329
  update:
299
330
  invalid: Det gick inte att uppdatera mötet
300
331
  success: Mötet har uppdaterats
332
+ meetings_poll:
333
+ form:
334
+ title: Redigera undersökningen för %{questionnaire_for}
335
+ update:
336
+ invalid: Det gick inte att uppdatera mötesundersökningen
337
+ success: Mötesundersökning har uppdaterats
301
338
  models:
302
339
  meeting:
303
340
  name: Möte
@@ -337,31 +374,36 @@ sv:
337
374
  value_types:
338
375
  organizer_presenter:
339
376
  not_found: 'Arrangören hittades inte i databasen (ID: %{id})'
377
+ application_helper:
378
+ filter_category_values:
379
+ all: Alla
380
+ filter_meeting_space_values:
381
+ all: Alla
382
+ filter_scope_values:
383
+ all: Alla
340
384
  calendar_modal:
341
385
  calendar_url: Kalender-URL
342
386
  close_window: Stäng fönster
343
387
  export_calendar: Exportera kalender
344
388
  conference_venues: Konferenslokaler
345
389
  content_blocks:
346
- upcoming_events:
347
- name: Kommande händelser
348
- upcoming_events: Kommande möten
349
- view_all_events: Visa alla
390
+ upcoming_meetings:
391
+ name: Kommande möten
392
+ upcoming_meetings: Kommande möten
393
+ view_all_meetings: Visa alla
350
394
  directory:
351
395
  meetings:
352
396
  index:
353
- all: Alla
354
- date: Datum
355
397
  meetings: Möten
356
- past: Tidigare
357
- search: Sök
358
398
  space_type: Deltagarutrymme
359
- upcoming: Kommande
360
399
  last_activity:
400
+ meeting_updated_at_html: "<span>Mötet uppdaterades på %{link}</span>"
361
401
  new_meeting_at_html: "<span>Nytt möte på %{link}</span>"
362
402
  layouts:
363
403
  live_event:
404
+ administrate: Administrera
364
405
  close: stäng
406
+ questions: Frågor
365
407
  mailer:
366
408
  invite_join_meeting_mailer:
367
409
  invite:
@@ -377,6 +419,13 @@ sv:
377
419
  close: Avsluta möte
378
420
  title: Avsluta möte
379
421
  meetings:
422
+ calendar_modal:
423
+ add_to_calendar: Lägg till i kalender
424
+ apple: Lägg till i Apple kalender
425
+ close_window: Stäng fönster
426
+ full_details_html: För mer detalj gå till %{link}
427
+ google: Lägg till i Google kalender
428
+ outlook: Lägg till i Outlook kalender
380
429
  count:
381
430
  meetings_count:
382
431
  one: "%{count} möte"
@@ -421,10 +470,20 @@ sv:
421
470
  address_help: 'Adress: som används av Geocoder för att hitta platsen'
422
471
  available_slots_help: Lämna det till 0 om du har obegränsade platser
423
472
  create_as: Skapa möte som
473
+ disclaimer: 'Disclaimer: När du använder ett externt anmälningssystem är du medveten om att administratörerna för %{organization} inte är ansvariga för de data som tillhandahålls av användarna till den externa tjänsten.'
424
474
  location_help: 'Plats: meddelande riktat till de användare som antyder platsen att träffas på'
475
+ location_hints_help: 'Tips för att hitta platsen: ytterligare information. Exempel: våningen om det är ett fysiskt möte eller möteslösenordet om det är ett online möte.'
476
+ online_meeting_url_help: 'Länk: tillåt deltagare att koppla sig direct till ditt möte'
477
+ registration_url_help: 'Länk: tillåt deltagare att registrera sig på en extern tjänst'
425
478
  select_a_category: Välj en kategori
479
+ select_a_meeting_type: Välj mötestyp
480
+ select_a_registration_type: Välj en registreringsmetod
426
481
  index:
482
+ click_here: Se alla möten
427
483
  new_meeting: Nytt möte
484
+ see_all: Se alla möten
485
+ see_all_withdrawn: Se alla tillbakadragna möten
486
+ text_banner: Du tittar på listan över möten som dragits tillbaka av sina författare. %{go_back_link}.
428
487
  meeting_minutes:
429
488
  related_information: Relaterad information
430
489
  meetings:
@@ -443,10 +502,17 @@ sv:
443
502
  close_meeting: Avsluta möte
444
503
  contributions: Antal bidrag
445
504
  date: Datum
505
+ edit_close_meeting: Redigera mötesrapport
446
506
  edit_meeting: Redigera möte
507
+ going: Du har anmält dig för detta möte
447
508
  join: Gå med i mötet
509
+ leave: Avbryt din registrering
448
510
  leave_confirmation: Är du säker på att du vill avboka från detta möte?
511
+ link_available_soon: Länk snart tillgänglig
512
+ link_closed: Länken till mötet kommer finnas tillgänglig några minuter innan det börjar
513
+ live_event: Detta möte händer nu
449
514
  meeting_minutes: Mötesprotokoll
515
+ micro_camera_permissions_warning: När du klickar på knappen nedan kommer du att bli ombedd om mikrofon och/eller kamera och du kommer att ansluta till videokonferensen
450
516
  no_slots_available: Inga platser kvar
451
517
  organizations: Delta i organisationer
452
518
  registration_code_help_text: Din registreringskod
@@ -457,6 +523,10 @@ sv:
457
523
  one: "%{count} plats kvar"
458
524
  other: "%{count} platser kvar"
459
525
  view: Visa
526
+ visit_finished: Visa tidigare möten
527
+ withdraw_btn_hint: Du kan dra tillbaka ditt möte om du ändrar dig. Mötet raderas inte utan kommer att synas i listan över möten som dragits tillbaka.
528
+ withdraw_confirmation_html: Är du säker på att du vill dra tillbaka det här mötet?<br><br><strong>Den här åtgärden kan inte ångras!</strong>
529
+ withdraw_meeting: Dra tillbaka möte
460
530
  update:
461
531
  invalid: Det gick inte att uppdatera mötet.
462
532
  success: Du har uppdaterat mötet.
@@ -534,8 +604,12 @@ sv:
534
604
  types:
535
605
  private_meeting: Privat möte
536
606
  transparent: Transparent
607
+ withdraw: Tillbakadragna
537
608
  versions:
538
609
  back_to_resource: Gå tillbaka till mötet
610
+ withdraw:
611
+ error: Det gick inte att dra tillbaka mötet
612
+ success: Mötet har dragits tillbaka
539
613
  metrics:
540
614
  meetings:
541
615
  description: Antal skapade möten
@@ -255,7 +255,7 @@ tr:
255
255
  update: Güncelle
256
256
  form:
257
257
  address_help: 'Adres: Geocoder tarafından konumu bulmak için kullanılır'
258
- available_slots_help: Sınırsız yuvanız varsa bunu 0 olarak bırakın
258
+ available_slots_help: Sınırsız alanınız varsa bunu 0 olarak bırakın
259
259
  disclaimer: 'Sorumluluk reddi: Harici bir kayıt sistemi kullanarak, %{organization} organizatörlerinin, kullanıcılar tarafından harici hizmete sağlanan verilerden sorumlu olmadığını biliyorsunuz.'
260
260
  location_help: 'Konum: kullanıcılara buluşulacak yeri ima eden mesaj'
261
261
  location_hints_help: 'Konum ipuçları: ek bilgi. Örnek: Yüz yüze bir toplantıysa binanın katı veya kısıtlı erişime sahip çevrimiçi bir toplantıysa toplantı parolası.'
@@ -326,20 +326,13 @@ tr:
326
326
  export_calendar: Takvimi dışa aktar
327
327
  conference_venues: Konferans Mekanları
328
328
  content_blocks:
329
- upcoming_events:
330
- name: Yaklaşan Etkinlikler
331
- upcoming_events: Yaklaşan toplantılar
332
- view_all_events: Hepsini gör
329
+ upcoming_meetings:
330
+ view_all_meetings: Hepsini gör
333
331
  directory:
334
332
  meetings:
335
333
  index:
336
- all: Tümü
337
- date: Tarih
338
334
  meetings: Toplantılar
339
- past: Geçmiş
340
- search: Arama
341
335
  space_type: Katılımcı alan
342
- upcoming: Yaklaşan
343
336
  last_activity:
344
337
  new_meeting_at_html: "<span>%{link} </span> adresinde yeni toplantı"
345
338
  mailer:
@@ -0,0 +1 @@
1
+ val:
@@ -304,20 +304,13 @@ zh-CN:
304
304
  export_calendar: 导出日历
305
305
  conference_venues: 会议地点
306
306
  content_blocks:
307
- upcoming_events:
308
- name: 即将到来的事件
309
- upcoming_events: 即将举行的会议
310
- view_all_events: 查看全部
307
+ upcoming_meetings:
308
+ view_all_meetings: 查看全部
311
309
  directory:
312
310
  meetings:
313
311
  index:
314
- all: 所有的
315
- date: 日期
316
312
  meetings: 会议
317
- past: 过去的
318
- search: 搜索
319
313
  space_type: 参与空间
320
- upcoming: 即将到来的
321
314
  last_activity:
322
315
  new_meeting_at_html: "<span>在 %{link}的新会议</span>"
323
316
  mailer:
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddCommentsAvailabilityColumnsToMeetingsTable < ActiveRecord::Migration[6.0]
4
+ def change
5
+ add_column :decidim_meetings_meetings, :comments_enabled, :boolean, default: true
6
+ add_column :decidim_meetings_meetings, :comments_start_time, :datetime
7
+ add_column :decidim_meetings_meetings, :comments_end_time, :datetime
8
+ reversible do |dir|
9
+ dir.up do
10
+ execute "UPDATE decidim_meetings_meetings set comments_enabled = true"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddStateFieldToMeeting < ActiveRecord::Migration[6.0]
4
+ def change
5
+ add_column :decidim_meetings_meetings, :state, :string, index: true
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddIframeAccessLevelToDecidimMeetings < ActiveRecord::Migration[6.0]
4
+ def change
5
+ add_column :decidim_meetings_meetings, :iframe_access_level, :integer, default: 0
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ class TransformShowEmbeddedIframeColumn < ActiveRecord::Migration[6.0]
4
+ def up
5
+ add_column :decidim_meetings_meetings, :iframe_embed_type, :integer, default: 0
6
+ execute "UPDATE decidim_meetings_meetings SET iframe_embed_type = 1 WHERE show_embedded_iframe = 't'"
7
+ remove_column :decidim_meetings_meetings, :show_embedded_iframe
8
+ end
9
+
10
+ def down
11
+ add_column :decidim_meetings_meetings, :show_embedded_iframe, :boolean, default: false
12
+ execute "UPDATE decidim_meetings_meetings SET show_embedded_iframe = 't' WHERE iframe_embed_type = 1"
13
+ remove_column :decidim_meetings_meetings, :iframe_embed_type
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RenameUpcomingEventsContentBlockToUpcomingMeetings < ActiveRecord::Migration[6.0]
4
+ class ContentBlock < ApplicationRecord
5
+ self.table_name = :decidim_content_blocks
6
+ end
7
+
8
+ def change
9
+ # rubocop:disable Rails/SkipsModelValidations
10
+ ContentBlock.where(manifest_name: "upcoming_events").update_all(manifest_name: "upcoming_meetings")
11
+ # rubocop:enable Rails/SkipsModelValidations
12
+ end
13
+ end
@@ -28,6 +28,7 @@ module Decidim
28
28
  end
29
29
 
30
30
  field :closed, GraphQL::Types::Boolean, "Whether this meeting is closed or not.", method: :closed?, null: false
31
+ field :isWithdrawn, GraphQL::Types::Boolean, "Whether this meeting is withdrawn or not.", method: :withdrawn?, null: false
31
32
  field :closing_report, Decidim::Core::TranslatedFieldType, "The closing report of this meeting.", null: true
32
33
  field :video_url, GraphQL::Types::String, "URL for the video of the session, if any", null: true
33
34
  field :audio_url, GraphQL::Types::String, "URL for the audio of the session, if any", null: true
@@ -72,7 +73,7 @@ module Decidim
72
73
  end
73
74
  field :type_of_meeting, GraphQL::Types::String, "The type of the meeting (online or in-person)", null: false
74
75
  field :online_meeting_url, GraphQL::Types::String, "The URL of the meeting (when the type is online)", null: false
75
- field :show_embedded_iframe, GraphQL::Types::Boolean, "Whether show or not the iframe", null: false
76
+ field :iframe_embed_type, GraphQL::Types::String, "The type of displaying of the online meeting URL", null: true
76
77
  end
77
78
  end
78
79
  end
@@ -25,7 +25,7 @@ Decidim.register_component(:meetings) do |component|
25
25
  end
26
26
 
27
27
  component.register_stat :meetings_count, primary: true, priority: Decidim::StatsRegistry::MEDIUM_PRIORITY do |components, start_at, end_at|
28
- meetings = Decidim::Meetings::FilteredMeetings.for(components, start_at, end_at)
28
+ meetings = Decidim::Meetings::FilteredMeetings.for(components, start_at, end_at).except_withdrawn
29
29
  meetings.count
30
30
  end
31
31
 
@@ -46,7 +46,7 @@ Decidim.register_component(:meetings) do |component|
46
46
  .not_hidden
47
47
  .visible
48
48
  .where(component: component_instance)
49
- .includes(component: { participatory_space: :organization })
49
+ .includes(:scope, :category, :attachments, component: { participatory_space: :organization })
50
50
  end
51
51
 
52
52
  exports.include_in_open_data = true
@@ -58,7 +58,7 @@ Decidim.register_component(:meetings) do |component|
58
58
  exports.collection do |component_instance|
59
59
  Decidim::Comments::Export.comments_for_resource(
60
60
  Decidim::Meetings::Meeting, component_instance
61
- )
61
+ ).includes(:author, :user_group, root_commentable: { component: { participatory_space: :organization } })
62
62
  end
63
63
 
64
64
  exports.include_in_open_data = true
@@ -129,6 +129,7 @@ Decidim.register_component(:meetings) do |component|
129
129
 
130
130
  2.times do
131
131
  start_time = [rand(1..20).weeks.from_now, rand(1..20).weeks.ago].sample
132
+ end_time = start_time + [rand(1..4).hours, rand(1..20).days].sample
132
133
  params = {
133
134
  component: component,
134
135
  scope: Faker::Boolean.boolean(true_ratio: 0.5) ? global : scopes.sample,
@@ -140,7 +141,7 @@ Decidim.register_component(:meetings) do |component|
140
141
  location: Decidim::Faker::Localized.sentence,
141
142
  location_hints: Decidim::Faker::Localized.sentence,
142
143
  start_time: start_time,
143
- end_time: start_time + rand(1..4).hours,
144
+ end_time: end_time,
144
145
  address: "#{Faker::Address.street_address} #{Faker::Address.zip} #{Faker::Address.city}",
145
146
  latitude: Faker::Address.latitude,
146
147
  longitude: Faker::Address.longitude,
@@ -156,14 +157,22 @@ Decidim.register_component(:meetings) do |component|
156
157
  _hybrid_meeting = Decidim.traceability.create!(
157
158
  Decidim::Meetings::Meeting,
158
159
  admin_user,
159
- params.merge(type_of_meeting: :hybrid, online_meeting_url: "http://example.org"),
160
+ params.merge(
161
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
162
+ type_of_meeting: :hybrid,
163
+ online_meeting_url: "http://example.org"
164
+ ),
160
165
  visibility: "all"
161
166
  )
162
167
 
163
168
  _online_meeting = Decidim.traceability.create!(
164
169
  Decidim::Meetings::Meeting,
165
170
  admin_user,
166
- params.merge(type_of_meeting: :online, online_meeting_url: "http://example.org"),
171
+ params.merge(
172
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
173
+ type_of_meeting: :online,
174
+ online_meeting_url: "http://example.org"
175
+ ),
167
176
  visibility: "all"
168
177
  )
169
178
 
@@ -22,9 +22,9 @@ module Decidim
22
22
  end
23
23
 
24
24
  initializer "decidim.meetings.content_blocks" do
25
- Decidim.content_blocks.register(:homepage, :upcoming_events) do |content_block|
26
- content_block.cell = "decidim/meetings/content_blocks/upcoming_events"
27
- content_block.public_name_key = "decidim.meetings.content_blocks.upcoming_events.name"
25
+ Decidim.content_blocks.register(:homepage, :upcoming_meetings) do |content_block|
26
+ content_block.cell = "decidim/meetings/content_blocks/upcoming_meetings"
27
+ content_block.public_name_key = "decidim.meetings.content_blocks.upcoming_meetings.name"
28
28
  content_block.default!
29
29
  end
30
30
  end
@@ -13,7 +13,10 @@ module Decidim
13
13
  isolate_namespace Decidim::Meetings
14
14
 
15
15
  routes do
16
- resources :meetings, only: [:index, :show, :new, :create, :edit, :update] do
16
+ resources :meetings, only: [:index, :show, :new, :create, :edit, :update, :withdraw] do
17
+ member do
18
+ put :withdraw
19
+ end
17
20
  resources :meeting_closes, only: [:edit, :update] do
18
21
  get :proposals_picker, on: :collection
19
22
  end
@@ -106,6 +109,10 @@ module Decidim
106
109
  metric_operation.manager_class = "Decidim::Meetings::Metrics::MeetingFollowersMetricMeasure"
107
110
  end
108
111
  end
112
+
113
+ initializer "decidim_meetings.webpacker.assets_path" do
114
+ Decidim.register_assets_path File.expand_path("app/packs", root)
115
+ end
109
116
  end
110
117
  end
111
118
  end
@@ -41,8 +41,8 @@ module Decidim
41
41
  location: meeting.location,
42
42
  reference: meeting.reference,
43
43
  comments: meeting.comments_count,
44
- attachments: meeting.attachments.count,
45
- followers: meeting.followers.count,
44
+ attachments: meeting.attachments.size,
45
+ followers: meeting.follows.size,
46
46
  url: url,
47
47
  related_proposals: related_proposals,
48
48
  related_results: related_results
@@ -37,7 +37,8 @@ FactoryBot.define do
37
37
  registration_type { :on_this_platform }
38
38
  type_of_meeting { :in_person }
39
39
  component { build(:component, manifest_name: "meetings") }
40
- show_embedded_iframe { false }
40
+ iframe_access_level { :all }
41
+ iframe_embed_type { :none }
41
42
 
42
43
  author do
43
44
  component.try(:organization)
@@ -47,6 +48,10 @@ FactoryBot.define do
47
48
  published_at { Time.current }
48
49
  end
49
50
 
51
+ trait :withdrawn do
52
+ state { "withdrawn" }
53
+ end
54
+
50
55
  trait :in_person do
51
56
  type_of_meeting { :in_person }
52
57
  end
@@ -135,8 +140,24 @@ FactoryBot.define do
135
140
  published_at { Time.current }
136
141
  end
137
142
 
138
- trait :show_embedded_iframe do
139
- show_embedded_iframe { true }
143
+ trait :signed_in_iframe_access_level do
144
+ iframe_access_level { :signed_in }
145
+ end
146
+
147
+ trait :registered_iframe_access_level do
148
+ iframe_access_level { :registered }
149
+ end
150
+
151
+ trait :embed_in_meeting_page_iframe_embed_type do
152
+ iframe_embed_type { :embed_in_meeting_page }
153
+ end
154
+
155
+ trait :open_in_live_event_page_iframe_embed_type do
156
+ iframe_embed_type { :open_in_live_event_page }
157
+ end
158
+
159
+ trait :open_in_new_tab_iframe_embed_type do
160
+ iframe_embed_type { :open_in_new_tab }
140
161
  end
141
162
  end
142
163
 
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ shared_examples_for "emits an upcoming notificaton" do
4
+ context "when it's a future meeting" do
5
+ let(:future_start_date) { 3.days.from_now }
6
+
7
+ before do
8
+ meeting.start_time = future_start_date
9
+ end
10
+
11
+ it "schedules a upcoming meeting notification job 48h before start time" do
12
+ expect(Decidim::Meetings::UpcomingMeetingNotificationJob)
13
+ .to receive(:generate_checksum).and_return "1234"
14
+
15
+ expect(Decidim::Meetings::UpcomingMeetingNotificationJob)
16
+ .to receive_message_chain(:set, :perform_later) # rubocop:disable RSpec/MessageChain
17
+ .with(set: meeting.start_time - Decidim::Meetings.upcoming_meeting_notification)
18
+ .with(kind_of(Integer), "1234")
19
+
20
+ subject.call
21
+ end
22
+ end
23
+
24
+ context "when it's a past meeting" do
25
+ let(:past_start_date) { 1.day.ago }
26
+
27
+ before do
28
+ meeting.start_time = past_start_date
29
+ end
30
+
31
+ it "doesn't schedule an upcoming meeting notification" do
32
+ expect(Decidim::Meetings::UpcomingMeetingNotificationJob).not_to receive(:generate_checksum)
33
+ expect(Decidim::Meetings::UpcomingMeetingNotificationJob).not_to receive(:set)
34
+ expect(Decidim::Meetings::UpcomingMeetingNotificationJob).not_to receive(:perform_later)
35
+
36
+ subject.call
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ shared_examples_for "a translated meeting event" do
4
+ describe "translated notifications" do
5
+ let(:en_body) { "This is Sparta!" }
6
+ let(:body) { { "en": en_body, "machine_translations": { "ca": "C'est Sparta!" } } }
7
+ let(:participatory_process) { create :participatory_process, organization: organization }
8
+ let(:meeting_component) { create(:meeting_component, participatory_space: participatory_process) }
9
+ let(:translatable) { true }
10
+ let(:en_version) { resource.description["en"] }
11
+ let(:machine_translated) { resource.description["machine_translations"]["ca"] }
12
+
13
+ let(:resource) do
14
+ create :meeting,
15
+ component: meeting_component,
16
+ title: { "en": "A nice event", "machine_translations": { "ca": "Une belle event" } },
17
+ description: body
18
+ end
19
+
20
+ it_behaves_like "a translated event"
21
+ end
22
+ end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-meetings version.
5
5
  module Meetings
6
6
  def self.version
7
- "0.25.0"
7
+ "0.26.0.rc2"
8
8
  end
9
9
  end
10
10
  end
@@ -23,5 +23,10 @@ module Decidim
23
23
  config_accessor :enable_proposal_linking do
24
24
  Decidim.const_defined?("Proposals")
25
25
  end
26
+
27
+ # Public Setting that defines the interval when the upcoming meeting will be sent
28
+ config_accessor :upcoming_meeting_notification do
29
+ 2.days
30
+ end
26
31
  end
27
32
  end