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