decidim-conferences 0.27.5 → 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 +3 -13
- 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 -3
- 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 -2
- 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 -62
- data/config/locales/bg.yml +0 -1
- data/config/locales/ca.yml +33 -53
- 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 +31 -51
- 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 -51
- data/config/locales/id-ID.yml +3 -57
- data/config/locales/it.yml +4 -62
- data/config/locales/ja.yml +34 -53
- data/config/locales/lb.yml +1 -55
- data/config/locales/lt.yml +14 -52
- data/config/locales/lv.yml +1 -60
- data/config/locales/nl.yml +3 -62
- data/config/locales/no.yml +1 -62
- data/config/locales/pl.yml +1 -78
- data/config/locales/pt-BR.yml +1 -63
- data/config/locales/pt.yml +2 -63
- data/config/locales/ro-RO.yml +13 -50
- data/config/locales/sk.yml +1 -60
- data/config/locales/sl.yml +0 -2
- data/config/locales/sr-CS.yml +0 -5
- data/config/locales/sv.yml +7 -62
- data/config/locales/tr-TR.yml +13 -61
- 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 +10 -9
- data/lib/decidim/conferences/version.rb +1 -1
- metadata +44 -47
- 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 -42
- 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 -23
- 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/environment.rb +0 -3
- 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
@@ -5,104 +5,22 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# Controller that allows managing conference user roles.
|
7
7
|
#
|
8
|
-
class ConferenceUserRolesController < Decidim::
|
8
|
+
class ConferenceUserRolesController < Decidim::Admin::ParticipatorySpace::UserRoleController
|
9
9
|
include Concerns::ConferenceAdmin
|
10
|
-
include Decidim::Admin::Officializations::Filterable
|
11
10
|
|
12
|
-
def
|
13
|
-
enforce_permission_to :index, :conference_user_role
|
14
|
-
@conference_user_roles = filtered_collection
|
15
|
-
end
|
11
|
+
def authorization_scope = :conference_user_role
|
16
12
|
|
17
|
-
def
|
18
|
-
enforce_permission_to :create, :conference_user_role
|
19
|
-
@form = form(ConferenceUserRoleForm).instance
|
20
|
-
end
|
13
|
+
def resource_form = form(ConferenceUserRoleForm)
|
21
14
|
|
22
|
-
def
|
23
|
-
enforce_permission_to :create, :conference_user_role
|
24
|
-
@form = form(ConferenceUserRoleForm).from_params(params)
|
15
|
+
def space_index_path = conference_user_roles_path(current_participatory_space)
|
25
16
|
|
26
|
-
|
27
|
-
on(:ok) do
|
28
|
-
flash[:notice] = I18n.t("conference_user_roles.create.success", scope: "decidim.admin")
|
29
|
-
end
|
17
|
+
def i18n_scope = "decidim.admin.conference_user_roles"
|
30
18
|
|
31
|
-
|
32
|
-
flash[:alert] = I18n.t("conference_user_roles.create.error", scope: "decidim.admin")
|
33
|
-
end
|
34
|
-
redirect_to conference_user_roles_path(current_conference)
|
35
|
-
end
|
36
|
-
end
|
19
|
+
def role_class = Decidim::ConferenceUserRole
|
37
20
|
|
38
|
-
def
|
39
|
-
@user_role = collection.find(params[:id])
|
40
|
-
enforce_permission_to :update, :conference_user_role, user_role: @user_role
|
41
|
-
@form = form(ConferenceUserRoleForm).from_model(@user_role.user)
|
42
|
-
end
|
21
|
+
def event = "decidim.events.conferences.role_assigned"
|
43
22
|
|
44
|
-
def
|
45
|
-
@user_role = collection.find(params[:id])
|
46
|
-
enforce_permission_to :update, :conference_user_role, user_role: @user_role
|
47
|
-
@form = form(ConferenceUserRoleForm).from_params(params)
|
48
|
-
|
49
|
-
UpdateConferenceAdmin.call(@form, @user_role) do
|
50
|
-
on(:ok) do
|
51
|
-
flash[:notice] = I18n.t("conference_user_roles.update.success", scope: "decidim.admin")
|
52
|
-
redirect_to conference_user_roles_path(current_conference)
|
53
|
-
end
|
54
|
-
|
55
|
-
on(:invalid) do
|
56
|
-
flash.now[:alert] = I18n.t("conference_user_roles.update.error", scope: "decidim.admin")
|
57
|
-
render :edit
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def destroy
|
63
|
-
@conference_user_role = collection.find(params[:id])
|
64
|
-
enforce_permission_to :destroy, :conference_user_role, user_role: @conference_user_role
|
65
|
-
|
66
|
-
DestroyConferenceAdmin.call(@conference_user_role, current_user) do
|
67
|
-
on(:ok) do
|
68
|
-
flash[:notice] = I18n.t("conference_user_roles.destroy.success", scope: "decidim.admin")
|
69
|
-
redirect_to conference_user_roles_path(current_conference)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
def resend_invitation
|
75
|
-
@user_role = collection.find(params[:id])
|
76
|
-
enforce_permission_to :invite, :conference_user_role, user_role: @user_role
|
77
|
-
|
78
|
-
InviteUserAgain.call(@user_role.user, "invite_admin") do
|
79
|
-
on(:ok) do
|
80
|
-
flash[:notice] = I18n.t("users.resend_invitation.success", scope: "decidim.admin")
|
81
|
-
end
|
82
|
-
|
83
|
-
on(:invalid) do
|
84
|
-
flash[:alert] = I18n.t("users.resend_invitation.error", scope: "decidim.admin")
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
redirect_to conference_user_roles_path(current_conference)
|
89
|
-
end
|
90
|
-
|
91
|
-
private
|
92
|
-
|
93
|
-
def search_field_predicate
|
94
|
-
:name_or_nickname_or_email_cont
|
95
|
-
end
|
96
|
-
|
97
|
-
def filters
|
98
|
-
[:invitation_accepted_at_present, :last_sign_in_at_present]
|
99
|
-
end
|
100
|
-
|
101
|
-
def collection
|
102
|
-
@collection ||= Decidim::ConferenceUserRole
|
103
|
-
.joins(:user)
|
104
|
-
.where(conference: current_conference)
|
105
|
-
end
|
23
|
+
def event_class = Decidim::Conferences::ConferenceRoleAssignedEvent
|
106
24
|
end
|
107
25
|
end
|
108
26
|
end
|
@@ -6,6 +6,8 @@ module Decidim
|
|
6
6
|
# Controller that allows managing conferences.
|
7
7
|
#
|
8
8
|
class ConferencesController < Decidim::Conferences::Admin::ApplicationController
|
9
|
+
include Decidim::Admin::ParticipatorySpaceAdminBreadcrumb
|
10
|
+
|
9
11
|
helper_method :current_conference, :current_participatory_space
|
10
12
|
layout "decidim/admin/conferences"
|
11
13
|
include Decidim::Conferences::Admin::Filterable
|
@@ -16,7 +16,7 @@ module Decidim
|
|
16
16
|
def update
|
17
17
|
enforce_permission_to :update, :conference, conference: current_conference
|
18
18
|
|
19
|
-
@form = form(DiplomaForm).from_params(diploma_params).with_context(conference: current_conference, current_organization:
|
19
|
+
@form = form(DiplomaForm).from_params(diploma_params).with_context(conference: current_conference, current_organization:)
|
20
20
|
|
21
21
|
UpdateDiploma.call(@form, current_conference) do
|
22
22
|
on(:ok) do
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This controller allows exporting things.
|
7
7
|
# It is targeted for customizations for exporting things that lives under
|
8
|
-
#
|
8
|
+
# a conference.
|
9
9
|
class ExportsController < Decidim::Admin::ExportsController
|
10
10
|
include Concerns::ConferenceAdmin
|
11
11
|
end
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This controller allows importing things.
|
7
7
|
# It is targeted for customizations for importing things that lives under
|
8
|
-
#
|
8
|
+
# a conference.
|
9
9
|
class ImportsController < Decidim::Admin::ImportsController
|
10
10
|
include Concerns::ConferenceAdmin
|
11
11
|
end
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Conferences
|
5
5
|
module Admin
|
6
6
|
module Moderations
|
7
|
-
# This controller allows admins to manage moderation reports in
|
7
|
+
# This controller allows admins to manage moderation reports in a conference.
|
8
8
|
class ReportsController < Decidim::Admin::Moderations::ReportsController
|
9
9
|
include Concerns::ConferenceAdmin
|
10
10
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Conferences
|
5
5
|
module Admin
|
6
|
-
# This controller allows admins to manage moderations in
|
6
|
+
# This controller allows admins to manage moderations in a conference.
|
7
7
|
class ModerationsController < Decidim::Admin::ModerationsController
|
8
8
|
include Concerns::ConferenceAdmin
|
9
9
|
end
|
@@ -10,6 +10,8 @@ module Decidim
|
|
10
10
|
|
11
11
|
include NeedsPermission
|
12
12
|
|
13
|
+
layout "layouts/decidim/conferences/application"
|
14
|
+
|
13
15
|
register_permissions(::Decidim::Conferences::ApplicationController,
|
14
16
|
Decidim::Conferences::Permissions,
|
15
17
|
Decidim::Admin::Permissions,
|
@@ -17,6 +19,10 @@ module Decidim
|
|
17
19
|
|
18
20
|
private
|
19
21
|
|
22
|
+
def fallback_layout
|
23
|
+
"layouts/decidim/conferences/application"
|
24
|
+
end
|
25
|
+
|
20
26
|
def permissions_context
|
21
27
|
super.merge(
|
22
28
|
current_participatory_space: try(:current_participatory_space)
|
@@ -7,7 +7,7 @@ module Decidim
|
|
7
7
|
before_action :ensure_signed_in
|
8
8
|
|
9
9
|
def create
|
10
|
-
enforce_permission_to
|
10
|
+
enforce_permission_to(:join, :conference, conference:)
|
11
11
|
|
12
12
|
JoinConference.call(conference, registration_type, current_user) do
|
13
13
|
on(:ok) do
|
@@ -23,7 +23,7 @@ module Decidim
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def destroy
|
26
|
-
enforce_permission_to
|
26
|
+
enforce_permission_to(:leave, :conference, conference:)
|
27
27
|
|
28
28
|
LeaveConference.call(conference, registration_type, current_user) do
|
29
29
|
on(:ok) do
|
@@ -39,7 +39,7 @@ module Decidim
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def decline_invitation
|
42
|
-
enforce_permission_to
|
42
|
+
enforce_permission_to(:decline_invitation, :conference, conference:)
|
43
43
|
|
44
44
|
DeclineInvitation.call(conference, current_user) do
|
45
45
|
on(:ok) do
|
@@ -1,16 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# i18n-tasks-use t('decidim.conferences.conferences.show.already_have_an_account?')
|
4
|
+
# i18n-tasks-use t('decidim.conferences.conferences.show.are_you_new?')
|
5
|
+
# i18n-tasks-use t('decidim.conferences.conferences.show.sign_in_description')
|
6
|
+
# i18n-tasks-use t('decidim.conferences.conferences.show.sign_up_description')
|
3
7
|
module Decidim
|
4
8
|
module Conferences
|
5
9
|
# A controller that holds the logic to show Conferences in a
|
6
10
|
# public layout.
|
7
11
|
class ConferencesController < Decidim::Conferences::ApplicationController
|
8
12
|
include ParticipatorySpaceContext
|
13
|
+
include Paginable
|
14
|
+
|
9
15
|
participatory_space_layout only: :show
|
10
16
|
|
11
17
|
helper Decidim::AttachmentsHelper
|
12
18
|
helper Decidim::IconHelper
|
13
|
-
helper Decidim::WidgetUrlsHelper
|
14
19
|
helper Decidim::SanitizeHelper
|
15
20
|
helper Decidim::ResourceReferenceHelper
|
16
21
|
helper Decidim::Conferences::PartnersHelper
|
@@ -49,7 +54,9 @@ module Decidim
|
|
49
54
|
@conferences ||= OrganizationPrioritizedConferences.new(current_organization, current_user)
|
50
55
|
end
|
51
56
|
|
52
|
-
|
57
|
+
def collection
|
58
|
+
@collection ||= paginate(conferences.query)
|
59
|
+
end
|
53
60
|
|
54
61
|
def promoted_conferences
|
55
62
|
@promoted_conferences ||= conferences | PromotedConferences.new
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Conferences
|
@@ -11,8 +11,8 @@ module Decidim
|
|
11
11
|
|
12
12
|
def i18n_options
|
13
13
|
{
|
14
|
-
resource_title
|
15
|
-
resource_url
|
14
|
+
resource_title:,
|
15
|
+
resource_url:,
|
16
16
|
scope: event_name
|
17
17
|
}
|
18
18
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Conferences
|
@@ -16,12 +16,12 @@ module Decidim
|
|
16
16
|
|
17
17
|
def i18n_options
|
18
18
|
{
|
19
|
-
resource_path
|
20
|
-
resource_title
|
21
|
-
resource_url
|
19
|
+
resource_path:,
|
20
|
+
resource_title:,
|
21
|
+
resource_url:,
|
22
22
|
scope: event_name,
|
23
|
-
participatory_space_title
|
24
|
-
participatory_space_url
|
23
|
+
participatory_space_title:,
|
24
|
+
participatory_space_url:,
|
25
25
|
role: i18n_role
|
26
26
|
}
|
27
27
|
end
|
@@ -24,7 +24,7 @@ module Decidim
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def slug_uniqueness
|
27
|
-
return unless OrganizationConferences.new(current_organization).query.where(slug:
|
27
|
+
return unless OrganizationConferences.new(current_organization).query.where(slug:).where.not(id:).any?
|
28
28
|
|
29
29
|
errors.add(:slug, :taken)
|
30
30
|
end
|
@@ -20,6 +20,7 @@ module Decidim
|
|
20
20
|
mimic :conference
|
21
21
|
|
22
22
|
attribute :slug, String
|
23
|
+
attribute :weight, Integer, default: 0
|
23
24
|
attribute :hashtag, String
|
24
25
|
attribute :promoted, Boolean
|
25
26
|
attribute :scopes_enabled, Boolean
|
@@ -36,8 +37,8 @@ module Decidim
|
|
36
37
|
attribute :location, String
|
37
38
|
attribute :participatory_processes_ids, Array[Integer]
|
38
39
|
attribute :assemblies_ids, Array[Integer]
|
39
|
-
attribute :consultations_ids, Array[Integer]
|
40
40
|
|
41
|
+
validates :weight, presence: true, numericality: { greater_than_or_equal_to: 0 }
|
41
42
|
validates :slug, presence: true, format: { with: Decidim::Conference.slug_format }
|
42
43
|
validates :title, :slogan, :description, :short_description, translatable_presence: true
|
43
44
|
|
@@ -88,29 +89,17 @@ module Decidim
|
|
88
89
|
end
|
89
90
|
end
|
90
91
|
|
91
|
-
def consultations_for_select
|
92
|
-
return unless Decidim.participatory_space_manifests.map(&:name).include?(:consultations)
|
93
|
-
|
94
|
-
@consultations_for_select ||= Decidim.find_participatory_space_manifest(:consultations)
|
95
|
-
.participatory_spaces.call(current_organization)&.order(title: :asc)&.map do |consultation|
|
96
|
-
[
|
97
|
-
translated_attribute(consultation.title),
|
98
|
-
consultation.id
|
99
|
-
]
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
92
|
private
|
104
93
|
|
105
94
|
def available_slots_greater_than_or_equal_to_registrations_count
|
106
|
-
conference = OrganizationConferences.new(current_organization).query.find_by(slug:
|
95
|
+
conference = OrganizationConferences.new(current_organization).query.find_by(slug:)
|
107
96
|
return true if conference.blank?
|
108
97
|
|
109
98
|
errors.add(:available_slots, :invalid) if available_slots < conference.conference_registrations.count
|
110
99
|
end
|
111
100
|
|
112
101
|
def slug_uniqueness
|
113
|
-
return unless OrganizationConferences.new(current_organization).query.where(slug:
|
102
|
+
return unless OrganizationConferences.new(current_organization).query.where(slug:).where.not(id: context[:conference_id]).any?
|
114
103
|
|
115
104
|
errors.add(:slug, :taken)
|
116
105
|
end
|
@@ -5,25 +5,10 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# A form object used to create conference user roles from the admin dashboard.
|
7
7
|
#
|
8
|
-
class ConferenceUserRoleForm <
|
8
|
+
class ConferenceUserRoleForm < Decidim::Admin::ParticipatorySpaceAdminUserForm
|
9
9
|
mimic :conference_user_role
|
10
10
|
|
11
|
-
|
12
|
-
attribute :email, String
|
13
|
-
attribute :role, String
|
14
|
-
|
15
|
-
validates :email, :role, presence: true
|
16
|
-
validates :name, presence: true
|
17
|
-
validates :role, inclusion: { in: Decidim::ConferenceUserRole::ROLES }
|
18
|
-
|
19
|
-
def roles
|
20
|
-
Decidim::ConferenceUserRole::ROLES.map do |role|
|
21
|
-
[
|
22
|
-
I18n.t(role, scope: "decidim.admin.models.conference_user_role.roles"),
|
23
|
-
role
|
24
|
-
]
|
25
|
-
end
|
26
|
-
end
|
11
|
+
def scope = "decidim.admin.models.conference_user_role.roles"
|
27
12
|
end
|
28
13
|
end
|
29
14
|
end
|
@@ -18,10 +18,6 @@ module Decidim
|
|
18
18
|
def assemblies_selected
|
19
19
|
@assemblies_selected ||= current_conference.linked_participatory_space_resources(:assemblies, "included_assemblies").pluck(:id) if current_conference.present?
|
20
20
|
end
|
21
|
-
|
22
|
-
def consultations_selected
|
23
|
-
@consultations_selected ||= current_conference.linked_participatory_space_resources("Consultations", "included_consultations").pluck(:id) if current_conference.present?
|
24
|
-
end
|
25
21
|
end
|
26
22
|
end
|
27
23
|
end
|
@@ -4,6 +4,8 @@ module Decidim
|
|
4
4
|
# A Helper to render conferences.
|
5
5
|
module Conferences
|
6
6
|
module ConferenceHelper
|
7
|
+
include PaginateHelper
|
8
|
+
|
7
9
|
# Renders the dates of a conference
|
8
10
|
#
|
9
11
|
def render_date(conference)
|
@@ -11,6 +13,59 @@ module Decidim
|
|
11
13
|
|
12
14
|
"#{l(conference.start_date, format: :decidim_with_month_name_short)} - #{l(conference.end_date, format: :decidim_with_month_name_short)}"
|
13
15
|
end
|
16
|
+
|
17
|
+
# Items to display in the navigation of a conference
|
18
|
+
#
|
19
|
+
def conference_nav_items(participatory_space)
|
20
|
+
[].tap do |items|
|
21
|
+
if participatory_space.speakers.exists?
|
22
|
+
items << {
|
23
|
+
name: t("layouts.decidim.conferences_nav.conference_speaker_menu_item"),
|
24
|
+
url: decidim_conferences.conference_conference_speakers_path(participatory_space)
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
meeting_components = participatory_space.components.published.where(manifest_name: "meetings")
|
29
|
+
other_components = participatory_space.components.published.where.not(manifest_name: "meetings")
|
30
|
+
|
31
|
+
meeting_components.each do |component|
|
32
|
+
next unless Decidim::Meetings::Meeting.where(component:).published.not_hidden.visible_for(current_user).exists?
|
33
|
+
|
34
|
+
items << {
|
35
|
+
name: translated_attribute(component.name),
|
36
|
+
url: decidim_conferences.conference_conference_program_path(participatory_space, id: component.id)
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
if participatory_space.partners.exists?
|
41
|
+
items << {
|
42
|
+
name: t("layouts.decidim.conferences_nav.conference_partners_menu_item"),
|
43
|
+
url: decidim_conferences.conference_path(participatory_space, anchor: "conference-partners-main_promotor")
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
if meeting_components.exists?
|
48
|
+
items << {
|
49
|
+
name: t("layouts.decidim.conferences_nav.venues"),
|
50
|
+
url: decidim_conferences.conference_path(participatory_space, anchor: "venues")
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
other_components.each do |component|
|
55
|
+
items << {
|
56
|
+
name: translated_attribute(component.name),
|
57
|
+
url: main_component_path(component)
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
if participatory_space.attachments.any? || participatory_space.media_links.any?
|
62
|
+
items << {
|
63
|
+
name: t("layouts.decidim.conferences_nav.media"),
|
64
|
+
url: decidim_conferences.conference_media_path(participatory_space)
|
65
|
+
}
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
14
69
|
end
|
15
70
|
end
|
16
71
|
end
|
@@ -12,7 +12,7 @@ module Decidim
|
|
12
12
|
meetings_by_time = {}
|
13
13
|
meetings.each do |meeting|
|
14
14
|
meetings_by_time[start_time: meeting.start_time, end_time: meeting.end_time] ||= []
|
15
|
-
meetings_by_time[start_time: meeting.start_time, end_time: meeting.end_time] << { meeting:
|
15
|
+
meetings_by_time[start_time: meeting.start_time, end_time: meeting.end_time] << { meeting: }
|
16
16
|
end
|
17
17
|
meetings_by_time
|
18
18
|
end
|
@@ -4,16 +4,6 @@ module Decidim
|
|
4
4
|
# A Helper to render and link to resources.
|
5
5
|
module Conferences
|
6
6
|
module MediaAttachmentsHelper
|
7
|
-
# Renders the attachments of a Conference that includes the
|
8
|
-
# HasAttachments concern.
|
9
|
-
#
|
10
|
-
# attached_to - The model to render the attachments from.
|
11
|
-
#
|
12
|
-
# Returns nothing.
|
13
|
-
def attachments_for_conference(attached_to)
|
14
|
-
render partial: "attachments", locals: { attached_to: attached_to }
|
15
|
-
end
|
16
|
-
|
17
7
|
# Renders the attachment's title.
|
18
8
|
# Checks if the attachment's title is translated or not and use
|
19
9
|
# the correct render method.
|
@@ -7,8 +7,10 @@ module Decidim
|
|
7
7
|
# conference - The model to render the partners
|
8
8
|
#
|
9
9
|
# Returns nothing.
|
10
|
+
|
11
|
+
# deprecated
|
10
12
|
def partners_for(conference)
|
11
|
-
render partial: "partners", locals: { conference:
|
13
|
+
render partial: "partners", locals: { conference: }
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
@@ -21,7 +21,7 @@ module Decidim
|
|
21
21
|
@registration_type = registration_type
|
22
22
|
|
23
23
|
subject = I18n.t("pending_validation.subject", scope: "decidim.conferences.mailer.conference_registration_mailer")
|
24
|
-
mail(to: user.email, subject:
|
24
|
+
mail(to: user.email, subject:)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -36,7 +36,7 @@ module Decidim
|
|
36
36
|
add_calendar_attachment
|
37
37
|
|
38
38
|
subject = I18n.t("confirmation.subject", scope: "decidim.conferences.mailer.conference_registration_mailer")
|
39
|
-
mail(to: user.email, subject:
|
39
|
+
mail(to: user.email, subject:)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Decidim
|
4
|
-
# Interaction between a user and an organization can be done via
|
5
|
-
# It
|
4
|
+
# Interaction between a user and an organization can be done via a Conference.
|
5
|
+
# It is a unit of action from the Organization point of view that groups
|
6
6
|
# several components (proposals, debates...) that can be enabled or disabled.
|
7
7
|
#
|
8
8
|
class Conference < ApplicationRecord
|
@@ -100,11 +100,11 @@ module Decidim
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def has_registration_for?(user)
|
103
|
-
conference_registrations.where(user:
|
103
|
+
conference_registrations.where(user:).any?
|
104
104
|
end
|
105
105
|
|
106
106
|
def has_registration_for_user_and_registration_type?(user, registration_type)
|
107
|
-
conference_registrations.where(user
|
107
|
+
conference_registrations.where(user:, registration_type:).any?
|
108
108
|
end
|
109
109
|
|
110
110
|
def has_available_slots?
|
@@ -1,51 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Decidim
|
4
|
-
# Defines a relation between a user and
|
4
|
+
# Defines a relation between a user and a Conference, and what kind of relation
|
5
5
|
# does the user have.
|
6
6
|
class ConferenceUserRole < ApplicationRecord
|
7
7
|
include Traceable
|
8
8
|
include Loggable
|
9
|
+
include ParticipatorySpaceUser
|
9
10
|
|
10
|
-
belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User", optional: true
|
11
11
|
belongs_to :conference, foreign_key: "decidim_conference_id", class_name: "Decidim::Conference", optional: true
|
12
12
|
alias participatory_space conference
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
scope :for_space, ->(participatory_space) { where(conference: participatory_space) }
|
15
|
+
|
16
|
+
validates :role, inclusion: { in: ParticipatorySpaceUser::ROLES }, uniqueness: { scope: [:user, :conference] }
|
17
|
+
def target_space_association = :conference
|
17
18
|
|
18
19
|
def self.log_presenter_class_for(_log)
|
19
20
|
Decidim::Conferences::AdminLog::ConferenceUserRolePresenter
|
20
21
|
end
|
21
|
-
|
22
|
-
ransacker :name do
|
23
|
-
Arel.sql(%{("decidim_users"."name")::text})
|
24
|
-
end
|
25
|
-
|
26
|
-
ransacker :nickname do
|
27
|
-
Arel.sql(%{("decidim_users"."nickname")::text})
|
28
|
-
end
|
29
|
-
|
30
|
-
ransacker :email do
|
31
|
-
Arel.sql(%{("decidim_users"."email")::text})
|
32
|
-
end
|
33
|
-
|
34
|
-
ransacker :invitation_accepted_at do
|
35
|
-
Arel.sql(%{("decidim_users"."invitation_accepted_at")::text})
|
36
|
-
end
|
37
|
-
|
38
|
-
ransacker :last_sign_in_at do
|
39
|
-
Arel.sql(%{("decidim_users"."last_sign_in_at")::text})
|
40
|
-
end
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
|
-
# Private: check if the process and the user have the same organization
|
45
|
-
def user_and_conference_same_organization
|
46
|
-
return if !conference || !user
|
47
|
-
|
48
|
-
errors.add(:conference, :invalid) unless user.organization == conference.organization
|
49
|
-
end
|
50
22
|
end
|
51
23
|
end
|