decidim-meetings 0.25.0.rc4 → 0.26.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/meetings/content_blocks/highlighted_meetings/heading.erb +1 -1
- data/app/cells/decidim/meetings/content_blocks/highlighted_meetings_cell.rb +1 -1
- data/app/cells/decidim/meetings/content_blocks/{upcoming_events → upcoming_meetings}/show.erb +6 -6
- data/app/cells/decidim/meetings/content_blocks/{upcoming_events_cell.rb → upcoming_meetings_cell.rb} +11 -10
- data/app/cells/decidim/meetings/highlighted_meetings_for_component_cell.rb +1 -1
- data/app/cells/decidim/meetings/join_meeting_button_cell.rb +1 -1
- data/app/cells/decidim/meetings/meeting_list_item_cell.rb +10 -0
- data/app/cells/decidim/meetings/meeting_m_cell.rb +48 -0
- data/app/cells/decidim/meetings/meeting_s_cell.rb +22 -0
- data/app/cells/decidim/meetings/meetings_map_cell.rb +6 -0
- data/app/cells/decidim/meetings/online_meeting_cell.rb +23 -8
- data/app/cells/decidim/meetings/online_meeting_link/show.erb +2 -2
- data/app/cells/decidim/meetings/online_meeting_link_cell.rb +1 -5
- data/app/cells/decidim/meetings/public_participants_list_cell.rb +1 -0
- data/app/cells/decidim/meetings/question_responses_cell.rb +1 -1
- data/app/commands/decidim/meetings/admin/create_meeting.rb +11 -1
- data/app/commands/decidim/meetings/admin/publish_meeting.rb +3 -1
- data/app/commands/decidim/meetings/admin/update_meeting.rb +8 -2
- data/app/commands/decidim/meetings/create_meeting.rb +14 -2
- data/app/commands/decidim/meetings/update_meeting.rb +5 -2
- data/app/commands/decidim/meetings/withdraw_meeting.rb +39 -0
- data/app/controllers/concerns/decidim/meetings/filterable.rb +33 -0
- data/app/controllers/decidim/meetings/directory/application_controller.rb +16 -0
- data/app/controllers/decidim/meetings/directory/meetings_controller.rb +31 -20
- data/app/controllers/decidim/meetings/live_events_controller.rb +7 -1
- data/app/controllers/decidim/meetings/meetings_controller.rb +19 -17
- data/app/events/decidim/meetings/close_meeting_event.rb +1 -3
- data/app/events/decidim/meetings/create_meeting_event.rb +2 -4
- data/app/events/decidim/meetings/meeting_event.rb +37 -0
- data/app/events/decidim/meetings/meeting_registrations_enabled_event.rb +1 -3
- data/app/events/decidim/meetings/meeting_registrations_over_percentage_event.rb +2 -4
- data/app/events/decidim/meetings/registration_code_validated_event.rb +2 -4
- data/app/events/decidim/meetings/upcoming_meeting_event.rb +1 -3
- data/app/events/decidim/meetings/update_meeting_event.rb +1 -3
- data/app/forms/decidim/meetings/admin/close_meeting_form.rb +1 -1
- data/app/forms/decidim/meetings/admin/meeting_copy_form.rb +4 -13
- data/app/forms/decidim/meetings/admin/meeting_form.rb +34 -46
- data/app/forms/decidim/meetings/base_meeting_form.rb +59 -0
- data/app/forms/decidim/meetings/close_meeting_form.rb +6 -6
- data/app/forms/decidim/meetings/meeting_form.rb +30 -46
- data/app/helpers/decidim/meetings/application_helper.rb +13 -1
- data/app/helpers/decidim/meetings/directory/application_helper.rb +150 -0
- data/app/helpers/decidim/meetings/meeting_cells_helper.rb +4 -1
- data/app/helpers/decidim/meetings/meetings_helper.rb +3 -0
- data/app/models/decidim/meetings/meeting.rb +53 -1
- data/app/packs/src/decidim/meetings/admin/meetings_form.js +27 -11
- data/app/packs/src/decidim/meetings/meetings_form.js +19 -0
- data/app/packs/src/decidim/meetings/meetings_polls.js +31 -26
- data/app/permissions/decidim/meetings/permissions.rb +9 -1
- data/app/presenters/decidim/meetings/meeting_edition_presenter.rb +14 -0
- data/app/presenters/decidim/meetings/meeting_presenter.rb +13 -6
- data/app/services/decidim/meetings/diff_renderer.rb +4 -4
- data/app/services/decidim/meetings/directory/meeting_search.rb +53 -0
- data/app/services/decidim/meetings/meeting_iframe_embedder.rb +1 -1
- data/app/services/decidim/meetings/meeting_search.rb +15 -2
- data/app/views/decidim/meetings/admin/meeting_copies/_form.html.erb +16 -1
- data/app/views/decidim/meetings/admin/meeting_copies/new.html.erb +1 -1
- data/app/views/decidim/meetings/admin/meetings/_form.html.erb +15 -3
- data/app/views/decidim/meetings/directory/meetings/_filters.html.erb +34 -0
- data/app/views/decidim/meetings/directory/meetings/index.html.erb +1 -18
- data/app/views/decidim/meetings/meetings/_filters.html.erb +2 -0
- data/app/views/decidim/meetings/meetings/_filters_small_view.html.erb +3 -3
- data/app/views/decidim/meetings/meetings/_form.html.erb +14 -3
- data/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +1 -1
- data/app/views/decidim/meetings/meetings/_meetings.html.erb +18 -0
- data/app/views/decidim/meetings/meetings/index.html.erb +1 -0
- data/app/views/decidim/meetings/meetings/show.html.erb +12 -13
- data/config/locales/ar.yml +2 -9
- data/config/locales/ca.yml +87 -22
- data/config/locales/cs.yml +83 -13
- data/config/locales/de.yml +2 -11
- data/config/locales/el.yml +2 -9
- data/config/locales/en.yml +41 -13
- data/config/locales/es-MX.yml +96 -9
- data/config/locales/es-PY.yml +96 -9
- data/config/locales/es.yml +136 -8
- data/config/locales/eu.yml +230 -11
- data/config/locales/fi-plain.yml +82 -13
- data/config/locales/fi.yml +83 -13
- data/config/locales/fr-CA.yml +114 -11
- data/config/locales/fr.yml +118 -14
- data/config/locales/ga-IE.yml +213 -0
- data/config/locales/gl.yml +30 -11
- data/config/locales/hu.yml +2 -9
- data/config/locales/id-ID.yml +2 -9
- data/config/locales/it.yml +43 -13
- data/config/locales/ja.yml +86 -16
- data/config/locales/lb-LU.yml +210 -0
- data/config/locales/lb.yml +410 -0
- data/config/locales/lv.yml +2 -9
- data/config/locales/nl.yml +66 -13
- data/config/locales/no.yml +2 -9
- data/config/locales/pl.yml +36 -11
- data/config/locales/pt-BR.yml +4 -14
- data/config/locales/pt.yml +153 -9
- data/config/locales/ro-RO.yml +193 -101
- data/config/locales/ru.yml +0 -8
- data/config/locales/sk.yml +2 -9
- data/config/locales/sl.yml +0 -3
- data/config/locales/sv.yml +108 -9
- data/config/locales/tr-TR.yml +2 -9
- data/config/locales/val-ES.yml +1 -0
- data/config/locales/zh-CN.yml +2 -9
- data/db/migrate/20210519133705_add_comments_availability_columns_to_meetings_table.rb +14 -0
- data/db/migrate/20210727085318_add_state_field_to_meeting.rb +7 -0
- data/db/migrate/20210903143040_add_iframe_access_level_to_decidim_meetings.rb +7 -0
- data/db/migrate/20210922140454_transform_show_embedded_iframe_column.rb +15 -0
- data/db/migrate/20210928095036_rename_upcoming_events_content_block_to_upcoming_meetings.rb +13 -0
- data/lib/decidim/api/meeting_type.rb +2 -1
- data/lib/decidim/meetings/component.rb +17 -7
- data/lib/decidim/meetings/directory_engine.rb +3 -3
- data/lib/decidim/meetings/engine.rb +8 -1
- data/lib/decidim/meetings/meeting_serializer.rb +2 -2
- data/lib/decidim/meetings/test/factories.rb +24 -3
- data/lib/decidim/meetings/test/notifications_handling.rb +39 -0
- data/lib/decidim/meetings/test/translated_event.rb +22 -0
- data/lib/decidim/meetings/version.rb +1 -1
- data/lib/decidim/meetings.rb +5 -0
- metadata +38 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 256dad0f957894de0c248a6cce248f88bc042dd492c66fd11e184d7a87967c39
|
4
|
+
data.tar.gz: c6a0dfbfe8f98bebebf610efb7343760c54dba467c110cc9f5f13f00b3808f15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dd07cca73c821eaf9cc3563a214a1739cac3fa09e1cd6a4f306dc0724a035d04019628b913ba134c4568cf453bc5d177a6c6df3753a835ba590756d7a01b68e
|
7
|
+
data.tar.gz: f44f047fcd96d9e89dd57a3758c6199285675eb91b813dc9c5fa60d50bdd69cff37f067697469513e129f4a3b8473d0d59d14d46efc436fc3817bda17f22aad5
|
@@ -1 +1 @@
|
|
1
|
-
<h2 class="section-heading"><%= t("decidim.meetings.content_blocks.
|
1
|
+
<h2 class="section-heading"><%= t("decidim.meetings.content_blocks.upcoming_meetings.upcoming_meetings") %></h2>
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module ContentBlocks
|
6
6
|
class HighlightedMeetingsCell < Decidim::ContentBlocks::HighlightedElementsCell
|
7
7
|
def base_relation
|
8
|
-
Decidim::Meetings::Meeting.where(component: published_components)
|
8
|
+
Decidim::Meetings::Meeting.except_withdrawn.where(component: published_components)
|
9
9
|
end
|
10
10
|
|
11
11
|
def elements
|
data/app/cells/decidim/meetings/content_blocks/{upcoming_events → upcoming_meetings}/show.erb
RENAMED
@@ -1,17 +1,17 @@
|
|
1
|
-
<section class="wrapper-home upcoming-
|
1
|
+
<section class="wrapper-home upcoming-meetings home-section">
|
2
2
|
<div class="row">
|
3
|
-
<h3 class="section-heading"><%= t("decidim.meetings.content_blocks.
|
3
|
+
<h3 class="section-heading"><%= t("decidim.meetings.content_blocks.upcoming_meetings.upcoming_meetings") %></h3>
|
4
4
|
<div class="row">
|
5
5
|
<div class="columns medium-6">
|
6
|
-
<%
|
6
|
+
<% upcoming_meetings.first(4).each do |event| %>
|
7
7
|
<%= card_for event, size: :s %>
|
8
8
|
<% end %>
|
9
9
|
</div>
|
10
10
|
<div class="columns medium-6">
|
11
11
|
<% if geolocation_enabled? %>
|
12
|
-
<%= cell "decidim/meetings/meetings_map",
|
12
|
+
<%= cell "decidim/meetings/meetings_map", upcoming_meetings %>
|
13
13
|
<% else %>
|
14
|
-
<% (
|
14
|
+
<% (upcoming_meetings - upcoming_meetings.first(4)).each do |event| %>
|
15
15
|
<%= card_for event, size: :s %>
|
16
16
|
<% end %>
|
17
17
|
<% end %>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
</div>
|
20
20
|
<div class="row">
|
21
21
|
<div class="column">
|
22
|
-
<%= link_to t("decidim.meetings.content_blocks.
|
22
|
+
<%= link_to t("decidim.meetings.content_blocks.upcoming_meetings.view_all_meetings"), meetings_directory_path, class: "button hollow button--sc pull-right" %>
|
23
23
|
</div>
|
24
24
|
</div>
|
25
25
|
</div>
|
data/app/cells/decidim/meetings/content_blocks/{upcoming_events_cell.rb → upcoming_meetings_cell.rb}
RENAMED
@@ -3,23 +3,24 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Meetings
|
5
5
|
module ContentBlocks
|
6
|
-
class
|
6
|
+
class UpcomingMeetingsCell < Decidim::ViewModel
|
7
7
|
include Decidim::CardHelper
|
8
8
|
|
9
9
|
def show
|
10
|
-
return if
|
10
|
+
return if upcoming_meetings.blank?
|
11
11
|
|
12
12
|
render
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
@
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
def upcoming_meetings
|
16
|
+
@upcoming_meetings ||= Decidim::Meetings::Meeting
|
17
|
+
.includes(component: :participatory_space)
|
18
|
+
.where(component: meeting_components)
|
19
|
+
.visible_meeting_for(current_user)
|
20
|
+
.where("end_time >= ?", Time.current)
|
21
|
+
.except_withdrawn
|
22
|
+
.order(start_time: :asc)
|
23
|
+
.limit(limit)
|
23
24
|
end
|
24
25
|
|
25
26
|
def geolocation_enabled?
|
@@ -18,7 +18,7 @@ module Decidim
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def meetings
|
21
|
-
@meetings ||= Decidim::Meetings::Meeting.where(component: model).visible_meeting_for(current_user)
|
21
|
+
@meetings ||= Decidim::Meetings::Meeting.where(component: model).except_withdrawn.visible_meeting_for(current_user)
|
22
22
|
end
|
23
23
|
|
24
24
|
def past_meetings
|
@@ -13,6 +13,16 @@ module Decidim
|
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
|
+
def cache_hash
|
17
|
+
hash = []
|
18
|
+
hash.push(I18n.locale.to_s)
|
19
|
+
hash.push(model.cache_key_with_version)
|
20
|
+
hash.push(model.component.cache_key_with_version)
|
21
|
+
hash.push(model.must_render_translation?(current_organization) ? 1 : 0) if model.respond_to?(:must_render_translation?)
|
22
|
+
|
23
|
+
hash.join(Decidim.cache_key_separator)
|
24
|
+
end
|
25
|
+
|
16
26
|
def resource_path
|
17
27
|
resource_locator(model).path(filter_link_params)
|
18
28
|
end
|
@@ -27,10 +27,58 @@ module Decidim
|
|
27
27
|
present(model).title
|
28
28
|
end
|
29
29
|
|
30
|
+
def description
|
31
|
+
present(model).description(strip_tags: true)
|
32
|
+
end
|
33
|
+
|
34
|
+
def badge
|
35
|
+
render if has_badge?
|
36
|
+
end
|
37
|
+
|
38
|
+
def has_badge?
|
39
|
+
withdrawn?
|
40
|
+
end
|
41
|
+
|
42
|
+
def state_classes
|
43
|
+
["alert"]
|
44
|
+
end
|
45
|
+
|
30
46
|
delegate :online_meeting?, to: :model
|
31
47
|
|
32
48
|
private
|
33
49
|
|
50
|
+
def cache_hash
|
51
|
+
hash = []
|
52
|
+
hash << I18n.locale.to_s
|
53
|
+
hash << model.cache_key_with_version
|
54
|
+
hash << Digest::MD5.hexdigest(model.component.cache_key_with_version)
|
55
|
+
hash << Digest::MD5.hexdigest(resource_image_path) if resource_image_path
|
56
|
+
hash << model.comments_count
|
57
|
+
hash << model.follows_count
|
58
|
+
hash << render_space? ? 1 : 0
|
59
|
+
|
60
|
+
if current_user
|
61
|
+
hash << current_user.cache_key_with_version
|
62
|
+
hash << current_user.follows?(model) ? 1 : 0
|
63
|
+
end
|
64
|
+
hash << Digest::MD5.hexdigest(model.author.cache_key_with_version)
|
65
|
+
hash << (model.must_render_translation?(current_organization) ? 1 : 0) if model.respond_to?(:must_render_translation?)
|
66
|
+
|
67
|
+
hash.join(Decidim.cache_key_separator)
|
68
|
+
end
|
69
|
+
|
70
|
+
def has_state?
|
71
|
+
withdrawn?
|
72
|
+
end
|
73
|
+
|
74
|
+
def resource_image_path
|
75
|
+
model.photo&.url
|
76
|
+
end
|
77
|
+
|
78
|
+
def has_image?
|
79
|
+
true
|
80
|
+
end
|
81
|
+
|
34
82
|
def spans_multiple_dates?
|
35
83
|
start_date != end_date
|
36
84
|
end
|
@@ -26,6 +26,28 @@ module Decidim
|
|
26
26
|
def presenter
|
27
27
|
@presenter ||= Decidim::Meetings::MeetingPresenter.new(model)
|
28
28
|
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def cache_hash
|
33
|
+
hash = []
|
34
|
+
hash << I18n.locale.to_s
|
35
|
+
hash << model.cache_key_with_version
|
36
|
+
hash << Digest::MD5.hexdigest(model.component.cache_key_with_version)
|
37
|
+
hash << Digest::MD5.hexdigest(resource_image_path) if resource_image_path
|
38
|
+
hash << model.comments_count
|
39
|
+
hash << model.follows_count
|
40
|
+
hash << render_space? ? 1 : 0
|
41
|
+
|
42
|
+
if current_user
|
43
|
+
hash << current_user.cache_key_with_version
|
44
|
+
hash << current_user.follows?(model) ? 1 : 0
|
45
|
+
end
|
46
|
+
hash << Digest::MD5.hexdigest(model.author.cache_key_with_version)
|
47
|
+
hash << (model.must_render_translation?(current_organization) ? 1 : 0) if model.respond_to?(:must_render_translation?)
|
48
|
+
|
49
|
+
hash.join(Decidim.cache_key_separator)
|
50
|
+
end
|
29
51
|
end
|
30
52
|
end
|
31
53
|
end
|
@@ -5,6 +5,16 @@ module Decidim
|
|
5
5
|
# This cell defines methods required for other cells to render
|
6
6
|
# online meeting urls
|
7
7
|
class OnlineMeetingCell < Decidim::ViewModel
|
8
|
+
delegate :live?, to: :model
|
9
|
+
|
10
|
+
def show
|
11
|
+
return if model.iframe_embed_type_none?
|
12
|
+
return unless model.iframe_access_level_allowed_for_user?(current_user)
|
13
|
+
return unless assembly_privacy_allowed?
|
14
|
+
|
15
|
+
render
|
16
|
+
end
|
17
|
+
|
8
18
|
protected
|
9
19
|
|
10
20
|
def embedder
|
@@ -14,23 +24,28 @@ module Decidim
|
|
14
24
|
delegate :embeddable?, to: :embedder
|
15
25
|
|
16
26
|
def live_event_url
|
17
|
-
if embeddable?
|
27
|
+
if embeddable? && !model.iframe_embed_type_open_in_new_tab?
|
18
28
|
Decidim::EngineRouter.main_proxy(model.component).meeting_live_event_path(meeting_id: model.id)
|
19
29
|
else
|
20
30
|
model.online_meeting_url
|
21
31
|
end
|
22
32
|
end
|
23
33
|
|
24
|
-
def live?
|
25
|
-
model.start_time &&
|
26
|
-
model.end_time &&
|
27
|
-
Time.current >= (model.start_time - 10.minutes) &&
|
28
|
-
Time.current <= model.end_time
|
29
|
-
end
|
30
|
-
|
31
34
|
def future?
|
32
35
|
Time.current <= model.start_time && !live?
|
33
36
|
end
|
37
|
+
|
38
|
+
def assembly_privacy_allowed?
|
39
|
+
return true if !private_transparent_assembly? || current_user&.admin?
|
40
|
+
|
41
|
+
model.participatory_space.users.include?(current_user)
|
42
|
+
end
|
43
|
+
|
44
|
+
def private_transparent_assembly?
|
45
|
+
return unless model.participatory_space.is_a?(Decidim::Assembly)
|
46
|
+
|
47
|
+
model.participatory_space.private_space? && model.participatory_space.is_transparent?
|
48
|
+
end
|
34
49
|
end
|
35
50
|
end
|
36
51
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% if online_meeting_url? %>
|
2
|
-
<% if
|
2
|
+
<% if live? || future? %>
|
3
3
|
<div class="card card--secondary">
|
4
4
|
<div class="card__content text-center">
|
5
5
|
<% if live? %>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
</div>
|
15
15
|
<% end %>
|
16
16
|
|
17
|
-
<% if show_embed? %>
|
17
|
+
<% if show_embed? && live? %>
|
18
18
|
<div class="<%= "margin-top-3" if live? %> absolutes aspect-ratio-16-9">
|
19
19
|
<%== embed_code(request.host) %>
|
20
20
|
</div>
|
@@ -7,10 +7,6 @@ module Decidim
|
|
7
7
|
class OnlineMeetingLinkCell < Decidim::Meetings::OnlineMeetingCell
|
8
8
|
include Decidim::LayoutHelper
|
9
9
|
|
10
|
-
def show
|
11
|
-
render
|
12
|
-
end
|
13
|
-
|
14
10
|
def online_meeting_url?
|
15
11
|
model.online_meeting_url.present?
|
16
12
|
end
|
@@ -20,7 +16,7 @@ module Decidim
|
|
20
16
|
private
|
21
17
|
|
22
18
|
def show_embed?
|
23
|
-
model.
|
19
|
+
model.iframe_embed_type_embed_in_meeting_page? && embedder.embeddable?
|
24
20
|
end
|
25
21
|
end
|
26
22
|
end
|
@@ -25,7 +25,7 @@ module Decidim
|
|
25
25
|
# This calculation is a bit complex because of multiple option answers
|
26
26
|
question_answers_choices = Decidim::Meetings::AnswerOption.where(decidim_question_id: model.id)
|
27
27
|
.joins([choices: :answer])
|
28
|
-
.group("#{answers_table_name}.id, #{answer_options_table_name}.id")
|
28
|
+
.group(Arel.sql("#{answers_table_name}.id, #{answer_options_table_name}.id"))
|
29
29
|
.select(<<~SELECT
|
30
30
|
#{answer_options_table_name}.id AS id,
|
31
31
|
#{answer_options_table_name}.body,
|
@@ -21,6 +21,7 @@ module Decidim
|
|
21
21
|
create_services!
|
22
22
|
end
|
23
23
|
|
24
|
+
create_follow_form_resource(form.current_user)
|
24
25
|
broadcast(:ok, meeting)
|
25
26
|
end
|
26
27
|
|
@@ -56,7 +57,11 @@ module Decidim
|
|
56
57
|
questionnaire: Decidim::Forms::Questionnaire.new,
|
57
58
|
customize_registration_email: form.customize_registration_email,
|
58
59
|
registration_email_custom_content: form.registration_email_custom_content,
|
59
|
-
|
60
|
+
iframe_embed_type: form.iframe_embed_type,
|
61
|
+
comments_enabled: form.comments_enabled,
|
62
|
+
comments_start_time: form.comments_start_time,
|
63
|
+
comments_end_time: form.comments_end_time,
|
64
|
+
iframe_access_level: form.iframe_access_level
|
60
65
|
}
|
61
66
|
|
62
67
|
@meeting = Decidim.traceability.create!(
|
@@ -76,6 +81,11 @@ module Decidim
|
|
76
81
|
)
|
77
82
|
end
|
78
83
|
end
|
84
|
+
|
85
|
+
def create_follow_form_resource(user)
|
86
|
+
follow_form = Decidim::FollowForm.from_params(followable_gid: meeting.to_signed_global_id.to_s).with_context(current_user: user)
|
87
|
+
Decidim::CreateFollow.call(follow_form, user)
|
88
|
+
end
|
79
89
|
end
|
80
90
|
end
|
81
91
|
end
|
@@ -60,10 +60,12 @@ module Decidim
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def schedule_upcoming_meeting_notification
|
63
|
+
return if meeting.start_time < Time.zone.now
|
64
|
+
|
63
65
|
checksum = Decidim::Meetings::UpcomingMeetingNotificationJob.generate_checksum(meeting)
|
64
66
|
|
65
67
|
Decidim::Meetings::UpcomingMeetingNotificationJob
|
66
|
-
.set(wait_until: meeting.start_time -
|
68
|
+
.set(wait_until: meeting.start_time - Decidim::Meetings.upcoming_meeting_notification)
|
67
69
|
.perform_later(meeting.id, checksum)
|
68
70
|
end
|
69
71
|
end
|
@@ -62,7 +62,11 @@ module Decidim
|
|
62
62
|
transparent: form.transparent,
|
63
63
|
customize_registration_email: form.customize_registration_email,
|
64
64
|
registration_email_custom_content: form.registration_email_custom_content,
|
65
|
-
|
65
|
+
iframe_embed_type: form.iframe_embed_type,
|
66
|
+
comments_enabled: form.comments_enabled,
|
67
|
+
comments_start_time: form.comments_start_time,
|
68
|
+
comments_end_time: form.comments_end_time,
|
69
|
+
iframe_access_level: form.iframe_access_level
|
66
70
|
)
|
67
71
|
end
|
68
72
|
|
@@ -95,10 +99,12 @@ module Decidim
|
|
95
99
|
end
|
96
100
|
|
97
101
|
def schedule_upcoming_meeting_notification
|
102
|
+
return if meeting.start_time < Time.zone.now
|
103
|
+
|
98
104
|
checksum = Decidim::Meetings::UpcomingMeetingNotificationJob.generate_checksum(meeting)
|
99
105
|
|
100
106
|
Decidim::Meetings::UpcomingMeetingNotificationJob
|
101
|
-
.set(wait_until: meeting.start_time -
|
107
|
+
.set(wait_until: meeting.start_time - Decidim::Meetings.upcoming_meeting_notification)
|
102
108
|
.perform_later(meeting.id, checksum)
|
103
109
|
end
|
104
110
|
end
|
@@ -21,6 +21,7 @@ module Decidim
|
|
21
21
|
send_notification
|
22
22
|
end
|
23
23
|
|
24
|
+
create_follow_form_resource(form.current_user)
|
24
25
|
broadcast(:ok, meeting)
|
25
26
|
end
|
26
27
|
|
@@ -54,7 +55,8 @@ module Decidim
|
|
54
55
|
type_of_meeting: form.clean_type_of_meeting,
|
55
56
|
component: form.current_component,
|
56
57
|
published_at: Time.current,
|
57
|
-
|
58
|
+
iframe_embed_type: form.iframe_embed_type,
|
59
|
+
iframe_access_level: form.iframe_access_level
|
58
60
|
}
|
59
61
|
|
60
62
|
@meeting = Decidim.traceability.create!(
|
@@ -63,13 +65,18 @@ module Decidim
|
|
63
65
|
params,
|
64
66
|
visibility: "public-only"
|
65
67
|
)
|
68
|
+
Decidim.traceability.perform_action!(:publish, meeting, form.current_user, visibility: "all") do
|
69
|
+
meeting.publish!
|
70
|
+
end
|
66
71
|
end
|
67
72
|
|
68
73
|
def schedule_upcoming_meeting_notification
|
74
|
+
return if meeting.start_time < Time.zone.now
|
75
|
+
|
69
76
|
checksum = Decidim::Meetings::UpcomingMeetingNotificationJob.generate_checksum(meeting)
|
70
77
|
|
71
78
|
Decidim::Meetings::UpcomingMeetingNotificationJob
|
72
|
-
.set(wait_until: meeting.start_time -
|
79
|
+
.set(wait_until: meeting.start_time - Decidim::Meetings.upcoming_meeting_notification)
|
73
80
|
.perform_later(meeting.id, checksum)
|
74
81
|
end
|
75
82
|
|
@@ -81,6 +88,11 @@ module Decidim
|
|
81
88
|
followers: meeting.participatory_space.followers
|
82
89
|
)
|
83
90
|
end
|
91
|
+
|
92
|
+
def create_follow_form_resource(user)
|
93
|
+
follow_form = Decidim::FollowForm.from_params(followable_gid: meeting.to_signed_global_id.to_s).with_context(current_user: user)
|
94
|
+
Decidim::CreateFollow.call(follow_form, user)
|
95
|
+
end
|
84
96
|
end
|
85
97
|
end
|
86
98
|
end
|
@@ -63,7 +63,8 @@ module Decidim
|
|
63
63
|
registrations_enabled: form.registrations_enabled,
|
64
64
|
type_of_meeting: form.clean_type_of_meeting,
|
65
65
|
online_meeting_url: form.online_meeting_url,
|
66
|
-
|
66
|
+
iframe_embed_type: form.iframe_embed_type,
|
67
|
+
iframe_access_level: form.iframe_access_level
|
67
68
|
},
|
68
69
|
visibility: "public-only"
|
69
70
|
)
|
@@ -91,10 +92,12 @@ module Decidim
|
|
91
92
|
end
|
92
93
|
|
93
94
|
def schedule_upcoming_meeting_notification
|
95
|
+
return if meeting.start_time < Time.zone.now
|
96
|
+
|
94
97
|
checksum = Decidim::Meetings::UpcomingMeetingNotificationJob.generate_checksum(meeting)
|
95
98
|
|
96
99
|
Decidim::Meetings::UpcomingMeetingNotificationJob
|
97
|
-
.set(wait_until: meeting.start_time -
|
100
|
+
.set(wait_until: meeting.start_time - Decidim::Meetings.upcoming_meeting_notification)
|
98
101
|
.perform_later(meeting.id, checksum)
|
99
102
|
end
|
100
103
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Meetings
|
5
|
+
# A command with all the business logic when a user withdraws a new proposal.
|
6
|
+
class WithdrawMeeting < Rectify::Command
|
7
|
+
# Public: Initializes the command.
|
8
|
+
#
|
9
|
+
# meeting - The meeting to withdraw.
|
10
|
+
# current_user - The current user.
|
11
|
+
def initialize(meeting, current_user)
|
12
|
+
@meeting = meeting
|
13
|
+
@current_user = current_user
|
14
|
+
end
|
15
|
+
|
16
|
+
# Executes the command. Broadcasts these events:
|
17
|
+
#
|
18
|
+
# - :ok when everything is valid, together with the meeting.
|
19
|
+
# - :invalid if the meeting does not belong to current user.
|
20
|
+
#
|
21
|
+
# Returns nothing.
|
22
|
+
def call
|
23
|
+
return broadcast(:invalid) unless @meeting.authored_by?(@current_user)
|
24
|
+
|
25
|
+
transaction do
|
26
|
+
change_meeting_state_to_withdrawn
|
27
|
+
end
|
28
|
+
|
29
|
+
broadcast(:ok, @meeting)
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def change_meeting_state_to_withdrawn
|
35
|
+
@meeting.update state: "withdrawn"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/concern"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Meetings
|
7
|
+
# A controller concern to specify default filter parameters for the controller resources.
|
8
|
+
module Filterable
|
9
|
+
extend ActiveSupport::Concern
|
10
|
+
|
11
|
+
included do
|
12
|
+
private
|
13
|
+
|
14
|
+
def default_filter_type_params
|
15
|
+
%w(all) + Decidim::Meetings::Meeting::TYPE_OF_MEETING
|
16
|
+
end
|
17
|
+
|
18
|
+
def default_search_params
|
19
|
+
{
|
20
|
+
scope: Meeting.not_hidden.visible_meeting_for(current_user)
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def default_filter_origin_params
|
25
|
+
filter_origin_params = %w(citizens)
|
26
|
+
filter_origin_params << "official"
|
27
|
+
filter_origin_params << "user_group" if current_organization.user_groups_enabled?
|
28
|
+
filter_origin_params
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Meetings
|
5
|
+
# This controller is the abstract class from which all other controllers of
|
6
|
+
# this engine inherit.
|
7
|
+
#
|
8
|
+
# Note that it inherits from `Decidim::Components::BaseController`, which
|
9
|
+
# override its layout and provide all kinds of useful methods.
|
10
|
+
module Directory
|
11
|
+
class ApplicationController < Decidim::ApplicationController
|
12
|
+
helper Decidim::Meetings::Directory::ApplicationHelper
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|