decidim-meetings 0.22.0 → 0.23.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/config/decidim_meetings_manifest.js +1 -0
- data/app/assets/javascripts/decidim/meetings/admin/meetings_form.js.es6 +3 -0
- data/app/assets/javascripts/decidim/meetings/meetings_form.js.es6 +9 -0
- data/app/cells/decidim/meetings/content_blocks/upcoming_events_cell.rb +2 -1
- data/app/cells/decidim/meetings/highlighted_meetings_for_component_cell.rb +1 -1
- data/app/cells/decidim/meetings/meeting_cell.rb +1 -1
- data/app/cells/decidim/meetings/meeting_list_item_cell.rb +2 -2
- data/app/cells/decidim/meetings/meeting_m_cell.rb +9 -1
- data/app/cells/decidim/meetings/meetings_map/show.erb +0 -2
- data/app/cells/decidim/meetings/meetings_map_cell.rb +3 -1
- data/app/commands/decidim/meetings/admin/close_meeting.rb +1 -2
- data/app/commands/decidim/meetings/admin/copy_meeting.rb +38 -28
- data/app/commands/decidim/meetings/admin/create_meeting.rb +36 -24
- data/app/commands/decidim/meetings/admin/invite_user_to_join_meeting.rb +2 -1
- data/app/commands/decidim/meetings/admin/update_meeting.rb +9 -3
- data/app/commands/decidim/meetings/create_meeting.rb +78 -0
- data/app/commands/decidim/meetings/update_meeting.rb +94 -0
- data/app/controllers/decidim/meetings/admin/application_controller.rb +1 -1
- data/app/controllers/decidim/meetings/admin/meetings_controller.rb +11 -7
- data/app/controllers/decidim/meetings/admin/registration_form_controller.rb +4 -0
- data/app/controllers/decidim/meetings/meetings_controller.rb +76 -13
- data/app/controllers/decidim/meetings/registrations_controller.rb +1 -1
- data/app/controllers/decidim/meetings/versions_controller.rb +14 -0
- data/app/controllers/decidim/meetings/{meeting_widgets_controller.rb → widgets_controller.rb} +2 -2
- data/app/forms/decidim/meetings/admin/meeting_copy_form.rb +2 -8
- data/app/forms/decidim/meetings/admin/meeting_form.rb +24 -23
- data/app/forms/decidim/meetings/meeting_form.rb +78 -0
- data/app/helpers/decidim/meetings/admin/application_helper.rb +1 -6
- data/app/helpers/decidim/meetings/application_helper.rb +25 -0
- data/app/helpers/decidim/meetings/meetings_helper.rb +12 -0
- data/app/models/decidim/meetings/agenda.rb +3 -0
- data/app/models/decidim/meetings/agenda_item.rb +3 -0
- data/app/models/decidim/meetings/meeting.rb +69 -23
- data/app/models/decidim/meetings/minutes.rb +3 -0
- data/app/models/decidim/meetings/service.rb +13 -0
- data/app/permissions/decidim/meetings/admin/permissions.rb +2 -0
- data/app/permissions/decidim/meetings/permissions.rb +20 -0
- data/app/presenters/decidim/meetings/admin_log/invite_presenter.rb +5 -1
- data/app/presenters/decidim/meetings/admin_log/meeting_presenter.rb +3 -4
- data/app/presenters/decidim/meetings/meeting_presenter.rb +7 -3
- data/app/presenters/decidim/meetings/official_author_presenter.rb +14 -0
- data/app/queries/decidim/meetings/filtered_meetings.rb +1 -1
- data/app/services/decidim/meetings/diff_renderer.rb +21 -0
- data/app/services/decidim/meetings/meeting_search.rb +3 -25
- data/app/types/decidim/meetings/meeting_type.rb +1 -1
- data/app/views/decidim/meetings/admin/meeting_copies/_form.html.erb +2 -9
- data/app/views/decidim/meetings/admin/meetings/_form.html.erb +4 -11
- data/app/views/decidim/meetings/admin/meetings/edit.html.erb +1 -1
- data/app/views/decidim/meetings/admin/meetings/index.html.erb +4 -2
- data/app/views/decidim/meetings/directory/meetings/index.js.erb +11 -4
- data/app/views/decidim/meetings/meetings/_count.html.erb +1 -0
- data/app/views/decidim/meetings/meetings/_filters.html.erb +8 -10
- data/app/views/decidim/meetings/meetings/_form.html.erb +51 -0
- data/app/views/decidim/meetings/meetings/edit.html.erb +25 -0
- data/app/views/decidim/meetings/meetings/index.html.erb +15 -0
- data/app/views/decidim/meetings/meetings/index.js.erb +13 -4
- data/app/views/decidim/meetings/meetings/new.html.erb +25 -0
- data/app/views/decidim/meetings/meetings/show.html.erb +24 -9
- data/app/views/decidim/meetings/versions/index.html.erb +8 -0
- data/app/views/decidim/meetings/versions/show.html.erb +10 -0
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +0 -8
- data/config/locales/bg-BG.yml +0 -8
- data/config/locales/bg.yml +21 -0
- data/config/locales/ca.yml +49 -7
- data/config/locales/cs.yml +57 -13
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +113 -71
- data/config/locales/el.yml +2 -7
- data/config/locales/en.yml +49 -7
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +49 -7
- data/config/locales/es-PY.yml +50 -8
- data/config/locales/es.yml +50 -8
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +0 -8
- data/config/locales/fi-plain.yml +49 -7
- data/config/locales/fi.yml +168 -126
- data/config/locales/fr-CA.yml +57 -7
- data/config/locales/fr.yml +57 -7
- data/config/locales/gl.yml +3 -7
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +2 -7
- data/config/locales/id-ID.yml +0 -8
- data/config/locales/is-IS.yml +0 -7
- data/config/locales/is.yml +228 -0
- data/config/locales/it.yml +47 -7
- data/config/locales/ja-JP.yml +48 -9
- data/config/locales/ja.yml +496 -0
- data/config/locales/ko-KR.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/{lv-LV.yml → lv.yml} +2 -2
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +49 -7
- data/config/locales/no.yml +34 -8
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +193 -149
- data/config/locales/pt-BR.yml +1 -9
- data/config/locales/pt.yml +47 -7
- data/config/locales/ro-RO.yml +48 -7
- data/config/locales/ru.yml +0 -8
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk.yml +2 -7
- data/config/locales/sl.yml +25 -2
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sv.yml +56 -8
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +154 -98
- data/config/locales/uk.yml +0 -7
- data/config/locales/vi-VN.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +496 -0
- data/config/locales/zh-TW.yml +1 -0
- data/db/migrate/20200526110940_add_author_to_meetings.rb +30 -0
- data/db/migrate/20200702123209_create_meeting_services_table.rb +13 -0
- data/db/migrate/20200702123210_move_meeting_services_to_own_model.rb +31 -0
- data/db/migrate/20200827153856_add_commentable_counter_cache_to_meetings.rb +9 -0
- data/db/migrate/20201016065302_fix_meetings_registration_terms.rb +29 -0
- data/db/migrate/20201111133246_add_salt_to_decidim_meetings.rb +8 -0
- data/lib/decidim/api/services_interface.rb +1 -7
- data/lib/decidim/meetings/admin_engine.rb +2 -0
- data/lib/decidim/meetings/component.rb +63 -11
- data/lib/decidim/meetings/engine.rb +3 -2
- data/lib/decidim/meetings/meeting_serializer.rb +1 -1
- data/lib/decidim/meetings/test/factories.rb +45 -8
- data/lib/decidim/meetings/version.rb +1 -1
- metadata +62 -22
- data/app/presenters/decidim/meetings/admin_log/value_types/organizer_presenter.rb +0 -70
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22df53220678ed19fc0fcdaace75d4eeeb176359964ee0e33a05272bac17d585
|
4
|
+
data.tar.gz: e8632ee7f75734cdae00df1f082e6ac2ac3f851213ca86f70fb08c638e21a2a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be2f3d7da0855204ea210b3bf3c22a3b9b350b0ad3bb43a16d334d114c0cd226bdffa26f61797a26c89644caed05b8b006c4bb0ed2809ce68ad89b3ca44a1924
|
7
|
+
data.tar.gz: bebecedc4b34d8730f2c2963e3dc697e4ddb78d8c93207c04fd82833c1f1fe780207ede45a0d36a2cf6e31338b02e42d6d1d696c2c6cff512b3be8b8bb00f55f
|
@@ -1,5 +1,6 @@
|
|
1
1
|
((exports) => {
|
2
2
|
const { AutoLabelByPositionComponent, AutoButtonsByPositionComponent, createDynamicFields, createSortList } = exports.DecidimAdmin;
|
3
|
+
const { attachGeocoding } = window.Decidim;
|
3
4
|
|
4
5
|
const wrapperSelector = ".meeting-services";
|
5
6
|
const fieldSelector = ".meeting-service";
|
@@ -93,5 +94,7 @@
|
|
93
94
|
|
94
95
|
$privateMeeting.on("change", toggleDisabledHiddenFields);
|
95
96
|
toggleDisabledHiddenFields();
|
97
|
+
|
98
|
+
attachGeocoding($form.find("#meeting_address"));
|
96
99
|
}
|
97
100
|
})(window);
|
@@ -16,13 +16,14 @@ module Decidim
|
|
16
16
|
@upcoming_events ||= Decidim::Meetings::Meeting
|
17
17
|
.includes(component: :participatory_space)
|
18
18
|
.where(component: meeting_components)
|
19
|
+
.visible_meeting_for(current_user)
|
19
20
|
.where("end_time >= ?", Time.current)
|
20
21
|
.order(start_time: :asc)
|
21
22
|
.limit(limit)
|
22
23
|
end
|
23
24
|
|
24
25
|
def geolocation_enabled?
|
25
|
-
Decidim.
|
26
|
+
Decidim::Map.available?(:geocoding)
|
26
27
|
end
|
27
28
|
|
28
29
|
def meetings_directory_path
|
@@ -14,11 +14,11 @@ module Decidim
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def resource_path
|
17
|
-
resource_locator(model).path
|
17
|
+
resource_locator(model).path(filter_link_params)
|
18
18
|
end
|
19
19
|
|
20
20
|
def title
|
21
|
-
|
21
|
+
present(model).title
|
22
22
|
end
|
23
23
|
|
24
24
|
def resource_date_time
|
@@ -7,6 +7,14 @@ module Decidim
|
|
7
7
|
class MeetingMCell < Decidim::CardMCell
|
8
8
|
include MeetingCellsHelper
|
9
9
|
|
10
|
+
def has_authors?
|
11
|
+
true
|
12
|
+
end
|
13
|
+
|
14
|
+
def render_authorship
|
15
|
+
cell "decidim/author", author_presenter_for(model.normalized_author)
|
16
|
+
end
|
17
|
+
|
10
18
|
def date
|
11
19
|
render
|
12
20
|
end
|
@@ -16,7 +24,7 @@ module Decidim
|
|
16
24
|
end
|
17
25
|
|
18
26
|
def title
|
19
|
-
|
27
|
+
present(model).title
|
20
28
|
end
|
21
29
|
|
22
30
|
private
|
@@ -52,8 +52,7 @@ module Decidim
|
|
52
52
|
event: "decidim.events.meetings.meeting_closed",
|
53
53
|
event_class: Decidim::Meetings::CloseMeetingEvent,
|
54
54
|
resource: meeting,
|
55
|
-
|
56
|
-
followers: meeting.followers - [meeting.organizer]
|
55
|
+
followers: meeting.followers
|
57
56
|
)
|
58
57
|
end
|
59
58
|
|
@@ -26,61 +26,71 @@ module Decidim
|
|
26
26
|
|
27
27
|
transaction do
|
28
28
|
copy_meeting!
|
29
|
+
copy_services!
|
29
30
|
schedule_upcoming_meeting_notification
|
30
31
|
send_notification
|
31
32
|
end
|
32
33
|
|
33
|
-
broadcast(:ok,
|
34
|
+
broadcast(:ok, copied_meeting)
|
34
35
|
end
|
35
36
|
|
36
37
|
private
|
37
38
|
|
38
|
-
attr_reader :form, :meeting
|
39
|
+
attr_reader :form, :meeting, :copied_meeting
|
39
40
|
|
40
41
|
def copy_meeting!
|
41
|
-
parsed_title = Decidim::ContentProcessor.parse_with_processor(:hashtag,
|
42
|
-
parsed_description = Decidim::ContentProcessor.parse_with_processor(:hashtag,
|
42
|
+
parsed_title = Decidim::ContentProcessor.parse_with_processor(:hashtag, form.title, current_organization: meeting.organization).rewrite
|
43
|
+
parsed_description = Decidim::ContentProcessor.parse_with_processor(:hashtag, form.description, current_organization: meeting.organization).rewrite
|
43
44
|
|
44
45
|
@copied_meeting = Decidim.traceability.create!(
|
45
46
|
Meeting,
|
46
|
-
|
47
|
-
scope:
|
48
|
-
category:
|
47
|
+
form.current_user,
|
48
|
+
scope: meeting.scope,
|
49
|
+
category: meeting.category,
|
49
50
|
title: parsed_title,
|
50
51
|
description: parsed_description,
|
51
|
-
end_time:
|
52
|
-
start_time:
|
53
|
-
address:
|
54
|
-
latitude:
|
55
|
-
longitude:
|
56
|
-
location:
|
57
|
-
location_hints:
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
registration_terms: @meeting.registration_terms
|
52
|
+
end_time: form.end_time,
|
53
|
+
start_time: form.start_time,
|
54
|
+
address: form.address,
|
55
|
+
latitude: form.latitude,
|
56
|
+
longitude: form.longitude,
|
57
|
+
location: form.location,
|
58
|
+
location_hints: form.location_hints,
|
59
|
+
component: meeting.component,
|
60
|
+
private_meeting: form.private_meeting,
|
61
|
+
transparent: form.transparent,
|
62
|
+
author: form.current_organization,
|
63
|
+
questionnaire: form.questionnaire,
|
64
|
+
registrations_enabled: meeting.registrations_enabled,
|
65
|
+
available_slots: meeting.available_slots,
|
66
|
+
registration_terms: meeting.registration_terms
|
67
67
|
)
|
68
68
|
end
|
69
69
|
|
70
|
+
def copy_services!
|
71
|
+
form.services_to_persist.map do |service|
|
72
|
+
Decidim::Meetings::Service.create!(
|
73
|
+
meeting: copied_meeting,
|
74
|
+
"title" => service.title,
|
75
|
+
"description" => service.description
|
76
|
+
)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
70
80
|
def schedule_upcoming_meeting_notification
|
71
|
-
checksum = Decidim::Meetings::UpcomingMeetingNotificationJob.generate_checksum(
|
81
|
+
checksum = Decidim::Meetings::UpcomingMeetingNotificationJob.generate_checksum(copied_meeting)
|
72
82
|
|
73
83
|
Decidim::Meetings::UpcomingMeetingNotificationJob
|
74
|
-
.set(wait_until:
|
75
|
-
.perform_later(
|
84
|
+
.set(wait_until: copied_meeting.start_time - 2.days)
|
85
|
+
.perform_later(copied_meeting.id, checksum)
|
76
86
|
end
|
77
87
|
|
78
88
|
def send_notification
|
79
89
|
Decidim::EventsManager.publish(
|
80
90
|
event: "decidim.events.meetings.meeting_created",
|
81
91
|
event_class: Decidim::Meetings::CreateMeetingEvent,
|
82
|
-
resource:
|
83
|
-
followers:
|
92
|
+
resource: copied_meeting,
|
93
|
+
followers: copied_meeting.participatory_space.followers
|
84
94
|
)
|
85
95
|
end
|
86
96
|
end
|
@@ -18,61 +18,73 @@ module Decidim
|
|
18
18
|
|
19
19
|
transaction do
|
20
20
|
create_meeting!
|
21
|
+
create_services!
|
21
22
|
schedule_upcoming_meeting_notification
|
22
23
|
send_notification
|
23
24
|
end
|
24
25
|
|
25
|
-
broadcast(:ok,
|
26
|
+
broadcast(:ok, meeting)
|
26
27
|
end
|
27
28
|
|
28
29
|
private
|
29
30
|
|
31
|
+
attr_reader :form, :meeting
|
32
|
+
|
30
33
|
def create_meeting!
|
31
|
-
parsed_title = Decidim::ContentProcessor.parse_with_processor(:hashtag,
|
32
|
-
parsed_description = Decidim::ContentProcessor.parse_with_processor(:hashtag,
|
34
|
+
parsed_title = Decidim::ContentProcessor.parse_with_processor(:hashtag, form.title, current_organization: form.current_organization).rewrite
|
35
|
+
parsed_description = Decidim::ContentProcessor.parse_with_processor(:hashtag, form.description, current_organization: form.current_organization).rewrite
|
33
36
|
params = {
|
34
|
-
scope:
|
35
|
-
category:
|
37
|
+
scope: form.scope,
|
38
|
+
category: form.category,
|
36
39
|
title: parsed_title,
|
37
40
|
description: parsed_description,
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
component: @form.current_component,
|
41
|
+
end_time: form.end_time,
|
42
|
+
start_time: form.start_time,
|
43
|
+
address: form.address,
|
44
|
+
latitude: form.latitude,
|
45
|
+
longitude: form.longitude,
|
46
|
+
location: form.location,
|
47
|
+
location_hints: form.location_hints,
|
48
|
+
private_meeting: form.private_meeting,
|
49
|
+
transparent: form.transparent,
|
50
|
+
author: form.current_organization,
|
51
|
+
registration_terms: form.current_component.settings.default_registration_terms,
|
52
|
+
component: form.current_component,
|
51
53
|
questionnaire: Decidim::Forms::Questionnaire.new
|
52
54
|
}
|
53
55
|
|
54
56
|
@meeting = Decidim.traceability.create!(
|
55
57
|
Meeting,
|
56
|
-
|
58
|
+
form.current_user,
|
57
59
|
params,
|
58
60
|
visibility: "all"
|
59
61
|
)
|
60
62
|
end
|
61
63
|
|
64
|
+
def create_services!
|
65
|
+
form.services_to_persist.each do |service|
|
66
|
+
Decidim::Meetings::Service.create!(
|
67
|
+
meeting: meeting,
|
68
|
+
"title" => service.title,
|
69
|
+
"description" => service.description
|
70
|
+
)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
62
74
|
def schedule_upcoming_meeting_notification
|
63
|
-
checksum = Decidim::Meetings::UpcomingMeetingNotificationJob.generate_checksum(
|
75
|
+
checksum = Decidim::Meetings::UpcomingMeetingNotificationJob.generate_checksum(meeting)
|
64
76
|
|
65
77
|
Decidim::Meetings::UpcomingMeetingNotificationJob
|
66
|
-
.set(wait_until:
|
67
|
-
.perform_later(
|
78
|
+
.set(wait_until: meeting.start_time - 2.days)
|
79
|
+
.perform_later(meeting.id, checksum)
|
68
80
|
end
|
69
81
|
|
70
82
|
def send_notification
|
71
83
|
Decidim::EventsManager.publish(
|
72
84
|
event: "decidim.events.meetings.meeting_created",
|
73
85
|
event_class: Decidim::Meetings::CreateMeetingEvent,
|
74
|
-
resource:
|
75
|
-
followers:
|
86
|
+
resource: meeting,
|
87
|
+
followers: meeting.participatory_space.followers
|
76
88
|
)
|
77
89
|
end
|
78
90
|
end
|
@@ -25,6 +25,7 @@ module Decidim
|
|
25
25
|
update_meeting!
|
26
26
|
send_notification if should_notify_followers?
|
27
27
|
schedule_upcoming_meeting_notification if start_time_changed?
|
28
|
+
update_services!
|
28
29
|
end
|
29
30
|
|
30
31
|
broadcast(:ok, meeting)
|
@@ -45,7 +46,6 @@ module Decidim
|
|
45
46
|
category: form.category,
|
46
47
|
title: parsed_title,
|
47
48
|
description: parsed_description,
|
48
|
-
services: form.services_to_persist.map { |service| { "title" => service.title, "description" => service.description } },
|
49
49
|
end_time: form.end_time,
|
50
50
|
start_time: form.start_time,
|
51
51
|
address: form.address,
|
@@ -54,11 +54,17 @@ module Decidim
|
|
54
54
|
location: form.location,
|
55
55
|
location_hints: form.location_hints,
|
56
56
|
private_meeting: form.private_meeting,
|
57
|
-
transparent: form.transparent
|
58
|
-
organizer: form.organizer
|
57
|
+
transparent: form.transparent
|
59
58
|
)
|
60
59
|
end
|
61
60
|
|
61
|
+
def update_services!
|
62
|
+
meeting.services = form.services_to_persist.map do |service|
|
63
|
+
Decidim::Meetings::Service.new("title" => service.title, "description" => service.description)
|
64
|
+
end
|
65
|
+
meeting.save!
|
66
|
+
end
|
67
|
+
|
62
68
|
def send_notification
|
63
69
|
Decidim::EventsManager.publish(
|
64
70
|
event: "decidim.events.meetings.meeting_updated",
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Meetings
|
5
|
+
# This command is executed when a participant or user group creates a Meeting from the public
|
6
|
+
# views.
|
7
|
+
class CreateMeeting < Rectify::Command
|
8
|
+
def initialize(form)
|
9
|
+
@form = form
|
10
|
+
end
|
11
|
+
|
12
|
+
# Creates the meeting if valid.
|
13
|
+
#
|
14
|
+
# Broadcasts :ok if successful, :invalid otherwise.
|
15
|
+
def call
|
16
|
+
return broadcast(:invalid) if form.invalid?
|
17
|
+
|
18
|
+
transaction do
|
19
|
+
create_meeting!
|
20
|
+
schedule_upcoming_meeting_notification
|
21
|
+
send_notification
|
22
|
+
end
|
23
|
+
|
24
|
+
broadcast(:ok, meeting)
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
attr_reader :meeting, :form
|
30
|
+
|
31
|
+
def create_meeting!
|
32
|
+
parsed_title = Decidim::ContentProcessor.parse_with_processor(:hashtag, form.title, current_organization: form.current_organization).rewrite
|
33
|
+
parsed_description = Decidim::ContentProcessor.parse_with_processor(:hashtag, form.description, current_organization: form.current_organization).rewrite
|
34
|
+
params = {
|
35
|
+
scope: form.scope,
|
36
|
+
category: form.category,
|
37
|
+
title: { I18n.locale => parsed_title },
|
38
|
+
description: { I18n.locale => parsed_description },
|
39
|
+
end_time: form.end_time,
|
40
|
+
start_time: form.start_time,
|
41
|
+
address: form.address,
|
42
|
+
latitude: form.latitude,
|
43
|
+
longitude: form.longitude,
|
44
|
+
location: { I18n.locale => form.location },
|
45
|
+
location_hints: { I18n.locale => form.location_hints },
|
46
|
+
author: form.current_user,
|
47
|
+
decidim_user_group_id: form.user_group_id,
|
48
|
+
registration_terms: form.current_component.settings.default_registration_terms,
|
49
|
+
component: form.current_component
|
50
|
+
}
|
51
|
+
|
52
|
+
@meeting = Decidim.traceability.create!(
|
53
|
+
Meeting,
|
54
|
+
form.current_user,
|
55
|
+
params,
|
56
|
+
visibility: "public-only"
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
def schedule_upcoming_meeting_notification
|
61
|
+
checksum = Decidim::Meetings::UpcomingMeetingNotificationJob.generate_checksum(meeting)
|
62
|
+
|
63
|
+
Decidim::Meetings::UpcomingMeetingNotificationJob
|
64
|
+
.set(wait_until: meeting.start_time - 2.days)
|
65
|
+
.perform_later(meeting.id, checksum)
|
66
|
+
end
|
67
|
+
|
68
|
+
def send_notification
|
69
|
+
Decidim::EventsManager.publish(
|
70
|
+
event: "decidim.events.meetings.meeting_created",
|
71
|
+
event_class: Decidim::Meetings::CreateMeetingEvent,
|
72
|
+
resource: meeting,
|
73
|
+
followers: meeting.participatory_space.followers
|
74
|
+
)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|