decidim-conferences 0.27.10 → 0.28.0.rc4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/conferences/conference_cell.rb +9 -4
  3. data/app/cells/decidim/conferences/conference_dropdown_metadata_cell.rb +19 -0
  4. data/app/cells/decidim/conferences/conference_g_cell.rb +23 -0
  5. data/app/cells/decidim/conferences/conference_metadata_cell.rb +21 -0
  6. data/app/cells/decidim/conferences/conference_s_cell.rb +13 -0
  7. data/app/cells/decidim/conferences/conference_speaker/show.erb +44 -58
  8. data/app/cells/decidim/conferences/conference_speaker_cell.rb +4 -14
  9. data/app/cells/decidim/conferences/content_blocks/highlighted_conferences_cell.rb +15 -14
  10. data/app/cells/decidim/conferences/content_blocks/highlighted_conferences_settings_form/show.erb +3 -0
  11. data/app/cells/decidim/conferences/content_blocks/highlighted_conferences_settings_form_cell.rb +19 -0
  12. data/app/cells/decidim/conferences/linked_participatory_spaces/show.erb +6 -8
  13. data/app/cells/decidim/conferences/linked_participatory_spaces_cell.rb +1 -10
  14. data/app/cells/decidim/conferences/media_link/show.erb +6 -8
  15. data/app/cells/decidim/conferences/partner/image.erb +3 -0
  16. data/app/cells/decidim/conferences/partner/show.erb +8 -8
  17. data/app/cells/decidim/conferences/partner/text.erb +1 -0
  18. data/app/cells/decidim/conferences/partner_cell.rb +4 -2
  19. data/app/cells/decidim/conferences/registration_type/join_conference.erb +15 -12
  20. data/app/cells/decidim/conferences/registration_type/registration_confirm.erb +12 -12
  21. data/app/cells/decidim/conferences/registration_type/show.erb +11 -14
  22. data/app/cells/decidim/conferences/registration_type_cell.rb +3 -3
  23. data/app/commands/decidim/conferences/admin/copy_conference.rb +1 -1
  24. data/app/commands/decidim/conferences/admin/create_conference.rb +2 -11
  25. data/app/commands/decidim/conferences/admin/create_conference_speaker.rb +2 -2
  26. data/app/commands/decidim/conferences/admin/create_media_link.rb +2 -2
  27. data/app/commands/decidim/conferences/admin/create_partner.rb +2 -2
  28. data/app/commands/decidim/conferences/admin/create_registration_type.rb +2 -2
  29. data/app/commands/decidim/conferences/admin/destroy_conference_speaker.rb +2 -2
  30. data/app/commands/decidim/conferences/admin/destroy_media_link.rb +1 -1
  31. data/app/commands/decidim/conferences/admin/destroy_partner.rb +3 -3
  32. data/app/commands/decidim/conferences/admin/destroy_registration_type.rb +1 -1
  33. data/app/commands/decidim/conferences/admin/invite_user_to_join_conference.rb +5 -5
  34. data/app/commands/decidim/conferences/admin/publish_conference.rb +9 -26
  35. data/app/commands/decidim/conferences/admin/send_conference_diplomas.rb +1 -1
  36. data/app/commands/decidim/conferences/admin/update_conference.rb +2 -11
  37. data/app/commands/decidim/conferences/admin/update_conference_speaker.rb +1 -1
  38. data/app/commands/decidim/conferences/admin/update_media_link.rb +1 -1
  39. data/app/commands/decidim/conferences/admin/update_partner.rb +1 -1
  40. data/app/commands/decidim/conferences/admin/update_registration_type.rb +1 -1
  41. data/app/commands/decidim/conferences/decline_invitation.rb +1 -1
  42. data/app/commands/decidim/conferences/join_conference.rb +5 -5
  43. data/app/constraints/decidim/conferences/current_component.rb +2 -2
  44. data/app/constraints/decidim/conferences/current_conference.rb +2 -2
  45. data/app/controllers/concerns/decidim/conferences/admin/conference_context.rb +1 -1
  46. data/app/controllers/decidim/conferences/admin/concerns/conference_admin.rb +2 -2
  47. data/app/controllers/decidim/conferences/admin/conference_attachment_collections_controller.rb +6 -1
  48. data/app/controllers/decidim/conferences/admin/conference_attachments_controller.rb +5 -0
  49. data/app/controllers/decidim/conferences/admin/conference_invites_controller.rb +2 -1
  50. data/app/controllers/decidim/conferences/admin/conference_publications_controller.rb +10 -28
  51. data/app/controllers/decidim/conferences/admin/conference_registrations_controller.rb +1 -1
  52. data/app/controllers/decidim/conferences/admin/conference_user_roles_controller.rb +8 -90
  53. data/app/controllers/decidim/conferences/admin/conferences_controller.rb +2 -0
  54. data/app/controllers/decidim/conferences/admin/diplomas_controller.rb +1 -1
  55. data/app/controllers/decidim/conferences/admin/exports_controller.rb +1 -1
  56. data/app/controllers/decidim/conferences/admin/imports_controller.rb +1 -1
  57. data/app/controllers/decidim/conferences/admin/moderations/reports_controller.rb +1 -1
  58. data/app/controllers/decidim/conferences/admin/moderations_controller.rb +1 -1
  59. data/app/controllers/decidim/conferences/application_controller.rb +6 -0
  60. data/app/controllers/decidim/conferences/conference_registrations_controller.rb +3 -3
  61. data/app/controllers/decidim/conferences/conferences_controller.rb +9 -2
  62. data/app/events/decidim/conferences/conference_registration_notification_event.rb +3 -13
  63. data/app/events/decidim/conferences/conference_registrations_enabled_event.rb +1 -1
  64. data/app/events/decidim/conferences/conference_registrations_over_percentage_event.rb +1 -1
  65. data/app/events/decidim/conferences/conference_role_assigned_event.rb +6 -6
  66. data/app/forms/decidim/conferences/admin/conference_copy_form.rb +1 -1
  67. data/app/forms/decidim/conferences/admin/conference_form.rb +4 -15
  68. data/app/forms/decidim/conferences/admin/conference_user_role_form.rb +2 -17
  69. data/app/helpers/decidim/conferences/admin/conferences_helper.rb +0 -4
  70. data/app/helpers/decidim/conferences/conference_helper.rb +55 -0
  71. data/app/helpers/decidim/conferences/conference_program_helper.rb +1 -1
  72. data/app/helpers/decidim/conferences/media_attachments_helper.rb +0 -10
  73. data/app/helpers/decidim/conferences/partners_helper.rb +3 -1
  74. data/app/mailers/decidim/conferences/admin/invite_join_conference_mailer.rb +1 -1
  75. data/app/mailers/decidim/conferences/admin/send_conference_diploma_mailer.rb +1 -1
  76. data/app/mailers/decidim/conferences/conference_registration_mailer.rb +2 -2
  77. data/app/models/decidim/conference.rb +4 -4
  78. data/app/models/decidim/conference_user_role.rb +6 -34
  79. data/app/packs/entrypoints/decidim_conferences.js +5 -0
  80. data/app/packs/src/decidim/conferences/admin/conferences.js +6 -6
  81. data/app/packs/stylesheets/decidim/conferences/_conference.scss +102 -0
  82. data/app/packs/stylesheets/decidim/conferences/_media.scss +13 -0
  83. data/app/packs/stylesheets/decidim/conferences/_program.scss +43 -0
  84. data/app/packs/stylesheets/decidim/conferences/_registration.scss +39 -0
  85. data/app/packs/stylesheets/decidim/conferences/_speaker.scss +83 -0
  86. data/app/packs/stylesheets/decidim/conferences/conferences.scss +5 -3
  87. data/app/permissions/decidim/conferences/permissions.rb +2 -13
  88. data/app/presenters/decidim/conference_speaker_presenter.rb +1 -1
  89. data/app/presenters/decidim/conferences/admin_log/conference_invite_presenter.rb +2 -2
  90. data/app/presenters/decidim/conferences/admin_log/conference_presenter.rb +2 -2
  91. data/app/presenters/decidim/conferences/admin_log/conference_registration_presenter.rb +2 -2
  92. data/app/presenters/decidim/conferences/admin_log/conference_speaker_presenter.rb +2 -2
  93. data/app/presenters/decidim/conferences/admin_log/conference_user_role_presenter.rb +2 -2
  94. data/app/presenters/decidim/conferences/admin_log/media_link_presenter.rb +2 -2
  95. data/app/presenters/decidim/conferences/admin_log/partner_presenter.rb +2 -2
  96. data/app/presenters/decidim/conferences/admin_log/registration_type_presenter.rb +2 -2
  97. data/app/presenters/decidim/conferences/conference_stats_presenter.rb +3 -28
  98. data/app/queries/decidim/conferences/admin/admin_users.rb +4 -4
  99. data/app/queries/decidim/conferences/conferences_with_user_role.rb +2 -2
  100. data/app/queries/decidim/conferences/organization_conferences.rb +1 -1
  101. data/app/queries/decidim/conferences/organization_published_conferences.rb +1 -1
  102. data/app/views/decidim/conferences/admin/conference_copies/_form.html.erb +22 -28
  103. data/app/views/decidim/conferences/admin/conference_copies/new.html.erb +16 -5
  104. data/app/views/decidim/conferences/admin/conference_invites/_form.html.erb +17 -19
  105. data/app/views/decidim/conferences/admin/conference_invites/index.html.erb +69 -74
  106. data/app/views/decidim/conferences/admin/conference_invites/new.html.erb +21 -17
  107. data/app/views/decidim/conferences/admin/conference_registrations/index.html.erb +45 -45
  108. data/app/views/decidim/conferences/admin/conference_speakers/_form.html.erb +42 -46
  109. data/app/views/decidim/conferences/admin/conference_speakers/edit.html.erb +16 -6
  110. data/app/views/decidim/conferences/admin/conference_speakers/index.html.erb +52 -55
  111. data/app/views/decidim/conferences/admin/conference_speakers/new.html.erb +16 -6
  112. data/app/views/decidim/conferences/admin/conference_user_roles/_form.html.erb +14 -18
  113. data/app/views/decidim/conferences/admin/conference_user_roles/edit.html.erb +16 -6
  114. data/app/views/decidim/conferences/admin/conference_user_roles/index.html.erb +53 -56
  115. data/app/views/decidim/conferences/admin/conference_user_roles/new.html.erb +16 -6
  116. data/app/views/decidim/conferences/admin/conferences/_form.html.erb +88 -88
  117. data/app/views/decidim/conferences/admin/conferences/edit.html.erb +26 -12
  118. data/app/views/decidim/conferences/admin/conferences/index.html.erb +55 -64
  119. data/app/views/decidim/conferences/admin/conferences/new.html.erb +16 -8
  120. data/app/views/decidim/conferences/admin/diplomas/_form.html.erb +18 -24
  121. data/app/views/decidim/conferences/admin/diplomas/edit.html.erb +19 -5
  122. data/app/views/decidim/conferences/admin/media_links/_form.html.erb +15 -19
  123. data/app/views/decidim/conferences/admin/media_links/edit.html.erb +16 -6
  124. data/app/views/decidim/conferences/admin/media_links/index.html.erb +37 -40
  125. data/app/views/decidim/conferences/admin/media_links/new.html.erb +16 -6
  126. data/app/views/decidim/conferences/admin/partners/_form.html.erb +18 -22
  127. data/app/views/decidim/conferences/admin/partners/edit.html.erb +16 -6
  128. data/app/views/decidim/conferences/admin/partners/index.html.erb +45 -48
  129. data/app/views/decidim/conferences/admin/partners/new.html.erb +16 -6
  130. data/app/views/decidim/conferences/admin/registration_types/_form.html.erb +23 -23
  131. data/app/views/decidim/conferences/admin/registration_types/edit.html.erb +16 -6
  132. data/app/views/decidim/conferences/admin/registration_types/index.html.erb +52 -56
  133. data/app/views/decidim/conferences/admin/registration_types/new.html.erb +16 -6
  134. data/app/views/decidim/conferences/admin/send_conference_diploma_mailer/diploma_user.html.erb +2 -2
  135. data/app/views/decidim/conferences/conference_program/_program_item.html.erb +21 -24
  136. data/app/views/decidim/conferences/conference_program/_program_meeting.html.erb +29 -63
  137. data/app/views/decidim/conferences/conference_program/show.html.erb +27 -39
  138. data/app/views/decidim/conferences/conference_speakers/index.html.erb +12 -6
  139. data/app/views/decidim/conferences/conferences/_conference_hero.html.erb +33 -0
  140. data/app/views/decidim/conferences/conferences/_partners.html.erb +10 -13
  141. data/app/views/decidim/conferences/conferences/index.html.erb +17 -7
  142. data/app/views/decidim/conferences/conferences/show.html.erb +84 -50
  143. data/app/views/decidim/conferences/media/index.html.erb +33 -19
  144. data/app/views/decidim/conferences/registration_types/index.html.erb +25 -17
  145. data/app/views/layouts/decidim/admin/conference.html.erb +12 -14
  146. data/app/views/layouts/decidim/admin/conferences.html.erb +13 -8
  147. data/app/views/layouts/decidim/conference.html.erb +7 -17
  148. data/app/views/layouts/decidim/conferences/_conference_nav_item.html.erb +6 -0
  149. data/app/views/layouts/decidim/conferences/application.html.erb +6 -0
  150. data/config/assets.rb +1 -1
  151. data/config/initializers/wicked_pdf.rb +1 -1
  152. data/config/locales/ar.yml +3 -64
  153. data/config/locales/bg.yml +0 -612
  154. data/config/locales/ca.yml +35 -55
  155. data/config/locales/cs.yml +35 -53
  156. data/config/locales/de.yml +34 -54
  157. data/config/locales/el.yml +11 -51
  158. data/config/locales/en.yml +34 -54
  159. data/config/locales/es-MX.yml +32 -52
  160. data/config/locales/es-PY.yml +32 -52
  161. data/config/locales/es.yml +32 -52
  162. data/config/locales/eu.yml +33 -58
  163. data/config/locales/fi-plain.yml +32 -52
  164. data/config/locales/fi.yml +32 -52
  165. data/config/locales/fr-CA.yml +31 -51
  166. data/config/locales/fr.yml +31 -51
  167. data/config/locales/ga-IE.yml +0 -17
  168. data/config/locales/gl.yml +3 -62
  169. data/config/locales/hu.yml +15 -53
  170. data/config/locales/id-ID.yml +3 -57
  171. data/config/locales/it.yml +4 -62
  172. data/config/locales/ja.yml +33 -54
  173. data/config/locales/lb.yml +1 -55
  174. data/config/locales/lt.yml +14 -52
  175. data/config/locales/lv.yml +1 -61
  176. data/config/locales/nl.yml +3 -62
  177. data/config/locales/no.yml +1 -62
  178. data/config/locales/pl.yml +1 -81
  179. data/config/locales/pt-BR.yml +1 -72
  180. data/config/locales/pt.yml +2 -63
  181. data/config/locales/ro-RO.yml +13 -50
  182. data/config/locales/sk.yml +1 -61
  183. data/config/locales/sl.yml +0 -2
  184. data/config/locales/sr-CS.yml +0 -9
  185. data/config/locales/sv.yml +22 -77
  186. data/config/locales/tr-TR.yml +13 -62
  187. data/config/locales/zh-CN.yml +3 -60
  188. data/config/locales/zh-TW.yml +6 -47
  189. data/db/migrate/20221116084952_add_weight_to_conferences.rb +7 -0
  190. data/lib/decidim/conferences/admin_engine.rb +14 -138
  191. data/lib/decidim/conferences/content_blocks/registry_manager.rb +21 -0
  192. data/lib/decidim/conferences/engine.rb +17 -15
  193. data/lib/decidim/conferences/menu.rb +182 -0
  194. data/lib/decidim/conferences/participatory_space.rb +6 -200
  195. data/lib/decidim/conferences/query_extensions.rb +2 -2
  196. data/lib/decidim/conferences/seeds.rb +153 -0
  197. data/lib/decidim/conferences/test/factories.rb +37 -73
  198. data/lib/decidim/conferences/version.rb +1 -1
  199. metadata +47 -51
  200. data/app/cells/decidim/conferences/conference_address/show.erb +0 -11
  201. data/app/cells/decidim/conferences/conference_address_cell.rb +0 -11
  202. data/app/cells/decidim/conferences/conference_m/footer.erb +0 -9
  203. data/app/cells/decidim/conferences/conference_m/tags.erb +0 -1
  204. data/app/cells/decidim/conferences/conference_m_cell.rb +0 -38
  205. data/app/cells/decidim/conferences/content_blocks/highlighted_conferences/show.erb +0 -30
  206. data/app/cells/decidim/conferences/photo/show.erb +0 -26
  207. data/app/cells/decidim/conferences/photo_cell.rb +0 -41
  208. data/app/cells/decidim/conferences/photos_list/show.erb +0 -8
  209. data/app/cells/decidim/conferences/photos_list_cell.rb +0 -18
  210. data/app/commands/decidim/conferences/admin/create_conference_admin.rb +0 -114
  211. data/app/commands/decidim/conferences/admin/destroy_conference_admin.rb +0 -58
  212. data/app/commands/decidim/conferences/admin/notify_role_assigned_to_conference.rb +0 -22
  213. data/app/commands/decidim/conferences/admin/unpublish_conference.rb +0 -39
  214. data/app/commands/decidim/conferences/admin/update_conference_admin.rb +0 -53
  215. data/app/controllers/decidim/conferences/conference_widgets_controller.rb +0 -33
  216. data/app/queries/decidim/conferences/admin/conference_invites.rb +0 -60
  217. data/app/views/decidim/conferences/_order_by_conferences.html.erb +0 -3
  218. data/app/views/decidim/conferences/conferences/_promoted_conference.html.erb +0 -27
  219. data/app/views/decidim/conferences/media/_attachments.html.erb +0 -6
  220. data/app/views/decidim/conferences/shared/_conference_user_login.html.erb +0 -14
  221. data/app/views/layouts/decidim/_conference_hero.html.erb +0 -42
  222. data/app/views/layouts/decidim/_conferences_nav.html.erb +0 -46
  223. data/config/locales/he-IL.yml +0 -1
  224. data/db/seeds/Exampledocument.pdf +0 -0
  225. data/db/seeds/city.jpeg +0 -0
  226. data/db/seeds/city2.jpeg +0 -0
  227. data/db/seeds/homepage_image.jpg +0 -0
  228. data/db/seeds/logo.png +0 -0
  229. data/decidim-conferences.gemspec +0 -33
@@ -16,7 +16,7 @@ module Decidim
16
16
  # Executes the command. Broadcasts these events:
17
17
  #
18
18
  # - :ok when everything is valid.
19
- # - :invalid if the form wasn't valid and we couldn't proceed.
19
+ # - :invalid if the form was not valid and we could not proceed.
20
20
  #
21
21
  # Returns nothing.
22
22
  def call
@@ -26,7 +26,6 @@ module Decidim
26
26
  add_admins_as_followers(conference)
27
27
  link_participatory_processes
28
28
  link_assemblies
29
- link_consultations
30
29
 
31
30
  broadcast(:ok, conference)
32
31
  else
@@ -48,6 +47,7 @@ module Decidim
48
47
  title: form.title,
49
48
  slogan: form.slogan,
50
49
  slug: form.slug,
50
+ weight: form.weight,
51
51
  hashtag: form.hashtag,
52
52
  description: form.description,
53
53
  short_description: form.short_description,
@@ -95,15 +95,6 @@ module Decidim
95
95
  def link_assemblies
96
96
  conference.link_participatory_space_resources(assemblies, "included_assemblies")
97
97
  end
98
-
99
- def consultations
100
- @consultations ||= conference.participatory_space_sibling_scope(:consultations)
101
- .where(id: @form.consultations_ids)
102
- end
103
-
104
- def link_consultations
105
- conference.link_participatory_space_resources(consultations, "included_consultations")
106
- end
107
98
  end
108
99
  end
109
100
  end
@@ -21,7 +21,7 @@ module Decidim
21
21
  # Executes the command. Broadcasts these events:
22
22
  #
23
23
  # - :ok when everything is valid.
24
- # - :invalid if the form wasn't valid and we couldn't proceed.
24
+ # - :invalid if the form was not valid and we could not proceed.
25
25
  #
26
26
  # Returns nothing.
27
27
  def call
@@ -62,7 +62,7 @@ module Decidim
62
62
  "short_bio"
63
63
  ).symbolize_keys.merge(
64
64
  decidim_conference_id: conference.id,
65
- conference: conference,
65
+ conference:,
66
66
  user: form.user
67
67
  ).merge(
68
68
  attachment_attributes(:avatar)
@@ -19,7 +19,7 @@ module Decidim
19
19
  # Executes the command. Broadcasts these events:
20
20
  #
21
21
  # - :ok when everything is valid.
22
- # - :invalid if the form wasn't valid and we couldn't proceed.
22
+ # - :invalid if the form was not valid and we could not proceed.
23
23
  #
24
24
  # Returns nothing.
25
25
  def call
@@ -55,7 +55,7 @@ module Decidim
55
55
  "weight",
56
56
  "date"
57
57
  ).symbolize_keys.merge(
58
- conference: conference
58
+ conference:
59
59
  ),
60
60
  log_info
61
61
  )
@@ -19,7 +19,7 @@ module Decidim
19
19
  # Executes the command. Broadcasts these events:
20
20
  #
21
21
  # - :ok when everything is valid.
22
- # - :invalid if the form wasn't valid and we couldn't proceed.
22
+ # - :invalid if the form was not valid and we could not proceed.
23
23
  #
24
24
  # Returns nothing.
25
25
  def call
@@ -70,7 +70,7 @@ module Decidim
70
70
  end
71
71
 
72
72
  def attributes
73
- { conference: conference }.merge(
73
+ { conference: }.merge(
74
74
  form.attributes.slice(
75
75
  "name",
76
76
  "weight",
@@ -20,7 +20,7 @@ module Decidim
20
20
  # Executes the command. Broadcasts these events:
21
21
  #
22
22
  # - :ok when everything is valid.
23
- # - :invalid if the form wasn't valid and we couldn't proceed.
23
+ # - :invalid if the form was not valid and we could not proceed.
24
24
  #
25
25
  # Returns nothing.
26
26
  def call
@@ -57,7 +57,7 @@ module Decidim
57
57
  "price",
58
58
  "weight"
59
59
  ).symbolize_keys.merge(
60
- conference: conference
60
+ conference:
61
61
  ),
62
62
  log_info
63
63
  )
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  module Admin
6
- # A command with all the business logic when destroying an conference
6
+ # A command with all the business logic when destroying a conference
7
7
  # speaker in the system.
8
8
  class DestroyConferenceSpeaker < Decidim::Command
9
9
  # Public: Initializes the command.
@@ -18,7 +18,7 @@ module Decidim
18
18
  # Executes the command. Broadcasts these events:
19
19
  #
20
20
  # - :ok when everything is valid.
21
- # - :invalid if the form wasn't valid and we couldn't proceed.
21
+ # - :invalid if the form was not valid and we could not proceed.
22
22
  #
23
23
  # Returns nothing.
24
24
  def call
@@ -18,7 +18,7 @@ module Decidim
18
18
  # Executes the command. Broadcasts these events:
19
19
  #
20
20
  # - :ok when everything is valid.
21
- # - :invalid if the form wasn't valid and we couldn't proceed.
21
+ # - :invalid if the form was not valid and we could not proceed.
22
22
  #
23
23
  # Returns nothing.
24
24
  def call
@@ -3,8 +3,8 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  module Admin
6
- # A command with all the business logic when destroying an conference
7
- # partner in the system.
6
+ # A command with all the business logic when destroying a conference
7
+ # Partner in the system.
8
8
  class DestroyPartner < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
@@ -18,7 +18,7 @@ module Decidim
18
18
  # Executes the command. Broadcasts these events:
19
19
  #
20
20
  # - :ok when everything is valid.
21
- # - :invalid if the form wasn't valid and we couldn't proceed.
21
+ # - :invalid if the form was not valid and we could not proceed.
22
22
  #
23
23
  # Returns nothing.
24
24
  def call
@@ -18,7 +18,7 @@ module Decidim
18
18
  # Executes the command. Broadcasts these events:
19
19
  #
20
20
  # - :ok when everything is valid.
21
- # - :invalid if the form wasn't valid and we couldn't proceed.
21
+ # - :invalid if the form was not valid and we could not proceed.
22
22
  #
23
23
  # Returns nothing.
24
24
  def call
@@ -20,7 +20,7 @@ module Decidim
20
20
  # Executes the command. Broadcasts these events:
21
21
  #
22
22
  # - :ok when everything is valid.
23
- # - :invalid if the form wasn't valid and we couldn't proceed.
23
+ # - :invalid if the form was not valid and we could not proceed.
24
24
  #
25
25
  # Returns nothing.
26
26
  def call
@@ -37,7 +37,7 @@ module Decidim
37
37
 
38
38
  def already_invited?
39
39
  return false unless user.persisted?
40
- return false unless conference.conference_invites.exists?(user: user)
40
+ return false unless conference.conference_invites.exists?(user:)
41
41
 
42
42
  form.errors.add(:email, :already_invited)
43
43
  true
@@ -57,8 +57,8 @@ module Decidim
57
57
  Decidim::Conferences::ConferenceInvite,
58
58
  invited_by,
59
59
  {
60
- user: user,
61
- conference: conference,
60
+ user:,
61
+ conference:,
62
62
  registration_type: form.registration_type,
63
63
  sent_at: Time.current
64
64
  },
@@ -98,7 +98,7 @@ module Decidim
98
98
 
99
99
  def invite_user_to_sign_up
100
100
  user.skip_reconfirmation!
101
- user.invite!(invited_by, invitation_instructions: "join_conference", conference: conference, registration_type: form.registration_type)
101
+ user.invite!(invited_by, invitation_instructions: "join_conference", conference:, registration_type: form.registration_type)
102
102
  end
103
103
  end
104
104
  end
@@ -3,46 +3,29 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  module Admin
6
- # A command that sets an conference as published.
7
- class PublishConference < Decidim::Command
8
- # Public: Initializes the command.
9
- #
10
- # conference - A Conference that will be published
11
- # current_user - the user performing the action
12
- def initialize(conference, current_user)
13
- @conference = conference
14
- @current_user = current_user
15
- end
16
-
17
- # Executes the command. Broadcasts these events:
18
- #
19
- # - :ok when everything is valid.
20
- # - :invalid if the data wasn't valid and we couldn't proceed.
21
- #
22
- # Returns nothing.
6
+ # A command that sets a Conference as published.
7
+ class PublishConference < Decidim::Admin::ParticipatorySpace::Publish
23
8
  def call
24
- return broadcast(:invalid) if conference.nil? || conference.published?
9
+ return broadcast(:invalid) if participatory_space.nil? || participatory_space.published?
25
10
 
26
- Decidim.traceability.perform_action!("publish", conference, current_user) do
27
- conference.publish!
11
+ Decidim.traceability.perform_action!(:publish, participatory_space, user, **default_options) do
12
+ participatory_space.publish!
28
13
  end
29
14
 
30
- broadcast(:ok)
31
15
  send_notification
16
+ broadcast(:ok, participatory_space)
32
17
  end
33
18
 
34
19
  private
35
20
 
36
- attr_reader :conference, :current_user
37
-
38
21
  def send_notification
39
- return unless conference.registrations_enabled?
22
+ return unless participatory_space.registrations_enabled?
40
23
 
41
24
  Decidim::EventsManager.publish(
42
25
  event: "decidim.events.conferences.registrations_enabled",
43
26
  event_class: Decidim::Conferences::ConferenceRegistrationsEnabledEvent,
44
- resource: conference,
45
- followers: conference.followers
27
+ resource: participatory_space,
28
+ followers: participatory_space.followers
46
29
  )
47
30
  end
48
31
  end
@@ -17,7 +17,7 @@ module Decidim
17
17
  # Executes the command. Broadcasts these events:
18
18
  #
19
19
  # - :ok when everything is valid.
20
- # - :invalid if the form wasn't valid and we couldn't proceed.
20
+ # - :invalid if the form was not valid and we could not proceed.
21
21
  #
22
22
  # Returns nothing.
23
23
  def call
@@ -20,7 +20,7 @@ module Decidim
20
20
  # Executes the command. Broadcasts these events:
21
21
  #
22
22
  # - :ok when everything is valid.
23
- # - :invalid if the form wasn't valid and we couldn't proceed.
23
+ # - :invalid if the form was not valid and we could not proceed.
24
24
  #
25
25
  # Returns nothing.
26
26
  def call
@@ -29,7 +29,6 @@ module Decidim
29
29
  update_conference
30
30
  link_participatory_processes
31
31
  link_assemblies
32
- link_consultations
33
32
 
34
33
  if @conference.valid?
35
34
  broadcast(:ok, @conference)
@@ -76,6 +75,7 @@ module Decidim
76
75
  title: form.title,
77
76
  slogan: form.slogan,
78
77
  slug: form.slug,
78
+ weight: form.weight,
79
79
  hashtag: form.hashtag,
80
80
  description: form.description,
81
81
  short_description: form.short_description,
@@ -152,15 +152,6 @@ module Decidim
152
152
  def link_assemblies
153
153
  @conference.link_participatory_space_resources(assemblies, "included_assemblies")
154
154
  end
155
-
156
- def consultations
157
- @consultations ||= @conference.participatory_space_sibling_scope(:consultations)
158
- .where(id: @form.consultations_ids)
159
- end
160
-
161
- def link_consultations
162
- @conference.link_participatory_space_resources(consultations, "included_consultations")
163
- end
164
155
  end
165
156
  end
166
157
  end
@@ -20,7 +20,7 @@ module Decidim
20
20
  # Executes the command. Broadcasts these events:
21
21
  #
22
22
  # - :ok when everything is valid.
23
- # - :invalid if the form wasn't valid and we couldn't proceed.
23
+ # - :invalid if the form was not valid and we could not proceed.
24
24
  #
25
25
  # Returns nothing.
26
26
  def call
@@ -18,7 +18,7 @@ module Decidim
18
18
  # Executes the command. Broadcasts these events:
19
19
  #
20
20
  # - :ok when everything is valid.
21
- # - :invalid if the form wasn't valid and we couldn't proceed.
21
+ # - :invalid if the form was not valid and we could not proceed.
22
22
  #
23
23
  # Returns nothing.
24
24
  def call
@@ -20,7 +20,7 @@ module Decidim
20
20
  # Executes the command. Broadcasts these events:
21
21
  #
22
22
  # - :ok when everything is valid.
23
- # - :invalid if the form wasn't valid and we couldn't proceed.
23
+ # - :invalid if the form was not valid and we could not proceed.
24
24
  #
25
25
  # Returns nothing.
26
26
  def call
@@ -18,7 +18,7 @@ module Decidim
18
18
  # Executes the command. Broadcasts these events:
19
19
  #
20
20
  # - :ok when everything is valid.
21
- # - :invalid if the form wasn't valid and we couldn't proceed.
21
+ # - :invalid if the form was not valid and we could not proceed.
22
22
  #
23
23
  # Returns nothing.
24
24
  def call
@@ -38,7 +38,7 @@ module Decidim
38
38
  end
39
39
 
40
40
  def invitation
41
- @invitation ||= conference.conference_invites.find_by(user: user)
41
+ @invitation ||= conference.conference_invites.find_by(user:)
42
42
  end
43
43
  end
44
44
  end
@@ -39,11 +39,11 @@ module Decidim
39
39
  attr_reader :conference, :user
40
40
 
41
41
  def accept_invitation
42
- conference.conference_invites.find_by(user: user)&.accept!
42
+ conference.conference_invites.find_by(user:)&.accept!
43
43
  end
44
44
 
45
45
  def create_registration
46
- Decidim::Conferences::ConferenceRegistration.create!(conference: conference, user: user, registration_type: @registration_type)
46
+ Decidim::Conferences::ConferenceRegistration.create!(conference:, user:, registration_type: @registration_type)
47
47
  end
48
48
 
49
49
  def create_meetings_registrations
@@ -51,7 +51,7 @@ module Decidim
51
51
  meetings = Decidim::Meetings::Meeting.where(component: published_meeting_components).where(id: @registration_type.conference_meetings.pluck(:id))
52
52
 
53
53
  meetings.each do |meeting|
54
- Decidim::Meetings::Registration.create!(meeting: meeting, user: user)
54
+ Decidim::Meetings::Registration.create!(meeting:, user:)
55
55
  end
56
56
  end
57
57
 
@@ -60,7 +60,7 @@ module Decidim
60
60
  end
61
61
 
62
62
  def already_joined_conference?
63
- conference.conference_registrations.where(user: user).any?
63
+ conference.conference_registrations.where(user:).any?
64
64
  end
65
65
 
66
66
  def send_email_pending_validation
@@ -94,7 +94,7 @@ module Decidim
94
94
  resource: @conference,
95
95
  followers: participatory_space_admins,
96
96
  extra: {
97
- percentage: percentage
97
+ percentage:
98
98
  }
99
99
  )
100
100
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module Conferences
5
- # This class infers the current component on an conference context
5
+ # This class infers the current component on a conference context
6
6
  # request parameters and injects it into the environment.
7
7
  class CurrentComponent
8
8
  # Public: Initializes the class.
@@ -17,7 +17,7 @@ module Decidim
17
17
  #
18
18
  # request - The request that holds the current component relevant information.
19
19
  #
20
- # Returns a true if the request matches an conference and a
20
+ # Returns a true if the request matches a conference and a
21
21
  # component belonging to that conference, false otherwise
22
22
  def matches?(request)
23
23
  CurrentConference.new.matches?(request) &&
@@ -2,11 +2,11 @@
2
2
 
3
3
  module Decidim
4
4
  module Conferences
5
- # This class infers the current conference we're scoped to by
5
+ # This class infers the current conference we are scoped to by
6
6
  # looking at the request parameters and the organization in the request
7
7
  # environment, and injects it into the environment.
8
8
  class CurrentConference
9
- # Public: Matches the request against an conference and injects it
9
+ # Public: Matches the request against a conference and injects it
10
10
  # into the environment.
11
11
  #
12
12
  # request - The request that holds the conference relevant
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  module Admin
6
- # This module, when injected into a controller, ensures there's a
6
+ # This module, when injected into a controller, ensures there is a
7
7
  # Conference available and deducts it from the context.
8
8
  module ConferenceContext
9
9
  def self.extended(base)
@@ -7,7 +7,7 @@ module Decidim
7
7
  module Admin
8
8
  module Concerns
9
9
  # This concern is meant to be included in all controllers that are scoped
10
- # into an conference's admin panel. It will override the layout so it shows
10
+ # into a conference's admin panel. It will override the layout so it shows
11
11
  # the sidebar, preload the conference, etc.
12
12
  module ConferenceAdmin
13
13
  extend ActiveSupport::Concern
@@ -36,7 +36,7 @@ module Decidim
36
36
  end
37
37
 
38
38
  def permissions_context
39
- super.merge(current_participatory_space: current_participatory_space)
39
+ super.merge(current_participatory_space:)
40
40
  end
41
41
 
42
42
  def permission_class_chain
@@ -3,11 +3,12 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  module Admin
6
- # Controller that allows managing all the attachment collections for an conference.
6
+ # Controller that allows managing all the attachment collections for a Conference.
7
7
  #
8
8
  class ConferenceAttachmentCollectionsController < Decidim::Conferences::Admin::ApplicationController
9
9
  include Concerns::ConferenceAdmin
10
10
  include Decidim::Admin::Concerns::HasAttachmentCollections
11
+ include Decidim::Admin::Concerns::HasTabbedMenu
11
12
 
12
13
  def after_destroy_path
13
14
  conference_attachment_collections_path(current_conference)
@@ -20,6 +21,10 @@ module Decidim
20
21
  def authorization_object
21
22
  @attachment_collection || AttachmentCollection
22
23
  end
24
+
25
+ private
26
+
27
+ def tab_menu_name = :conferences_admin_attachments_menu
23
28
  end
24
29
  end
25
30
  end
@@ -9,6 +9,7 @@ module Decidim
9
9
  class ConferenceAttachmentsController < Decidim::Conferences::Admin::ApplicationController
10
10
  include Concerns::ConferenceAdmin
11
11
  include Decidim::Admin::Concerns::HasAttachments
12
+ include Decidim::Admin::Concerns::HasTabbedMenu
12
13
 
13
14
  def after_destroy_path
14
15
  conference_attachments_path(current_conference)
@@ -21,6 +22,10 @@ module Decidim
21
22
  def authorization_object
22
23
  @attachment || Attachment
23
24
  end
25
+
26
+ private
27
+
28
+ def tab_menu_name = :conferences_admin_attachments_menu
24
29
  end
25
30
  end
26
31
  end
@@ -7,6 +7,7 @@ module Decidim
7
7
  #
8
8
  class ConferenceInvitesController < Decidim::Conferences::Admin::ApplicationController
9
9
  include Concerns::ConferenceAdmin
10
+ include Decidim::Paginable
10
11
 
11
12
  helper_method :conference
12
13
 
@@ -17,7 +18,7 @@ module Decidim
17
18
 
18
19
  @query = params[:q]
19
20
  @status = params[:status]
20
- @conference_invites = Decidim::Conferences::Admin::ConferenceInvites.for(current_participatory_space.conference_invites, @query, @status).page(params[:page]).per(15)
21
+ @conference_invites = Decidim::Admin::Invites.for(current_participatory_space.conference_invites, @query, @status).page(params[:page]).per(15)
21
22
  end
22
23
 
23
24
  def new
@@ -5,40 +5,22 @@ module Decidim
5
5
  module Admin
6
6
  # Controller that allows managing conference publications.
7
7
  #
8
- class ConferencePublicationsController < Decidim::Conferences::Admin::ApplicationController
8
+ # i18n-tasks-use t('decidim.admin.conference_publications.create.error')
9
+ # i18n-tasks-use t('decidim.admin.conference_publications.create.success')
10
+ # i18n-tasks-use t('decidim.admin.conference_publications.destroy.error')
11
+ # i18n-tasks-use t('decidim.admin.conference_publications.destroy.success')
12
+ class ConferencePublicationsController < Decidim::Admin::SpacePublicationsController
9
13
  include Concerns::ConferenceAdmin
10
14
 
11
- def create
12
- enforce_permission_to :publish, :conference, conference: current_conference
15
+ private
13
16
 
14
- PublishConference.call(current_conference, current_user) do
15
- on(:ok) do
16
- flash[:notice] = I18n.t("conference_publications.create.success", scope: "decidim.admin")
17
- end
17
+ def enforce_permission_to_publish = enforce_permission_to(:publish, :conference, conference: current_conference)
18
18
 
19
- on(:invalid) do
20
- flash.now[:alert] = I18n.t("conference_publications.create.error", scope: "decidim.admin")
21
- end
19
+ def publish_command = PublishConference
22
20
 
23
- redirect_back(fallback_location: conferences_path)
24
- end
25
- end
21
+ def i18n_scope = "decidim.admin.conference_publications"
26
22
 
27
- def destroy
28
- enforce_permission_to :publish, :conference, conference: current_conference
29
-
30
- UnpublishConference.call(current_conference, current_user) do
31
- on(:ok) do
32
- flash[:notice] = I18n.t("conference_publications.destroy.success", scope: "decidim.admin")
33
- end
34
-
35
- on(:invalid) do
36
- flash.now[:alert] = I18n.t("conference_publications.destroy.error", scope: "decidim.admin")
37
- end
38
-
39
- redirect_back(fallback_location: conferences_path)
40
- end
41
- end
23
+ def fallback_location = conferences_path
42
24
  end
43
25
  end
44
26
  end
@@ -30,7 +30,7 @@ module Decidim
30
30
  end
31
31
 
32
32
  def confirm
33
- enforce_permission_to(:confirm, :conference_registration, conference_registration: conference_registration)
33
+ enforce_permission_to(:confirm, :conference_registration, conference_registration:)
34
34
 
35
35
  ConfirmConferenceRegistration.call(conference_registration, current_user) do
36
36
  on(:ok) do