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