decidim-meetings 0.27.8 → 0.28.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (251) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/meetings/attending_organizations_list_cell.rb +32 -0
  3. data/app/cells/decidim/meetings/cancel_registration_meeting_button/cancelation_modal.erb +21 -0
  4. data/app/cells/decidim/meetings/cancel_registration_meeting_button/show.erb +10 -13
  5. data/app/cells/decidim/meetings/cancel_registration_meeting_button_cell.rb +2 -2
  6. data/app/cells/decidim/meetings/content_blocks/highlighted_meetings_cell.rb +8 -18
  7. data/app/cells/decidim/meetings/dates_and_map/show.erb +25 -0
  8. data/app/cells/decidim/meetings/dates_and_map/static_map.erb +1 -0
  9. data/app/cells/decidim/meetings/dates_and_map_cell.rb +35 -0
  10. data/app/cells/decidim/meetings/highlighted_meetings_for_component/show.erb +32 -30
  11. data/app/cells/decidim/meetings/highlighted_meetings_for_component_cell.rb +76 -16
  12. data/app/cells/decidim/meetings/join_meeting_button/registration_modal.erb +25 -0
  13. data/app/cells/decidim/meetings/join_meeting_button/remaining_slots.erb +4 -0
  14. data/app/cells/decidim/meetings/join_meeting_button/show.erb +6 -4
  15. data/app/cells/decidim/meetings/join_meeting_button_cell.rb +3 -7
  16. data/app/cells/decidim/meetings/meeting_activity_cell.rb +1 -12
  17. data/app/cells/decidim/meetings/meeting_card_metadata_cell.rb +64 -0
  18. data/app/cells/decidim/meetings/meeting_cell.rb +2 -6
  19. data/app/cells/decidim/meetings/meeting_l/image.erb +5 -0
  20. data/app/cells/decidim/meetings/meeting_l_cell.rb +33 -0
  21. data/app/cells/decidim/meetings/meeting_month/show.erb +33 -0
  22. data/app/cells/decidim/meetings/meeting_month_cell.rb +72 -0
  23. data/app/cells/decidim/meetings/meeting_s_cell.rb +5 -37
  24. data/app/cells/decidim/meetings/meetings_map/show.erb +9 -24
  25. data/app/cells/decidim/meetings/meetings_map_cell.rb +1 -1
  26. data/app/cells/decidim/meetings/online_meeting_cell.rb +1 -0
  27. data/app/cells/decidim/meetings/online_meeting_link/show.erb +18 -41
  28. data/app/cells/decidim/meetings/public_participants_list/show.erb +4 -15
  29. data/app/commands/decidim/meetings/admin/copy_meeting.rb +1 -1
  30. data/app/commands/decidim/meetings/admin/create_meeting.rb +1 -1
  31. data/app/commands/decidim/meetings/admin/invite_user_to_join_meeting.rb +5 -5
  32. data/app/commands/decidim/meetings/admin/publish_meeting.rb +1 -1
  33. data/app/commands/decidim/meetings/admin/unpublish_meeting.rb +1 -1
  34. data/app/commands/decidim/meetings/create_meeting.rb +14 -3
  35. data/app/commands/decidim/meetings/decline_invitation.rb +1 -1
  36. data/app/commands/decidim/meetings/join_meeting.rb +5 -5
  37. data/app/commands/decidim/meetings/update_meeting.rb +13 -3
  38. data/app/controllers/concerns/decidim/meetings/component_filterable.rb +4 -4
  39. data/app/controllers/decidim/meetings/admin/agenda_controller.rb +6 -6
  40. data/app/controllers/decidim/meetings/admin/invites_controller.rb +3 -3
  41. data/app/controllers/decidim/meetings/admin/meeting_closes_controller.rb +2 -4
  42. data/app/controllers/decidim/meetings/admin/meeting_copies_controller.rb +3 -3
  43. data/app/controllers/decidim/meetings/admin/meetings_controller.rb +7 -7
  44. data/app/controllers/decidim/meetings/admin/meetings_poll_controller.rb +4 -4
  45. data/app/controllers/decidim/meetings/admin/registrations_controller.rb +6 -6
  46. data/app/controllers/decidim/meetings/application_controller.rb +11 -0
  47. data/app/controllers/decidim/meetings/calendars_controller.rb +0 -1
  48. data/app/controllers/decidim/meetings/directory/application_controller.rb +12 -0
  49. data/app/controllers/decidim/meetings/directory/meetings_controller.rb +5 -30
  50. data/app/controllers/decidim/meetings/live_events_controller.rb +1 -0
  51. data/app/controllers/decidim/meetings/meeting_closes_controller.rb +2 -3
  52. data/app/controllers/decidim/meetings/meetings_controller.rb +75 -7
  53. data/app/controllers/decidim/meetings/polls/answers_controller.rb +2 -2
  54. data/app/controllers/decidim/meetings/polls/questions_controller.rb +1 -1
  55. data/app/controllers/decidim/meetings/registrations_controller.rb +5 -5
  56. data/app/events/decidim/meetings/close_meeting_event.rb +1 -1
  57. data/app/events/decidim/meetings/meeting_event.rb +1 -1
  58. data/app/events/decidim/meetings/meeting_registration_notification_event.rb +3 -3
  59. data/app/events/decidim/meetings/meeting_registrations_enabled_event.rb +1 -1
  60. data/app/events/decidim/meetings/meeting_registrations_over_percentage_event.rb +1 -1
  61. data/app/events/decidim/meetings/registration_code_validated_event.rb +1 -1
  62. data/app/forms/decidim/meetings/admin/meeting_form.rb +5 -1
  63. data/app/forms/decidim/meetings/admin/meeting_registrations_form.rb +2 -2
  64. data/app/forms/decidim/meetings/admin/validate_registration_code_form.rb +1 -1
  65. data/app/forms/decidim/meetings/base_meeting_form.rb +1 -1
  66. data/app/forms/decidim/meetings/meeting_form.rb +3 -3
  67. data/app/helpers/decidim/meetings/admin/application_helper.rb +1 -0
  68. data/app/helpers/decidim/meetings/application_helper.rb +18 -25
  69. data/app/helpers/decidim/meetings/directory/application_helper.rb +11 -59
  70. data/app/helpers/decidim/meetings/map_helper.rb +2 -9
  71. data/app/helpers/decidim/meetings/meetings_helper.rb +6 -5
  72. data/app/jobs/decidim/meetings/hide_all_created_by_author_job.rb +13 -0
  73. data/app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb +1 -1
  74. data/app/mailers/decidim/meetings/registration_mailer.rb +1 -1
  75. data/app/models/decidim/meetings/meeting.rb +11 -32
  76. data/app/models/decidim/meetings/question.rb +1 -1
  77. data/app/packs/entrypoints/decidim_meetings.js +3 -0
  78. data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_attended_meetings.svg +42 -1
  79. data/app/packs/src/decidim/meetings/admin/agendas.js +3 -4
  80. data/app/packs/src/decidim/meetings/admin/registrations_form.js +12 -4
  81. data/app/packs/src/decidim/meetings/meetings_form.js +1 -1
  82. data/app/packs/src/decidim/meetings/poll.component.js +1 -28
  83. data/app/packs/stylesheets/decidim/meetings/_calendar.scss +47 -0
  84. data/app/packs/stylesheets/decidim/meetings/_item.scss +177 -0
  85. data/app/packs/stylesheets/decidim/meetings/_list.scss +58 -0
  86. data/app/packs/stylesheets/decidim/meetings/_live_event.scss +128 -0
  87. data/app/packs/stylesheets/decidim/meetings/meetings.scss +4 -0
  88. data/app/permissions/decidim/meetings/permissions.rb +15 -12
  89. data/app/presenters/decidim/meetings/admin_log/invite_presenter.rb +2 -2
  90. data/app/presenters/decidim/meetings/admin_log/meeting_presenter.rb +6 -2
  91. data/app/presenters/decidim/meetings/admin_log/questionnaire_presenter.rb +2 -2
  92. data/app/presenters/decidim/meetings/admin_log/value_types/meeting_title_description_presenter.rb +1 -1
  93. data/app/presenters/decidim/meetings/log/resource_presenter.rb +18 -0
  94. data/app/presenters/decidim/meetings/meeting_presenter.rb +8 -2
  95. data/app/services/decidim/meetings/calendar/component_calendar.rb +1 -1
  96. data/app/services/decidim/meetings/close_meeting_reminder_generator.rb +7 -13
  97. data/app/services/decidim/meetings/meeting_iframe_embedder.rb +1 -1
  98. data/app/views/decidim/meetings/_calendar_modal.html.erb +19 -21
  99. data/app/views/decidim/meetings/admin/agenda/_agenda_item.html.erb +12 -12
  100. data/app/views/decidim/meetings/admin/agenda/_agenda_item_child.html.erb +8 -8
  101. data/app/views/decidim/meetings/admin/agenda/_agenda_item_child_template.html.erb +1 -1
  102. data/app/views/decidim/meetings/admin/agenda/_agenda_item_fields.html.erb +3 -3
  103. data/app/views/decidim/meetings/admin/agenda/_form.html.erb +54 -50
  104. data/app/views/decidim/meetings/admin/agenda/edit.html.erb +18 -6
  105. data/app/views/decidim/meetings/admin/agenda/new.html.erb +17 -5
  106. data/app/views/decidim/meetings/admin/invite_join_meeting_mailer/invite.html.erb +11 -2
  107. data/app/views/decidim/meetings/admin/invites/_form.html.erb +38 -28
  108. data/app/views/decidim/meetings/admin/invites/index.html.erb +77 -81
  109. data/app/views/decidim/meetings/admin/meeting_closes/_form.html.erb +26 -28
  110. data/app/views/decidim/meetings/admin/meeting_closes/edit.html.erb +17 -5
  111. data/app/views/decidim/meetings/admin/meeting_copies/new.html.erb +17 -6
  112. data/app/views/decidim/meetings/admin/meetings/_form.html.erb +76 -83
  113. data/app/views/decidim/meetings/admin/meetings/_service.html.erb +14 -10
  114. data/app/views/decidim/meetings/admin/meetings/_services.html.erb +9 -5
  115. data/app/views/decidim/meetings/admin/meetings/edit.html.erb +17 -7
  116. data/app/views/decidim/meetings/admin/meetings/index.html.erb +133 -129
  117. data/app/views/decidim/meetings/admin/meetings/new.html.erb +16 -6
  118. data/app/views/decidim/meetings/admin/poll/_answer_option.html.erb +1 -1
  119. data/app/views/decidim/meetings/admin/poll/_answer_option_template.html.erb +1 -1
  120. data/app/views/decidim/meetings/admin/poll/_form.html.erb +17 -32
  121. data/app/views/decidim/meetings/admin/poll/_question.html.erb +81 -75
  122. data/app/views/decidim/meetings/admin/poll/edit.html.erb +28 -8
  123. data/app/views/decidim/meetings/admin/registrations/_form.html.erb +32 -55
  124. data/app/views/decidim/meetings/admin/registrations/edit.html.erb +59 -26
  125. data/app/views/decidim/meetings/directory/meetings/index.html.erb +15 -20
  126. data/app/views/decidim/meetings/directory/meetings/index.js.erb +1 -23
  127. data/app/views/decidim/meetings/layouts/_aside_block.html.erb +8 -0
  128. data/app/views/decidim/meetings/layouts/live_event.html.erb +20 -19
  129. data/app/views/decidim/meetings/live_events/show.html.erb +4 -5
  130. data/app/views/decidim/meetings/meeting_closes/_form.html.erb +3 -10
  131. data/app/views/decidim/meetings/meeting_closes/edit.html.erb +17 -21
  132. data/app/views/decidim/meetings/meetings/_actions.html.erb +6 -0
  133. data/app/views/decidim/meetings/meetings/_add_to_calendar_modal.html.erb +17 -0
  134. data/app/views/decidim/meetings/meetings/_form.html.erb +26 -34
  135. data/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +3 -22
  136. data/app/views/decidim/meetings/meetings/_meeting.html.erb +74 -0
  137. data/app/views/decidim/meetings/meetings/_meeting_agenda.html.erb +28 -26
  138. data/app/views/decidim/meetings/meetings/_meeting_aside.html.erb +98 -0
  139. data/app/views/decidim/meetings/meetings/_meeting_minutes.html.erb +23 -36
  140. data/app/views/decidim/meetings/meetings/edit.html.erb +17 -21
  141. data/app/views/decidim/meetings/meetings/index.html.erb +15 -33
  142. data/app/views/decidim/meetings/meetings/index.js.erb +1 -23
  143. data/app/views/decidim/meetings/meetings/new.html.erb +17 -21
  144. data/app/views/decidim/meetings/meetings/show.html.erb +8 -167
  145. data/app/views/decidim/meetings/polls/answers/_multiple_option.html.erb +9 -13
  146. data/app/views/decidim/meetings/polls/answers/_single_option.html.erb +4 -4
  147. data/app/views/decidim/meetings/polls/answers/create.js.erb +1 -1
  148. data/app/views/decidim/meetings/polls/questions/_index.html.erb +1 -1
  149. data/app/views/decidim/meetings/polls/questions/_index_admin.html.erb +5 -5
  150. data/app/views/decidim/meetings/polls/questions/_published_question.html.erb +9 -11
  151. data/app/views/decidim/meetings/polls/questions/_question.html.erb +3 -3
  152. data/app/views/decidim/meetings/polls/questions/index_admin.js.erb +1 -1
  153. data/app/views/decidim/meetings/shared/_filters.html.erb +20 -0
  154. data/app/views/decidim/meetings/shared/_index.html.erb +24 -0
  155. data/app/views/decidim/meetings/shared/_index.js.erb +16 -0
  156. data/app/views/decidim/meetings/shared/_meetings.html.erb +33 -0
  157. data/app/views/decidim/meetings/shared/_meetings_aside.html.erb +18 -0
  158. data/app/views/decidim/meetings/versions/show.html.erb +14 -4
  159. data/app/views/decidim/participatory_spaces/_conference_venues.html.erb +13 -15
  160. data/config/assets.rb +0 -2
  161. data/config/locales/ar.yml +6 -94
  162. data/config/locales/bg.yml +0 -673
  163. data/config/locales/ca.yml +52 -75
  164. data/config/locales/cs.yml +49 -71
  165. data/config/locales/de.yml +53 -76
  166. data/config/locales/el.yml +48 -51
  167. data/config/locales/en.yml +51 -74
  168. data/config/locales/es-MX.yml +50 -73
  169. data/config/locales/es-PY.yml +48 -71
  170. data/config/locales/es.yml +53 -76
  171. data/config/locales/eu.yml +52 -75
  172. data/config/locales/fi-plain.yml +46 -69
  173. data/config/locales/fi.yml +44 -67
  174. data/config/locales/fr-CA.yml +43 -69
  175. data/config/locales/fr.yml +48 -71
  176. data/config/locales/ga-IE.yml +2 -16
  177. data/config/locales/gl.yml +5 -63
  178. data/config/locales/hu.yml +6 -92
  179. data/config/locales/id-ID.yml +4 -60
  180. data/config/locales/is-IS.yml +1 -22
  181. data/config/locales/it.yml +6 -86
  182. data/config/locales/ja.yml +44 -73
  183. data/config/locales/lb.yml +6 -67
  184. data/config/locales/lt.yml +42 -65
  185. data/config/locales/lv.yml +4 -61
  186. data/config/locales/nl.yml +4 -92
  187. data/config/locales/no.yml +4 -80
  188. data/config/locales/pl.yml +2 -199
  189. data/config/locales/pt-BR.yml +4 -200
  190. data/config/locales/pt.yml +5 -85
  191. data/config/locales/ro-RO.yml +11 -81
  192. data/config/locales/ru.yml +5 -60
  193. data/config/locales/sk.yml +4 -61
  194. data/config/locales/sl.yml +0 -3
  195. data/config/locales/sr-CS.yml +0 -6
  196. data/config/locales/sv.yml +10 -90
  197. data/config/locales/tr-TR.yml +5 -78
  198. data/config/locales/uk.yml +5 -53
  199. data/config/locales/zh-CN.yml +3 -70
  200. data/config/locales/zh-TW.yml +24 -51
  201. data/db/migrate/20201016065302_fix_meetings_registration_terms.rb +1 -1
  202. data/db/migrate/20230427105701_change_types_and_registration_types_on_meetings.rb +49 -0
  203. data/lib/decidim/meetings/admin_engine.rb +2 -2
  204. data/lib/decidim/meetings/component.rb +4 -216
  205. data/lib/decidim/meetings/content_blocks/registry_manager.rb +17 -0
  206. data/lib/decidim/meetings/directory_engine.rb +4 -6
  207. data/lib/decidim/meetings/engine.rb +62 -27
  208. data/lib/decidim/meetings/meeting_serializer.rb +3 -3
  209. data/lib/decidim/meetings/seeds.rb +188 -0
  210. data/lib/decidim/meetings/test/factories.rb +124 -54
  211. data/lib/decidim/meetings/test/notifications_handling.rb +3 -3
  212. data/lib/decidim/meetings/test/translated_event.rb +1 -1
  213. data/lib/decidim/meetings/version.rb +1 -1
  214. metadata +58 -58
  215. data/app/cells/decidim/meetings/content_blocks/highlighted_meetings/elements.erb +0 -16
  216. data/app/cells/decidim/meetings/content_blocks/highlighted_meetings/heading.erb +0 -1
  217. data/app/cells/decidim/meetings/content_blocks/upcoming_meetings/show.erb +0 -26
  218. data/app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb +0 -63
  219. data/app/cells/decidim/meetings/join_meeting_button/registration_confirm.erb +0 -31
  220. data/app/cells/decidim/meetings/meeting_highlighted_list_item/show.erb +0 -21
  221. data/app/cells/decidim/meetings/meeting_highlighted_list_item_cell.rb +0 -10
  222. data/app/cells/decidim/meetings/meeting_list_item/show.erb +0 -14
  223. data/app/cells/decidim/meetings/meeting_list_item_cell.rb +0 -44
  224. data/app/cells/decidim/meetings/meeting_m/address.erb +0 -5
  225. data/app/cells/decidim/meetings/meeting_m/data.erb +0 -2
  226. data/app/cells/decidim/meetings/meeting_m/date.erb +0 -8
  227. data/app/cells/decidim/meetings/meeting_m/footer.erb +0 -9
  228. data/app/cells/decidim/meetings/meeting_m/multiple_dates.erb +0 -17
  229. data/app/cells/decidim/meetings/meeting_m/single_date.erb +0 -9
  230. data/app/cells/decidim/meetings/meeting_m/tags.erb +0 -1
  231. data/app/cells/decidim/meetings/meeting_m_cell.rb +0 -121
  232. data/app/cells/decidim/meetings/meeting_s/show.erb +0 -27
  233. data/app/controllers/concerns/decidim/meetings/filterable.rb +0 -27
  234. data/app/controllers/decidim/meetings/widgets_controller.rb +0 -30
  235. data/app/packs/stylesheets/decidim/meetings/_header.scss +0 -52
  236. data/app/packs/stylesheets/decidim/meetings/_main.scss +0 -178
  237. data/app/packs/stylesheets/decidim/meetings/_meetings.scss +0 -2
  238. data/app/queries/decidim/meetings/admin/invites.rb +0 -60
  239. data/app/views/decidim/meetings/admin/meeting_closes/proposals_picker.html.erb +0 -1
  240. data/app/views/decidim/meetings/directory/meetings/_filters.html.erb +0 -34
  241. data/app/views/decidim/meetings/directory/meetings/_meetings.html.erb +0 -26
  242. data/app/views/decidim/meetings/meeting_closes/proposals_picker.html.erb +0 -1
  243. data/app/views/decidim/meetings/meetings/_calendar_modal.html.erb +0 -26
  244. data/app/views/decidim/meetings/meetings/_filters.html.erb +0 -40
  245. data/app/views/decidim/meetings/meetings/_filters_small_view.html.erb +0 -18
  246. data/app/views/decidim/meetings/meetings/_meetings.html.erb +0 -48
  247. data/app/views/decidim/meetings/versions/index.html.erb +0 -8
  248. data/app/views/decidim/participatory_spaces/_upcoming_meeting_for_card.html.erb +0 -4
  249. data/config/locales/he-IL.yml +0 -1
  250. data/decidim-meetings.gemspec +0 -36
  251. data/lib/decidim/meetings/seeds/city.jpeg +0 -0
@@ -12,26 +12,21 @@ module Decidim
12
12
  include Decidim::SanitizeHelper
13
13
  include Decidim::CheckBoxesTreeHelper
14
14
  include Decidim::RichTextEditorHelper
15
+ include ::Decidim::FollowableHelper
15
16
 
16
17
  def filter_origin_values
17
- origin_values = []
18
- origin_values << TreePoint.new("official", t("decidim.meetings.meetings.filters.origin_values.official"))
19
- origin_values << TreePoint.new("participants", t("decidim.meetings.meetings.filters.origin_values.participants")) # todo
20
- if current_organization.user_groups_enabled?
21
- origin_values << TreePoint.new("user_group", t("decidim.meetings.meetings.filters.origin_values.user_groups")) # todo
22
- end
23
- # if current_organization.user_groups_enabled? and component_settings enabled enabled
18
+ origin_keys = %w(official participants)
19
+ origin_keys << "user_group" if current_organization.user_groups_enabled?
24
20
 
25
- TreeNode.new(
26
- TreePoint.new("", t("decidim.meetings.meetings.filters.origin_values.all")),
27
- origin_values
28
- )
21
+ origin_values = flat_filter_values(*origin_keys, scope: "decidim.meetings.meetings.filters.origin_values")
22
+ origin_values.prepend(["", t("all", scope: "decidim.meetings.meetings.filters.origin_values")])
23
+
24
+ filter_tree_from_array(origin_values)
29
25
  end
30
26
 
31
27
  def filter_type_values
32
- type_values = []
33
- Decidim::Meetings::Meeting::TYPE_OF_MEETING.each do |type|
34
- type_values << TreePoint.new(type, t("decidim.meetings.meetings.filters.type_values.#{type}"))
28
+ type_values = flat_filter_values(*Decidim::Meetings::Meeting::TYPE_OF_MEETING.keys, scope: "decidim.meetings.meetings.filters.type_values").map do |args|
29
+ TreePoint.new(*args)
35
30
  end
36
31
 
37
32
  TreeNode.new(
@@ -41,23 +36,16 @@ module Decidim
41
36
  end
42
37
 
43
38
  def filter_date_values
44
- [
45
- ["all", t("decidim.meetings.meetings.filters.date_values.all")],
46
- ["upcoming", t("decidim.meetings.meetings.filters.date_values.upcoming")],
47
- ["past", t("decidim.meetings.meetings.filters.date_values.past")]
48
- ]
39
+ flat_filter_values(:all, :upcoming, :past, scope: "decidim.meetings.meetings.filters.date_values")
49
40
  end
50
41
 
51
42
  # Options to filter meetings by activity.
52
43
  def activity_filter_values
53
- [
54
- ["all", t("decidim.meetings.meetings.filters.all")],
55
- ["my_meetings", t("decidim.meetings.meetings.filters.my_meetings")]
56
- ]
44
+ flat_filter_values(:all, :my_meetings, scope: "decidim.meetings.meetings.filters")
57
45
  end
58
46
 
59
47
  # If the meeting is official or the rich text editor is enabled on the
60
- # frontend, the meeting body is considered as safe content; that's unless
48
+ # frontend, the meeting body is considered as safe content; that is unless
61
49
  # the meeting comes from a collaborative_draft or a participatory_text.
62
50
  def safe_content?
63
51
  rich_text_editor_in_public_views? || safe_content_admin?
@@ -90,12 +78,17 @@ module Decidim
90
78
  end
91
79
 
92
80
  def online_or_hybrid_meeting?(meeting)
93
- meeting.online_meeting? || meeting.hybrid_meeting?
81
+ meeting.online? || meeting.hybrid?
94
82
  end
95
83
 
96
84
  def iframe_embed_or_live_event_page?(meeting)
97
85
  %w(embed_in_meeting_page open_in_live_event_page).include? meeting.iframe_embed_type
98
86
  end
87
+
88
+ def apply_meetings_pack_tags
89
+ append_stylesheet_pack_tag("decidim_meetings", media: "all")
90
+ append_javascript_pack_tag("decidim_meetings")
91
+ end
99
92
  end
100
93
  end
101
94
  end
@@ -13,11 +13,12 @@ module Decidim
13
13
  include Decidim::Comments::CommentsHelper
14
14
  include Decidim::SanitizeHelper
15
15
  include Decidim::CheckBoxesTreeHelper
16
+ include Decidim::IconHelper
17
+ include Decidim::FiltersHelper
16
18
 
17
19
  def filter_type_values
18
- type_values = []
19
- Decidim::Meetings::Meeting::TYPE_OF_MEETING.each do |type|
20
- type_values << TreePoint.new(type, t("decidim.meetings.meetings.filters.type_values.#{type}"))
20
+ type_values = flat_filter_values(*Decidim::Meetings::Meeting::TYPE_OF_MEETING.keys, scope: "decidim.meetings.meetings.filters.type_values").map do |args|
21
+ TreePoint.new(*args)
21
22
  end
22
23
 
23
24
  TreeNode.new(
@@ -27,53 +28,19 @@ module Decidim
27
28
  end
28
29
 
29
30
  def filter_date_values
30
- [
31
- ["all", t("decidim.meetings.meetings.filters.date_values.all")],
32
- ["upcoming", t("decidim.meetings.meetings.filters.date_values.upcoming")],
33
- ["past", t("decidim.meetings.meetings.filters.date_values.past")]
34
- ]
35
- end
36
-
37
- def directory_filter_scopes_values
38
- main_scopes = current_organization.scopes.top_level
39
-
40
- scopes_values = main_scopes.includes(:scope_type, :children).flat_map do |scope|
41
- TreeNode.new(
42
- TreePoint.new(scope.id.to_s, translated_attribute(scope.name, current_organization)),
43
- scope_children_to_tree(scope)
44
- )
45
- end
46
-
47
- scopes_values.prepend(TreePoint.new("global", t("decidim.scopes.global")))
48
-
49
- TreeNode.new(
50
- TreePoint.new("", t("decidim.meetings.application_helper.filter_scope_values.all")),
51
- scopes_values
52
- )
53
- end
54
-
55
- def scope_children_to_tree(scope)
56
- return unless scope.children.any?
57
-
58
- scope.children.includes(:scope_type, :children).flat_map do |child|
59
- TreeNode.new(
60
- TreePoint.new(child.id.to_s, translated_attribute(child.name, current_organization)),
61
- scope_children_to_tree(child)
62
- )
63
- end
31
+ %w(all upcoming past).map { |k| [k, t(k, scope: "decidim.meetings.meetings.filters.date_values")] }
64
32
  end
65
33
 
66
34
  def directory_meeting_spaces_values
67
35
  participatory_spaces = current_organization.public_participatory_spaces
68
36
 
69
37
  spaces = participatory_spaces.collect(&:model_name).uniq.map do |participatory_space|
70
- TreePoint.new(participatory_space.name.underscore, participatory_space.human(count: 2))
38
+ [participatory_space.name.underscore, participatory_space.human(count: 2)]
71
39
  end
72
40
 
73
- TreeNode.new(
74
- TreePoint.new("", t("decidim.meetings.application_helper.filter_meeting_space_values.all")),
75
- spaces
76
- )
41
+ spaces.prepend(["", t("decidim.meetings.application_helper.filter_meeting_space_values.all")])
42
+
43
+ filter_tree_from_array(spaces)
77
44
  end
78
45
 
79
46
  def directory_filter_categories_values
@@ -92,7 +59,7 @@ module Decidim
92
59
  key_point = current_participatory_space.class.name.gsub("::", "__") + current_participatory_space.id.to_s
93
60
 
94
61
  TreeNode.new(
95
- TreePoint.new(key_point, decidim_escape_translated(current_participatory_space.title)),
62
+ TreePoint.new(key_point, translated_attribute(current_participatory_space.title, current_organization)),
96
63
  categories_values
97
64
  )
98
65
  end
@@ -104,24 +71,9 @@ module Decidim
104
71
  )
105
72
  end
106
73
 
107
- def directory_filter_origin_values
108
- origin_values = []
109
- origin_values << TreePoint.new("official", t("decidim.meetings.meetings.filters.origin_values.official"))
110
- origin_values << TreePoint.new("participants", t("decidim.meetings.meetings.filters.origin_values.participants"))
111
- origin_values << TreePoint.new("user_group", t("decidim.meetings.meetings.filters.origin_values.user_groups")) if current_organization.user_groups_enabled?
112
-
113
- TreeNode.new(
114
- TreePoint.new("", t("decidim.meetings.meetings.filters.origin_values.all")),
115
- origin_values
116
- )
117
- end
118
-
119
74
  # Options to filter meetings by activity.
120
75
  def activity_filter_values
121
- [
122
- ["all", t("decidim.meetings.meetings.filters.all")],
123
- ["my_meetings", t("decidim.meetings.meetings.filters.my_meetings")]
124
- ]
76
+ %w(all my_meetings).map { |k| [k, t(k, scope: "decidim.meetings.meetings.filters")] }
125
77
  end
126
78
 
127
79
  protected
@@ -12,15 +12,8 @@ module Decidim
12
12
  geocoded_meetings = meetings.select(&:geocoded_and_valid?)
13
13
  geocoded_meetings.map do |meeting|
14
14
  meeting.slice(:latitude, :longitude, :address).merge(title: translated_attribute(meeting.title),
15
- description: html_truncate(translated_attribute(meeting.description), length: 200),
16
- startTimeDay: l(meeting.start_time, format: "%d"),
17
- startTimeMonth: l(meeting.start_time, format: "%B"),
18
- startTimeYear: l(meeting.start_time, format: "%Y"),
19
- startTime: "#{meeting.start_time.strftime("%H:%M")} - #{meeting.end_time.strftime("%H:%M")}",
20
- icon: icon("meetings", width: 40, height: 70, remove_icon_class: true),
21
- location: translated_attribute(meeting.location),
22
- locationHints: decidim_html_escape(translated_attribute(meeting.location_hints)),
23
- link: resource_locator(meeting).path)
15
+ link: resource_locator(meeting).path,
16
+ items: cell("decidim/meetings/meeting_card_metadata", meeting).send(:meeting_items_for_map).to_json)
24
17
  end
25
18
  end
26
19
  end
@@ -8,6 +8,7 @@ module Decidim
8
8
  include Decidim::Meetings::ApplicationHelper
9
9
  include Decidim::TranslationsHelper
10
10
  include Decidim::ResourceHelper
11
+ include Decidim::EndorsableHelper
11
12
 
12
13
  # Public: truncates the meeting description
13
14
  #
@@ -19,7 +20,7 @@ module Decidim
19
20
  link = resource_locator(meeting).path
20
21
  description = CGI.unescapeHTML present(meeting).description
21
22
  tail = "... #{link_to(t("read_more", scope: "decidim.meetings"), link)}".html_safe
22
- CGI.unescapeHTML html_truncate(description, max_length: max_length, tail: tail)
23
+ CGI.unescapeHTML html_truncate(description, max_length:, tail:)
23
24
  end
24
25
 
25
26
  # Public: The css class applied based on the meeting type to
@@ -30,10 +31,10 @@ module Decidim
30
31
  # Returns a String.
31
32
  def meeting_type_badge_css_class(type)
32
33
  case type
33
- when "private", "withdraw"
34
+ when "withdraw"
34
35
  "alert"
35
- when "transparent"
36
- "secondary"
36
+ when "private", "transparent"
37
+ "reverse"
37
38
  end
38
39
  end
39
40
 
@@ -84,7 +85,7 @@ module Decidim
84
85
  def display_duration_agenda_items(agenda_item_id, index, agenda_items_times)
85
86
  html = ""
86
87
  if agenda_item_id == agenda_items_times[index][:agenda_item_id]
87
- html += "[ #{agenda_items_times[index][:start_time].strftime("%H:%M")} - #{agenda_items_times[index][:end_time].strftime("%H:%M")}]"
88
+ html += "[#{agenda_items_times[index][:start_time].strftime("%H:%M")} - #{agenda_items_times[index][:end_time].strftime("%H:%M")}]"
88
89
  end
89
90
  html.html_safe
90
91
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Meetings
5
+ class HideAllCreatedByAuthorJob < ::Decidim::HideAllCreatedByAuthorJob
6
+ protected
7
+
8
+ def base_query
9
+ Decidim::Meetings::Meeting.not_hidden.where(author:)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -30,7 +30,7 @@ module Decidim
30
30
  @locator = Decidim::ResourceLocatorPresenter.new(@meeting)
31
31
 
32
32
  subject = I18n.t("invite.subject", scope: "decidim.meetings.mailer.invite_join_meeting_mailer")
33
- mail(to: user.email, subject: subject)
33
+ mail(to: user.email, subject:)
34
34
  end
35
35
  end
36
36
 
@@ -24,7 +24,7 @@ module Decidim
24
24
  add_calendar_attachment
25
25
 
26
26
  subject = I18n.t("confirmation.subject", scope: "decidim.meetings.mailer.registration_mailer")
27
- mail(to: user.email, subject: subject)
27
+ mail(to: user.email, subject:)
28
28
  end
29
29
  end
30
30
 
@@ -27,8 +27,8 @@ module Decidim
27
27
  include Decidim::Publicable
28
28
  include Decidim::FilterableResource
29
29
 
30
- TYPE_OF_MEETING = %w(in_person online hybrid).freeze
31
- REGISTRATION_TYPE = %w(registration_disabled on_this_platform on_different_platform).freeze
30
+ TYPE_OF_MEETING = { in_person: 0, online: 10, hybrid: 20 }.freeze
31
+ REGISTRATION_TYPES = { registration_disabled: 0, on_this_platform: 10, on_different_platform: 20 }.freeze
32
32
 
33
33
  translatable_fields :title, :description, :location, :location_hints, :closing_report, :registration_terms
34
34
 
@@ -48,6 +48,8 @@ module Decidim
48
48
 
49
49
  enum iframe_access_level: [:all, :signed_in, :registered], _prefix: true
50
50
  enum iframe_embed_type: [:none, :embed_in_meeting_page, :open_in_live_event_page, :open_in_new_tab], _prefix: true
51
+ enum type_of_meeting: TYPE_OF_MEETING
52
+ enum registration_type: REGISTRATION_TYPES, _scopes: false
51
53
 
52
54
  component_manifest_name "meetings"
53
55
 
@@ -82,7 +84,7 @@ module Decidim
82
84
  scope :visible_for, lambda { |user|
83
85
  (all.distinct if user&.admin?) ||
84
86
  if user.present?
85
- spaces = Decidim.participatory_space_registry.manifests.filter_map do |manifest|
87
+ (spaces = Decidim.participatory_space_registry.manifests.filter_map do |manifest|
86
88
  table_name = manifest.model_class_name.constantize.try(:table_name)
87
89
  next if table_name.blank?
88
90
 
@@ -90,8 +92,8 @@ module Decidim
90
92
  name: table_name.singularize,
91
93
  class_name: manifest.model_class_name
92
94
  }
93
- end
94
- user_role_queries = spaces.map do |space|
95
+ end)
96
+ (user_role_queries = spaces.map do |space|
95
97
  roles_table = "#{space[:name]}_user_roles"
96
98
  next unless connection.table_exists?(roles_table)
97
99
 
@@ -101,7 +103,7 @@ module Decidim
101
103
  (SELECT CONCAT(#{roles_table}.#{space[:name]}_id, '-#{space[:class_name]}')
102
104
  FROM #{roles_table} WHERE #{roles_table}.decidim_user_id = ?)
103
105
  "
104
- end
106
+ end)
105
107
 
106
108
  query = "
107
109
  decidim_meetings_meetings.private_meeting = ?
@@ -133,12 +135,7 @@ module Decidim
133
135
 
134
136
  scope :authored_by, ->(author) { where(decidim_author_id: author) }
135
137
 
136
- scope_search_multi :with_any_type, TYPE_OF_MEETING.map(&:to_sym)
137
-
138
- TYPE_OF_MEETING.each do |type|
139
- scope type.to_sym, -> { where(type_of_meeting: type.to_sym) }
140
- scope "not_#{type}".to_sym, -> { where.not(type_of_meeting: type.to_sym) }
141
- end
138
+ scope_search_multi :with_any_type, TYPE_OF_MEETING.keys
142
139
 
143
140
  searchable_fields({
144
141
  scope_id: :decidim_scope_id,
@@ -204,7 +201,7 @@ module Decidim
204
201
  end
205
202
 
206
203
  def has_registration_for?(user)
207
- registrations.where(user: user).any?
204
+ registrations.where(user:).any?
208
205
  end
209
206
 
210
207
  def maps_enabled?
@@ -241,7 +238,7 @@ module Decidim
241
238
  end
242
239
 
243
240
  def current_user_can_visit_meeting?(user)
244
- Decidim::Meetings::Meeting.visible_for(user).exists?(id: id)
241
+ Decidim::Meetings::Meeting.visible_for(user).exists?(id:)
245
242
  end
246
243
 
247
244
  def iframe_access_level_allowed_for_user?(user)
@@ -325,24 +322,6 @@ module Decidim
325
322
  [normalized_author.name]
326
323
  end
327
324
 
328
- TYPE_OF_MEETING.each do |type|
329
- define_method("#{type}_meeting?") do
330
- type_of_meeting == type
331
- end
332
- end
333
-
334
- def registration_disabled?
335
- registration_type == "registration_disabled"
336
- end
337
-
338
- def on_this_platform?
339
- registration_type == "on_this_platform"
340
- end
341
-
342
- def on_different_platform?
343
- registration_type == "on_different_platform"
344
- end
345
-
346
325
  def has_contributions?
347
326
  !!contributions_count && contributions_count.positive?
348
327
  end
@@ -35,7 +35,7 @@ module Decidim
35
35
 
36
36
  # Public: returns whether the questionnaire is answered by the user or not.
37
37
  def answered_by?(user)
38
- questionnaire.answers.where({ user: user, question: self }).any? if questionnaire.questions.present? && user.present?
38
+ questionnaire.answers.where({ user:, question: self }).any? if questionnaire.questions.present? && user.present?
39
39
  end
40
40
 
41
41
  def number_of_options
@@ -4,3 +4,6 @@ import "src/decidim/forms/forms"
4
4
 
5
5
  // Images
6
6
  require.context("../images", true)
7
+
8
+ // CSS
9
+ import "stylesheets/decidim/meetings/meetings.scss"
@@ -1 +1,42 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="meetings-svg" width="1080" height="1080" x="0" y="0" enable-background="new 0 0 1080 1080" version="1.1" viewBox="0 0 1080 1080" xml:space="preserve"><g id="meetings" class="stroke-primary"><g id="paper_down"><polyline id="_x32_5-pct_14_" fill="#31536E" fill-opacity=".25" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" points="604.753 874.5 378.529 924.816 367.337 874.497" class="fill-primary"/><polyline id="_x32_5-pct_13_" fill="#31536E" fill-opacity=".25" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" points="836.5 510.5 902.72 808.227 836.5 822.955" class="fill-primary"/><polyline id="_x32_5-pct_12_" fill="#31536E" fill-opacity=".25" stroke="#31536E" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" points="531.249 205.5 757.471 155.184 766.35 197.105" class="fill-primary"/><polyline id="_x32_5-pct_11_" fill="#31536E" fill-opacity=".25" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" points="299.5 569.499 233.28 271.774 299.5 257.045" class="fill-primary"/></g><g id="paper"><polyline fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" points="836.5 294.5 836.5 874.5 299.5 874.5 299.5 824.5"/><polyline fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" points="299.5 661.5 299.5 205.5 755.5 205.5"/></g><g id="pencil"><path fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" d="M310.292,820.867l554.726-554.725c23.627-23.627,23.785-61.775,0.354-85.207l0,0c-23.433-23.431-61.58-23.273-85.206,0.354 L225.439,736.015l-47.714,132.567L310.292,820.867z"/><path id="_x35_0-pct_11_" fill="#31536E" fill-opacity=".5" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" d="M836.379,294.78l28.639-28.638c23.627-23.627,23.785-61.775,0.354-85.207l0,0c-23.433-23.431-61.58-23.273-85.206,0.354 l-28.637,28.638" class="fill-primary"/><line x1="751.527" x2="836.38" y1="209.927" y2="294.78" fill="#31536E" stroke="#31536E" stroke-miterlimit="10" stroke-width="16"/><line x1="716.172" x2="801.023" y1="245.283" y2="330.136" fill="none" stroke="#31536E" stroke-miterlimit="10" stroke-width="16"/><polyline fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" points="227.476 733.785 270.5 734.958 270.5 771.5 309.745 771.5 310.195 820.982"/><polygon id="_x32_5-pct_15_" fill="#31536E" fill-opacity=".25" stroke="#31536E" stroke-miterlimit="10" stroke-width="8" points="310.292 771.37 776.275 305.387 738.092 267.203 270.694 734.601 270.5 771.5" class="fill-primary"/><polygon fill="#31536E" points="177.629 868.678 200.69 804.604 241.703 845.616" class="fill-primary"/></g><g id="stars_8" class="stars"><path fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4" d="M155.26,565.735c0-14.688-18.667-35.354-35.355-35.354c15.355,0,35.355-20.333,35.355-35.355 c0,15.022,16.666,35.355,35.355,35.355C171.593,530.381,155.26,551.048,155.26,565.735z"/><g><circle cx="904.382" cy="162.858" r="13.5" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="887.883" x2="866.67" y1="146.123" y2="124.91" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="921.824" x2="943.037" y1="180.064" y2="201.277" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="921.117" x2="942.33" y1="146.83" y2="125.617" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="887.883" x2="866.67" y1="180.064" y2="201.277" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/></g><g><line x1="266.689" x2="240.528" y1="898.798" y2="924.962" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="231.335" x2="205.173" y1="934.153" y2="960.317" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="265.982" x2="239.82" y1="960.317" y2="934.153" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="230.628" x2="204.466" y1="924.962" y2="898.798" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/></g><path fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4" d="M922.592,965.056c0,0-21.565,4.035-26.516,8.983c-4.948,4.947-8.982,26.515-8.982,26.515s-4.035-21.564-8.983-26.515 c-4.947-4.948-26.515-8.983-26.515-8.983s22.077-4.546,26.515-8.982c4.438-4.438,8.983-26.516,8.983-26.516 s4.034,21.565,8.982,26.516C901.025,961.021,922.592,965.056,922.592,965.056z"/><g><circle cx="896.863" cy="447.201" r="16.604" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="860.962" cy="447.201" r="6.432" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="896.863" cy="483.103" r="6.433" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="932.765" cy="447.201" r="6.432" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="896.863" cy="411.3" r="6.432" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/></g><g><line x1="298.746" x2="353.649" y1="98.42" y2="153.325" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="353.649" x2="298.746" y1="98.42" y2="153.325" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="308" x2="281" y1="125.447" y2="125.447" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="346" x2="373" y1="125.447" y2="125.447" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="327" x2="327" y1="144.447" y2="171.447" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="327" x2="327" y1="106.447" y2="79.447" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/></g></g></g></svg>
1
+ <svg width="540" height="540" viewBox="0 0 540 540" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M302.378 437.25L189.266 462.408L183.67 437.248" fill="#3E4C5C" fill-opacity="0.25"/>
3
+ <path d="M302.378 437.25L189.266 462.408L183.67 437.248" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M418.25 255.25L451.36 404.113L418.25 411.478" fill="#3E4C5C" fill-opacity="0.25"/>
5
+ <path d="M418.25 255.25L451.36 404.113L418.25 411.478" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
6
+ <path d="M265.625 102.75L378.736 77.5918L383.175 98.5523" fill="#3E4C5C" fill-opacity="0.25"/>
7
+ <path d="M265.625 102.75L378.736 77.5918L383.175 98.5523" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linejoin="round"/>
8
+ <path d="M149.751 284.748L116.641 135.886L149.751 128.521" fill="#3E4C5C" fill-opacity="0.25"/>
9
+ <path d="M149.751 284.748L116.641 135.886L149.751 128.521" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
10
+ <path d="M418.25 147.25V437.25H149.75V412.25" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
11
+ <path d="M149.75 330.75V102.75H377.75" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
12
+ <path d="M155.147 410.434L432.51 133.071C444.323 121.258 444.402 102.184 432.687 90.4676C420.97 78.7521 401.897 78.8311 390.084 90.6446L112.72 368.008L88.8633 434.291L155.147 410.434Z" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
13
+ <path d="M418.189 147.39L432.508 133.071C444.322 121.258 444.401 102.184 432.685 90.4676C420.969 78.7521 401.895 78.8311 390.082 90.6446L375.764 104.964" fill="#3E4C5C" fill-opacity="0.5"/>
14
+ <path d="M418.189 147.39L432.508 133.071C444.322 121.258 444.401 102.184 432.685 90.4676C420.969 78.7521 401.895 78.8311 390.082 90.6446L375.764 104.964" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
15
+ <path d="M375.764 104.963L418.19 147.389" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10"/>
16
+ <path d="M358.086 122.641L400.511 165.067" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10"/>
17
+ <path d="M113.738 366.893L135.25 367.479V385.75H154.873L155.098 410.491" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
18
+ <path d="M155.146 385.685L388.138 152.694L369.046 133.602L135.347 367.301L135.25 385.75L155.146 385.685Z" fill="#3E4C5C" fill-opacity="0.25" stroke="#3E4C5C" stroke-width="4" stroke-miterlimit="10"/>
19
+ <path d="M88.8145 434.34L100.345 402.303L120.851 422.809L88.8145 434.34Z" fill="#3E4C5C"/>
20
+ <path d="M77.6306 282.866C77.6306 275.522 68.2971 265.189 59.9531 265.189C67.6306 265.189 77.6306 255.023 77.6306 247.512C77.6306 255.023 85.9636 265.189 95.3081 265.189C85.7971 265.189 77.6306 275.523 77.6306 282.866Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
21
+ <path d="M452.191 88.1777C455.919 88.1777 458.941 85.1557 458.941 81.4277C458.941 77.6998 455.919 74.6777 452.191 74.6777C448.463 74.6777 445.441 77.6998 445.441 81.4277C445.441 85.1557 448.463 88.1777 452.191 88.1777Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
22
+ <path d="M443.942 73.0596L433.336 62.4531" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
23
+ <path d="M460.912 90.0293L471.519 100.636" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
24
+ <path d="M460.559 73.4131L471.165 62.8066" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
25
+ <path d="M443.942 90.0293L433.336 100.636" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
26
+ <path d="M133.346 449.398L120.266 462.48" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
27
+ <path d="M115.669 467.076L102.588 480.158" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
28
+ <path d="M132.993 480.158L119.912 467.076" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
29
+ <path d="M115.315 462.48L102.234 449.398" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
30
+ <path d="M461.297 482.526C461.297 482.526 450.514 484.544 448.039 487.018C445.565 489.491 443.548 500.275 443.548 500.275C443.548 500.275 441.53 489.493 439.056 487.018C436.583 484.544 425.799 482.526 425.799 482.526C425.799 482.526 436.837 480.253 439.056 478.035C441.275 475.816 443.548 464.777 443.548 464.777C443.548 464.777 445.565 475.56 448.039 478.035C450.513 480.509 461.297 482.526 461.297 482.526Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
31
+ <path d="M448.433 231.903C453.018 231.903 456.735 228.186 456.735 223.601C456.735 219.016 453.018 215.299 448.433 215.299C443.848 215.299 440.131 219.016 440.131 223.601C440.131 228.186 443.848 231.903 448.433 231.903Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
32
+ <path d="M430.482 226.817C432.258 226.817 433.698 225.377 433.698 223.601C433.698 221.825 432.258 220.385 430.482 220.385C428.705 220.385 427.266 221.825 427.266 223.601C427.266 225.377 428.705 226.817 430.482 226.817Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
33
+ <path d="M448.431 244.767C450.208 244.767 451.648 243.327 451.648 241.55C451.648 239.774 450.208 238.334 448.431 238.334C446.655 238.334 445.215 239.774 445.215 241.55C445.215 243.327 446.655 244.767 448.431 244.767Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
34
+ <path d="M466.384 226.817C468.16 226.817 469.6 225.377 469.6 223.601C469.6 221.825 468.16 220.385 466.384 220.385C464.608 220.385 463.168 221.825 463.168 223.601C463.168 225.377 464.608 226.817 466.384 226.817Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
35
+ <path d="M448.433 208.866C450.209 208.866 451.649 207.426 451.649 205.65C451.649 203.873 450.209 202.434 448.433 202.434C446.657 202.434 445.217 203.873 445.217 205.65C445.217 207.426 446.657 208.866 448.433 208.866Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
36
+ <path d="M149.373 49.209L176.825 76.6615" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
37
+ <path d="M176.825 49.209L149.373 76.6615" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
38
+ <path d="M154 62.7227H140.5" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
39
+ <path d="M173 62.7227H186.5" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
40
+ <path d="M163.5 72.2227V85.7227" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
41
+ <path d="M163.5 53.2227V39.7227" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
42
+ </svg>
@@ -2,7 +2,6 @@ import AutoButtonsByPositionComponent from "src/decidim/admin/auto_buttons_by_po
2
2
  import AutoLabelByPositionComponent from "src/decidim/admin/auto_label_by_position.component"
3
3
  import createSortList from "src/decidim/admin/sort_list.component"
4
4
  import createDynamicFields from "src/decidim/admin/dynamic_fields.component"
5
- import createQuillEditor from "src/decidim/editor"
6
5
 
7
6
  const wrapperSelector = ".meeting-agenda-items";
8
7
  const fieldSelector = ".meeting-agenda-item";
@@ -69,8 +68,8 @@ const createDynamicFieldsForAgendaItemChilds = (fieldId) => {
69
68
  onAddField: ($field) => {
70
69
  createSortableListChild();
71
70
 
72
- $field.find(".editor-container").each((idx, el) => {
73
- createQuillEditor(el);
71
+ $field[0].querySelectorAll(".editor-container").forEach((el) => {
72
+ window.createEditor(el);
74
73
  });
75
74
 
76
75
  autoLabelByPositionChild.run();
@@ -124,7 +123,7 @@ createDynamicFields({
124
123
  createSortableList();
125
124
 
126
125
  $field.find(".editor-container").each((idx, el) => {
127
- createQuillEditor(el);
126
+ window.createEditor(el);
128
127
  });
129
128
 
130
129
  autoLabelByPosition.run();
@@ -7,16 +7,24 @@ $(() => {
7
7
  const $reservedSlots = $form.find("#meeting_reserved_slots");
8
8
  const $customizeRegistrationEmail = $form.find("#meeting_customize_registration_email");
9
9
 
10
+ $customizeRegistrationEmail.on("click", (event) => {
11
+
12
+ if (event.target.checked) {
13
+ $("#customize_registration_email-div").removeClass("hidden");
14
+ } else {
15
+ $("#customize_registration_email-div").addClass("hidden");
16
+ }
17
+ })
18
+
10
19
  const toggleDisabledFields = () => {
11
20
  const enabled = $registrationsEnabled.prop("checked");
12
21
  $availableSlots.attr("disabled", !enabled);
13
22
  $reservedSlots.attr("disabled", !enabled);
14
23
  $customizeRegistrationEmail.attr("disabled", !enabled);
15
24
 
16
- $form.find(".editor-container").each((idx, node) => {
17
- const quill = Quill.find(node);
18
- quill.enable(enabled);
19
- })
25
+ $form[0].querySelectorAll(".editor-container .ProseMirror").forEach((node) => {
26
+ node.editor.setOptions({ editable: enabled });
27
+ });
20
28
  };
21
29
 
22
30
  $registrationsEnabled.on("change", toggleDisabledFields);
@@ -62,7 +62,7 @@ $(() => {
62
62
 
63
63
  createFieldDependentInputs({
64
64
  controllerField: $("#meeting_iframe_embed_type"),
65
- wrapperSelector: ".iframe-fields",
65
+ wrapperSelector: "main",
66
66
  dependentFieldsSelector: ".iframe-fields--access-level",
67
67
  dependentInputSelector: "input",
68
68
  enablingCondition: ($field) => {
@@ -1,8 +1,5 @@
1
1
  /* eslint id-length: ["error", { "exceptions": ["$"] }] */
2
2
 
3
- import createOptionAttachedInputs from "src/decidim/forms/option_attached_inputs.component"
4
- import createMaxChoicesAlertComponent from "src/decidim/forms/max_choices_alert.component"
5
-
6
3
  /**
7
4
  * A plain Javascript component that handles questions from polls in meetings:
8
5
  * - fetches them via Ajax
@@ -78,7 +75,6 @@ export default class PollComponent {
78
75
  this._updateCounter();
79
76
  this._setQuestionsState(this.$element);
80
77
  this._pollQuestions();
81
- this._addValidations();
82
78
  });
83
79
  }
84
80
 
@@ -114,7 +110,7 @@ export default class PollComponent {
114
110
 
115
111
  /**
116
112
  * Initializes the state of a single question with two types of modifications:
117
- * - sets the is-new class if the question is new (doesn't exist in the internal list)
113
+ * - sets the is-new class if the question is new (does not exist in the internal list)
118
114
  * - sets the state to open if it was open in the internal list
119
115
  * @private
120
116
  * @param {jQuery} $el - The HTML container for the questionnaire.
@@ -167,27 +163,4 @@ export default class PollComponent {
167
163
  this.$counter.html(`(${questionsCount})`);
168
164
  }
169
165
  }
170
-
171
- _addValidations() {
172
- $(".js-radio-button-collection, .js-check-box-collection").each((idx, el) => {
173
- createOptionAttachedInputs({
174
- wrapperField: $(el),
175
- controllerFieldSelector: "input[type=radio], input[type=checkbox]",
176
- dependentInputSelector: "input[type=text], input[type=hidden]"
177
- });
178
- });
179
-
180
- $.unique($(".js-check-box-collection").parents(".answer")).each((idx, el) => {
181
- const maxChoices = $(el).data("max-choices");
182
- if (maxChoices) {
183
- createMaxChoicesAlertComponent({
184
- wrapperField: $(el),
185
- controllerFieldSelector: "input[type=checkbox]",
186
- controllerCollectionSelector: ".js-check-box-collection",
187
- alertElement: $(el).find(".max-choices-alert"),
188
- maxChoices: maxChoices
189
- });
190
- }
191
- });
192
- }
193
166
  }