decidim-meetings 0.27.8 → 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/meetings/attending_organizations_list_cell.rb +32 -0
- data/app/cells/decidim/meetings/cancel_registration_meeting_button/cancelation_modal.erb +21 -0
- data/app/cells/decidim/meetings/cancel_registration_meeting_button/show.erb +10 -13
- data/app/cells/decidim/meetings/cancel_registration_meeting_button_cell.rb +2 -2
- data/app/cells/decidim/meetings/content_blocks/highlighted_meetings_cell.rb +8 -18
- data/app/cells/decidim/meetings/dates_and_map/show.erb +25 -0
- data/app/cells/decidim/meetings/dates_and_map/static_map.erb +1 -0
- data/app/cells/decidim/meetings/dates_and_map_cell.rb +35 -0
- data/app/cells/decidim/meetings/highlighted_meetings_for_component/show.erb +32 -30
- data/app/cells/decidim/meetings/highlighted_meetings_for_component_cell.rb +76 -16
- data/app/cells/decidim/meetings/join_meeting_button/registration_modal.erb +25 -0
- data/app/cells/decidim/meetings/join_meeting_button/remaining_slots.erb +4 -0
- data/app/cells/decidim/meetings/join_meeting_button/show.erb +6 -4
- data/app/cells/decidim/meetings/join_meeting_button_cell.rb +3 -7
- data/app/cells/decidim/meetings/meeting_activity_cell.rb +1 -12
- data/app/cells/decidim/meetings/meeting_card_metadata_cell.rb +64 -0
- data/app/cells/decidim/meetings/meeting_cell.rb +2 -6
- data/app/cells/decidim/meetings/meeting_l/image.erb +5 -0
- data/app/cells/decidim/meetings/meeting_l_cell.rb +33 -0
- data/app/cells/decidim/meetings/meeting_month/show.erb +33 -0
- data/app/cells/decidim/meetings/meeting_month_cell.rb +72 -0
- data/app/cells/decidim/meetings/meeting_s_cell.rb +5 -37
- data/app/cells/decidim/meetings/meetings_map/show.erb +9 -24
- data/app/cells/decidim/meetings/meetings_map_cell.rb +1 -1
- data/app/cells/decidim/meetings/online_meeting_cell.rb +1 -0
- data/app/cells/decidim/meetings/online_meeting_link/show.erb +18 -41
- data/app/cells/decidim/meetings/public_participants_list/show.erb +4 -15
- data/app/commands/decidim/meetings/admin/copy_meeting.rb +1 -1
- data/app/commands/decidim/meetings/admin/create_meeting.rb +1 -1
- data/app/commands/decidim/meetings/admin/invite_user_to_join_meeting.rb +5 -5
- data/app/commands/decidim/meetings/admin/publish_meeting.rb +1 -1
- data/app/commands/decidim/meetings/admin/unpublish_meeting.rb +1 -1
- data/app/commands/decidim/meetings/create_meeting.rb +14 -3
- data/app/commands/decidim/meetings/decline_invitation.rb +1 -1
- data/app/commands/decidim/meetings/join_meeting.rb +5 -5
- data/app/commands/decidim/meetings/update_meeting.rb +13 -3
- data/app/controllers/concerns/decidim/meetings/component_filterable.rb +4 -4
- data/app/controllers/decidim/meetings/admin/agenda_controller.rb +6 -6
- data/app/controllers/decidim/meetings/admin/invites_controller.rb +3 -3
- data/app/controllers/decidim/meetings/admin/meeting_closes_controller.rb +2 -4
- data/app/controllers/decidim/meetings/admin/meeting_copies_controller.rb +3 -3
- data/app/controllers/decidim/meetings/admin/meetings_controller.rb +7 -7
- data/app/controllers/decidim/meetings/admin/meetings_poll_controller.rb +4 -4
- data/app/controllers/decidim/meetings/admin/registrations_controller.rb +6 -6
- data/app/controllers/decidim/meetings/application_controller.rb +11 -0
- data/app/controllers/decidim/meetings/calendars_controller.rb +0 -1
- data/app/controllers/decidim/meetings/directory/application_controller.rb +12 -0
- data/app/controllers/decidim/meetings/directory/meetings_controller.rb +5 -30
- data/app/controllers/decidim/meetings/live_events_controller.rb +1 -0
- data/app/controllers/decidim/meetings/meeting_closes_controller.rb +2 -3
- data/app/controllers/decidim/meetings/meetings_controller.rb +75 -7
- data/app/controllers/decidim/meetings/polls/answers_controller.rb +2 -2
- data/app/controllers/decidim/meetings/polls/questions_controller.rb +1 -1
- data/app/controllers/decidim/meetings/registrations_controller.rb +5 -5
- data/app/events/decidim/meetings/close_meeting_event.rb +1 -1
- data/app/events/decidim/meetings/meeting_event.rb +1 -1
- data/app/events/decidim/meetings/meeting_registration_notification_event.rb +3 -3
- data/app/events/decidim/meetings/meeting_registrations_enabled_event.rb +1 -1
- data/app/events/decidim/meetings/meeting_registrations_over_percentage_event.rb +1 -1
- data/app/events/decidim/meetings/registration_code_validated_event.rb +1 -1
- data/app/forms/decidim/meetings/admin/meeting_form.rb +5 -1
- data/app/forms/decidim/meetings/admin/meeting_registrations_form.rb +2 -2
- data/app/forms/decidim/meetings/admin/validate_registration_code_form.rb +1 -1
- data/app/forms/decidim/meetings/base_meeting_form.rb +1 -1
- data/app/forms/decidim/meetings/meeting_form.rb +3 -3
- data/app/helpers/decidim/meetings/admin/application_helper.rb +1 -0
- data/app/helpers/decidim/meetings/application_helper.rb +18 -25
- data/app/helpers/decidim/meetings/directory/application_helper.rb +11 -59
- data/app/helpers/decidim/meetings/map_helper.rb +2 -9
- data/app/helpers/decidim/meetings/meetings_helper.rb +6 -5
- data/app/jobs/decidim/meetings/hide_all_created_by_author_job.rb +13 -0
- data/app/mailers/decidim/meetings/admin/invite_join_meeting_mailer.rb +1 -1
- data/app/mailers/decidim/meetings/registration_mailer.rb +1 -1
- data/app/models/decidim/meetings/meeting.rb +11 -32
- data/app/models/decidim/meetings/question.rb +1 -1
- data/app/packs/entrypoints/decidim_meetings.js +3 -0
- data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_attended_meetings.svg +42 -1
- data/app/packs/src/decidim/meetings/admin/agendas.js +3 -4
- data/app/packs/src/decidim/meetings/admin/registrations_form.js +12 -4
- data/app/packs/src/decidim/meetings/meetings_form.js +1 -1
- data/app/packs/src/decidim/meetings/poll.component.js +1 -28
- data/app/packs/stylesheets/decidim/meetings/_calendar.scss +47 -0
- data/app/packs/stylesheets/decidim/meetings/_item.scss +177 -0
- data/app/packs/stylesheets/decidim/meetings/_list.scss +58 -0
- data/app/packs/stylesheets/decidim/meetings/_live_event.scss +128 -0
- data/app/packs/stylesheets/decidim/meetings/meetings.scss +4 -0
- data/app/permissions/decidim/meetings/permissions.rb +15 -12
- data/app/presenters/decidim/meetings/admin_log/invite_presenter.rb +2 -2
- data/app/presenters/decidim/meetings/admin_log/meeting_presenter.rb +6 -2
- data/app/presenters/decidim/meetings/admin_log/questionnaire_presenter.rb +2 -2
- data/app/presenters/decidim/meetings/admin_log/value_types/meeting_title_description_presenter.rb +1 -1
- data/app/presenters/decidim/meetings/log/resource_presenter.rb +18 -0
- data/app/presenters/decidim/meetings/meeting_presenter.rb +8 -2
- data/app/services/decidim/meetings/calendar/component_calendar.rb +1 -1
- data/app/services/decidim/meetings/close_meeting_reminder_generator.rb +7 -13
- data/app/services/decidim/meetings/meeting_iframe_embedder.rb +1 -1
- data/app/views/decidim/meetings/_calendar_modal.html.erb +19 -21
- data/app/views/decidim/meetings/admin/agenda/_agenda_item.html.erb +12 -12
- data/app/views/decidim/meetings/admin/agenda/_agenda_item_child.html.erb +8 -8
- data/app/views/decidim/meetings/admin/agenda/_agenda_item_child_template.html.erb +1 -1
- data/app/views/decidim/meetings/admin/agenda/_agenda_item_fields.html.erb +3 -3
- data/app/views/decidim/meetings/admin/agenda/_form.html.erb +54 -50
- data/app/views/decidim/meetings/admin/agenda/edit.html.erb +18 -6
- data/app/views/decidim/meetings/admin/agenda/new.html.erb +17 -5
- data/app/views/decidim/meetings/admin/invite_join_meeting_mailer/invite.html.erb +11 -2
- data/app/views/decidim/meetings/admin/invites/_form.html.erb +38 -28
- data/app/views/decidim/meetings/admin/invites/index.html.erb +77 -81
- data/app/views/decidim/meetings/admin/meeting_closes/_form.html.erb +26 -28
- data/app/views/decidim/meetings/admin/meeting_closes/edit.html.erb +17 -5
- data/app/views/decidim/meetings/admin/meeting_copies/new.html.erb +17 -6
- data/app/views/decidim/meetings/admin/meetings/_form.html.erb +76 -83
- data/app/views/decidim/meetings/admin/meetings/_service.html.erb +14 -10
- data/app/views/decidim/meetings/admin/meetings/_services.html.erb +9 -5
- data/app/views/decidim/meetings/admin/meetings/edit.html.erb +17 -7
- data/app/views/decidim/meetings/admin/meetings/index.html.erb +133 -129
- data/app/views/decidim/meetings/admin/meetings/new.html.erb +16 -6
- data/app/views/decidim/meetings/admin/poll/_answer_option.html.erb +1 -1
- data/app/views/decidim/meetings/admin/poll/_answer_option_template.html.erb +1 -1
- data/app/views/decidim/meetings/admin/poll/_form.html.erb +17 -32
- data/app/views/decidim/meetings/admin/poll/_question.html.erb +81 -75
- data/app/views/decidim/meetings/admin/poll/edit.html.erb +28 -8
- data/app/views/decidim/meetings/admin/registrations/_form.html.erb +32 -55
- data/app/views/decidim/meetings/admin/registrations/edit.html.erb +59 -26
- data/app/views/decidim/meetings/directory/meetings/index.html.erb +15 -20
- data/app/views/decidim/meetings/directory/meetings/index.js.erb +1 -23
- data/app/views/decidim/meetings/layouts/_aside_block.html.erb +8 -0
- data/app/views/decidim/meetings/layouts/live_event.html.erb +20 -19
- data/app/views/decidim/meetings/live_events/show.html.erb +4 -5
- data/app/views/decidim/meetings/meeting_closes/_form.html.erb +3 -10
- data/app/views/decidim/meetings/meeting_closes/edit.html.erb +17 -21
- data/app/views/decidim/meetings/meetings/_actions.html.erb +6 -0
- data/app/views/decidim/meetings/meetings/_add_to_calendar_modal.html.erb +17 -0
- data/app/views/decidim/meetings/meetings/_form.html.erb +26 -34
- data/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +3 -22
- data/app/views/decidim/meetings/meetings/_meeting.html.erb +74 -0
- data/app/views/decidim/meetings/meetings/_meeting_agenda.html.erb +28 -26
- data/app/views/decidim/meetings/meetings/_meeting_aside.html.erb +98 -0
- data/app/views/decidim/meetings/meetings/_meeting_minutes.html.erb +23 -36
- data/app/views/decidim/meetings/meetings/edit.html.erb +17 -21
- data/app/views/decidim/meetings/meetings/index.html.erb +15 -33
- data/app/views/decidim/meetings/meetings/index.js.erb +1 -23
- data/app/views/decidim/meetings/meetings/new.html.erb +17 -21
- data/app/views/decidim/meetings/meetings/show.html.erb +8 -167
- data/app/views/decidim/meetings/polls/answers/_multiple_option.html.erb +9 -13
- data/app/views/decidim/meetings/polls/answers/_single_option.html.erb +4 -4
- data/app/views/decidim/meetings/polls/answers/create.js.erb +1 -1
- data/app/views/decidim/meetings/polls/questions/_index.html.erb +1 -1
- data/app/views/decidim/meetings/polls/questions/_index_admin.html.erb +5 -5
- data/app/views/decidim/meetings/polls/questions/_published_question.html.erb +9 -11
- data/app/views/decidim/meetings/polls/questions/_question.html.erb +3 -3
- data/app/views/decidim/meetings/polls/questions/index_admin.js.erb +1 -1
- data/app/views/decidim/meetings/shared/_filters.html.erb +20 -0
- data/app/views/decidim/meetings/shared/_index.html.erb +24 -0
- data/app/views/decidim/meetings/shared/_index.js.erb +16 -0
- data/app/views/decidim/meetings/shared/_meetings.html.erb +33 -0
- data/app/views/decidim/meetings/shared/_meetings_aside.html.erb +18 -0
- data/app/views/decidim/meetings/versions/show.html.erb +14 -4
- data/app/views/decidim/participatory_spaces/_conference_venues.html.erb +13 -15
- data/config/assets.rb +0 -2
- data/config/locales/ar.yml +6 -94
- data/config/locales/bg.yml +0 -673
- data/config/locales/ca.yml +52 -75
- data/config/locales/cs.yml +49 -71
- data/config/locales/de.yml +53 -76
- data/config/locales/el.yml +48 -51
- data/config/locales/en.yml +51 -74
- data/config/locales/es-MX.yml +50 -73
- data/config/locales/es-PY.yml +48 -71
- data/config/locales/es.yml +53 -76
- data/config/locales/eu.yml +52 -75
- data/config/locales/fi-plain.yml +46 -69
- data/config/locales/fi.yml +44 -67
- data/config/locales/fr-CA.yml +43 -69
- data/config/locales/fr.yml +48 -71
- data/config/locales/ga-IE.yml +2 -16
- data/config/locales/gl.yml +5 -63
- data/config/locales/hu.yml +6 -92
- data/config/locales/id-ID.yml +4 -60
- data/config/locales/is-IS.yml +1 -22
- data/config/locales/it.yml +6 -86
- data/config/locales/ja.yml +44 -73
- data/config/locales/lb.yml +6 -67
- data/config/locales/lt.yml +42 -65
- data/config/locales/lv.yml +4 -61
- data/config/locales/nl.yml +4 -92
- data/config/locales/no.yml +4 -80
- data/config/locales/pl.yml +2 -199
- data/config/locales/pt-BR.yml +4 -200
- data/config/locales/pt.yml +5 -85
- data/config/locales/ro-RO.yml +11 -81
- data/config/locales/ru.yml +5 -60
- data/config/locales/sk.yml +4 -61
- data/config/locales/sl.yml +0 -3
- data/config/locales/sr-CS.yml +0 -6
- data/config/locales/sv.yml +10 -90
- data/config/locales/tr-TR.yml +5 -78
- data/config/locales/uk.yml +5 -53
- data/config/locales/zh-CN.yml +3 -70
- data/config/locales/zh-TW.yml +24 -51
- data/db/migrate/20201016065302_fix_meetings_registration_terms.rb +1 -1
- data/db/migrate/20230427105701_change_types_and_registration_types_on_meetings.rb +49 -0
- data/lib/decidim/meetings/admin_engine.rb +2 -2
- data/lib/decidim/meetings/component.rb +4 -216
- data/lib/decidim/meetings/content_blocks/registry_manager.rb +17 -0
- data/lib/decidim/meetings/directory_engine.rb +4 -6
- data/lib/decidim/meetings/engine.rb +62 -27
- data/lib/decidim/meetings/meeting_serializer.rb +3 -3
- data/lib/decidim/meetings/seeds.rb +188 -0
- data/lib/decidim/meetings/test/factories.rb +124 -54
- data/lib/decidim/meetings/test/notifications_handling.rb +3 -3
- data/lib/decidim/meetings/test/translated_event.rb +1 -1
- data/lib/decidim/meetings/version.rb +1 -1
- metadata +58 -58
- data/app/cells/decidim/meetings/content_blocks/highlighted_meetings/elements.erb +0 -16
- data/app/cells/decidim/meetings/content_blocks/highlighted_meetings/heading.erb +0 -1
- data/app/cells/decidim/meetings/content_blocks/upcoming_meetings/show.erb +0 -26
- data/app/cells/decidim/meetings/content_blocks/upcoming_meetings_cell.rb +0 -63
- data/app/cells/decidim/meetings/join_meeting_button/registration_confirm.erb +0 -31
- data/app/cells/decidim/meetings/meeting_highlighted_list_item/show.erb +0 -21
- data/app/cells/decidim/meetings/meeting_highlighted_list_item_cell.rb +0 -10
- data/app/cells/decidim/meetings/meeting_list_item/show.erb +0 -14
- data/app/cells/decidim/meetings/meeting_list_item_cell.rb +0 -44
- data/app/cells/decidim/meetings/meeting_m/address.erb +0 -5
- data/app/cells/decidim/meetings/meeting_m/data.erb +0 -2
- data/app/cells/decidim/meetings/meeting_m/date.erb +0 -8
- data/app/cells/decidim/meetings/meeting_m/footer.erb +0 -9
- data/app/cells/decidim/meetings/meeting_m/multiple_dates.erb +0 -17
- data/app/cells/decidim/meetings/meeting_m/single_date.erb +0 -9
- data/app/cells/decidim/meetings/meeting_m/tags.erb +0 -1
- data/app/cells/decidim/meetings/meeting_m_cell.rb +0 -121
- data/app/cells/decidim/meetings/meeting_s/show.erb +0 -27
- data/app/controllers/concerns/decidim/meetings/filterable.rb +0 -27
- data/app/controllers/decidim/meetings/widgets_controller.rb +0 -30
- data/app/packs/stylesheets/decidim/meetings/_header.scss +0 -52
- data/app/packs/stylesheets/decidim/meetings/_main.scss +0 -178
- data/app/packs/stylesheets/decidim/meetings/_meetings.scss +0 -2
- data/app/queries/decidim/meetings/admin/invites.rb +0 -60
- data/app/views/decidim/meetings/admin/meeting_closes/proposals_picker.html.erb +0 -1
- data/app/views/decidim/meetings/directory/meetings/_filters.html.erb +0 -34
- data/app/views/decidim/meetings/directory/meetings/_meetings.html.erb +0 -26
- data/app/views/decidim/meetings/meeting_closes/proposals_picker.html.erb +0 -1
- data/app/views/decidim/meetings/meetings/_calendar_modal.html.erb +0 -26
- data/app/views/decidim/meetings/meetings/_filters.html.erb +0 -40
- data/app/views/decidim/meetings/meetings/_filters_small_view.html.erb +0 -18
- data/app/views/decidim/meetings/meetings/_meetings.html.erb +0 -48
- data/app/views/decidim/meetings/versions/index.html.erb +0 -8
- data/app/views/decidim/participatory_spaces/_upcoming_meeting_for_card.html.erb +0 -4
- data/config/locales/he-IL.yml +0 -1
- data/decidim-meetings.gemspec +0 -36
- data/lib/decidim/meetings/seeds/city.jpeg +0 -0
@@ -18,7 +18,7 @@ module Decidim
|
|
18
18
|
def create
|
19
19
|
enforce_permission_to :create, :meeting
|
20
20
|
|
21
|
-
@form = meeting_form.from_params(params, current_component:
|
21
|
+
@form = meeting_form.from_params(params, current_component:)
|
22
22
|
|
23
23
|
Decidim::Meetings::Admin::CreateMeeting.call(@form) do
|
24
24
|
on(:ok) do
|
@@ -34,15 +34,15 @@ module Decidim
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def edit
|
37
|
-
enforce_permission_to
|
37
|
+
enforce_permission_to(:update, :meeting, meeting:)
|
38
38
|
|
39
39
|
@form = meeting_form.from_model(meeting)
|
40
40
|
end
|
41
41
|
|
42
42
|
def update
|
43
|
-
enforce_permission_to
|
43
|
+
enforce_permission_to(:update, :meeting, meeting:)
|
44
44
|
|
45
|
-
@form = meeting_form.from_params(params, current_component:
|
45
|
+
@form = meeting_form.from_params(params, current_component:)
|
46
46
|
|
47
47
|
Decidim::Meetings::Admin::UpdateMeeting.call(@form, meeting) do
|
48
48
|
on(:ok) do
|
@@ -58,7 +58,7 @@ module Decidim
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def destroy
|
61
|
-
enforce_permission_to
|
61
|
+
enforce_permission_to(:destroy, :meeting, meeting:)
|
62
62
|
|
63
63
|
Decidim::Meetings::Admin::DestroyMeeting.call(meeting, current_user) do
|
64
64
|
on(:ok) do
|
@@ -79,7 +79,7 @@ module Decidim
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def publish
|
82
|
-
enforce_permission_to
|
82
|
+
enforce_permission_to(:update, :meeting, meeting:)
|
83
83
|
|
84
84
|
Decidim::Meetings::Admin::PublishMeeting.call(meeting, current_user) do
|
85
85
|
on(:ok) do
|
@@ -95,7 +95,7 @@ module Decidim
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def unpublish
|
98
|
-
enforce_permission_to
|
98
|
+
enforce_permission_to(:update, :meeting, meeting:)
|
99
99
|
|
100
100
|
Decidim::Meetings::Admin::UnpublishMeeting.call(meeting, current_user) do
|
101
101
|
on(:ok) do
|
@@ -13,7 +13,7 @@ module Decidim
|
|
13
13
|
helper Decidim::Forms::Admin::ApplicationHelper
|
14
14
|
|
15
15
|
def edit
|
16
|
-
enforce_permission_to
|
16
|
+
enforce_permission_to(:update, :poll, meeting:, poll:)
|
17
17
|
|
18
18
|
@form = form(Admin::QuestionnaireForm).from_model(questionnaire)
|
19
19
|
|
@@ -21,7 +21,7 @@ module Decidim
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def update
|
24
|
-
enforce_permission_to
|
24
|
+
enforce_permission_to(:update, :poll, meeting:, poll:)
|
25
25
|
|
26
26
|
@form = form(Admin::QuestionnaireForm).from_params(params)
|
27
27
|
|
@@ -69,7 +69,7 @@ module Decidim
|
|
69
69
|
private
|
70
70
|
|
71
71
|
def questionnaire
|
72
|
-
@questionnaire ||= Decidim::Meetings::Questionnaire.find_or_initialize_by(questionnaire_for:
|
72
|
+
@questionnaire ||= Decidim::Meetings::Questionnaire.find_or_initialize_by(questionnaire_for:)
|
73
73
|
end
|
74
74
|
|
75
75
|
def blank_question
|
@@ -99,7 +99,7 @@ module Decidim
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def poll
|
102
|
-
@poll ||= Poll.find_or_initialize_by(meeting:
|
102
|
+
@poll ||= Poll.find_or_initialize_by(meeting:)
|
103
103
|
end
|
104
104
|
end
|
105
105
|
end
|
@@ -6,16 +6,16 @@ module Decidim
|
|
6
6
|
# This controller allows an admin to manage meeting registrations from a Participatory Process
|
7
7
|
class RegistrationsController < Admin::ApplicationController
|
8
8
|
def edit
|
9
|
-
enforce_permission_to
|
9
|
+
enforce_permission_to(:update, :meeting, meeting:)
|
10
10
|
|
11
11
|
@form = MeetingRegistrationsForm.from_model(meeting)
|
12
12
|
@validation_form = ValidateRegistrationCodeForm.new
|
13
13
|
end
|
14
14
|
|
15
15
|
def update
|
16
|
-
enforce_permission_to
|
16
|
+
enforce_permission_to(:update, :meeting, meeting:)
|
17
17
|
|
18
|
-
@form = MeetingRegistrationsForm.from_params(params).with_context(current_organization: meeting.organization, meeting:
|
18
|
+
@form = MeetingRegistrationsForm.from_params(params).with_context(current_organization: meeting.organization, meeting:)
|
19
19
|
@validation_form = ValidateRegistrationCodeForm.new
|
20
20
|
|
21
21
|
UpdateRegistrations.call(@form, meeting) do
|
@@ -32,7 +32,7 @@ module Decidim
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def export
|
35
|
-
enforce_permission_to
|
35
|
+
enforce_permission_to(:export_registrations, :meeting, meeting:)
|
36
36
|
|
37
37
|
ExportMeetingRegistrations.call(meeting, params[:format], current_user) do
|
38
38
|
on(:ok) do |export_data|
|
@@ -42,10 +42,10 @@ module Decidim
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def validate_registration_code
|
45
|
-
enforce_permission_to
|
45
|
+
enforce_permission_to(:update, :meeting, meeting:)
|
46
46
|
|
47
47
|
@form = MeetingRegistrationsForm.from_model(meeting)
|
48
|
-
@validation_form = ValidateRegistrationCodeForm.from_params(params).with_context(current_organization: meeting.organization, meeting:
|
48
|
+
@validation_form = ValidateRegistrationCodeForm.from_params(params).with_context(current_organization: meeting.organization, meeting:)
|
49
49
|
|
50
50
|
ValidateRegistrationCode.call(@validation_form, meeting) do
|
51
51
|
on(:ok) do
|
@@ -9,6 +9,17 @@ module Decidim
|
|
9
9
|
# override its layout and provide all kinds of useful methods.
|
10
10
|
class ApplicationController < Decidim::Components::BaseController
|
11
11
|
helper Decidim::Meetings::ApplicationHelper
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def add_addtional_csp_directives
|
16
|
+
return unless respond_to?(:meeting) || meeting.present?
|
17
|
+
|
18
|
+
embedded = MeetingIframeEmbedder.new(meeting.online_meeting_url).embed_transformed_url(request.host)
|
19
|
+
return if embedded.blank?
|
20
|
+
|
21
|
+
content_security_policy.append_csp_directive("frame-src", embedded)
|
22
|
+
end
|
12
23
|
end
|
13
24
|
end
|
14
25
|
end
|
@@ -9,7 +9,19 @@ module Decidim
|
|
9
9
|
# override its layout and provide all kinds of useful methods.
|
10
10
|
module Directory
|
11
11
|
class ApplicationController < Decidim::ApplicationController
|
12
|
+
include HasSpecificBreadcrumb
|
13
|
+
|
12
14
|
helper Decidim::Meetings::Directory::ApplicationHelper
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def breadcrumb_item
|
19
|
+
{
|
20
|
+
label: t("decidim.pages.home.extended.meetings"),
|
21
|
+
url: root_path,
|
22
|
+
active: true
|
23
|
+
}
|
24
|
+
end
|
13
25
|
end
|
14
26
|
end
|
15
27
|
end
|
@@ -8,10 +8,8 @@ module Decidim
|
|
8
8
|
layout "layouts/decidim/application"
|
9
9
|
|
10
10
|
include FilterResource
|
11
|
-
include Filterable
|
12
11
|
include Paginable
|
13
12
|
|
14
|
-
helper Decidim::WidgetUrlsHelper
|
15
13
|
helper Decidim::FiltersHelper
|
16
14
|
helper Decidim::Meetings::MapHelper
|
17
15
|
helper Decidim::ResourceHelper
|
@@ -44,37 +42,14 @@ module Decidim
|
|
44
42
|
with_any_date: "upcoming",
|
45
43
|
title_or_description_cont: "",
|
46
44
|
activity: "all",
|
47
|
-
with_any_scope:
|
48
|
-
with_any_space:
|
49
|
-
with_any_type:
|
50
|
-
with_any_origin:
|
51
|
-
with_any_global_category:
|
45
|
+
with_any_scope: nil,
|
46
|
+
with_any_space: nil,
|
47
|
+
with_any_type: nil,
|
48
|
+
with_any_origin: nil,
|
49
|
+
with_any_global_category: nil
|
52
50
|
}
|
53
51
|
end
|
54
52
|
|
55
|
-
def default_filter_category_params
|
56
|
-
participatory_spaces = current_organization.public_participatory_spaces
|
57
|
-
list_of_ps = []
|
58
|
-
participatory_spaces.flat_map do |current_participatory_space|
|
59
|
-
next unless current_participatory_space.respond_to?(:categories)
|
60
|
-
|
61
|
-
key_point = current_participatory_space.class.name.gsub("::", "__") + current_participatory_space.id.to_s
|
62
|
-
|
63
|
-
list_of_ps.push(key_point)
|
64
|
-
list_of_ps += current_participatory_space.categories.pluck(:id).map(&:to_s)
|
65
|
-
end
|
66
|
-
|
67
|
-
["all"] + list_of_ps
|
68
|
-
end
|
69
|
-
|
70
|
-
def default_filter_space_params
|
71
|
-
%w(all) + current_organization.public_participatory_spaces.collect(&:model_name).uniq.collect(&:name).collect(&:underscore)
|
72
|
-
end
|
73
|
-
|
74
|
-
def default_filter_scope_params
|
75
|
-
%w(all global) + current_organization.scopes.pluck(:id).map(&:to_s)
|
76
|
-
end
|
77
|
-
|
78
53
|
def meeting_components
|
79
54
|
@meeting_components ||= Decidim::Component
|
80
55
|
.where(manifest_name: "meetings")
|
@@ -4,19 +4,18 @@ module Decidim
|
|
4
4
|
module Meetings
|
5
5
|
# This controller allows a participant to update the closing_report and the linked proposals of a closed meeting
|
6
6
|
class MeetingClosesController < Decidim::Meetings::ApplicationController
|
7
|
-
include Decidim::Proposals::Admin::Picker if Decidim::Meetings.enable_proposal_linking
|
8
7
|
include FormFactory
|
9
8
|
|
10
9
|
helper_method :meeting
|
11
10
|
|
12
11
|
def edit
|
13
|
-
enforce_permission_to
|
12
|
+
enforce_permission_to(:close, :meeting, meeting:)
|
14
13
|
|
15
14
|
@form = form(CloseMeetingForm).from_model(meeting)
|
16
15
|
end
|
17
16
|
|
18
17
|
def update
|
19
|
-
enforce_permission_to
|
18
|
+
enforce_permission_to(:close, :meeting, meeting:)
|
20
19
|
|
21
20
|
@form = form(CloseMeetingForm).from_params(params.merge(proposals: meeting.sibling_scope(:proposals)))
|
22
21
|
|
@@ -5,18 +5,19 @@ module Decidim
|
|
5
5
|
# Exposes the meeting resource so users can view them
|
6
6
|
class MeetingsController < Decidim::Meetings::ApplicationController
|
7
7
|
include FilterResource
|
8
|
-
include Filterable
|
9
8
|
include ComponentFilterable
|
10
9
|
include Flaggable
|
11
10
|
include Withdrawable
|
12
11
|
include FormFactory
|
13
12
|
include Paginable
|
14
13
|
|
15
|
-
helper Decidim::WidgetUrlsHelper
|
16
14
|
helper Decidim::ResourceVersionsHelper
|
17
15
|
helper Decidim::ShortLinkHelper
|
16
|
+
include Decidim::AttachmentsHelper
|
18
17
|
|
19
|
-
helper_method :meetings, :meeting, :registration, :search
|
18
|
+
helper_method :meetings, :meeting, :registration, :search, :nav_paths, :tab_panel_items
|
19
|
+
|
20
|
+
before_action :add_addtional_csp_directives, only: [:show]
|
20
21
|
|
21
22
|
def new
|
22
23
|
enforce_permission_to :create, :meeting
|
@@ -27,7 +28,7 @@ module Decidim
|
|
27
28
|
def create
|
28
29
|
enforce_permission_to :create, :meeting
|
29
30
|
|
30
|
-
@form = meeting_form.from_params(params, current_component:
|
31
|
+
@form = meeting_form.from_params(params, current_component:)
|
31
32
|
|
32
33
|
CreateMeeting.call(@form) do
|
33
34
|
on(:ok) do |meeting|
|
@@ -65,13 +66,13 @@ module Decidim
|
|
65
66
|
end
|
66
67
|
|
67
68
|
def edit
|
68
|
-
enforce_permission_to
|
69
|
+
enforce_permission_to(:update, :meeting, meeting:)
|
69
70
|
|
70
71
|
@form = meeting_form.from_model(meeting)
|
71
72
|
end
|
72
73
|
|
73
74
|
def update
|
74
|
-
enforce_permission_to
|
75
|
+
enforce_permission_to(:update, :meeting, meeting:)
|
75
76
|
|
76
77
|
@form = meeting_form.from_params(params)
|
77
78
|
|
@@ -89,7 +90,7 @@ module Decidim
|
|
89
90
|
end
|
90
91
|
|
91
92
|
def withdraw
|
92
|
-
enforce_permission_to
|
93
|
+
enforce_permission_to(:withdraw, :meeting, meeting:)
|
93
94
|
|
94
95
|
WithdrawMeeting.call(@meeting, current_user) do
|
95
96
|
on(:ok) do
|
@@ -109,6 +110,36 @@ module Decidim
|
|
109
110
|
@meeting ||= Meeting.not_hidden.where(component: current_component).find_by(id: params[:id])
|
110
111
|
end
|
111
112
|
|
113
|
+
def next_meeting
|
114
|
+
return if search_collection.size < 2
|
115
|
+
|
116
|
+
search_collection.order(:start_time, :id).where(
|
117
|
+
Decidim::Meetings::Meeting.arel_table[:start_time].gt(meeting.start_time).or(
|
118
|
+
Decidim::Meetings::Meeting.arel_table[:start_time].eq(meeting.start_time).and(
|
119
|
+
Decidim::Meetings::Meeting.arel_table[:id].gt(meeting.id)
|
120
|
+
)
|
121
|
+
)
|
122
|
+
).first
|
123
|
+
end
|
124
|
+
|
125
|
+
def prev_meeting
|
126
|
+
return if search_collection.size < 2
|
127
|
+
|
128
|
+
search_collection.order(:start_time, :id).where(
|
129
|
+
Decidim::Meetings::Meeting.arel_table[:start_time].lt(meeting.start_time).or(
|
130
|
+
Decidim::Meetings::Meeting.arel_table[:start_time].eq(meeting.start_time).and(
|
131
|
+
Decidim::Meetings::Meeting.arel_table[:id].lt(meeting.id)
|
132
|
+
)
|
133
|
+
)
|
134
|
+
).last
|
135
|
+
end
|
136
|
+
|
137
|
+
def nav_paths
|
138
|
+
return {} if meeting.blank?
|
139
|
+
|
140
|
+
{ prev_path: prev_meeting, next_path: next_meeting }.compact_blank.transform_values { |meeting| meeting_path(meeting) }
|
141
|
+
end
|
142
|
+
|
112
143
|
def meetings
|
113
144
|
is_past_meetings = params.dig("filter", "with_any_date")&.include?("past")
|
114
145
|
@meetings ||= paginate(search.result.order(start_time: is_past_meetings ? :desc : :asc))
|
@@ -130,6 +161,43 @@ module Decidim
|
|
130
161
|
def meeting_form
|
131
162
|
form(Decidim::Meetings::MeetingForm)
|
132
163
|
end
|
164
|
+
|
165
|
+
def tab_panel_items
|
166
|
+
@tab_panel_items ||= [
|
167
|
+
{
|
168
|
+
enabled: meeting.public_participants.any?,
|
169
|
+
id: "participants",
|
170
|
+
text: t("attending_participants", scope: "decidim.meetings.public_participants_list"),
|
171
|
+
icon: "group-line",
|
172
|
+
method: :cell,
|
173
|
+
args: ["decidim/meetings/public_participants_list", meeting]
|
174
|
+
},
|
175
|
+
{
|
176
|
+
enabled: !meeting.closed? && meeting.user_group_registrations.any?,
|
177
|
+
id: "organizations",
|
178
|
+
text: t("attending_organizations", scope: "decidim.meetings.public_participants_list"),
|
179
|
+
icon: "community-line",
|
180
|
+
method: :cell,
|
181
|
+
args: ["decidim/meetings/attending_organizations_list", meeting]
|
182
|
+
},
|
183
|
+
{
|
184
|
+
enabled: meeting.linked_resources(:proposals, "proposals_from_meeting").present?,
|
185
|
+
id: "included_proposals",
|
186
|
+
text: t("decidim/proposals/proposal", scope: "activerecord.models", count: 2),
|
187
|
+
icon: resource_type_icon_key("Decidim::Proposals::Proposal"),
|
188
|
+
method: :cell,
|
189
|
+
args: ["decidim/linked_resources_for", meeting, { type: :proposals, link_name: "proposals_from_meeting" }]
|
190
|
+
},
|
191
|
+
{
|
192
|
+
enabled: meeting.linked_resources(:results, "meetings_through_proposals").present?,
|
193
|
+
id: "included_meetings",
|
194
|
+
text: t("decidim/accountability/result", scope: "activerecord.models", count: 2),
|
195
|
+
icon: resource_type_icon_key("Decidim::Accountability::Result"),
|
196
|
+
method: :cell,
|
197
|
+
args: ["decidim/linked_resources_for", meeting, { type: :results, link_name: "meetings_through_proposals" }]
|
198
|
+
}
|
199
|
+
] + attachments_tab_panel_items(@meeting)
|
200
|
+
end
|
133
201
|
end
|
134
202
|
end
|
135
203
|
end
|
@@ -10,8 +10,8 @@ module Decidim
|
|
10
10
|
helper_method :question
|
11
11
|
|
12
12
|
def create
|
13
|
-
enforce_permission_to
|
14
|
-
@form = form(AnswerForm).from_params(params, question
|
13
|
+
enforce_permission_to(:create, :answer, question:)
|
14
|
+
@form = form(AnswerForm).from_params(params, question:, current_user:)
|
15
15
|
|
16
16
|
CreateAnswer.call(@form, current_user, questionnaire) do
|
17
17
|
# Both :ok and :invalid render the same template, because
|
@@ -15,7 +15,7 @@ module Decidim
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def update
|
18
|
-
enforce_permission_to
|
18
|
+
enforce_permission_to(:update, :question, question:)
|
19
19
|
|
20
20
|
Decidim::Meetings::Admin::UpdateQuestionStatus.call(question, current_user) do
|
21
21
|
respond_to do |format|
|
@@ -7,9 +7,9 @@ module Decidim
|
|
7
7
|
include Decidim::Forms::Concerns::HasQuestionnaire
|
8
8
|
|
9
9
|
def answer
|
10
|
-
enforce_permission_to
|
10
|
+
enforce_permission_to(:join, :meeting, meeting:)
|
11
11
|
|
12
|
-
@form = form(Decidim::Forms::QuestionnaireForm).from_params(params, session_token:
|
12
|
+
@form = form(Decidim::Forms::QuestionnaireForm).from_params(params, session_token:)
|
13
13
|
|
14
14
|
JoinMeeting.call(meeting, current_user, @form) do
|
15
15
|
on(:ok) do
|
@@ -30,7 +30,7 @@ module Decidim
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def create
|
33
|
-
enforce_permission_to
|
33
|
+
enforce_permission_to(:register, :meeting, meeting:)
|
34
34
|
|
35
35
|
@form = JoinMeetingForm.from_params(params)
|
36
36
|
|
@@ -48,7 +48,7 @@ module Decidim
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def destroy
|
51
|
-
enforce_permission_to
|
51
|
+
enforce_permission_to(:leave, :meeting, meeting:)
|
52
52
|
|
53
53
|
LeaveMeeting.call(meeting, current_user) do
|
54
54
|
on(:ok) do
|
@@ -64,7 +64,7 @@ module Decidim
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def decline_invitation
|
67
|
-
enforce_permission_to
|
67
|
+
enforce_permission_to(:decline_invitation, :meeting, meeting:)
|
68
68
|
|
69
69
|
DeclineInvitation.call(meeting, current_user) do
|
70
70
|
on(:ok) do
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Meetings
|
@@ -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
|
registration_code: extra["registration_code"]
|
18
18
|
}
|
@@ -57,6 +57,10 @@ module Decidim
|
|
57
57
|
|
58
58
|
self.decidim_category_id = model.categorization.decidim_category_id if model.categorization
|
59
59
|
self.type_of_meeting = model.type_of_meeting
|
60
|
+
|
61
|
+
presenter = MeetingEditionPresenter.new(model)
|
62
|
+
self.title = presenter.title(all_locales: true)
|
63
|
+
self.description = presenter.editor_description(all_locales: true)
|
60
64
|
end
|
61
65
|
|
62
66
|
def services_to_persist
|
@@ -125,7 +129,7 @@ module Decidim
|
|
125
129
|
end
|
126
130
|
|
127
131
|
def registration_type_select
|
128
|
-
Decidim::Meetings::Meeting::
|
132
|
+
Decidim::Meetings::Meeting::REGISTRATION_TYPES.keys.map do |type|
|
129
133
|
[
|
130
134
|
I18n.t("registration_type.#{type}", scope: "decidim.meetings"),
|
131
135
|
type
|
@@ -41,9 +41,9 @@ module Decidim
|
|
41
41
|
# to resubmit the form, the form will not hold an ID, so the `to_param`
|
42
42
|
# method will return an empty string and Rails will treat this as a
|
43
43
|
# `create` action, thus raising an error since this action is not defined
|
44
|
-
# for the controller we
|
44
|
+
# for the controller we are using.
|
45
45
|
#
|
46
|
-
# TL;DR: if you remove this method, we
|
46
|
+
# TL;DR: if you remove this method, we will get errors, so do not.
|
47
47
|
def id
|
48
48
|
return super if super.present?
|
49
49
|
|
@@ -19,7 +19,7 @@ module Decidim
|
|
19
19
|
validates :end_time, presence: true, date: { after: :start_time }
|
20
20
|
|
21
21
|
def type_of_meeting_select
|
22
|
-
Decidim::Meetings::Meeting::TYPE_OF_MEETING.map do |type|
|
22
|
+
Decidim::Meetings::Meeting::TYPE_OF_MEETING.keys.map do |type|
|
23
23
|
[
|
24
24
|
I18n.t("type_of_meeting.#{type}", scope: "decidim.meetings"),
|
25
25
|
type
|
@@ -47,7 +47,7 @@ module Decidim
|
|
47
47
|
self.decidim_category_id = model.categorization.decidim_category_id if model.categorization
|
48
48
|
presenter = MeetingEditionPresenter.new(model)
|
49
49
|
self.title = presenter.title(all_locales: false)
|
50
|
-
self.description = presenter.
|
50
|
+
self.description = presenter.editor_description(all_locales: false)
|
51
51
|
self.location = presenter.location(all_locales: false)
|
52
52
|
self.location_hints = presenter.location_hints(all_locales: false)
|
53
53
|
self.registration_terms = presenter.registration_terms(all_locales: false)
|
@@ -81,7 +81,7 @@ module Decidim
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def type_of_meeting_select
|
84
|
-
Decidim::Meetings::Meeting::TYPE_OF_MEETING.map do |type|
|
84
|
+
Decidim::Meetings::Meeting::TYPE_OF_MEETING.keys.map do |type|
|
85
85
|
[
|
86
86
|
I18n.t("type_of_meeting.#{type}", scope: "decidim.meetings"),
|
87
87
|
type
|
@@ -116,7 +116,7 @@ module Decidim
|
|
116
116
|
end
|
117
117
|
|
118
118
|
def registration_type_select
|
119
|
-
Decidim::Meetings::Meeting::
|
119
|
+
Decidim::Meetings::Meeting::REGISTRATION_TYPES.keys.map do |type|
|
120
120
|
[
|
121
121
|
I18n.t("registration_type.#{type}", scope: "decidim.meetings"),
|
122
122
|
type
|