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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8211ea4678c56611a982a412c54639cf6665136f6f84b2ebbb3487a913783f0
4
- data.tar.gz: c84bf4c51112e2a5061e49794900a7d75f2f4dac670621ffa01a86c2302d6ea8
3
+ metadata.gz: 93a241fc0fd0001dca0742aa036870fad47d1920466304a88687ee9df038ac95
4
+ data.tar.gz: 92d9be9a5908337903a535eafc57283c431f09d32e6914561fbf1ce2987a1811
5
5
  SHA512:
6
- metadata.gz: 61b6e066b24fff9f06083ecf1a33c03796f28857a583513b6cf67be4d3402c544bf96e7ec2306b55072389539d513897af0a86e68264bbb4d07cceab41d10680
7
- data.tar.gz: db3f50fa68c11ec7e3ab26aef4102e1c702dcb720847d09ed9c385fa75fa58e886a8a015474d436e7277d546fce049b0f1d7bf740dcccad3986973c6680742d1
6
+ metadata.gz: 10652328d80c951307926aa7f23929def21662f4f17a663fcfd22e8972329fa244cc666aea9f86d67b18b2a851a6a42b4016c10ebed10855cceb4ab142c5db48
7
+ data.tar.gz: 364398407b41b687662b81f29a1db756d4f1ecab6e4bb9a9c7284fb9f02f76dc8579e871a237396b3cfce0595d7cfef10f7c862da10af62d05df8d674e800dc4
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "cell/partial"
4
+
5
+ module Decidim
6
+ module Meetings
7
+ # This cell renders the list of public participanting
8
+ # organizations of a meeting.
9
+ #
10
+ # Example:
11
+ #
12
+ # cell("decidim/participating_organizations_list", meeting)
13
+ class AttendingOrganizationsListCell < PublicParticipantsListCell
14
+ private
15
+
16
+ def user_group_ids
17
+ model.user_group_registrations.user_group_ids
18
+ end
19
+
20
+ def user_groups
21
+ Decidim::UserGroup.where(id: user_group_ids)
22
+ end
23
+
24
+ # Finds the public organizations (as user groups) of meeting
25
+ #
26
+ # Returns an Array of presented UserGroups
27
+ def public_participants
28
+ @public_participants ||= user_groups.map { |user_group| present(user_group) }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,21 @@
1
+ <%= decidim_modal id: "meeting-cancelation-confirm-#{model.id}", class: "meeting__cancelation-modal" do %>
2
+ <%= decidim_form_for(registration_form, url: meeting_registration_path(model), method: :delete) do |form| %>
3
+ <div data-dialog-container>
4
+ <%= icon "door-open-line" %>
5
+ <h2 id="dialog-title-meeting-cancelation-confirm-<%= model.id %>" data-dialog-title><%= t("leave", scope: "decidim.meetings.meetings.show") %></h2>
6
+ <div>
7
+
8
+ <div id="dialog-desc-meeting-cancelation-confirm-<%= model.id %>" class="meeting__cancelation-modal__description"><%= t("leave_confirmation", scope: "decidim.meetings.meetings.show") %></div>
9
+ </div>
10
+ </div>
11
+ <div data-dialog-actions>
12
+ <button type="button" class="button button__sm md:button__lg button__transparent-secondary" data-dialog-close="meeting-cancelation-confirm-<%= model.id %>">
13
+ <span><%= t("close", scope: "decidim.shared.flag_modal") %></span>
14
+ </button>
15
+ <button type="submit" class="button button__sm md:button__lg button__secondary">
16
+ <span><%= t("leave", scope: "decidim.meetings.meetings.show") %></span>
17
+ <%= icon "arrow-right-line" %>
18
+ </button>
19
+ </div>
20
+ <% end %>
21
+ <% end %>
@@ -1,13 +1,10 @@
1
- <div class="text-center">
2
- <%= action_authorized_link_to(
3
- :join,
4
- meeting_registration_path(model),
5
- resource: model,
6
- method: :delete,
7
- class: button_classes,
8
- data: { disable: true, confirm: t("leave_confirmation", scope: "decidim.meetings.meetings.show") }
9
- ) do %>
10
- <%= t("leave", scope: "decidim.meetings.meetings.show") %>
11
- <%= icon icon_name %>
12
- <% end %>
13
- </div>
1
+ <%= render :cancelation_modal %>
2
+ <%= action_authorized_button_to(
3
+ :join,
4
+ "#",
5
+ class: button_classes,
6
+ data: { "dialog-open": "meeting-cancelation-confirm-#{model.id}" }
7
+ ) do %>
8
+ <%= t("leave", scope: "decidim.meetings.meetings.show") %>
9
+ <%= icon icon_name %>
10
+ <% end %>
@@ -21,11 +21,11 @@ module Decidim
21
21
  end
22
22
 
23
23
  def button_classes
24
- ""
24
+ "button button__sm button__text-secondary"
25
25
  end
26
26
 
27
27
  def icon_name
28
- "circle-x"
28
+ "calendar-close-line"
29
29
  end
30
30
 
31
31
  def registration_form
@@ -3,29 +3,19 @@
3
3
  module Decidim
4
4
  module Meetings
5
5
  module ContentBlocks
6
- class HighlightedMeetingsCell < Decidim::ContentBlocks::HighlightedElementsCell
7
- def base_relation
8
- Decidim::Meetings::Meeting
9
- .except_withdrawn
10
- .published
11
- .not_hidden
12
- .upcoming
13
- .visible_for(current_user)
14
- .where(component: published_components)
15
- end
6
+ class HighlightedMeetingsCell < Decidim::ContentBlocks::HighlightedElementsWithCellForListCell
7
+ private
16
8
 
17
- def elements
18
- @elements ||= base_relation.order(start_time: :asc).limit(limit)
9
+ def list_cell_path
10
+ "decidim/meetings/highlighted_meetings_for_component"
19
11
  end
20
12
 
21
- def geolocation_enabled?
22
- Decidim::Map.available?(:geocoding)
13
+ def see_all_path
14
+ meetings_directory_path if model.scope_name == "homepage"
23
15
  end
24
16
 
25
- private
26
-
27
- def limit
28
- geolocation_enabled? ? 4 : 8
17
+ def meetings_directory_path
18
+ Decidim::Meetings::DirectoryEngine.routes.url_helpers.root_path
29
19
  end
30
20
  end
31
21
  end
@@ -0,0 +1,25 @@
1
+ <div class="meeting__calendar-container">
2
+ <div class="meeting__calendar meeting__calendar__lg">
3
+ <div class="meeting__calendar-month">
4
+ <span><%= l(start_time, format: !same_month? ? "%b" : "%B") %></span>
5
+ <span class="meeting__calendar-separator"><%= "-" if !same_month? %></span>
6
+ <span><%= l(end_time, format: "%b") if !same_month? %></span>
7
+ </div>
8
+ <div class="meeting__calendar-day">
9
+ <span><%= l(start_time, format: "%d") %></span>
10
+ <span class="meeting__calendar-separator"><%= "-" if !same_day? || !same_month? %></span>
11
+ <span><%= l(end_time, format: "%d") if !same_day? || !same_month? %></span>
12
+ </div>
13
+ <div class="meeting__calendar-time">
14
+ <time datetime="<%= start_time.iso8601 %>"><%= l(start_time, format: "%H:%M") %></time>
15
+ <span class="meeting__calendar-separator"><%= "-" %></span>
16
+ <time datetime="<%= end_time.iso8601 %>"><%= l(end_time, format: "%H:%M") %></time>
17
+ </div>
18
+ </div>
19
+
20
+ <%= static_map %>
21
+
22
+ <% if online? %>
23
+ <%= cell("decidim/address", meeting, online: true) %>
24
+ <% end %>
25
+ </div>
@@ -0,0 +1 @@
1
+ <%= render partial: "decidim/shared/static_map", formats: [:html], locals: { geolocalizable: meeting } %>
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Meetings
5
+ # This cell renders the meeting dates range and the map if enabled and
6
+ # available
7
+ class DatesAndMapCell < Decidim::ViewModel
8
+ include Cell::ViewModel::Partial
9
+ include Decidim::MapHelper
10
+
11
+ alias meeting model
12
+
13
+ delegate :start_time, :end_time, :maps_enabled?, :online?, to: :meeting
14
+ delegate :snippets, to: :controller
15
+
16
+ def static_map
17
+ return render :static_map if display_map?
18
+ end
19
+
20
+ private
21
+
22
+ def same_month?
23
+ start_time.month == end_time.month
24
+ end
25
+
26
+ def same_day?
27
+ start_time.day == end_time.day
28
+ end
29
+
30
+ def display_map?
31
+ maps_enabled? && !online?
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,34 +1,36 @@
1
- <% if upcoming_meetings.any? %>
2
- <div class="section row collapse upcoming_meetings">
3
- <h3 class="section-heading">
4
- <%= decidim_escape_translated(model.name) %> - <%= t("decidim.participatory_spaces.highlighted_meetings.upcoming_meetings") %>
5
- <a href="<%= main_component_path(model) %>" class="text-small"><%= t("decidim.participatory_spaces.highlighted_meetings.see_all", count: upcoming_meetings_count) %></a>
6
- </h3>
7
- <div class="card card--list">
8
- <% upcoming_meetings.includes(:component).each do |meeting| %>
9
- <%= card_for meeting, size: :list_item %>
10
- <% end %>
11
- </div>
12
- <%= link_to(
13
- t("decidim.participatory_spaces.highlighted_meetings.see_all", count: upcoming_meetings_count),
14
- main_component_path(model),
15
- class: "button button--sc hollow button--right"
16
- ) %>
1
+ <%# NOTE: Since this call can be called from outside decidim-meetings, frontend assets are required %>
2
+
3
+ <%= apply_meetings_pack_tags %>
4
+
5
+ <div class="content-block__title">
6
+ <h2 class="h2 decorator">
7
+ <%= single_component? ? translated_attribute(model.name) : t("decidim.components.meetings.name") %>
8
+ </h2>
9
+ <div class="label text-lg"><%= meetings_count %></div>
10
+ <% if see_all_path.present? %>
11
+ <%= link_to see_all_path, class: "button button__sm button__text-secondary" do %>
12
+ <span><%= t("decidim.participatory_spaces.highlighted_meetings.see_all") %></span>
13
+ <%= icon "arrow-right-line" %>
14
+ <% end %>
15
+ <% end %>
16
+ </div>
17
+ <% if show_map? %>
18
+ <div class="meeting-list__block-map">
19
+ <%= cell "decidim/meetings/meetings_map", collection %>
17
20
  </div>
18
- <% elsif past_meetings.any? %>
19
- <div class="section row collapse past_meetings">
20
- <h3 class="section-heading">
21
- <%= decidim_escape_translated(model.name) %> - <%= t("decidim.participatory_spaces.highlighted_meetings.past_meetings") %> <a href="<%= main_component_path(model) %>" class="text-small"><%= t("decidim.participatory_spaces.highlighted_meetings.see_all", count: past_meetings_count) %></a>
22
- </h3>
23
- <div class="card card--list">
24
- <% past_meetings.each do |meeting| %>
25
- <%= card_for meeting, size: :list_item %>
21
+ <% end %>
22
+ <div class="meeting-list__block-list">
23
+ <% if show_calendar? %>
24
+ <div class="meeting-list__block-list-aside">
25
+ <% calendar_months.each do |start_date| %>
26
+ <%= cell "decidim/meetings/meeting_month", collection, start_date: %>
26
27
  <% end %>
27
28
  </div>
28
- <%= link_to(
29
- t("decidim.participatory_spaces.highlighted_meetings.see_all", count: past_meetings_count),
30
- main_component_path(model),
31
- class: "button button--sc hollow button--right"
32
- ) %>
29
+ <% end %>
30
+ <div class="card__list-list">
31
+ <span class="meeting-list__block-list-title"><%= title %></span>
32
+ <% collection.includes(:component).each do |meeting| %>
33
+ <%= cell "decidim/meetings/meeting_l", meeting, title_tag: :h3, **options.slice(:show_space) %>
34
+ <% end %>
33
35
  </div>
34
- <% end %>
36
+ </div>
@@ -8,41 +8,89 @@ module Decidim
8
8
  # It is intended to be used in the `participatory_space_highlighted_elements`
9
9
  # view hook.
10
10
  class HighlightedMeetingsForComponentCell < Decidim::ViewModel
11
+ include Decidim::Meetings::ApplicationHelper
11
12
  include Decidim::ComponentPathHelper
12
13
  include Decidim::CardHelper
14
+ include Decidim::LayoutHelper
15
+
16
+ delegate :snippets, to: :controller
13
17
 
14
18
  def show
15
- render unless meetings_count.zero?
19
+ render unless items_blank?
20
+ end
21
+
22
+ def items_blank?
23
+ meetings_count.zero?
16
24
  end
17
25
 
18
26
  private
19
27
 
28
+ def meetings_count
29
+ @meetings_count ||= meetings.size
30
+ end
31
+
32
+ def base_relation
33
+ @base_relation ||= Decidim::Meetings::Meeting.where(component: model)
34
+ .except_withdrawn
35
+ .published
36
+ .not_hidden
37
+ .visible_for(current_user)
38
+ end
39
+
40
+ def section_id
41
+ return "upcoming_meetings" if show_upcoming_meetings?
42
+
43
+ "past_meetings"
44
+ end
45
+
46
+ def collection
47
+ @collection ||= meetings.limit(limit)
48
+ end
49
+
20
50
  def meetings
21
- @meetings ||= Decidim::Meetings::Meeting.where(component: model)
22
- .except_withdrawn
23
- .published
24
- .not_hidden
25
- .visible_for(current_user)
51
+ @meetings ||= show_upcoming_meetings? ? upcoming_meetings : past_meetings
26
52
  end
27
53
 
28
- def past_meetings
29
- @past_meetings ||= meetings.past.order(end_time: :desc, start_time: :desc).limit(3)
54
+ def title
55
+ return t("upcoming_meetings", scope: "decidim.participatory_spaces.highlighted_meetings") if show_upcoming_meetings?
56
+
57
+ t("past_meetings", scope: "decidim.participatory_spaces.highlighted_meetings")
30
58
  end
31
59
 
32
- def upcoming_meetings
33
- @upcoming_meetings ||= meetings.upcoming.order(:start_time, :end_time).limit(3)
60
+ def show_upcoming_meetings?
61
+ @show_upcoming_meetings ||= options[:force_upcoming] || upcoming_meetings.present?
34
62
  end
35
63
 
36
- def meetings_count
37
- @meetings_count ||= meetings.count
64
+ def show_map?
65
+ maps_active? && !all_online_meetings?
38
66
  end
39
67
 
40
- def past_meetings_count
41
- @past_meetings_count ||= meetings.past.count
68
+ def maps_active?
69
+ Decidim::Map.available?(:geocoding, :dynamic)
42
70
  end
43
71
 
44
- def upcoming_meetings_count
45
- @upcoming_meetings_count ||= meetings.upcoming.count
72
+ def all_online_meetings?
73
+ collection.collect(&:type_of_meeting).all?("online")
74
+ end
75
+
76
+ def show_calendar?
77
+ @show_calendar ||= show_upcoming_meetings? && collection.minimum(:start_time).before?(2.months.from_now.beginning_of_month)
78
+ end
79
+
80
+ def calendar_months
81
+ [Date.current, Date.current.next_month]
82
+ end
83
+
84
+ def past_meetings
85
+ @past_meetings ||= base_relation.past.order(end_time: :desc, start_time: :desc)
86
+ end
87
+
88
+ def upcoming_meetings
89
+ @upcoming_meetings ||= base_relation.upcoming.order(:start_time, :end_time)
90
+ end
91
+
92
+ def single_component?
93
+ @single_component ||= model.is_a?(Decidim::Component)
46
94
  end
47
95
 
48
96
  def cache_hash
@@ -53,6 +101,18 @@ module Decidim
53
101
  hash << I18n.locale.to_s
54
102
  hash.join(Decidim.cache_key_separator)
55
103
  end
104
+
105
+ def component_routes
106
+ Decidim::EngineRouter.main_proxy(model)
107
+ end
108
+
109
+ def limit
110
+ 3
111
+ end
112
+
113
+ def see_all_path
114
+ @see_all_path ||= options[:see_all_path] || (single_component? && main_component_path(model))
115
+ end
56
116
  end
57
117
  end
58
118
  end
@@ -0,0 +1,25 @@
1
+ <%= decidim_modal id: "meeting-registration-confirm-#{model.id}", class: "meeting__registration-modal" do %>
2
+ <%= decidim_form_for(registration_form, url: meeting_registration_path(model), method: :post) do |form| %>
3
+ <div data-dialog-container>
4
+ <%= icon "login-circle-line" %>
5
+ <h2 id="dialog-title-meeting-registration-confirm-<%= model.id %>" data-dialog-title><%= t("join", scope: "decidim.meetings.meetings.show") %></h2>
6
+ <div>
7
+
8
+ <div class="form__wrapper">
9
+ <%= cell("decidim/represent_user_group", form) %>
10
+ <%= cell("decidim/public_participation", form) %>
11
+ <span class="meeting__registration-modal__terms"><%= registration_terms_text %></span>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ <div data-dialog-actions>
16
+ <button type="button" class="button button__sm md:button__lg button__transparent-secondary" data-dialog-close="meeting-registration-confirm-<%= model.id %>">
17
+ <span><%= i18n_cancel_text %></span>
18
+ </button>
19
+ <button type="submit" class="button button__sm md:button__lg button__secondary">
20
+ <span><%= i18n_confirm_text %></span>
21
+ <%= icon "arrow-right-line" %>
22
+ </button>
23
+ </div>
24
+ <% end %>
25
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <div class="meeting__aside-progress">
2
+ <span><%= t("remaining_slots", scope: "decidim.meetings.meetings.show", count: model.remaining_slots) %></span>
3
+ <progress value="<%= model.remaining_slots %>" max="<%= model.available_slots %>"></progress>
4
+ </div>
@@ -6,23 +6,25 @@
6
6
  i18n_join_text,
7
7
  join_meeting_registration_path(model),
8
8
  class: button_classes,
9
- disabled: !model.has_available_slots?,
9
+ disabled: !model.has_available_slots?
10
10
  ) %>
11
11
  <% else %>
12
- <%= render :registration_confirm %>
12
+ <%= render :registration_modal %>
13
13
  <%= action_authorized_button_to(
14
14
  :join,
15
15
  i18n_join_text,
16
16
  "#",
17
17
  class: button_classes,
18
18
  disabled: !model.has_available_slots?,
19
- data: { open: current_user.present? ? "meeting-registration-confirm-#{model.id}" : "loginModal" }
19
+ data: { "dialog-open": current_user.present? ? "meeting-registration-confirm-#{model.id}" : "loginModal" }
20
20
  ) %>
21
21
  <% end %>
22
22
  <% end %>
23
+
23
24
  <% if shows_remaining_slots? %>
24
- <span><%= t("remaining_slots", scope: "decidim.meetings.meetings.show", count: model.remaining_slots) %></span>
25
+ <%= render :remaining_slots %>
25
26
  <% end %>
27
+
26
28
  <% elsif model.on_different_platform? %>
27
29
  <%= action_authorized_link_to(
28
30
  :join,
@@ -10,6 +10,8 @@ module Decidim
10
10
  include ActionView::Helpers::FormOptionsHelper
11
11
 
12
12
  def show
13
+ return unless model.can_be_joined_by?(current_user) || model.on_different_platform?
14
+
13
15
  render
14
16
  end
15
17
 
@@ -22,13 +24,7 @@ module Decidim
22
24
  end
23
25
 
24
26
  def button_classes
25
- return "button expanded button--sc" if big_button?
26
-
27
- "button card__button button--sc small"
28
- end
29
-
30
- def big_button?
31
- options[:big_button]
27
+ "button button__xl button__secondary w-full"
32
28
  end
33
29
 
34
30
  def shows_remaining_slots?
@@ -5,18 +5,7 @@ module Decidim
5
5
  # A cell to display when actions happen on a meeting.
6
6
  class MeetingActivityCell < ActivityCell
7
7
  def title
8
- case action
9
- when "update"
10
- I18n.t(
11
- "decidim.meetings.last_activity.meeting_updated_at_html",
12
- link: participatory_space_link
13
- )
14
- else
15
- I18n.t(
16
- "decidim.meetings.last_activity.new_meeting_at_html",
17
- link: participatory_space_link
18
- )
19
- end
8
+ action == "update" ? I18n.t("decidim.meetings.last_activity.meeting_updated") : I18n.t("decidim.meetings.last_activity.new_meeting")
20
9
  end
21
10
 
22
11
  def resource_link_text
@@ -0,0 +1,64 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Meetings
5
+ # This cell renders metadata for an instance of a Meeting
6
+ class MeetingCardMetadataCell < Decidim::CardMetadataCell
7
+ include Decidim::LayoutHelper
8
+ include ActionView::Helpers::DateHelper
9
+
10
+ alias meeting model
11
+
12
+ delegate :type_of_meeting, :start_time, :end_time, :category, :withdrawn?, to: :meeting
13
+
14
+ alias start_date start_time
15
+ alias end_date end_time
16
+
17
+ def initialize(*)
18
+ super
19
+
20
+ @items.prepend(*meeting_items)
21
+ end
22
+
23
+ private
24
+
25
+ def meeting_items
26
+ [type, duration_item, comments_count_item, category_item, withdrawn_item]
27
+ end
28
+
29
+ def meeting_items_for_map
30
+ [dates_item, type].compact_blank.map do |item|
31
+ {
32
+ text: item[:text],
33
+ icon: icon(item[:icon]).html_safe
34
+ }
35
+ end
36
+ end
37
+
38
+ def type
39
+ {
40
+ text: t(type_of_meeting, scope: "decidim.meetings.meetings.filters.type_values"),
41
+ icon: resource_type_icon_key(type_of_meeting)
42
+ }
43
+ end
44
+
45
+ def official
46
+ return unless official?
47
+
48
+ {
49
+ text: t("decidim.meetings.models.meeting.fields.official_meeting"),
50
+ icon: "information-line"
51
+ }
52
+ end
53
+
54
+ def withdrawn_item
55
+ return unless withdrawn?
56
+
57
+ {
58
+ text: t("withdraw", scope: "decidim.meetings.types"),
59
+ icon: resource_type_icon_key("withdrawn")
60
+ }
61
+ end
62
+ end
63
+ end
64
+ end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Meetings
5
5
  # This cell renders the meeting card for an instance of a Meeting
6
- # the default size is the Medium Card (:m)
6
+ # the default size is the List Card (:l)
7
7
  # also available the List Item Card (:list_item)
8
8
  class MeetingCell < Decidim::ViewModel
9
9
  include Decidim::SanitizeHelper
@@ -18,14 +18,10 @@ module Decidim
18
18
 
19
19
  def card_size
20
20
  case @options[:size]
21
- when :highlighted_list_item
22
- "decidim/meetings/meeting_highlighted_list_item"
23
- when :list_item
24
- "decidim/meetings/meeting_list_item"
25
21
  when :s
26
22
  "decidim/meetings/meeting_s"
27
23
  else
28
- "decidim/meetings/meeting_m"
24
+ "decidim/meetings/meeting_l"
29
25
  end
30
26
  end
31
27
 
@@ -0,0 +1,5 @@
1
+ <time class="card__calendar" datetime="<%= meeting.start_time.iso8601 %>">
2
+ <div class="card__calendar-month"><%= l(meeting.start_time, format: "%b") %></div>
3
+ <div class="card__calendar-day"><%= l(meeting.start_time, format: "%d") %></div>
4
+ <div class="card__calendar-time"><%= l(meeting.start_time, format: "%H:%M") %></div>
5
+ </time>
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "cell/partial"
4
+
5
+ module Decidim
6
+ module Meetings
7
+ # This cell renders the List (:l) meeting card
8
+ # for an instance of a Meeting
9
+ class MeetingLCell < Decidim::CardLCell
10
+ delegate :component_settings, to: :controller
11
+
12
+ alias meeting model
13
+
14
+ def has_image?
15
+ true
16
+ end
17
+
18
+ def extra_class
19
+ "card__calendar-list__reset"
20
+ end
21
+
22
+ def image
23
+ render
24
+ end
25
+
26
+ private
27
+
28
+ def metadata_cell
29
+ "decidim/meetings/meeting_card_metadata"
30
+ end
31
+ end
32
+ end
33
+ end