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
@@ -18,7 +18,7 @@ module Decidim
18
18
  def create
19
19
  enforce_permission_to :create, :meeting
20
20
 
21
- @form = meeting_form.from_params(params, current_component: current_component)
21
+ @form = meeting_form.from_params(params, current_component:)
22
22
 
23
23
  Decidim::Meetings::Admin::CreateMeeting.call(@form) do
24
24
  on(:ok) do
@@ -34,15 +34,15 @@ module Decidim
34
34
  end
35
35
 
36
36
  def edit
37
- enforce_permission_to :update, :meeting, meeting: meeting
37
+ enforce_permission_to(:update, :meeting, meeting:)
38
38
 
39
39
  @form = meeting_form.from_model(meeting)
40
40
  end
41
41
 
42
42
  def update
43
- enforce_permission_to :update, :meeting, meeting: meeting
43
+ enforce_permission_to(:update, :meeting, meeting:)
44
44
 
45
- @form = meeting_form.from_params(params, current_component: current_component)
45
+ @form = meeting_form.from_params(params, current_component:)
46
46
 
47
47
  Decidim::Meetings::Admin::UpdateMeeting.call(@form, meeting) do
48
48
  on(:ok) do
@@ -58,7 +58,7 @@ module Decidim
58
58
  end
59
59
 
60
60
  def destroy
61
- enforce_permission_to :destroy, :meeting, meeting: meeting
61
+ enforce_permission_to(:destroy, :meeting, meeting:)
62
62
 
63
63
  Decidim::Meetings::Admin::DestroyMeeting.call(meeting, current_user) do
64
64
  on(:ok) do
@@ -79,7 +79,7 @@ module Decidim
79
79
  end
80
80
 
81
81
  def publish
82
- enforce_permission_to :update, :meeting, meeting: meeting
82
+ enforce_permission_to(:update, :meeting, meeting:)
83
83
 
84
84
  Decidim::Meetings::Admin::PublishMeeting.call(meeting, current_user) do
85
85
  on(:ok) do
@@ -95,7 +95,7 @@ module Decidim
95
95
  end
96
96
 
97
97
  def unpublish
98
- enforce_permission_to :update, :meeting, meeting: meeting
98
+ enforce_permission_to(:update, :meeting, meeting:)
99
99
 
100
100
  Decidim::Meetings::Admin::UnpublishMeeting.call(meeting, current_user) do
101
101
  on(:ok) do
@@ -13,7 +13,7 @@ module Decidim
13
13
  helper Decidim::Forms::Admin::ApplicationHelper
14
14
 
15
15
  def edit
16
- enforce_permission_to :update, :poll, meeting: meeting, poll: poll
16
+ enforce_permission_to(:update, :poll, meeting:, poll:)
17
17
 
18
18
  @form = form(Admin::QuestionnaireForm).from_model(questionnaire)
19
19
 
@@ -21,7 +21,7 @@ module Decidim
21
21
  end
22
22
 
23
23
  def update
24
- enforce_permission_to :update, :poll, meeting: meeting, poll: poll
24
+ enforce_permission_to(:update, :poll, meeting:, poll:)
25
25
 
26
26
  @form = form(Admin::QuestionnaireForm).from_params(params)
27
27
 
@@ -69,7 +69,7 @@ module Decidim
69
69
  private
70
70
 
71
71
  def questionnaire
72
- @questionnaire ||= Decidim::Meetings::Questionnaire.find_or_initialize_by(questionnaire_for: questionnaire_for)
72
+ @questionnaire ||= Decidim::Meetings::Questionnaire.find_or_initialize_by(questionnaire_for:)
73
73
  end
74
74
 
75
75
  def blank_question
@@ -99,7 +99,7 @@ module Decidim
99
99
  end
100
100
 
101
101
  def poll
102
- @poll ||= Poll.find_or_initialize_by(meeting: meeting)
102
+ @poll ||= Poll.find_or_initialize_by(meeting:)
103
103
  end
104
104
  end
105
105
  end
@@ -6,16 +6,16 @@ module Decidim
6
6
  # This controller allows an admin to manage meeting registrations from a Participatory Process
7
7
  class RegistrationsController < Admin::ApplicationController
8
8
  def edit
9
- enforce_permission_to :update, :meeting, meeting: meeting
9
+ enforce_permission_to(:update, :meeting, meeting:)
10
10
 
11
11
  @form = MeetingRegistrationsForm.from_model(meeting)
12
12
  @validation_form = ValidateRegistrationCodeForm.new
13
13
  end
14
14
 
15
15
  def update
16
- enforce_permission_to :update, :meeting, meeting: meeting
16
+ enforce_permission_to(:update, :meeting, meeting:)
17
17
 
18
- @form = MeetingRegistrationsForm.from_params(params).with_context(current_organization: meeting.organization, meeting: meeting)
18
+ @form = MeetingRegistrationsForm.from_params(params).with_context(current_organization: meeting.organization, meeting:)
19
19
  @validation_form = ValidateRegistrationCodeForm.new
20
20
 
21
21
  UpdateRegistrations.call(@form, meeting) do
@@ -32,7 +32,7 @@ module Decidim
32
32
  end
33
33
 
34
34
  def export
35
- enforce_permission_to :export_registrations, :meeting, meeting: meeting
35
+ enforce_permission_to(:export_registrations, :meeting, meeting:)
36
36
 
37
37
  ExportMeetingRegistrations.call(meeting, params[:format], current_user) do
38
38
  on(:ok) do |export_data|
@@ -42,10 +42,10 @@ module Decidim
42
42
  end
43
43
 
44
44
  def validate_registration_code
45
- enforce_permission_to :update, :meeting, meeting: meeting
45
+ enforce_permission_to(:update, :meeting, meeting:)
46
46
 
47
47
  @form = MeetingRegistrationsForm.from_model(meeting)
48
- @validation_form = ValidateRegistrationCodeForm.from_params(params).with_context(current_organization: meeting.organization, meeting: meeting)
48
+ @validation_form = ValidateRegistrationCodeForm.from_params(params).with_context(current_organization: meeting.organization, meeting:)
49
49
 
50
50
  ValidateRegistrationCode.call(@validation_form, meeting) do
51
51
  on(:ok) do
@@ -9,6 +9,17 @@ module Decidim
9
9
  # override its layout and provide all kinds of useful methods.
10
10
  class ApplicationController < Decidim::Components::BaseController
11
11
  helper Decidim::Meetings::ApplicationHelper
12
+
13
+ private
14
+
15
+ def add_addtional_csp_directives
16
+ return unless respond_to?(:meeting) || meeting.present?
17
+
18
+ embedded = MeetingIframeEmbedder.new(meeting.online_meeting_url).embed_transformed_url(request.host)
19
+ return if embedded.blank?
20
+
21
+ content_security_policy.append_csp_directive("frame-src", embedded)
22
+ end
12
23
  end
13
24
  end
14
25
  end
@@ -6,7 +6,6 @@ module Decidim
6
6
  # to their favorite calendar app
7
7
  class CalendarsController < Decidim::Meetings::ApplicationController
8
8
  include FilterResource
9
- include Filterable
10
9
  include ComponentFilterable
11
10
 
12
11
  layout false
@@ -9,7 +9,19 @@ module Decidim
9
9
  # override its layout and provide all kinds of useful methods.
10
10
  module Directory
11
11
  class ApplicationController < Decidim::ApplicationController
12
+ include HasSpecificBreadcrumb
13
+
12
14
  helper Decidim::Meetings::Directory::ApplicationHelper
15
+
16
+ private
17
+
18
+ def breadcrumb_item
19
+ {
20
+ label: t("decidim.pages.home.extended.meetings"),
21
+ url: root_path,
22
+ active: true
23
+ }
24
+ end
13
25
  end
14
26
  end
15
27
  end
@@ -8,10 +8,8 @@ module Decidim
8
8
  layout "layouts/decidim/application"
9
9
 
10
10
  include FilterResource
11
- include Filterable
12
11
  include Paginable
13
12
 
14
- helper Decidim::WidgetUrlsHelper
15
13
  helper Decidim::FiltersHelper
16
14
  helper Decidim::Meetings::MapHelper
17
15
  helper Decidim::ResourceHelper
@@ -44,37 +42,14 @@ module Decidim
44
42
  with_any_date: "upcoming",
45
43
  title_or_description_cont: "",
46
44
  activity: "all",
47
- with_any_scope: default_filter_scope_params,
48
- with_any_space: default_filter_space_params,
49
- with_any_type: default_filter_type_params,
50
- with_any_origin: default_filter_origin_params,
51
- with_any_global_category: default_filter_category_params
45
+ with_any_scope: nil,
46
+ with_any_space: nil,
47
+ with_any_type: nil,
48
+ with_any_origin: nil,
49
+ with_any_global_category: nil
52
50
  }
53
51
  end
54
52
 
55
- def default_filter_category_params
56
- participatory_spaces = current_organization.public_participatory_spaces
57
- list_of_ps = []
58
- participatory_spaces.flat_map do |current_participatory_space|
59
- next unless current_participatory_space.respond_to?(:categories)
60
-
61
- key_point = current_participatory_space.class.name.gsub("::", "__") + current_participatory_space.id.to_s
62
-
63
- list_of_ps.push(key_point)
64
- list_of_ps += current_participatory_space.categories.pluck(:id).map(&:to_s)
65
- end
66
-
67
- ["all"] + list_of_ps
68
- end
69
-
70
- def default_filter_space_params
71
- %w(all) + current_organization.public_participatory_spaces.collect(&:model_name).uniq.collect(&:name).collect(&:underscore)
72
- end
73
-
74
- def default_filter_scope_params
75
- %w(all global) + current_organization.scopes.pluck(:id).map(&:to_s)
76
- end
77
-
78
53
  def meeting_components
79
54
  @meeting_components ||= Decidim::Component
80
55
  .where(manifest_name: "meetings")
@@ -9,6 +9,7 @@ module Decidim
9
9
  include Decidim::Meetings::PollsResources
10
10
 
11
11
  helper_method :live_meeting_embed_code
12
+ before_action :add_addtional_csp_directives, only: :show
12
13
 
13
14
  def show
14
15
  raise ActionController::RoutingError, "Not Found" unless meeting
@@ -4,19 +4,18 @@ module Decidim
4
4
  module Meetings
5
5
  # This controller allows a participant to update the closing_report and the linked proposals of a closed meeting
6
6
  class MeetingClosesController < Decidim::Meetings::ApplicationController
7
- include Decidim::Proposals::Admin::Picker if Decidim::Meetings.enable_proposal_linking
8
7
  include FormFactory
9
8
 
10
9
  helper_method :meeting
11
10
 
12
11
  def edit
13
- enforce_permission_to :close, :meeting, meeting: meeting
12
+ enforce_permission_to(:close, :meeting, meeting:)
14
13
 
15
14
  @form = form(CloseMeetingForm).from_model(meeting)
16
15
  end
17
16
 
18
17
  def update
19
- enforce_permission_to :close, :meeting, meeting: meeting
18
+ enforce_permission_to(:close, :meeting, meeting:)
20
19
 
21
20
  @form = form(CloseMeetingForm).from_params(params.merge(proposals: meeting.sibling_scope(:proposals)))
22
21
 
@@ -5,18 +5,19 @@ module Decidim
5
5
  # Exposes the meeting resource so users can view them
6
6
  class MeetingsController < Decidim::Meetings::ApplicationController
7
7
  include FilterResource
8
- include Filterable
9
8
  include ComponentFilterable
10
9
  include Flaggable
11
10
  include Withdrawable
12
11
  include FormFactory
13
12
  include Paginable
14
13
 
15
- helper Decidim::WidgetUrlsHelper
16
14
  helper Decidim::ResourceVersionsHelper
17
15
  helper Decidim::ShortLinkHelper
16
+ include Decidim::AttachmentsHelper
18
17
 
19
- helper_method :meetings, :meeting, :registration, :search
18
+ helper_method :meetings, :meeting, :registration, :search, :nav_paths, :tab_panel_items
19
+
20
+ before_action :add_addtional_csp_directives, only: [:show]
20
21
 
21
22
  def new
22
23
  enforce_permission_to :create, :meeting
@@ -27,7 +28,7 @@ module Decidim
27
28
  def create
28
29
  enforce_permission_to :create, :meeting
29
30
 
30
- @form = meeting_form.from_params(params, current_component: current_component)
31
+ @form = meeting_form.from_params(params, current_component:)
31
32
 
32
33
  CreateMeeting.call(@form) do
33
34
  on(:ok) do |meeting|
@@ -65,13 +66,13 @@ module Decidim
65
66
  end
66
67
 
67
68
  def edit
68
- enforce_permission_to :update, :meeting, meeting: meeting
69
+ enforce_permission_to(:update, :meeting, meeting:)
69
70
 
70
71
  @form = meeting_form.from_model(meeting)
71
72
  end
72
73
 
73
74
  def update
74
- enforce_permission_to :update, :meeting, meeting: meeting
75
+ enforce_permission_to(:update, :meeting, meeting:)
75
76
 
76
77
  @form = meeting_form.from_params(params)
77
78
 
@@ -89,7 +90,7 @@ module Decidim
89
90
  end
90
91
 
91
92
  def withdraw
92
- enforce_permission_to :withdraw, :meeting, meeting: meeting
93
+ enforce_permission_to(:withdraw, :meeting, meeting:)
93
94
 
94
95
  WithdrawMeeting.call(@meeting, current_user) do
95
96
  on(:ok) do
@@ -109,6 +110,36 @@ module Decidim
109
110
  @meeting ||= Meeting.not_hidden.where(component: current_component).find_by(id: params[:id])
110
111
  end
111
112
 
113
+ def next_meeting
114
+ return if search_collection.size < 2
115
+
116
+ search_collection.order(:start_time, :id).where(
117
+ Decidim::Meetings::Meeting.arel_table[:start_time].gt(meeting.start_time).or(
118
+ Decidim::Meetings::Meeting.arel_table[:start_time].eq(meeting.start_time).and(
119
+ Decidim::Meetings::Meeting.arel_table[:id].gt(meeting.id)
120
+ )
121
+ )
122
+ ).first
123
+ end
124
+
125
+ def prev_meeting
126
+ return if search_collection.size < 2
127
+
128
+ search_collection.order(:start_time, :id).where(
129
+ Decidim::Meetings::Meeting.arel_table[:start_time].lt(meeting.start_time).or(
130
+ Decidim::Meetings::Meeting.arel_table[:start_time].eq(meeting.start_time).and(
131
+ Decidim::Meetings::Meeting.arel_table[:id].lt(meeting.id)
132
+ )
133
+ )
134
+ ).last
135
+ end
136
+
137
+ def nav_paths
138
+ return {} if meeting.blank?
139
+
140
+ { prev_path: prev_meeting, next_path: next_meeting }.compact_blank.transform_values { |meeting| meeting_path(meeting) }
141
+ end
142
+
112
143
  def meetings
113
144
  is_past_meetings = params.dig("filter", "with_any_date")&.include?("past")
114
145
  @meetings ||= paginate(search.result.order(start_time: is_past_meetings ? :desc : :asc))
@@ -130,6 +161,43 @@ module Decidim
130
161
  def meeting_form
131
162
  form(Decidim::Meetings::MeetingForm)
132
163
  end
164
+
165
+ def tab_panel_items
166
+ @tab_panel_items ||= [
167
+ {
168
+ enabled: meeting.public_participants.any?,
169
+ id: "participants",
170
+ text: t("attending_participants", scope: "decidim.meetings.public_participants_list"),
171
+ icon: "group-line",
172
+ method: :cell,
173
+ args: ["decidim/meetings/public_participants_list", meeting]
174
+ },
175
+ {
176
+ enabled: !meeting.closed? && meeting.user_group_registrations.any?,
177
+ id: "organizations",
178
+ text: t("attending_organizations", scope: "decidim.meetings.public_participants_list"),
179
+ icon: "community-line",
180
+ method: :cell,
181
+ args: ["decidim/meetings/attending_organizations_list", meeting]
182
+ },
183
+ {
184
+ enabled: meeting.linked_resources(:proposals, "proposals_from_meeting").present?,
185
+ id: "included_proposals",
186
+ text: t("decidim/proposals/proposal", scope: "activerecord.models", count: 2),
187
+ icon: resource_type_icon_key("Decidim::Proposals::Proposal"),
188
+ method: :cell,
189
+ args: ["decidim/linked_resources_for", meeting, { type: :proposals, link_name: "proposals_from_meeting" }]
190
+ },
191
+ {
192
+ enabled: meeting.linked_resources(:results, "meetings_through_proposals").present?,
193
+ id: "included_meetings",
194
+ text: t("decidim/accountability/result", scope: "activerecord.models", count: 2),
195
+ icon: resource_type_icon_key("Decidim::Accountability::Result"),
196
+ method: :cell,
197
+ args: ["decidim/linked_resources_for", meeting, { type: :results, link_name: "meetings_through_proposals" }]
198
+ }
199
+ ] + attachments_tab_panel_items(@meeting)
200
+ end
133
201
  end
134
202
  end
135
203
  end
@@ -10,8 +10,8 @@ module Decidim
10
10
  helper_method :question
11
11
 
12
12
  def create
13
- enforce_permission_to :create, :answer, question: question
14
- @form = form(AnswerForm).from_params(params, question: question, current_user: current_user)
13
+ enforce_permission_to(:create, :answer, question:)
14
+ @form = form(AnswerForm).from_params(params, question:, current_user:)
15
15
 
16
16
  CreateAnswer.call(@form, current_user, questionnaire) do
17
17
  # Both :ok and :invalid render the same template, because
@@ -15,7 +15,7 @@ module Decidim
15
15
  end
16
16
 
17
17
  def update
18
- enforce_permission_to :update, :question, question: question
18
+ enforce_permission_to(:update, :question, question:)
19
19
 
20
20
  Decidim::Meetings::Admin::UpdateQuestionStatus.call(question, current_user) do
21
21
  respond_to do |format|
@@ -7,9 +7,9 @@ module Decidim
7
7
  include Decidim::Forms::Concerns::HasQuestionnaire
8
8
 
9
9
  def answer
10
- enforce_permission_to :join, :meeting, meeting: meeting
10
+ enforce_permission_to(:join, :meeting, meeting:)
11
11
 
12
- @form = form(Decidim::Forms::QuestionnaireForm).from_params(params, session_token: session_token)
12
+ @form = form(Decidim::Forms::QuestionnaireForm).from_params(params, session_token:)
13
13
 
14
14
  JoinMeeting.call(meeting, current_user, @form) do
15
15
  on(:ok) do
@@ -30,7 +30,7 @@ module Decidim
30
30
  end
31
31
 
32
32
  def create
33
- enforce_permission_to :register, :meeting, meeting: meeting
33
+ enforce_permission_to(:register, :meeting, meeting:)
34
34
 
35
35
  @form = JoinMeetingForm.from_params(params)
36
36
 
@@ -48,7 +48,7 @@ module Decidim
48
48
  end
49
49
 
50
50
  def destroy
51
- enforce_permission_to :leave, :meeting, meeting: meeting
51
+ enforce_permission_to(:leave, :meeting, meeting:)
52
52
 
53
53
  LeaveMeeting.call(meeting, current_user) do
54
54
  on(:ok) do
@@ -64,7 +64,7 @@ module Decidim
64
64
  end
65
65
 
66
66
  def decline_invitation
67
- enforce_permission_to :decline_invitation, :meeting, meeting: meeting
67
+ enforce_permission_to(:decline_invitation, :meeting, meeting:)
68
68
 
69
69
  DeclineInvitation.call(meeting, current_user) do
70
70
  on(:ok) do
@@ -1,4 +1,4 @@
1
- # frozen-string_literal: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Decidim
4
4
  module Meetings
@@ -1,4 +1,4 @@
1
- # frozen-string_literal: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Decidim
4
4
  module Meetings
@@ -1,4 +1,4 @@
1
- # frozen-string_literal: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Decidim
4
4
  module Meetings
@@ -11,8 +11,8 @@ module Decidim
11
11
 
12
12
  def i18n_options
13
13
  {
14
- resource_title: resource_title,
15
- resource_url: resource_url,
14
+ resource_title:,
15
+ resource_url:,
16
16
  scope: event_name,
17
17
  registration_code: extra["registration_code"]
18
18
  }
@@ -1,4 +1,4 @@
1
- # frozen-string_literal: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Decidim
4
4
  module Meetings
@@ -1,4 +1,4 @@
1
- # frozen-string_literal: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Decidim
4
4
  module Meetings
@@ -1,4 +1,4 @@
1
- # frozen-string_literal: true
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Decidim
4
4
  module Meetings
@@ -57,6 +57,10 @@ module Decidim
57
57
 
58
58
  self.decidim_category_id = model.categorization.decidim_category_id if model.categorization
59
59
  self.type_of_meeting = model.type_of_meeting
60
+
61
+ presenter = MeetingEditionPresenter.new(model)
62
+ self.title = presenter.title(all_locales: true)
63
+ self.description = presenter.editor_description(all_locales: true)
60
64
  end
61
65
 
62
66
  def services_to_persist
@@ -125,7 +129,7 @@ module Decidim
125
129
  end
126
130
 
127
131
  def registration_type_select
128
- Decidim::Meetings::Meeting::REGISTRATION_TYPE.map do |type|
132
+ Decidim::Meetings::Meeting::REGISTRATION_TYPES.keys.map do |type|
129
133
  [
130
134
  I18n.t("registration_type.#{type}", scope: "decidim.meetings"),
131
135
  type
@@ -41,9 +41,9 @@ module Decidim
41
41
  # to resubmit the form, the form will not hold an ID, so the `to_param`
42
42
  # method will return an empty string and Rails will treat this as a
43
43
  # `create` action, thus raising an error since this action is not defined
44
- # for the controller we're using.
44
+ # for the controller we are using.
45
45
  #
46
- # TL;DR: if you remove this method, we'll get errors, so don't.
46
+ # TL;DR: if you remove this method, we will get errors, so do not.
47
47
  def id
48
48
  return super if super.present?
49
49
 
@@ -11,7 +11,7 @@ module Decidim
11
11
  validate :registration_exists
12
12
 
13
13
  def registration
14
- @registration ||= meeting.registrations.find_by(code: code, validated_at: nil)
14
+ @registration ||= meeting.registrations.find_by(code:, validated_at: nil)
15
15
  end
16
16
 
17
17
  private
@@ -19,7 +19,7 @@ module Decidim
19
19
  validates :end_time, presence: true, date: { after: :start_time }
20
20
 
21
21
  def type_of_meeting_select
22
- Decidim::Meetings::Meeting::TYPE_OF_MEETING.map do |type|
22
+ Decidim::Meetings::Meeting::TYPE_OF_MEETING.keys.map do |type|
23
23
  [
24
24
  I18n.t("type_of_meeting.#{type}", scope: "decidim.meetings"),
25
25
  type
@@ -47,7 +47,7 @@ module Decidim
47
47
  self.decidim_category_id = model.categorization.decidim_category_id if model.categorization
48
48
  presenter = MeetingEditionPresenter.new(model)
49
49
  self.title = presenter.title(all_locales: false)
50
- self.description = presenter.description(all_locales: false)
50
+ self.description = presenter.editor_description(all_locales: false)
51
51
  self.location = presenter.location(all_locales: false)
52
52
  self.location_hints = presenter.location_hints(all_locales: false)
53
53
  self.registration_terms = presenter.registration_terms(all_locales: false)
@@ -81,7 +81,7 @@ module Decidim
81
81
  end
82
82
 
83
83
  def type_of_meeting_select
84
- Decidim::Meetings::Meeting::TYPE_OF_MEETING.map do |type|
84
+ Decidim::Meetings::Meeting::TYPE_OF_MEETING.keys.map do |type|
85
85
  [
86
86
  I18n.t("type_of_meeting.#{type}", scope: "decidim.meetings"),
87
87
  type
@@ -116,7 +116,7 @@ module Decidim
116
116
  end
117
117
 
118
118
  def registration_type_select
119
- Decidim::Meetings::Meeting::REGISTRATION_TYPE.map do |type|
119
+ Decidim::Meetings::Meeting::REGISTRATION_TYPES.keys.map do |type|
120
120
  [
121
121
  I18n.t("registration_type.#{type}", scope: "decidim.meetings"),
122
122
  type
@@ -8,6 +8,7 @@ module Decidim
8
8
  module ApplicationHelper
9
9
  include Decidim::MapHelper
10
10
  include Decidim::Admin::ResourceScopeHelper
11
+ include Decidim::PaginateHelper
11
12
 
12
13
  def tabs_id_for_service(service)
13
14
  "meeting_service_#{service.to_param}"