decidim-conferences 0.26.8 → 0.27.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/conferences/content_blocks/highlighted_conferences/show.erb +2 -2
  3. data/app/cells/decidim/conferences/content_blocks/highlighted_conferences_cell.rb +4 -5
  4. data/app/commands/decidim/conferences/admin/confirm_conference_registration.rb +3 -3
  5. data/app/commands/decidim/conferences/admin/copy_conference.rb +1 -1
  6. data/app/commands/decidim/conferences/admin/create_conference.rb +1 -1
  7. data/app/commands/decidim/conferences/admin/create_conference_speaker.rb +8 -8
  8. data/app/commands/decidim/conferences/admin/create_media_link.rb +6 -6
  9. data/app/commands/decidim/conferences/admin/create_partner.rb +8 -8
  10. data/app/commands/decidim/conferences/admin/create_registration_type.rb +6 -6
  11. data/app/commands/decidim/conferences/admin/destroy_conference_admin.rb +1 -6
  12. data/app/commands/decidim/conferences/admin/destroy_conference_speaker.rb +1 -1
  13. data/app/commands/decidim/conferences/admin/destroy_media_link.rb +1 -1
  14. data/app/commands/decidim/conferences/admin/destroy_partner.rb +1 -1
  15. data/app/commands/decidim/conferences/admin/destroy_registration_type.rb +1 -1
  16. data/app/commands/decidim/conferences/admin/export_conference_registrations.rb +1 -1
  17. data/app/commands/decidim/conferences/admin/invite_user_to_join_conference.rb +10 -12
  18. data/app/commands/decidim/conferences/admin/notify_role_assigned_to_conference.rb +1 -1
  19. data/app/commands/decidim/conferences/admin/publish_conference.rb +1 -1
  20. data/app/commands/decidim/conferences/admin/publish_registration_type.rb +1 -1
  21. data/app/commands/decidim/conferences/admin/send_conference_diplomas.rb +1 -1
  22. data/app/commands/decidim/conferences/admin/unpublish_conference.rb +1 -1
  23. data/app/commands/decidim/conferences/admin/unpublish_registration_type.rb +1 -1
  24. data/app/commands/decidim/conferences/admin/update_conference.rb +1 -1
  25. data/app/commands/decidim/conferences/admin/update_conference_speaker.rb +8 -8
  26. data/app/commands/decidim/conferences/admin/update_diploma.rb +3 -3
  27. data/app/commands/decidim/conferences/admin/update_media_link.rb +6 -6
  28. data/app/commands/decidim/conferences/admin/update_partner.rb +6 -6
  29. data/app/commands/decidim/conferences/admin/update_registration_type.rb +6 -6
  30. data/app/commands/decidim/conferences/decline_invitation.rb +1 -1
  31. data/app/commands/decidim/conferences/join_conference.rb +1 -8
  32. data/app/commands/decidim/conferences/leave_conference.rb +4 -4
  33. data/app/controllers/decidim/conferences/admin/conference_invites_controller.rb +12 -8
  34. data/app/controllers/decidim/conferences/admin/conference_registrations_controller.rb +10 -8
  35. data/app/controllers/decidim/conferences/admin/conference_speakers_controller.rb +11 -17
  36. data/app/controllers/decidim/conferences/admin/media_links_controller.rb +1 -1
  37. data/app/controllers/decidim/conferences/admin/partners_controller.rb +1 -1
  38. data/app/controllers/decidim/conferences/admin/registration_type_publications_controller.rb +1 -1
  39. data/app/controllers/decidim/conferences/admin/registration_types_controller.rb +1 -1
  40. data/app/controllers/decidim/conferences/admin/reminders_controller.rb +14 -0
  41. data/app/controllers/decidim/conferences/conference_program_controller.rb +2 -2
  42. data/app/controllers/decidim/conferences/conference_registrations_controller.rb +1 -18
  43. data/app/events/decidim/conferences/conference_registration_notification_event.rb +1 -1
  44. data/app/events/decidim/conferences/conference_role_assigned_event.rb +1 -1
  45. data/app/forms/decidim/conferences/admin/conference_registration_invite_form.rb +1 -1
  46. data/app/helpers/decidim/conferences/admin/conference_speakers_helper.rb +14 -0
  47. data/app/mailers/decidim/conferences/admin/send_conference_diploma_mailer.rb +2 -2
  48. data/app/models/decidim/conference.rb +2 -3
  49. data/app/models/decidim/conferences/conference_invite.rb +2 -2
  50. data/app/models/decidim/conferences/conference_registration.rb +2 -2
  51. data/app/permissions/decidim/conferences/permissions.rb +0 -1
  52. data/app/presenters/decidim/conference_speaker_presenter.rb +3 -5
  53. data/app/presenters/decidim/conferences/conference_stats_presenter.rb +4 -1
  54. data/app/queries/decidim/conferences/admin/admin_users.rb +1 -1
  55. data/app/queries/decidim/conferences/admin/conference_invites.rb +1 -1
  56. data/app/queries/decidim/conferences/admin/conference_speakers.rb +1 -1
  57. data/app/queries/decidim/conferences/conference_program_meetings.rb +2 -2
  58. data/app/queries/decidim/conferences/conference_program_meetings_by_day.rb +3 -3
  59. data/app/queries/decidim/conferences/conferences_with_user_role.rb +1 -1
  60. data/app/queries/decidim/conferences/organization_conferences.rb +1 -1
  61. data/app/queries/decidim/conferences/organization_prioritized_conferences.rb +3 -3
  62. data/app/queries/decidim/conferences/organization_published_conferences.rb +3 -3
  63. data/app/queries/decidim/conferences/prioritized_conferences.rb +1 -1
  64. data/app/queries/decidim/conferences/promoted_conferences.rb +1 -1
  65. data/app/queries/decidim/conferences/published_conferences.rb +1 -1
  66. data/app/queries/decidim/conferences/visible_conferences.rb +1 -1
  67. data/app/serializers/decidim/conferences/{data_portability_conference_invite_serializer.rb → download_your_data_conference_invite_serializer.rb} +2 -2
  68. data/app/serializers/decidim/conferences/{data_portability_conference_registration_serializer.rb → download_your_data_conference_registration_serializer.rb} +2 -2
  69. data/app/views/decidim/conferences/admin/conference_copies/new.html.erb +0 -1
  70. data/app/views/decidim/conferences/admin/conference_invites/index.html.erb +0 -1
  71. data/app/views/decidim/conferences/admin/conference_invites/new.html.erb +0 -1
  72. data/app/views/decidim/conferences/admin/conference_registrations/index.html.erb +0 -1
  73. data/app/views/decidim/conferences/admin/conference_speakers/edit.html.erb +1 -2
  74. data/app/views/decidim/conferences/admin/conference_speakers/index.html.erb +0 -1
  75. data/app/views/decidim/conferences/admin/conference_speakers/new.html.erb +0 -1
  76. data/app/views/decidim/conferences/admin/conference_user_roles/edit.html.erb +0 -1
  77. data/app/views/decidim/conferences/admin/conference_user_roles/index.html.erb +0 -1
  78. data/app/views/decidim/conferences/admin/conference_user_roles/new.html.erb +0 -1
  79. data/app/views/decidim/conferences/admin/conferences/_form.html.erb +3 -3
  80. data/app/views/decidim/conferences/admin/conferences/edit.html.erb +0 -1
  81. data/app/views/decidim/conferences/admin/conferences/index.html.erb +0 -1
  82. data/app/views/decidim/conferences/admin/conferences/new.html.erb +0 -1
  83. data/app/views/decidim/conferences/admin/diplomas/edit.html.erb +0 -1
  84. data/app/views/decidim/conferences/admin/invite_join_conference_mailer/invite.html.erb +3 -3
  85. data/app/views/decidim/conferences/admin/media_links/edit.html.erb +0 -1
  86. data/app/views/decidim/conferences/admin/media_links/index.html.erb +0 -1
  87. data/app/views/decidim/conferences/admin/media_links/new.html.erb +0 -1
  88. data/app/views/decidim/conferences/admin/partners/_form.html.erb +2 -1
  89. data/app/views/decidim/conferences/admin/partners/edit.html.erb +0 -1
  90. data/app/views/decidim/conferences/admin/partners/index.html.erb +3 -2
  91. data/app/views/decidim/conferences/admin/partners/new.html.erb +0 -1
  92. data/app/views/decidim/conferences/admin/registration_types/edit.html.erb +0 -1
  93. data/app/views/decidim/conferences/admin/registration_types/index.html.erb +0 -1
  94. data/app/views/decidim/conferences/admin/registration_types/new.html.erb +0 -1
  95. data/app/views/decidim/conferences/conferences/_promoted_conference.html.erb +1 -1
  96. data/app/views/decidim/conferences/conferences/show.html.erb +2 -2
  97. data/app/views/devise/mailer/join_conference.html.erb +2 -2
  98. data/app/views/devise/mailer/join_conference.text.erb +2 -2
  99. data/app/views/layouts/decidim/_conference_hero.html.erb +1 -1
  100. data/app/views/layouts/decidim/_conferences_nav.html.erb +1 -1
  101. data/config/locales/am-ET.yml +1 -0
  102. data/config/locales/ar.yml +9 -2
  103. data/config/locales/bg.yml +1 -0
  104. data/config/locales/ca.yml +8 -11
  105. data/config/locales/cs.yml +18 -21
  106. data/config/locales/da.yml +1 -0
  107. data/config/locales/de.yml +7 -10
  108. data/config/locales/el.yml +8 -13
  109. data/config/locales/en.yml +7 -11
  110. data/config/locales/eo.yml +1 -0
  111. data/config/locales/es-MX.yml +9 -12
  112. data/config/locales/es-PY.yml +10 -13
  113. data/config/locales/es.yml +9 -12
  114. data/config/locales/et.yml +1 -0
  115. data/config/locales/eu.yml +40 -39
  116. data/config/locales/fi-plain.yml +8 -11
  117. data/config/locales/fi.yml +10 -13
  118. data/config/locales/fr-CA.yml +4 -7
  119. data/config/locales/fr.yml +6 -9
  120. data/config/locales/ga-IE.yml +4 -0
  121. data/config/locales/gl.yml +9 -1
  122. data/config/locales/hr.yml +1 -0
  123. data/config/locales/hu.yml +9 -65
  124. data/config/locales/id-ID.yml +12 -1
  125. data/config/locales/is-IS.yml +2 -1
  126. data/config/locales/it.yml +11 -3
  127. data/config/locales/ja.yml +5 -8
  128. data/config/locales/ko.yml +1 -0
  129. data/config/locales/lb.yml +7 -2
  130. data/config/locales/lt.yml +1 -616
  131. data/config/locales/lv.yml +12 -1
  132. data/config/locales/mt.yml +1 -0
  133. data/config/locales/nl.yml +13 -5
  134. data/config/locales/no.yml +10 -2
  135. data/config/locales/om-ET.yml +1 -0
  136. data/config/locales/pl.yml +9 -2
  137. data/config/locales/pt-BR.yml +11 -3
  138. data/config/locales/pt.yml +9 -1
  139. data/config/locales/ro-RO.yml +10 -14
  140. data/config/locales/ru.yml +1 -0
  141. data/config/locales/si-LK.yml +1 -0
  142. data/config/locales/sk.yml +12 -1
  143. data/config/locales/sl.yml +1 -0
  144. data/config/locales/so-SO.yml +1 -0
  145. data/config/locales/sr-CS.yml +1 -0
  146. data/config/locales/sv.yml +9 -7
  147. data/config/locales/sw-KE.yml +1 -0
  148. data/config/locales/ti-ER.yml +1 -0
  149. data/config/locales/tr-TR.yml +14 -4
  150. data/config/locales/uk.yml +1 -0
  151. data/config/locales/val-ES.yml +1 -0
  152. data/config/locales/vi.yml +1 -0
  153. data/config/locales/zh-CN.yml +12 -1
  154. data/config/locales/zh-TW.yml +1 -611
  155. data/lib/decidim/conferences/admin_engine.rb +1 -0
  156. data/lib/decidim/conferences/participatory_space.rb +8 -8
  157. data/lib/decidim/conferences/test/factories.rb +1 -5
  158. data/lib/decidim/conferences/version.rb +1 -1
  159. metadata +18 -23
  160. data/config/environment.rb +0 -0
  161. data/config/locales/fa-IR.yml +0 -1
  162. data/config/locales/gn-PY.yml +0 -1
  163. data/config/locales/ka-GE.yml +0 -1
  164. data/config/locales/kaa.yml +0 -20
  165. data/config/locales/lo-LA.yml +0 -1
  166. data/config/locales/oc-FR.yml +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7761601f2bc735c74722ab8518bf66ae940b62c2ef3be50b9c1486e5a28b18f
4
- data.tar.gz: e6dd33d71369c287a79538bb099852e08a9ef7fe8a4f27f68465bfcd83987ed5
3
+ metadata.gz: 5258df72a4c5a6687ef76c3d1ab8083b6e031aa66063a3182614ea95127b510b
4
+ data.tar.gz: 32d40203166f672c3e29165aa814faf2d1c311e22014fea3ad4873153042af6f
5
5
  SHA512:
6
- metadata.gz: eed128af272cf37b894adf111ae35a3881d692aea0f8bfdcd6922f40859814ebcb70c95b1de1cee0f4416640cf5f7feb0e162daf9e31081f18ea6cc1754f30ce
7
- data.tar.gz: c2c87e8d2b4a65382b39b6d7516c4049dbd79316fb66741334aee9280114108f1ba801e71c7e1d324935bb4077b7e99c975d76a57f2c227fa16a7a9f51a97aad
6
+ metadata.gz: ffd7e95539f0068f5cef41b91849b45ecb55900f5b590d9339d4dc68824f7f623555914f053eb697f68d4ddf3f41e0b2b8851e1c7077d04b8aa5cb960325183f
7
+ data.tar.gz: 6f3e0cace82753ab90c13041e86ec9bdacbb9278792cc615c46cdfb608a0d074dc19d31c4749d560d5a866ff913e95d0668035bca427b968c6f7162f7b39d3ab
@@ -1,4 +1,4 @@
1
- <section class="wrapper-home home-section">
1
+ <section id="highlighted_conferences" class="wrapper-home home-section">
2
2
  <div class="row" id="highlighted-conferences">
3
3
  <h3 class="section-heading"><%= t("active_conferences", scope: i18n_scope) %></h3>
4
4
  <div class="row collapse">
@@ -8,7 +8,7 @@
8
8
  <div class="column">
9
9
  <%= link_to decidim_conferences.conference_path(conference), class: "card card--conference card--mini" do %>
10
10
  <div aria-hidden="true" class="card__image-top"
11
- style="background-image:url('<%= conference.attached_uploader(:hero_image).path %>')"></div>
11
+ style="background-image:url(<%= conference.attached_uploader(:hero_image).path %>)"></div>
12
12
  <div class="card__content">
13
13
  <span class="card__title card__link"><%= translated_attribute conference.title %></span>
14
14
  </div>
@@ -6,10 +6,6 @@ module Decidim
6
6
  class HighlightedConferencesCell < Decidim::ViewModel
7
7
  delegate :current_user, to: :controller
8
8
 
9
- cache :show, expires_in: 10.minutes, if: :perform_caching? do
10
- cache_hash
11
- end
12
-
13
9
  def show
14
10
  render if highlighted_conferences.any?
15
11
  end
@@ -31,9 +27,12 @@ module Decidim
31
27
  def cache_hash
32
28
  hash = []
33
29
  hash.push(I18n.locale)
34
- hash.push(highlighted_conferences.map(&:cache_key_with_version))
35
30
  hash.join(Decidim.cache_key_separator)
36
31
  end
32
+
33
+ def cache_expiry_time
34
+ 10.minutes
35
+ end
37
36
  end
38
37
  end
39
38
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  module Admin
6
6
  # This command is executed when the user joins a conference.
7
- class ConfirmConferenceRegistration < Rectify::Command
7
+ class ConfirmConferenceRegistration < Decidim::Command
8
8
  # Initializes a JoinConference Command.
9
9
  #
10
10
  # conference_registration - The registration to be confirmed
@@ -18,9 +18,9 @@ module Decidim
18
18
  #
19
19
  # Broadcasts :ok if successful, :invalid otherwise.
20
20
  def call
21
- @conference_registration.with_lock do
22
- return broadcast(:invalid) unless can_join_conference?
21
+ return broadcast(:invalid) unless can_join_conference?
23
22
 
23
+ @conference_registration.with_lock do
24
24
  confirm_registration
25
25
  send_email_confirmation
26
26
  send_notification_confirmation
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when copying a new participatory
7
7
  # conference in the system.
8
- class CopyConference < Rectify::Command
8
+ class CopyConference < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # form - A form object with the params.
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when creating a new
7
7
  # conference in the system.
8
- class CreateConference < Rectify::Command
8
+ class CreateConference < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # form - A form object with the params.
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when creating a new conference
7
7
  # speaker in the system.
8
- class CreateConferenceSpeaker < Rectify::Command
8
+ class CreateConferenceSpeaker < Decidim::Command
9
9
  include ::Decidim::AttachmentAttributesMethods
10
10
 
11
11
  # Public: Initializes the command.
@@ -54,13 +54,13 @@ module Decidim
54
54
 
55
55
  def conference_speaker_with_attributes
56
56
  attrs = form.attributes.slice(
57
- :full_name,
58
- :twitter_handle,
59
- :personal_url,
60
- :position,
61
- :affiliation,
62
- :short_bio
63
- ).merge(
57
+ "full_name",
58
+ "twitter_handle",
59
+ "personal_url",
60
+ "position",
61
+ "affiliation",
62
+ "short_bio"
63
+ ).symbolize_keys.merge(
64
64
  decidim_conference_id: conference.id,
65
65
  conference: conference,
66
66
  user: form.user
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when creating a new
7
7
  # media link for conference in the system.
8
- class CreateMediaLink < Rectify::Command
8
+ class CreateMediaLink < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # form - A form object with the params.
@@ -50,11 +50,11 @@ module Decidim
50
50
  Decidim::Conferences::MediaLink,
51
51
  current_user,
52
52
  form.attributes.slice(
53
- :title,
54
- :link,
55
- :weight,
56
- :date
57
- ).merge(
53
+ "title",
54
+ "link",
55
+ "weight",
56
+ "date"
57
+ ).symbolize_keys.merge(
58
58
  conference: conference
59
59
  ),
60
60
  log_info
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when creating a new partner
7
7
  # in the system.
8
- class CreatePartner < Rectify::Command
8
+ class CreatePartner < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # form - A form object with the params.
@@ -72,13 +72,13 @@ module Decidim
72
72
  def attributes
73
73
  { conference: conference }.merge(
74
74
  form.attributes.slice(
75
- :name,
76
- :weight,
77
- :link,
78
- :partner_type,
79
- :logo,
80
- :remove_avatar
81
- )
75
+ "name",
76
+ "weight",
77
+ "link",
78
+ "partner_type",
79
+ "logo",
80
+ "remove_avatar"
81
+ ).symbolize_keys
82
82
  )
83
83
  end
84
84
  end
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when creating a new registration type
7
7
  # in the system.
8
- class CreateRegistrationType < Rectify::Command
8
+ class CreateRegistrationType < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # form - A form object with the params.
@@ -52,11 +52,11 @@ module Decidim
52
52
  Decidim::Conferences::RegistrationType,
53
53
  form.current_user,
54
54
  form.attributes.slice(
55
- :title,
56
- :description,
57
- :price,
58
- :weight
59
- ).merge(
55
+ "title",
56
+ "description",
57
+ "price",
58
+ "weight"
59
+ ).symbolize_keys.merge(
60
60
  conference: conference
61
61
  ),
62
62
  log_info
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when destroying an conference
7
7
  # admin in the system.
8
- class DestroyConferenceAdmin < Rectify::Command
8
+ class DestroyConferenceAdmin < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # role - the ConferenceUserRole to destroy
@@ -23,7 +23,6 @@ module Decidim
23
23
  # Returns nothing.
24
24
  def call
25
25
  destroy_role!
26
- dispatch_system_event
27
26
  broadcast(:ok)
28
27
  end
29
28
 
@@ -31,10 +30,6 @@ module Decidim
31
30
 
32
31
  attr_reader :role, :current_user
33
32
 
34
- def dispatch_system_event
35
- ActiveSupport::Notifications.publish("decidim.system.participatory_space.admin.destroyed", role.class.name, role.id)
36
- end
37
-
38
33
  def destroy_role!
39
34
  extra_info = {
40
35
  resource: {
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when destroying an conference
7
7
  # speaker in the system.
8
- class DestroyConferenceSpeaker < Rectify::Command
8
+ class DestroyConferenceSpeaker < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # conference_speaker - the ConferenceSpeaker to destroy
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when destroying a media link
7
7
  # in the system.
8
- class DestroyMediaLink < Rectify::Command
8
+ class DestroyMediaLink < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # media_link - the MediaLink to destroy
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when destroying an conference
7
7
  # partner in the system.
8
- class DestroyPartner < Rectify::Command
8
+ class DestroyPartner < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # conference_partner - the Partner to destroy
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when destroying a conference
7
7
  # registration type in the system.
8
- class DestroyRegistrationType < Rectify::Command
8
+ class DestroyRegistrationType < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # registration_type - the Partner to destroy
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # This command is executed when the user exports the registrations of
7
7
  # a Conference from the admin panel.
8
- class ExportConferenceRegistrations < Rectify::Command
8
+ class ExportConferenceRegistrations < Decidim::Command
9
9
  # conference - The current instance of the page to be closed.
10
10
  # format - a string representing the export format
11
11
  # current_user - the user performing the action
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic to invite users to join a conference.
7
7
  #
8
- class InviteUserToJoinConference < Rectify::Command
8
+ class InviteUserToJoinConference < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # form - A form object with the params.
@@ -86,21 +86,19 @@ module Decidim
86
86
  end
87
87
 
88
88
  def user
89
- @user ||= begin
90
- if form.existing_user
91
- form.user
92
- else
93
- Decidim::User.find_or_initialize_by(
94
- organization: form.current_organization,
95
- email: form.email.downcase
96
- )
97
- end
98
- end
89
+ @user ||= if form.existing_user
90
+ form.user
91
+ else
92
+ Decidim::User.find_or_initialize_by(
93
+ organization: form.current_organization,
94
+ email: form.email.downcase
95
+ )
96
+ end
99
97
  end
100
98
 
101
99
  def invite_user_to_sign_up
102
100
  user.skip_reconfirmation!
103
- 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: conference)
104
102
  end
105
103
  end
106
104
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  module Admin
6
6
  # A command to notify users when a role is assigned for a Conference
7
- class NotifyRoleAssignedToConference < Rectify::Command
7
+ class NotifyRoleAssignedToConference < Decidim::Command
8
8
  def send_notification(user)
9
9
  Decidim::EventsManager.publish(
10
10
  event: "decidim.events.conferences.role_assigned",
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  module Admin
6
6
  # A command that sets an conference as published.
7
- class PublishConference < Rectify::Command
7
+ class PublishConference < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # conference - A Conference that will be published
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  module Admin
6
6
  # This command gets called when a registration_type is published from the admin panel.
7
- class PublishRegistrationType < Rectify::Command
7
+ class PublishRegistrationType < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # registration_type - The registration_type to publish.
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic to send diplomas to registered conference users.
7
7
  #
8
- class SendConferenceDiplomas < Rectify::Command
8
+ class SendConferenceDiplomas < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # conference - The conference which the user is invited to.
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  module Admin
6
6
  # A command that sets an conference as unpublished.
7
- class UnpublishConference < Rectify::Command
7
+ class UnpublishConference < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # conference - A Conference that will be published
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  module Admin
6
6
  # This command gets called when a registration type is unpublished from the admin panel.
7
- class UnpublishRegistrationType < Rectify::Command
7
+ class UnpublishRegistrationType < Decidim::Command
8
8
  # Public: Initializes the command.
9
9
  #
10
10
  # registration_type - The registration_type to unpublish.
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when creating a new participatory
7
7
  # conference in the system.
8
- class UpdateConference < Rectify::Command
8
+ class UpdateConference < Decidim::Command
9
9
  include ::Decidim::AttachmentAttributesMethods
10
10
 
11
11
  # Public: Initializes the command.
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when updating a conference
7
7
  # speaker in the system.
8
- class UpdateConferenceSpeaker < Rectify::Command
8
+ class UpdateConferenceSpeaker < Decidim::Command
9
9
  include ::Decidim::AttachmentAttributesMethods
10
10
 
11
11
  # Public: Initializes the command.
@@ -55,13 +55,13 @@ module Decidim
55
55
 
56
56
  def attributes
57
57
  form.attributes.slice(
58
- :full_name,
59
- :twitter_handle,
60
- :personal_url,
61
- :position,
62
- :affiliation,
63
- :short_bio
64
- ).merge(
58
+ "full_name",
59
+ "twitter_handle",
60
+ "personal_url",
61
+ "position",
62
+ "affiliation",
63
+ "short_bio"
64
+ ).symbolize_keys.merge(
65
65
  user: form.user
66
66
  ).merge(
67
67
  attachment_attributes(:avatar)
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  module Admin
6
6
  # This command is executed when the user updates the conference diploma configuration.
7
- class UpdateDiploma < Rectify::Command
7
+ class UpdateDiploma < Decidim::Command
8
8
  # Initializes a UpdateDiploma Command.
9
9
  #
10
10
  # form - The form from which to get the data.
@@ -18,9 +18,9 @@ module Decidim
18
18
  #
19
19
  # Broadcasts :ok if successful, :invalid otherwise.
20
20
  def call
21
- @conference.with_lock do
22
- return broadcast(:invalid) if form.invalid?
21
+ return broadcast(:invalid) if form.invalid?
23
22
 
23
+ @conference.with_lock do
24
24
  update_conference_diploma
25
25
  Decidim.traceability.perform_action!(:update_diploma, @conference, form.current_user) do
26
26
  @conference
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when updating a conference
7
7
  # speaker in the system.
8
- class UpdateMediaLink < Rectify::Command
8
+ class UpdateMediaLink < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # form - A form object with the params.
@@ -50,11 +50,11 @@ module Decidim
50
50
  media_link,
51
51
  form.current_user,
52
52
  form.attributes.slice(
53
- :title,
54
- :link,
55
- :weight,
56
- :date
57
- ),
53
+ "title",
54
+ "link",
55
+ "weight",
56
+ "date"
57
+ ).symbolize_keys,
58
58
  log_info
59
59
  )
60
60
  end
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when updating a conference
7
7
  # partner in the system.
8
- class UpdatePartner < Rectify::Command
8
+ class UpdatePartner < Decidim::Command
9
9
  include ::Decidim::AttachmentAttributesMethods
10
10
 
11
11
  # Public: Initializes the command.
@@ -51,11 +51,11 @@ module Decidim
51
51
 
52
52
  def attributes
53
53
  form.attributes.slice(
54
- :name,
55
- :weight,
56
- :partner_type,
57
- :link
58
- ).merge(
54
+ "name",
55
+ "weight",
56
+ "partner_type",
57
+ "link"
58
+ ).symbolize_keys.merge(
59
59
  attachment_attributes(:logo)
60
60
  )
61
61
  end
@@ -5,7 +5,7 @@ module Decidim
5
5
  module Admin
6
6
  # A command with all the business logic when updating a conference
7
7
  # registration type in the system.
8
- class UpdateRegistrationType < Rectify::Command
8
+ class UpdateRegistrationType < Decidim::Command
9
9
  # Public: Initializes the command.
10
10
  #
11
11
  # form - A form object with the params.
@@ -51,11 +51,11 @@ module Decidim
51
51
  registration_type,
52
52
  form.current_user,
53
53
  form.attributes.slice(
54
- :title,
55
- :description,
56
- :price,
57
- :weight
58
- ),
54
+ "title",
55
+ "description",
56
+ "price",
57
+ "weight"
58
+ ).symbolize_keys,
59
59
  log_info
60
60
  )
61
61
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  # This command is executed when the user declines an invite to the conference.
6
- class DeclineInvitation < Rectify::Command
6
+ class DeclineInvitation < Decidim::Command
7
7
  # Initializes a DeclineInvitation Command.
8
8
  #
9
9
  # conference - The current instance of the conference where user has been invited.
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  # This command is executed when the user joins a conference.
6
- class JoinConference < Rectify::Command
6
+ class JoinConference < Decidim::Command
7
7
  # Initializes a JoinConference Command.
8
8
  #
9
9
  # conference - The current instance of the conference to be joined.
@@ -21,11 +21,8 @@ module Decidim
21
21
  # Broadcasts :ok if successful, :invalid otherwise.
22
22
  def call
23
23
  return broadcast(:invalid) unless can_join_conference?
24
- return broadcast(:ok) if already_joined_conference?
25
24
 
26
25
  conference.with_lock do
27
- return broadcast(:invalid) unless can_join_conference?
28
-
29
26
  create_registration
30
27
  create_meetings_registrations
31
28
  accept_invitation
@@ -61,10 +58,6 @@ module Decidim
61
58
  conference.registrations_enabled? && conference.has_available_slots?
62
59
  end
63
60
 
64
- def already_joined_conference?
65
- conference.conference_registrations.where(user: user).any?
66
- end
67
-
68
61
  def send_email_pending_validation
69
62
  Decidim::Conferences::ConferenceRegistrationMailer.pending_validation(user, conference, @registration_type).deliver_later
70
63
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  # This command is executed when the user leaves a conference.
6
- class LeaveConference < Rectify::Command
6
+ class LeaveConference < Decidim::Command
7
7
  # Initializes a LeaveConference Command.
8
8
  #
9
9
  # conference - The current instance of the conference to be left.
@@ -20,10 +20,10 @@ module Decidim
20
20
  #
21
21
  # Broadcasts :ok if successful, :invalid otherwise.
22
22
  def call
23
- @conference.with_lock do
24
- return broadcast(:invalid) unless registration
25
- return broadcast(:invalid) unless meetings_registrations
23
+ return broadcast(:invalid) unless registration
24
+ return broadcast(:invalid) unless meetings_registrations
26
25
 
26
+ @conference.with_lock do
27
27
  destroy_registration
28
28
  destroy_meeting_registration
29
29
  end
@@ -10,31 +10,29 @@ module Decidim
10
10
 
11
11
  helper_method :conference
12
12
 
13
- alias conference current_participatory_space
14
-
15
13
  def index
16
- enforce_permission_to(:read_invites, :conference, conference: current_participatory_space)
14
+ enforce_permission_to :read_invites, :conference, conference: conference
17
15
 
18
16
  @query = params[:q]
19
17
  @status = params[:status]
20
- @conference_invites = Decidim::Conferences::Admin::ConferenceInvites.for(current_participatory_space.conference_invites, @query, @status).page(params[:page]).per(15)
18
+ @conference_invites = Decidim::Conferences::Admin::ConferenceInvites.for(conference.conference_invites, @query, @status).page(params[:page]).per(15)
21
19
  end
22
20
 
23
21
  def new
24
- enforce_permission_to(:invite_attendee, :conference, conference: current_participatory_space)
22
+ enforce_permission_to :invite_attendee, :conference, conference: conference
25
23
 
26
24
  @form = form(ConferenceRegistrationInviteForm).instance
27
25
  end
28
26
 
29
27
  def create
30
- enforce_permission_to(:invite_attendee, :conference, conference: current_participatory_space)
28
+ enforce_permission_to :invite_attendee, :conference, conference: conference
31
29
 
32
30
  @form = form(ConferenceRegistrationInviteForm).from_params(params)
33
31
 
34
- InviteUserToJoinConference.call(@form, current_participatory_space, current_user) do
32
+ InviteUserToJoinConference.call(@form, conference, current_user) do
35
33
  on(:ok) do
36
34
  flash[:notice] = I18n.t("conference_invites.create.success", scope: "decidim.conferences.admin")
37
- redirect_to conference_conference_invites_path(current_participatory_space)
35
+ redirect_to conference_conference_invites_path(conference)
38
36
  end
39
37
 
40
38
  on(:invalid) do
@@ -43,6 +41,12 @@ module Decidim
43
41
  end
44
42
  end
45
43
  end
44
+
45
+ private
46
+
47
+ def conference
48
+ @conference ||= Decidim::Conference.find_by(slug: params[:conference_slug])
49
+ end
46
50
  end
47
51
  end
48
52
  end