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
@@ -11,18 +11,16 @@ module Decidim
11
11
 
12
12
  helper_method :conference
13
13
 
14
- alias conference current_participatory_space
15
-
16
14
  def index
17
- enforce_permission_to(:read_conference_registrations, :conference, conference: current_participatory_space)
15
+ enforce_permission_to :read_conference_registrations, :conference, conference: conference
18
16
 
19
- @conference_registrations = paginate(current_participatory_space.conference_registrations)
17
+ @conference_registrations = paginate(Decidim::Conferences::ConferenceRegistration.where(conference: conference))
20
18
  end
21
19
 
22
20
  def export
23
- enforce_permission_to(:export_conference_registrations, :conference, conference: current_participatory_space)
21
+ enforce_permission_to :export_conference_registrations, :conference, conference: conference
24
22
 
25
- ExportConferenceRegistrations.call(current_participatory_space, params[:format], current_user) do
23
+ ExportConferenceRegistrations.call(conference, params[:format], current_user) do
26
24
  on(:ok) do |export_data|
27
25
  send_data export_data.read, type: "text/#{export_data.extension}", filename: export_data.filename("conference_registrations")
28
26
  end
@@ -30,7 +28,7 @@ module Decidim
30
28
  end
31
29
 
32
30
  def confirm
33
- enforce_permission_to(:confirm, :conference_registration, conference_registration: conference_registration)
31
+ enforce_permission_to :confirm, :conference_registration, conference_registration: conference_registration
34
32
 
35
33
  ConfirmConferenceRegistration.call(conference_registration, current_user) do
36
34
  on(:ok) do
@@ -47,10 +45,14 @@ module Decidim
47
45
 
48
46
  private
49
47
 
48
+ def conference
49
+ @conference ||= Decidim::Conference.find_by(slug: params[:conference_slug])
50
+ end
51
+
50
52
  def conference_registration
51
53
  return if params[:id].blank?
52
54
 
53
- @conference_registration ||= current_participatory_space.conference_registrations.find_by(id: params[:id])
55
+ @conference_registration ||= conference.conference_registrations.find_by(id: params[:id])
54
56
  end
55
57
  end
56
58
  end
@@ -6,11 +6,10 @@ module Decidim
6
6
  # Controller that allows managing conference speakers.
7
7
  #
8
8
  class ConferenceSpeakersController < Decidim::Conferences::Admin::ApplicationController
9
+ helper Decidim::Conferences::Admin::ConferenceSpeakersHelper
9
10
  include Concerns::ConferenceAdmin
10
11
  include Decidim::Paginable
11
12
 
12
- helper_method :conference_speaker, :meetings_selected
13
-
14
13
  def index
15
14
  enforce_permission_to :index, :conference_speaker
16
15
 
@@ -42,15 +41,17 @@ module Decidim
42
41
  end
43
42
 
44
43
  def edit
45
- enforce_permission_to :update, :conference_speaker, speaker: conference_speaker
46
- @form = form(ConferenceSpeakerForm).from_model(conference_speaker)
44
+ @item = collection.find(params[:id])
45
+ enforce_permission_to :update, :conference_speaker, speaker: @item
46
+ @form = form(ConferenceSpeakerForm).from_model(@item)
47
47
  end
48
48
 
49
49
  def update
50
- enforce_permission_to :update, :conference_speaker, speaker: conference_speaker
50
+ @conference_speaker = collection.find(params[:id])
51
+ enforce_permission_to :update, :conference_speaker, speaker: @conference_speaker
51
52
  @form = form(ConferenceSpeakerForm).from_params(params)
52
53
 
53
- UpdateConferenceSpeaker.call(@form, conference_speaker) do
54
+ UpdateConferenceSpeaker.call(@form, @conference_speaker) do
54
55
  on(:ok) do
55
56
  flash[:notice] = I18n.t("conference_speakers.update.success", scope: "decidim.admin")
56
57
  redirect_to conference_speakers_path(current_conference)
@@ -64,9 +65,10 @@ module Decidim
64
65
  end
65
66
 
66
67
  def destroy
67
- enforce_permission_to :destroy, :conference_speaker, speaker: conference_speaker
68
+ @conference_speaker = collection.find(params[:id])
69
+ enforce_permission_to :destroy, :conference_speaker, speaker: @conference_speaker
68
70
 
69
- DestroyConferenceSpeaker.call(conference_speaker, current_user) do
71
+ DestroyConferenceSpeaker.call(@conference_speaker, current_user) do
70
72
  on(:ok) do
71
73
  flash[:notice] = I18n.t("conference_speakers.destroy.success", scope: "decidim.admin")
72
74
  redirect_to conference_speakers_path(current_conference)
@@ -76,16 +78,8 @@ module Decidim
76
78
 
77
79
  private
78
80
 
79
- def meetings_selected
80
- @meetings_selected ||= @conference_speaker.conference_meetings.pluck(:id) if @conference_speaker.present?
81
- end
82
-
83
- def conference_speaker
84
- @conference_speaker ||= collection.find(params[:id])
85
- end
86
-
87
81
  def collection
88
- @collection ||= current_conference.speakers
82
+ @collection ||= Decidim::ConferenceSpeaker.where(conference: current_conference)
89
83
  end
90
84
  end
91
85
  end
@@ -75,7 +75,7 @@ module Decidim
75
75
  private
76
76
 
77
77
  def collection
78
- @collection ||= current_conference.media_links
78
+ @collection ||= Decidim::Conferences::MediaLink.where(conference: current_conference)
79
79
  end
80
80
  end
81
81
  end
@@ -76,7 +76,7 @@ module Decidim
76
76
  private
77
77
 
78
78
  def collection
79
- @collection ||= current_conference.partners
79
+ @collection ||= Decidim::Conferences::Partner.where(conference: current_conference)
80
80
  end
81
81
  end
82
82
  end
@@ -45,7 +45,7 @@ module Decidim
45
45
  private
46
46
 
47
47
  def collection
48
- @collection ||= current_conference.registration_types
48
+ @collection ||= Decidim::Conferences::RegistrationType.where(conference: current_conference)
49
49
  end
50
50
  end
51
51
  end
@@ -77,7 +77,7 @@ module Decidim
77
77
  private
78
78
 
79
79
  def collection
80
- @collection ||= current_conference.registration_types
80
+ @collection ||= Decidim::Conferences::RegistrationType.where(conference: current_conference)
81
81
  end
82
82
  end
83
83
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Conferences
5
+ module Admin
6
+ # This controller allows to send reminders.
7
+ # It is targeted for customizations for reminder things that lives under
8
+ # a conference.
9
+ class RemindersController < Decidim::Admin::RemindersController
10
+ include Concerns::ConferenceAdmin
11
+ end
12
+ end
13
+ end
14
+ end
@@ -26,9 +26,9 @@ module Decidim
26
26
  end
27
27
 
28
28
  def meetings
29
- return unless meeting_component&.published? || !meeting_component.presence
29
+ return unless meeting_component.published? || !meeting_component.presence
30
30
 
31
- @meetings ||= Decidim::Meetings::Meeting.where(component: meeting_component).visible_meeting_for(current_user).order(:start_time)
31
+ @meetings ||= Decidim::Meetings::Meeting.where(component: meeting_component).visible_for(current_user).order(:start_time)
32
32
  end
33
33
 
34
34
  def meeting_days
@@ -4,8 +4,6 @@ module Decidim
4
4
  module Conferences
5
5
  # Exposes the registration resource so users can join and leave conferences.
6
6
  class ConferenceRegistrationsController < Decidim::Conferences::ApplicationController
7
- before_action :ensure_signed_in
8
-
9
7
  def create
10
8
  enforce_permission_to :join, :conference, conference: conference
11
9
 
@@ -56,22 +54,8 @@ module Decidim
56
54
 
57
55
  private
58
56
 
59
- def ensure_signed_in
60
- return if user_signed_in?
61
-
62
- case action_name
63
- when "create"
64
- flash[:alert] = t("conference_registrations.create.unauthorized", scope: "decidim.conferences")
65
- when "decline_invitation"
66
- flash[:alert] = t("conference_registrations.decline_invitation.unauthorized", scope: "decidim.conferences")
67
- else
68
- raise Decidim::ActionForbidden
69
- end
70
- redirect_to(user_has_no_permission_referer || user_has_no_permission_path)
71
- end
72
-
73
57
  def conference
74
- @conference ||= Conference.find_by(slug: params[:conference_slug], organization: current_organization)
58
+ @conference ||= Conference.find_by(slug: params[:conference_slug])
75
59
  end
76
60
 
77
61
  def registration_type
@@ -81,7 +65,6 @@ module Decidim
81
65
  def redirect_after_path
82
66
  referer = request.headers["Referer"]
83
67
  return redirect_to(conference_path(conference)) if referer =~ /invitation_token/
84
- return redirect_to(conference_path(conference)) if referer =~ %r{users/sign_in}
85
68
 
86
69
  redirect_back fallback_location: conference_path(conference)
87
70
  end
@@ -6,7 +6,7 @@ module Decidim
6
6
  include Decidim::Events::NotificationEvent
7
7
 
8
8
  def notification_title
9
- I18n.t("notification_title", i18n_options).html_safe
9
+ I18n.t("notification_title", **i18n_options).html_safe
10
10
  end
11
11
 
12
12
  def i18n_options
@@ -7,7 +7,7 @@ module Decidim
7
7
  include Decidim::Events::AuthorEvent
8
8
 
9
9
  def notification_title
10
- I18n.t("notification_title", i18n_options).html_safe
10
+ I18n.t("notification_title", **i18n_options).html_safe
11
11
  end
12
12
 
13
13
  def i18n_role
@@ -14,7 +14,7 @@ module Decidim
14
14
  attribute :existing_user, Boolean, default: false
15
15
 
16
16
  validates :name, presence: true, unless: proc { |object| object.existing_user }
17
- validates :email, presence: true, 'valid_email_2/email': { disposable: true }, unless: proc { |object| object.existing_user }
17
+ validates :email, presence: true, "valid_email_2/email": { disposable: true }, unless: proc { |object| object.existing_user }
18
18
  validates :user, presence: true, if: proc { |object| object.existing_user }
19
19
 
20
20
  def user
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Conferences
5
+ module Admin
6
+ # Helpers related to the Conferences Speakers admin layout.
7
+ module ConferenceSpeakersHelper
8
+ def meetings_selected
9
+ @meetings_selected ||= @conference_speaker.conference_meetings.pluck(:id) if @conference_speaker.present?
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -35,8 +35,8 @@ module Decidim
35
35
  def add_diploma_attachment
36
36
  diploma = WickedPdf.new.pdf_from_string(
37
37
  render_to_string(pdf: "conference-diploma",
38
- template: "decidim/conferences/admin/send_conference_diploma_mailer/diploma_user.html.erb",
39
- layout: "decidim/diploma.html.erb"),
38
+ template: "decidim/conferences/admin/send_conference_diploma_mailer/diploma_user",
39
+ layout: "decidim/diploma"),
40
40
  orientation: "Landscape"
41
41
  )
42
42
 
@@ -19,6 +19,7 @@ module Decidim
19
19
  include Decidim::Searchable
20
20
  include Decidim::HasUploadValidations
21
21
  include Decidim::TranslatableResource
22
+ include Decidim::FilterableResource
22
23
 
23
24
  translatable_fields :title, :slogan, :short_description, :description, :objectives, :registration_terms
24
25
 
@@ -140,8 +141,6 @@ module Decidim
140
141
  end
141
142
 
142
143
  # Allow ransacker to search for a key in a hstore column (`title`.`en`)
143
- ransacker :title do |parent|
144
- Arel::Nodes::InfixOperation.new("->>", parent.table[:title], Arel::Nodes.build_quoted(I18n.locale.to_s))
145
- end
144
+ ransacker_i18n :title
146
145
  end
147
146
  end
@@ -6,7 +6,7 @@ module Decidim
6
6
  class ConferenceInvite < ApplicationRecord
7
7
  include Decidim::Traceable
8
8
  include Decidim::Loggable
9
- include Decidim::DataPortability
9
+ include Decidim::DownloadYourData
10
10
 
11
11
  belongs_to :conference, foreign_key: "decidim_conference_id", class_name: "Decidim::Conference"
12
12
  belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"
@@ -15,7 +15,7 @@ module Decidim
15
15
  validates :user, uniqueness: { scope: :conference }
16
16
 
17
17
  def self.export_serializer
18
- Decidim::Conferences::DataPortabilityConferenceInviteSerializer
18
+ Decidim::Conferences::DownloadYourDataConferenceInviteSerializer
19
19
  end
20
20
 
21
21
  def self.log_presenter_class_for(_log)
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  # The data store for a Registration in the Decidim::Conferences component.
6
6
  class ConferenceRegistration < ApplicationRecord
7
- include Decidim::DataPortability
7
+ include Decidim::DownloadYourData
8
8
 
9
9
  belongs_to :conference, foreign_key: "decidim_conference_id", class_name: "Decidim::Conference"
10
10
  belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"
@@ -19,7 +19,7 @@ module Decidim
19
19
  end
20
20
 
21
21
  def self.export_serializer
22
- Decidim::Conferences::DataPortabilityConferenceRegistrationSerializer
22
+ Decidim::Conferences::DownloadYourDataConferenceRegistrationSerializer
23
23
  end
24
24
 
25
25
  def confirmed?
@@ -77,7 +77,6 @@ module Decidim
77
77
  end
78
78
 
79
79
  def can_decline_invitation?
80
- return unless user
81
80
  return unless conference.presence
82
81
  return unless conference.registrations_enabled? &&
83
82
  conference.conference_invites.exists?(user: user) &&
@@ -46,11 +46,9 @@ module Decidim
46
46
  private
47
47
 
48
48
  def user
49
- @user ||= begin
50
- if (user = __getobj__.user.presence)
51
- Decidim::UserPresenter.new(user)
52
- end
53
- end
49
+ @user ||= if (user = __getobj__.user.presence)
50
+ Decidim::UserPresenter.new(user)
51
+ end
54
52
  end
55
53
  end
56
54
  end
@@ -4,9 +4,12 @@ module Decidim
4
4
  module Conferences
5
5
  # A presenter to render statistics in the homepage.
6
6
  class ConferenceStatsPresenter < Decidim::StatsPresenter
7
- attribute :conference, Decidim::Conference
8
7
  include IconHelper
9
8
 
9
+ def conference
10
+ __getobj__.fetch(:conference)
11
+ end
12
+
10
13
  # Public: Render a collection of primary stats.
11
14
  def highlighted
12
15
  highlighted_stats = component_stats(priority: StatsRegistry::HIGH_PRIORITY)
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  module Admin
6
6
  # A class used to find the admins for an conference or an organization conferences.
7
- class AdminUsers < Rectify::Query
7
+ class AdminUsers < Decidim::Query
8
8
  # Syntactic sugar to initialize the class and return the queried objects.
9
9
  #
10
10
  # conference - an conference that needs to find its conference admins
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  module Admin
6
6
  # A class used to find the ConferenceInvites by their status status.
7
- class ConferenceInvites < Rectify::Query
7
+ class ConferenceInvites < Decidim::Query
8
8
  # Syntactic sugar to initialize the class and return the queried objects.
9
9
  #
10
10
  # conference_invites - the initial Invites relation that needs to be filtered.
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  module Admin
6
6
  # A class used to find the ConferenceSpeakers's by the search.
7
- class ConferenceSpeakers < Rectify::Query
7
+ class ConferenceSpeakers < Decidim::Query
8
8
  # Syntactic sugar to initialize the class and return the queried objects.
9
9
  #
10
10
  # conference_speakers - the initial ConferenceSpeaker relation that needs to be filtered.
@@ -3,14 +3,14 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  # This query class filters meetings for component and day
6
- class ConferenceProgramMeetings < Rectify::Query
6
+ class ConferenceProgramMeetings < Decidim::Query
7
7
  def initialize(component, user = nil)
8
8
  @component = component
9
9
  @user = user
10
10
  end
11
11
 
12
12
  def query
13
- Decidim::Meetings::Meeting.where(component: @component).visible_meeting_for(@user)
13
+ Decidim::Meetings::Meeting.where(component: @component).visible_for(@user)
14
14
  end
15
15
  end
16
16
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  # This query class filters meetings for component and day
6
- class ConferenceProgramMeetingsByDay < Rectify::Query
6
+ class ConferenceProgramMeetingsByDay < Decidim::Query
7
7
  def initialize(component, day, user = nil)
8
8
  @component = component
9
9
  @day = day
@@ -11,9 +11,9 @@ module Decidim
11
11
  end
12
12
 
13
13
  def query
14
- Rectify::Query.merge(
14
+ Decidim::Query.merge(
15
15
  ConferenceProgramMeetings.new(@component, @user)
16
- ).query.where(start_time: @day.beginning_of_day..@day.end_of_day).order(start_time: :asc)
16
+ ).query.where(start_time: @day.all_day).order(start_time: :asc)
17
17
  end
18
18
  end
19
19
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  # A class used to find the Conferences that the given user has
6
6
  # the specific role privilege.
7
- class ConferencesWithUserRole < Rectify::Query
7
+ class ConferencesWithUserRole < Decidim::Query
8
8
  # Syntactic sugar to initialize the class and return the queried objects.
9
9
  #
10
10
  # user - a User that needs to find which conferences can manage
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  # This query class filters all conferences given an organization.
6
- class OrganizationConferences < Rectify::Query
6
+ class OrganizationConferences < Decidim::Query
7
7
  def initialize(organization)
8
8
  @organization = organization
9
9
  end
@@ -4,17 +4,17 @@ module Decidim
4
4
  module Conferences
5
5
  # This query class filters public conferences given an organization in a
6
6
  # meaningful prioritized order.
7
- class OrganizationPrioritizedConferences < Rectify::Query
7
+ class OrganizationPrioritizedConferences < Decidim::Query
8
8
  def initialize(organization, user = nil)
9
9
  @organization = organization
10
10
  @user = user
11
11
  end
12
12
 
13
13
  def query
14
- Rectify::Query.merge(
14
+ Decidim::Query.merge(
15
15
  OrganizationPublishedConferences.new(@organization, @user),
16
16
  PrioritizedConferences.new
17
- ).query
17
+ ).query.with_attached_hero_image
18
18
  end
19
19
  end
20
20
  end
@@ -3,18 +3,18 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  # This query class filters published conferences given an organization.
6
- class OrganizationPublishedConferences < Rectify::Query
6
+ class OrganizationPublishedConferences < Decidim::Query
7
7
  def initialize(organization, user = nil)
8
8
  @organization = organization
9
9
  @user = user
10
10
  end
11
11
 
12
12
  def query
13
- Rectify::Query.merge(
13
+ Decidim::Query.merge(
14
14
  OrganizationConferences.new(@organization),
15
15
  VisibleConferences.new(@user),
16
16
  PublishedConferences.new
17
- ).query.order(start_date: :desc)
17
+ ).query
18
18
  end
19
19
  end
20
20
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  # This query orders conferences by importance, prioritizing promoted
6
6
  # conferences.
7
- class PrioritizedConferences < Rectify::Query
7
+ class PrioritizedConferences < Decidim::Query
8
8
  def query
9
9
  Decidim::Conference.order(promoted: :desc)
10
10
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  # This query filters conferences so only promoted ones are returned.
6
- class PromotedConferences < Rectify::Query
6
+ class PromotedConferences < Decidim::Query
7
7
  def query
8
8
  Decidim::Conference.promoted
9
9
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  # This query filters published conferences only.
6
- class PublishedConferences < Rectify::Query
6
+ class PublishedConferences < Decidim::Query
7
7
  def query
8
8
  Decidim::Conference.published
9
9
  end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  # This query class filters conferences given a current_user.
6
- class VisibleConferences < Rectify::Query
6
+ class VisibleConferences < Decidim::Query
7
7
  def query
8
8
  Decidim::Conference.public_spaces
9
9
  end
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Decidim
4
4
  module Conferences
5
- class DataPortabilityConferenceInviteSerializer < Decidim::Exporters::Serializer
6
- # Serializes a conference invite for data portability
5
+ class DownloadYourDataConferenceInviteSerializer < Decidim::Exporters::Serializer
6
+ # Serializes a conference invite for download your data
7
7
  def serialize
8
8
  {
9
9
  id: resource.id,
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Decidim
4
4
  module Conferences
5
- class DataPortabilityConferenceRegistrationSerializer < Decidim::Exporters::Serializer
6
- # Serializes a registration for data portability
5
+ class DownloadYourDataConferenceRegistrationSerializer < Decidim::Exporters::Serializer
6
+ # Serializes a registration for download your data
7
7
  def serialize
8
8
  {
9
9
  id: resource.id,
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t("conference_copies.new.title", scope: "decidim.admin")) %>
2
1
  <%= decidim_form_for(@form, url: conference_copies_path(current_conference), method: :post, html: { class: "form copy_conference" }) do |f| %>
3
2
  <%= render partial: "form", object: f, locals: { title: t("conference_copies.new.title", scope: "decidim.admin"), select: t("conference_copies.new.select", scope: "decidim.admin") } %>
4
3
 
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t(".invites")) %>
2
1
  <div class="filters row">
3
2
  <div class="column medium-3">
4
3
  <span class="dropdown-menu-inverted_label"><%= t(".filter_by") %> :</span>
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t(".new_invite")) %>
2
1
  <h2 class="process-title-summary">
3
2
  <%= t(".new_invite") %>
4
3
  </h2>
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t(".registrations")) %>
2
1
  <div class="card" id="conference-registrations">
3
2
  <div class="card-divider">
4
3
  <h2 class="card-title">
@@ -1,5 +1,4 @@
1
- <% add_decidim_page_title(t("conference_speakers.edit.title", scope: "decidim.admin")) %>
2
- <%= decidim_form_for(@form, url: conference_speaker_path(conference_speaker.conference, conference_speaker), html: { class: "form edit_conference_speaker" }) do |f| %>
1
+ <%= decidim_form_for(@form, url: conference_speaker_path(@item.conference, @item), html: { class: "form edit_conference_speaker" }) do |f| %>
3
2
  <%= render partial: "form", object: f, locals: { title: t("conference_speakers.edit.title", scope: "decidim.admin") } %>
4
3
 
5
4
  <div class="button--double form-general-submit">
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t("conference_speakers.index.conference_speakers_title", scope: "decidim.admin")) %>
2
1
  <div class="filters row">
3
2
  <div class="column medium-4">
4
3
  <%= form_tag "", method: :get do %>
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t("conference_speakers.new.title", scope: "decidim.admin")) %>
2
1
  <%= decidim_form_for(@form, html: { class: "form new_conference_speaker" }) do |f| %>
3
2
  <%= render partial: "form", object: f, locals: { title: t("conference_speakers.new.title", scope: "decidim.admin") } %>
4
3
 
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t("conference_user_roles.edit.title", scope: "decidim.admin")) %>
2
1
  <%= decidim_form_for(@form, url: conference_user_role_path(@user_role.conference, @user_role), html: { class: "form edit_conference_user_roles" }) do |f| %>
3
2
  <%= render partial: "form", object: f, locals: { title: t("conference_user_roles.edit.title", scope: "decidim.admin") } %>
4
3
 
@@ -1,4 +1,3 @@
1
- <% add_decidim_page_title(t("conference_user_roles.index.conference_admins_title", scope: "decidim.admin")) %>
2
1
  <div class='card' id="conference_admins">
3
2
  <div class="card-divider">
4
3
  <h2 class="card-title">