decidim-conferences 0.28.5 → 0.29.0.rc1

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 (125) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/conferences/conference_g_cell.rb +2 -2
  3. data/app/cells/decidim/conferences/conference_speaker_cell.rb +1 -1
  4. data/app/cells/decidim/conferences/content_blocks/highlighted_conferences_cell.rb +0 -2
  5. data/app/cells/decidim/conferences/linked_participatory_spaces_cell.rb +0 -1
  6. data/app/cells/decidim/conferences/media_link/show.erb +1 -1
  7. data/app/cells/decidim/conferences/media_link_cell.rb +0 -3
  8. data/app/cells/decidim/conferences/partner/image.erb +1 -1
  9. data/app/cells/decidim/conferences/partner_cell.rb +1 -1
  10. data/app/cells/decidim/conferences/registration_type_cell.rb +1 -5
  11. data/app/commands/decidim/conferences/admin/create_conference.rb +20 -65
  12. data/app/commands/decidim/conferences/admin/create_conference_speaker.rb +17 -81
  13. data/app/commands/decidim/conferences/admin/create_media_link.rb +10 -44
  14. data/app/commands/decidim/conferences/admin/create_partner.rb +9 -62
  15. data/app/commands/decidim/conferences/admin/create_registration_type.rb +15 -51
  16. data/app/commands/decidim/conferences/admin/destroy_conference_speaker.rb +6 -38
  17. data/app/commands/decidim/conferences/admin/destroy_media_link.rb +6 -38
  18. data/app/commands/decidim/conferences/admin/destroy_partner.rb +6 -38
  19. data/app/commands/decidim/conferences/admin/destroy_registration_type.rb +6 -38
  20. data/app/commands/decidim/conferences/admin/publish_conference_speaker.rb +51 -0
  21. data/app/commands/decidim/conferences/admin/unpublish_conference_speaker.rb +44 -0
  22. data/app/commands/decidim/conferences/admin/update_conference.rb +35 -93
  23. data/app/commands/decidim/conferences/admin/update_conference_speaker.rb +17 -74
  24. data/app/commands/decidim/conferences/admin/update_media_link.rb +8 -44
  25. data/app/commands/decidim/conferences/admin/update_partner.rb +10 -61
  26. data/app/commands/decidim/conferences/admin/update_registration_type.rb +12 -47
  27. data/app/controllers/concerns/decidim/conferences/admin/conferences_invites/filterable.rb +41 -0
  28. data/app/controllers/decidim/conferences/admin/conference_invites_controller.rb +8 -3
  29. data/app/controllers/decidim/conferences/admin/conference_speakers_controller.rb +33 -1
  30. data/app/controllers/decidim/conferences/admin/conferences_controller.rb +1 -1
  31. data/app/controllers/decidim/conferences/admin/media_links_controller.rb +1 -1
  32. data/app/controllers/decidim/conferences/admin/partners_controller.rb +1 -1
  33. data/app/controllers/decidim/conferences/admin/registration_types_controller.rb +1 -1
  34. data/app/controllers/decidim/conferences/application_controller.rb +4 -1
  35. data/app/controllers/decidim/conferences/conference_program_controller.rb +1 -2
  36. data/app/controllers/decidim/conferences/conference_speakers_controller.rb +1 -4
  37. data/app/controllers/decidim/conferences/conferences_controller.rb +1 -4
  38. data/app/controllers/decidim/conferences/media_controller.rb +1 -4
  39. data/app/controllers/decidim/conferences/registration_types_controller.rb +0 -3
  40. data/app/events/decidim/conferences/conference_role_assigned_event.rb +0 -5
  41. data/app/forms/decidim/conferences/admin/conference_form.rb +5 -5
  42. data/app/forms/decidim/conferences/admin/conference_speaker_form.rb +1 -1
  43. data/app/forms/decidim/conferences/admin/registration_type_form.rb +1 -1
  44. data/app/helpers/decidim/conferences/conference_helper.rb +2 -1
  45. data/app/mailers/decidim/conferences/admin/send_conference_diploma_mailer.rb +5 -9
  46. data/app/models/decidim/conference.rb +2 -2
  47. data/app/models/decidim/conference_speaker.rb +2 -0
  48. data/app/permissions/decidim/conferences/permissions.rb +2 -2
  49. data/app/presenters/decidim/conferences/admin_log/conference_speaker_presenter.rb +2 -1
  50. data/app/views/decidim/conferences/admin/conference_invites/_form.html.erb +5 -5
  51. data/app/views/decidim/conferences/admin/conference_invites/index.html.erb +1 -33
  52. data/app/views/decidim/conferences/admin/conference_registrations/index.html.erb +2 -4
  53. data/app/views/decidim/conferences/admin/conference_speakers/index.html.erb +11 -1
  54. data/app/views/decidim/conferences/admin/conference_user_roles/index.html.erb +1 -1
  55. data/app/views/decidim/conferences/admin/invite_join_conference_mailer/invite.html.erb +1 -1
  56. data/app/views/decidim/conferences/admin/media_links/index.html.erb +1 -1
  57. data/app/views/decidim/conferences/admin/media_links/new.html.erb +1 -1
  58. data/app/views/decidim/conferences/admin/partners/index.html.erb +3 -3
  59. data/app/views/decidim/conferences/admin/registration_types/index.html.erb +1 -1
  60. data/app/views/decidim/conferences/admin/send_conference_diploma_mailer/diploma_user.html.erb +7 -11
  61. data/app/views/decidim/conferences/conference_program/_program_item.html.erb +1 -1
  62. data/app/views/decidim/conferences/conference_speakers/index.html.erb +1 -0
  63. data/app/views/decidim/conferences/conferences/_conference_hero.html.erb +1 -1
  64. data/app/views/decidim/conferences/conferences/show.html.erb +5 -3
  65. data/app/views/decidim/conferences/media/index.html.erb +1 -0
  66. data/app/views/decidim/conferences/registration_types/index.html.erb +2 -1
  67. data/app/views/devise/mailer/join_conference.html.erb +1 -1
  68. data/app/views/devise/mailer/join_conference.text.erb +1 -1
  69. data/app/views/layouts/decidim/diploma.html.erb +1 -1
  70. data/config/initializers/wicked_pdf.rb +6 -4
  71. data/config/locales/ar.yml +21 -4
  72. data/config/locales/bg.yml +27 -6
  73. data/config/locales/ca.yml +18 -20
  74. data/config/locales/cs.yml +18 -21
  75. data/config/locales/de.yml +19 -21
  76. data/config/locales/el.yml +21 -6
  77. data/config/locales/en.yml +25 -27
  78. data/config/locales/es-MX.yml +18 -20
  79. data/config/locales/es-PY.yml +21 -23
  80. data/config/locales/es.yml +14 -16
  81. data/config/locales/eu.yml +169 -171
  82. data/config/locales/fi-plain.yml +17 -19
  83. data/config/locales/fi.yml +23 -25
  84. data/config/locales/fr-CA.yml +19 -21
  85. data/config/locales/fr.yml +19 -21
  86. data/config/locales/ga-IE.yml +0 -6
  87. data/config/locales/gl.yml +21 -4
  88. data/config/locales/hu.yml +21 -6
  89. data/config/locales/id-ID.yml +21 -4
  90. data/config/locales/it.yml +21 -4
  91. data/config/locales/ja.yml +17 -17
  92. data/config/locales/lb.yml +19 -6
  93. data/config/locales/lt.yml +21 -6
  94. data/config/locales/lv.yml +21 -6
  95. data/config/locales/nl.yml +21 -4
  96. data/config/locales/no.yml +21 -6
  97. data/config/locales/pl.yml +27 -6
  98. data/config/locales/pt-BR.yml +21 -51
  99. data/config/locales/pt.yml +21 -6
  100. data/config/locales/ro-RO.yml +12 -19
  101. data/config/locales/sk.yml +21 -6
  102. data/config/locales/sv.yml +52 -37
  103. data/config/locales/tr-TR.yml +21 -4
  104. data/config/locales/zh-CN.yml +21 -4
  105. data/config/locales/zh-TW.yml +21 -6
  106. data/db/migrate/20240613095855_add_published_at_to_conference_speakers.rb +7 -0
  107. data/decidim-conferences.gemspec +3 -2
  108. data/lib/decidim/api/conference_partner_type.rb +1 -1
  109. data/lib/decidim/api/conference_speaker_type.rb +1 -1
  110. data/lib/decidim/api/conference_type.rb +6 -2
  111. data/lib/decidim/conferences/admin_engine.rb +6 -1
  112. data/lib/decidim/conferences/engine.rb +1 -0
  113. data/lib/decidim/conferences/menu.rb +11 -0
  114. data/lib/decidim/conferences/seeds.rb +4 -22
  115. data/lib/decidim/conferences/test/factories.rb +5 -0
  116. data/lib/decidim/conferences/version.rb +1 -1
  117. metadata +33 -23
  118. data/app/cells/decidim/conference_activity_cell.rb +0 -10
  119. data/app/helpers/decidim/conferences/media_attachments_helper.rb +0 -19
  120. data/app/helpers/decidim/conferences/partners_helper.rb +0 -17
  121. data/app/uploaders/decidim/cw/conferences/diploma_uploader.rb +0 -14
  122. data/app/uploaders/decidim/cw/conferences/partner_logo_uploader.rb +0 -15
  123. data/app/views/layouts/decidim/conference.html.erb +0 -17
  124. data/config/locales/bn-BD.yml +0 -1
  125. data/config/locales/bs-BA.yml +0 -14
@@ -5,77 +5,26 @@ 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 < Decidim::Command
9
- include ::Decidim::AttachmentAttributesMethods
8
+ class UpdatePartner < Decidim::Commands::UpdateResource
9
+ fetch_file_attributes :logo
10
10
 
11
- # Public: Initializes the command.
12
- #
13
- # form - A form object with the params.
14
- # conference_partner - The ConferencePartner to update
15
- def initialize(form, conference_partner)
16
- @form = form
17
- @conference_partner = conference_partner
18
- end
19
-
20
- # Executes the command. Broadcasts these events:
21
- #
22
- # - :ok when everything is valid.
23
- # - :invalid if the form was not valid and we could not proceed.
24
- #
25
- # Returns nothing.
26
- def call
27
- return broadcast(:invalid) if form.invalid?
28
- return broadcast(:invalid) unless conference_partner
29
-
30
- # We are going to assign the attributes only to handle the validation of the avatar before accessing
31
- # `update_conference_partner!` which uses `update!`. Without this step, the image validation may render
32
- # an ActiveRecord::RecordInvalid error
33
- # After we assign and check if the object is valid, we reload the model to let it be handled the old way
34
- # If there is an error we add the error to the form
35
- conference_partner.assign_attributes(attributes)
36
- if conference_partner.valid?
37
- conference_partner.reload
38
-
39
- update_conference_partner!
40
- broadcast(:ok)
41
- else
42
- form.errors.add(:logo, conference_partner.errors[:logo]) if conference_partner.errors.include? :logo
11
+ fetch_form_attributes :name, :weight, :partner_type, :link
43
12
 
44
- broadcast(:invalid)
45
- end
46
- end
47
-
48
- private
13
+ protected
49
14
 
50
- attr_reader :form, :conference_partner
51
-
52
- def attributes
53
- form.attributes.slice(
54
- "name",
55
- "weight",
56
- "partner_type",
57
- "link"
58
- ).symbolize_keys.merge(
59
- attachment_attributes(:logo)
60
- )
15
+ def invalid?
16
+ form.invalid? || !resource
61
17
  end
62
18
 
63
- def update_conference_partner!
64
- log_info = {
19
+ def extra_params
20
+ {
65
21
  resource: {
66
- title: conference_partner.name
22
+ title: resource.name
67
23
  },
68
24
  participatory_space: {
69
- title: conference_partner.conference.title
25
+ title: resource.conference.title
70
26
  }
71
27
  }
72
-
73
- Decidim.traceability.update!(
74
- conference_partner,
75
- form.current_user,
76
- attributes,
77
- log_info
78
- )
79
28
  end
80
29
  end
81
30
  end
@@ -5,69 +5,34 @@ 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 < Decidim::Command
9
- # Public: Initializes the command.
10
- #
11
- # form - A form object with the params.
12
- # registration_type - The RegistrationType to update
13
- def initialize(form, registration_type)
14
- @form = form
15
- @registration_type = registration_type
16
- end
17
-
18
- # Executes the command. Broadcasts these events:
19
- #
20
- # - :ok when everything is valid.
21
- # - :invalid if the form was not valid and we could not proceed.
22
- #
23
- # Returns nothing.
24
- def call
25
- return broadcast(:invalid) if form.invalid?
26
- return broadcast(:invalid) unless registration_type
8
+ class UpdateRegistrationType < Decidim::Commands::UpdateResource
9
+ fetch_form_attributes :title, :description, :price, :weight
27
10
 
28
- transaction do
29
- update_registration_type!
30
- link_meetings(@registration_type)
31
- end
32
-
33
- broadcast(:ok)
11
+ def invalid?
12
+ form.invalid? || !resource
34
13
  end
35
14
 
36
- private
15
+ def run_after_hooks
16
+ resource.conference_meetings = conference_meetings(resource)
17
+ end
37
18
 
38
- attr_reader :form, :registration_type
19
+ protected
39
20
 
40
- def update_registration_type!
41
- log_info = {
21
+ def extra_params
22
+ {
42
23
  resource: {
43
- title: registration_type.title
24
+ title: resource.title
44
25
  },
45
26
  participatory_space: {
46
- title: registration_type.conference.title
27
+ title: resource.conference.title
47
28
  }
48
29
  }
49
-
50
- Decidim.traceability.update!(
51
- registration_type,
52
- form.current_user,
53
- form.attributes.slice(
54
- "title",
55
- "description",
56
- "price",
57
- "weight"
58
- ).symbolize_keys,
59
- log_info
60
- )
61
30
  end
62
31
 
63
32
  def conference_meetings(registration_type)
64
33
  meeting_components = registration_type.conference.components.where(manifest_name: "meetings")
65
34
  Decidim::ConferenceMeeting.where(component: meeting_components).where(id: @form.attributes[:conference_meeting_ids])
66
35
  end
67
-
68
- def link_meetings(registration_type)
69
- registration_type.conference_meetings = conference_meetings(registration_type)
70
- end
71
36
  end
72
37
  end
73
38
  end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "active_support/concern"
4
+
5
+ module Decidim
6
+ module Conferences
7
+ module Admin
8
+ module ConferencesInvites
9
+ module Filterable
10
+ extend ActiveSupport::Concern
11
+
12
+ included do
13
+ include Decidim::Admin::Filterable
14
+
15
+ private
16
+
17
+ def filters
18
+ [:accepted_at_not_null, :rejected_at_not_null, :sent_at_not_null]
19
+ end
20
+
21
+ def filters_with_values
22
+ {
23
+ accepted_at_not_null: %w(true false),
24
+ rejected_at_not_null: %w(true false),
25
+ sent_at_not_null: %w(true false)
26
+ }
27
+ end
28
+
29
+ def base_query
30
+ collection
31
+ end
32
+
33
+ def search_field_predicate
34
+ :user_name_or_user_email_cont
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -8,6 +8,7 @@ module Decidim
8
8
  class ConferenceInvitesController < Decidim::Conferences::Admin::ApplicationController
9
9
  include Concerns::ConferenceAdmin
10
10
  include Decidim::Paginable
11
+ include Decidim::Conferences::Admin::ConferencesInvites::Filterable
11
12
 
12
13
  helper_method :conference
13
14
 
@@ -18,9 +19,7 @@ module Decidim
18
19
  def index
19
20
  enforce_permission_to(:read_invites, :conference, conference: current_participatory_space)
20
21
 
21
- @query = params[:q]
22
- @status = params[:status]
23
- @conference_invites = Decidim::Admin::Invites.for(current_participatory_space.conference_invites, @query, @status).page(params[:page]).per(15)
22
+ @conference_invites = filtered_collection
24
23
  end
25
24
 
26
25
  def new
@@ -46,6 +45,12 @@ module Decidim
46
45
  end
47
46
  end
48
47
  end
48
+
49
+ private
50
+
51
+ def collection
52
+ current_conference.conference_invites
53
+ end
49
54
  end
50
55
  end
51
56
  end
@@ -28,7 +28,7 @@ module Decidim
28
28
  enforce_permission_to :create, :conference_speaker
29
29
  @form = form(ConferenceSpeakerForm).from_params(params)
30
30
 
31
- CreateConferenceSpeaker.call(@form, current_user, current_conference) do
31
+ CreateConferenceSpeaker.call(@form) do
32
32
  on(:ok) do
33
33
  flash[:notice] = I18n.t("conference_speakers.create.success", scope: "decidim.admin")
34
34
  redirect_to conference_speakers_path(current_conference)
@@ -74,6 +74,38 @@ module Decidim
74
74
  end
75
75
  end
76
76
 
77
+ def publish
78
+ enforce_permission_to(:update, :conference_speaker, speaker: conference_speaker)
79
+
80
+ Decidim::Conferences::Admin::PublishConferenceSpeaker.call(conference_speaker, current_user) do
81
+ on(:ok) do
82
+ flash[:notice] = I18n.t("conference_speakers.publish.success", scope: "decidim.admin")
83
+ redirect_to conference_speakers_path(current_conference)
84
+ end
85
+
86
+ on(:invalid) do
87
+ flash.now[:alert] = I18n.t("conference_speakers.publish.invalid", scope: "decidim.admin")
88
+ render action: "index"
89
+ end
90
+ end
91
+ end
92
+
93
+ def unpublish
94
+ enforce_permission_to(:update, :conference_speaker, speaker: conference_speaker)
95
+
96
+ Decidim::Conferences::Admin::UnpublishConferenceSpeaker.call(conference_speaker, current_user) do
97
+ on(:ok) do
98
+ flash[:notice] = I18n.t("conference_speakers.unpublish.success", scope: "decidim.admin")
99
+ redirect_to conference_speakers_path(current_conference)
100
+ end
101
+
102
+ on(:invalid) do
103
+ flash.now[:alert] = I18n.t("conference_speakers.unpublish.invalid", scope: "decidim.admin")
104
+ render action: "index"
105
+ end
106
+ end
107
+ end
108
+
77
109
  private
78
110
 
79
111
  def meetings_selected
@@ -52,7 +52,7 @@ module Decidim
52
52
  conference_id: current_conference.id
53
53
  )
54
54
 
55
- UpdateConference.call(current_conference, @form) do
55
+ UpdateConference.call(@form, current_conference) do
56
56
  on(:ok) do |conference|
57
57
  flash[:notice] = I18n.t("conferences.update.success", scope: "decidim.admin")
58
58
  redirect_to edit_conference_path(conference)
@@ -23,7 +23,7 @@ module Decidim
23
23
  enforce_permission_to :create, :media_link
24
24
  @form = form(Decidim::Conferences::Admin::MediaLinkForm).from_params(params)
25
25
 
26
- CreateMediaLink.call(@form, current_user, current_conference) do
26
+ CreateMediaLink.call(@form) do
27
27
  on(:ok) do
28
28
  flash[:notice] = I18n.t("media_links.create.success", scope: "decidim.admin")
29
29
  redirect_to conference_media_links_path(current_conference)
@@ -24,7 +24,7 @@ module Decidim
24
24
  enforce_permission_to :create, :partner
25
25
  @form = form(Decidim::Conferences::Admin::PartnerForm).from_params(params)
26
26
 
27
- CreatePartner.call(@form, current_user, current_conference) do
27
+ CreatePartner.call(@form) do
28
28
  on(:ok) do
29
29
  flash[:notice] = I18n.t("partners.create.success", scope: "decidim.admin")
30
30
  redirect_to conference_partners_path(current_conference)
@@ -27,7 +27,7 @@ module Decidim
27
27
  enforce_permission_to :create, :registration_type
28
28
  @form = form(Decidim::Conferences::Admin::RegistrationTypeForm).from_params(params)
29
29
 
30
- CreateRegistrationType.call(@form, current_user, current_conference) do
30
+ CreateRegistrationType.call(@form) do
31
31
  on(:ok) do
32
32
  flash[:notice] = I18n.t("registration_types.create.success", scope: "decidim.admin")
33
33
  redirect_to conference_registration_types_path(current_conference)
@@ -2,7 +2,10 @@
2
2
 
3
3
  module Decidim
4
4
  module Conferences
5
- # The main admin application controller for conferences
5
+ # The main application controller for conferences
6
+ #
7
+ # This controller is the abstract class from which all other controllers of
8
+ # this engine inherit.
6
9
  class ApplicationController < Decidim::ApplicationController
7
10
  helper Decidim::ApplicationHelper
8
11
  helper Decidim::ResourceHelper
@@ -4,9 +4,9 @@ module Decidim
4
4
  module Conferences
5
5
  class ConferenceProgramController < Decidim::Conferences::ApplicationController
6
6
  include ParticipatorySpaceContext
7
+
7
8
  helper Decidim::SanitizeHelper
8
9
  helper Decidim::Conferences::ConferenceProgramHelper
9
- participatory_space_layout only: :show
10
10
 
11
11
  helper_method :collection, :conference, :meeting_days, :meeting_component
12
12
 
@@ -14,7 +14,6 @@ module Decidim
14
14
  raise ActionController::RoutingError, "No meetings for this conference " if meetings.blank?
15
15
 
16
16
  enforce_permission_to :list, :program
17
- redirect_to decidim_conferences.conference_path(current_participatory_space) unless current_user_can_visit_space?
18
17
  end
19
18
 
20
19
  private
@@ -5,21 +5,18 @@ module Decidim
5
5
  class ConferenceSpeakersController < Decidim::Conferences::ApplicationController
6
6
  include ParticipatorySpaceContext
7
7
 
8
- participatory_space_layout only: :index
9
-
10
8
  helper_method :collection, :conference
11
9
 
12
10
  def index
13
11
  raise ActionController::RoutingError, "No speakers for this conference " if speakers.empty?
14
12
 
15
13
  enforce_permission_to :list, :speakers
16
- redirect_to decidim_conferences.conference_path(current_participatory_space) unless current_user_can_visit_space?
17
14
  end
18
15
 
19
16
  private
20
17
 
21
18
  def speakers
22
- @speakers ||= current_participatory_space.speakers
19
+ @speakers ||= current_participatory_space.speakers.published
23
20
  end
24
21
 
25
22
  alias collection speakers
@@ -12,13 +12,10 @@ module Decidim
12
12
  include ParticipatorySpaceContext
13
13
  include Paginable
14
14
 
15
- participatory_space_layout only: :show
16
-
17
15
  helper Decidim::AttachmentsHelper
18
16
  helper Decidim::IconHelper
19
17
  helper Decidim::SanitizeHelper
20
18
  helper Decidim::ResourceReferenceHelper
21
- helper Decidim::Conferences::PartnersHelper
22
19
 
23
20
  helper_method :collection, :promoted_conferences, :conferences, :stats
24
21
 
@@ -29,7 +26,7 @@ module Decidim
29
26
  end
30
27
 
31
28
  def show
32
- check_current_user_can_visit_space
29
+ enforce_permission_to :read, :conference, conference: current_participatory_space
33
30
  end
34
31
 
35
32
  def user_diploma
@@ -4,10 +4,8 @@ module Decidim
4
4
  module Conferences
5
5
  class MediaController < Decidim::Conferences::ApplicationController
6
6
  include ParticipatorySpaceContext
7
- helper Decidim::Conferences::MediaAttachmentsHelper
8
- helper Decidim::SanitizeHelper
9
7
 
10
- participatory_space_layout only: :index
8
+ helper Decidim::SanitizeHelper
11
9
 
12
10
  helper_method :collection, :conference
13
11
 
@@ -15,7 +13,6 @@ module Decidim
15
13
  raise ActionController::RoutingError, "No media_links for this conference " if media_links.empty? && current_participatory_space.attachments.empty?
16
14
 
17
15
  enforce_permission_to :list, :media_links
18
- redirect_to decidim_conferences.conference_path(current_participatory_space) unless current_user_can_visit_space?
19
16
  end
20
17
 
21
18
  private
@@ -5,15 +5,12 @@ module Decidim
5
5
  class RegistrationTypesController < Decidim::Conferences::ApplicationController
6
6
  include ParticipatorySpaceContext
7
7
 
8
- participatory_space_layout only: :index
9
-
10
8
  helper_method :collection, :conference
11
9
 
12
10
  def index
13
11
  raise ActionController::RoutingError, "No registration types for this conference " if registration_types.empty? && current_participatory_space.registrations_enabled
14
12
 
15
13
  enforce_permission_to :list, :registration_types
16
- redirect_to decidim_conferences.conference_path(current_participatory_space) unless current_user_can_visit_space?
17
14
  end
18
15
 
19
16
  private
@@ -3,13 +3,8 @@
3
3
  module Decidim
4
4
  module Conferences
5
5
  class ConferenceRoleAssignedEvent < Decidim::Events::SimpleEvent
6
- include Decidim::Events::NotificationEvent
7
6
  include Decidim::Events::AuthorEvent
8
7
 
9
- def notification_title
10
- I18n.t("notification_title", **i18n_options).html_safe
11
- end
12
-
13
8
  def i18n_role
14
9
  I18n.t(extra["role"], scope: "decidim.admin.models.conference_user_role.roles", default: extra["role"])
15
10
  end
@@ -12,10 +12,10 @@ module Decidim
12
12
 
13
13
  translatable_attribute :title, String
14
14
  translatable_attribute :slogan, String
15
- translatable_attribute :short_description, Decidim::Attributes::RichText
16
- translatable_attribute :description, Decidim::Attributes::RichText
17
- translatable_attribute :objectives, Decidim::Attributes::RichText
18
- translatable_attribute :registration_terms, Decidim::Attributes::RichText
15
+ translatable_attribute :short_description, String
16
+ translatable_attribute :description, String
17
+ translatable_attribute :objectives, String
18
+ translatable_attribute :registration_terms, String
19
19
 
20
20
  mimic :conference
21
21
 
@@ -33,7 +33,7 @@ module Decidim
33
33
  attribute :start_date, Decidim::Attributes::LocalizedDate
34
34
  attribute :end_date, Decidim::Attributes::LocalizedDate
35
35
  attribute :registrations_enabled, Boolean
36
- attribute :available_slots, Integer
36
+ attribute :available_slots, Integer, default: 0
37
37
  attribute :location, String
38
38
  attribute :participatory_processes_ids, Array[Integer]
39
39
  attribute :assemblies_ids, Array[Integer]
@@ -10,7 +10,7 @@ module Decidim
10
10
 
11
11
  translatable_attribute :position, String
12
12
  translatable_attribute :affiliation, String
13
- translatable_attribute :short_bio, Decidim::Attributes::RichText
13
+ translatable_attribute :short_bio, String
14
14
 
15
15
  mimic :conference_speaker
16
16
 
@@ -11,7 +11,7 @@ module Decidim
11
11
  mimic :conference_registration_type
12
12
 
13
13
  translatable_attribute :title, String
14
- translatable_attribute :description, Decidim::Attributes::RichText
14
+ translatable_attribute :description, String
15
15
 
16
16
  attribute :weight, Integer
17
17
  attribute :price, Decimal
@@ -5,6 +5,7 @@ module Decidim
5
5
  module Conferences
6
6
  module ConferenceHelper
7
7
  include PaginateHelper
8
+ include Decidim::AttachmentsHelper
8
9
 
9
10
  # Renders the dates of a conference
10
11
  #
@@ -18,7 +19,7 @@ module Decidim
18
19
  #
19
20
  def conference_nav_items(participatory_space)
20
21
  [].tap do |items|
21
- if participatory_space.speakers.exists?
22
+ if participatory_space.speakers.published.exists?
22
23
  items << {
23
24
  name: t("layouts.decidim.conferences_nav.conference_speaker_menu_item"),
24
25
  url: decidim_conferences.conference_conference_speakers_path(participatory_space)
@@ -33,18 +33,14 @@ module Decidim
33
33
  private
34
34
 
35
35
  def add_diploma_attachment
36
- diploma = WickedPdf.new.pdf_from_string(pdf_content, orientation: "Landscape")
37
-
38
- attachments["conference-#{@user.nickname.parameterize}-diploma.pdf"] = diploma
39
- end
40
-
41
- def pdf_content
42
- Premailer.new(
36
+ diploma = WickedPdf.new.pdf_from_string(
43
37
  render_to_string(pdf: "conference-diploma",
44
38
  template: "decidim/conferences/admin/send_conference_diploma_mailer/diploma_user",
45
39
  layout: "decidim/diploma"),
46
- with_html_string: true
47
- ).to_inline_css
40
+ orientation: "Landscape"
41
+ )
42
+
43
+ attachments["conference-#{@user.nickname.parameterize}-diploma.pdf"] = diploma
48
44
  end
49
45
  end
50
46
  end
@@ -60,7 +60,7 @@ module Decidim
60
60
  validates_upload :hero_image, uploader: Decidim::HeroImageUploader
61
61
 
62
62
  has_one_attached :banner_image
63
- validates_upload :banner_image, uploader: Decidim::HomepageImageUploader
63
+ validates_upload :banner_image, uploader: Decidim::BannerImageUploader
64
64
 
65
65
  has_one_attached :main_logo
66
66
  validates_upload :main_logo, uploader: Decidim::Conferences::DiplomaUploader
@@ -136,7 +136,7 @@ module Decidim
136
136
  end
137
137
 
138
138
  def user_roles(role_name = nil)
139
- roles = Decidim::ConferenceUserRole.order_by_name.where(conference: self)
139
+ roles = Decidim::ConferenceUserRole.where(conference: self)
140
140
  return roles if role_name.blank?
141
141
 
142
142
  roles.where(role: role_name)
@@ -8,6 +8,7 @@ module Decidim
8
8
  include Decidim::Loggable
9
9
  include Decidim::HasUploadValidations
10
10
  include Decidim::TranslatableResource
11
+ include Decidim::Publicable
11
12
 
12
13
  translatable_fields :position, :affiliation, :short_bio
13
14
 
@@ -17,6 +18,7 @@ module Decidim
17
18
  has_many :conference_meetings, through: :conference_speaker_conference_meetings, class_name: "Decidim::ConferenceMeeting"
18
19
 
19
20
  default_scope { order(full_name: :asc, created_at: :asc) }
21
+ scope :published, -> { where.not(published_at: nil) }
20
22
 
21
23
  has_one_attached :avatar
22
24
  validates_avatar :avatar, uploader: Decidim::AvatarUploader
@@ -160,7 +160,7 @@ module Decidim
160
160
  end
161
161
 
162
162
  # All users with a relation to a conference and organization admins can enter
163
- # the space area. The sapce area is considered to be the conferences zone,
163
+ # the space area. The space area is considered to be the conferences zone,
164
164
  # not the conference groups one.
165
165
  def user_can_enter_space_area?
166
166
  return unless permission_action.action == :enter &&
@@ -254,7 +254,7 @@ module Decidim
254
254
  allow! if permission_action.action == :export && permission_action.subject == :component_data
255
255
  end
256
256
 
257
- # Process admins can eprform everything *inside* that conference. They cannot
257
+ # Process admins can perform everything *inside* that conference. They cannot
258
258
  # create a conference or perform actions on conference groups or other
259
259
  # conferences.
260
260
  def conference_admin_action?
@@ -26,7 +26,8 @@ module Decidim
26
26
  position: "Decidim::Conferences::AdminLog::ValueTypes::SpeakerPositionPresenter",
27
27
  position_other: :string,
28
28
  weight: :integer,
29
- ceased_date: :date
29
+ ceased_date: :date,
30
+ published_at: :date
30
31
  }
31
32
  end
32
33
 
@@ -1,7 +1,7 @@
1
1
  <div class="form__wrapper">
2
2
  <div class="card attendee-fields pt-4">
3
3
  <div class="row column">
4
- <fieldset class="check-radio-collection">
4
+ <fieldset>
5
5
  <legend><%= t(".attendee_type") %></legend>
6
6
  <%= form.collection_radio_buttons(:existing_user, [[t(".non_user"), false], [t(".existing_user"), true]], :last, :first) %>
7
7
  </fieldset>
@@ -11,21 +11,21 @@
11
11
  <p><%= t(".invite_explanation") %></p>
12
12
  </div>
13
13
 
14
- <div class="row column auto cell attendee-fields--new-user">
14
+ <div class="row column cell attendee-fields--new-user">
15
15
  <%= form.text_field :name %>
16
16
  </div>
17
- <div class="row column auto cell attendee-fields--new-user">
17
+ <div class="row column cell attendee-fields--new-user">
18
18
  <%= form.text_field :email %>
19
19
  </div>
20
20
 
21
- <div class="row column auto cell attendee-fields--user-picker">
21
+ <div class="row column cell attendee-fields--user-picker">
22
22
  <% prompt_options = { url: decidim_admin.users_organization_url, placeholder: t(".select_user") } %>
23
23
  <%= form.autocomplete_select(:user_id, form.object.user.presence, { multiple: false, class: "autocomplete-field--results-inline" }, prompt_options) do |user|
24
24
  { value: user.id, label: "#{user.name} (@#{user.nickname})" }
25
25
  end %>
26
26
  </div>
27
27
 
28
- <div class="row column auto cell">
28
+ <div class="row column cell">
29
29
  <%= form.select :registration_type_id,
30
30
  options_for_select(@form.registration_types_for_select),
31
31
  { include_blank: false },