decidim-meetings 0.29.2 → 0.30.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/cancel_registration_meeting_button/cancelation_modal.erb +1 -1
- data/app/cells/decidim/meetings/cancel_registration_meeting_button/show.erb +3 -1
- data/app/cells/decidim/meetings/cancel_registration_meeting_button_cell.rb +1 -1
- data/app/cells/decidim/meetings/dates_and_map/show.erb +1 -1
- data/app/cells/decidim/meetings/highlighted_meetings_for_component/show.erb +1 -1
- data/app/cells/decidim/meetings/join_meeting_button/show.erb +5 -2
- data/app/cells/decidim/meetings/meeting_card_metadata_cell.rb +3 -3
- data/app/cells/decidim/meetings/meeting_l_cell.rb +12 -0
- data/app/commands/decidim/meetings/admin/copy_meeting.rb +1 -2
- data/app/commands/decidim/meetings/admin/create_meeting.rb +8 -2
- data/app/commands/decidim/meetings/admin/update_meeting.rb +8 -2
- data/app/commands/decidim/meetings/create_meeting.rb +2 -2
- data/app/commands/decidim/meetings/update_meeting.rb +2 -3
- data/app/controllers/concerns/decidim/meetings/admin/filterable.rb +9 -5
- data/app/controllers/concerns/decidim/meetings/component_filterable.rb +1 -2
- data/app/controllers/decidim/meetings/admin/meetings_controller.rb +14 -22
- data/app/controllers/decidim/meetings/admin/registration_form_controller.rb +8 -0
- data/app/controllers/decidim/meetings/directory/meetings_controller.rb +2 -4
- data/app/controllers/decidim/meetings/meetings_controller.rb +40 -6
- data/app/forms/decidim/meetings/admin/meeting_form.rb +16 -30
- data/app/forms/decidim/meetings/base_meeting_form.rb +6 -0
- data/app/forms/decidim/meetings/meeting_form.rb +2 -30
- data/app/helpers/decidim/meetings/admin/application_helper.rb +11 -1
- data/app/helpers/decidim/meetings/application_helper.rb +35 -1
- data/app/helpers/decidim/meetings/directory/application_helper.rb +9 -48
- data/app/helpers/decidim/meetings/meetings_helper.rb +5 -0
- data/app/models/decidim/meetings/invite.rb +10 -0
- data/app/models/decidim/meetings/meeting.rb +23 -1
- data/app/models/decidim/meetings/meeting_link.rb +25 -0
- data/app/packs/entrypoints/decidim_meetings_admin.js +1 -0
- data/app/packs/src/decidim/meetings/admin/meetings_components_form.js +77 -0
- data/app/packs/src/decidim/meetings/admin/meetings_form.js +8 -0
- data/app/permissions/decidim/meetings/admin/permissions.rb +1 -1
- data/app/permissions/decidim/meetings/permissions.rb +13 -9
- data/app/presenters/decidim/meetings/admin_log/meeting_presenter.rb +1 -1
- data/app/presenters/decidim/meetings/meeting_presenter.rb +13 -1
- data/app/queries/decidim/meetings/filtered_meetings.rb +2 -2
- data/app/queries/decidim/meetings/metrics/meeting_followers_metric_measure.rb +2 -2
- data/app/queries/decidim/meetings/metrics/meetings_metric_manage.rb +6 -6
- data/app/serializers/decidim/meetings/base_download_your_data_serializer.rb +32 -0
- data/app/serializers/decidim/meetings/download_your_data_invite_serializer.rb +6 -26
- data/app/serializers/decidim/meetings/download_your_data_meeting_serializer.rb +15 -0
- data/app/serializers/decidim/meetings/download_your_data_registration_serializer.rb +6 -24
- data/app/views/decidim/meetings/admin/meetings/_component.html.erb +15 -0
- data/app/views/decidim/meetings/admin/meetings/_form.html.erb +7 -9
- data/app/views/decidim/meetings/admin/meetings/_linked_spaces.html.erb +53 -0
- data/app/views/decidim/meetings/admin/meetings/_meeting-tr.html.erb +42 -0
- data/app/views/decidim/meetings/admin/meetings/_meeting_actions.html.erb +70 -0
- data/app/views/decidim/meetings/admin/meetings/_meetings-thead.html.erb +26 -0
- data/app/views/decidim/meetings/admin/meetings/index.html.erb +16 -142
- data/app/views/decidim/meetings/admin/meetings/manage_trash.html.erb +23 -0
- data/app/views/decidim/meetings/admin/registration_form/edit_questions.html.erb +44 -0
- data/app/views/decidim/meetings/admin/registrations/edit.html.erb +1 -0
- data/app/views/decidim/meetings/directory/meetings/index.html.erb +1 -2
- data/app/views/decidim/meetings/live_events/show.html.erb +5 -5
- data/app/views/decidim/meetings/meetings/_form.html.erb +4 -8
- data/app/views/decidim/meetings/meetings/_meeting.html.erb +51 -26
- data/app/views/decidim/meetings/meetings/_meeting_actions.html.erb +34 -0
- data/app/views/decidim/meetings/meetings/_meeting_aside.html.erb +20 -59
- data/app/views/decidim/meetings/meetings/_meeting_poll_actions.html.erb +2 -5
- data/app/views/decidim/meetings/meetings/_schema_org_event_meeting.html.erb +3 -0
- data/app/views/decidim/meetings/meetings/index.html.erb +10 -2
- data/app/views/decidim/meetings/meetings/show.html.erb +5 -5
- data/app/views/decidim/meetings/polls/answers/index.html.erb +5 -5
- data/app/views/decidim/meetings/shared/_filters.html.erb +1 -13
- data/app/views/decidim/meetings/shared/_index.html.erb +1 -1
- data/app/views/decidim/meetings/shared/_index.js.erb +3 -2
- data/app/views/decidim/meetings/shared/_meetings_aside.html.erb +2 -2
- data/app/views/decidim/participatory_spaces/_conference_venues.html.erb +1 -1
- data/config/locales/ar.yml +17 -17
- data/config/locales/bg.yml +5 -25
- data/config/locales/ca.yml +137 -25
- data/config/locales/cs.yml +138 -28
- data/config/locales/de.yml +106 -26
- data/config/locales/el.yml +1 -22
- data/config/locales/en.yml +133 -21
- data/config/locales/es-MX.yml +137 -25
- data/config/locales/es-PY.yml +137 -25
- data/config/locales/es.yml +137 -25
- data/config/locales/eu.yml +138 -26
- data/config/locales/fi-plain.yml +138 -26
- data/config/locales/fi.yml +138 -26
- data/config/locales/fr-CA.yml +79 -26
- data/config/locales/fr.yml +79 -26
- data/config/locales/ga-IE.yml +0 -13
- data/config/locales/gl.yml +1 -12
- data/config/locales/hu.yml +1 -19
- data/config/locales/id-ID.yml +1 -13
- data/config/locales/is-IS.yml +0 -12
- data/config/locales/it.yml +1 -17
- data/config/locales/ja.yml +95 -25
- data/config/locales/lb.yml +0 -11
- data/config/locales/lt.yml +1 -23
- data/config/locales/lv.yml +1 -13
- data/config/locales/nl.yml +1 -17
- data/config/locales/no.yml +1 -16
- data/config/locales/pl.yml +5 -21
- data/config/locales/pt-BR.yml +1 -21
- data/config/locales/pt.yml +1 -17
- data/config/locales/ro-RO.yml +30 -17
- data/config/locales/ru.yml +1 -13
- data/config/locales/sk.yml +1 -13
- data/config/locales/sv.yml +74 -26
- data/config/locales/tr-TR.yml +1 -19
- data/config/locales/uk.yml +0 -12
- data/config/locales/zh-CN.yml +1 -18
- data/config/locales/zh-TW.yml +1 -21
- data/db/migrate/20181107175558_add_questionnaire_to_existing_meetings.rb +1 -1
- data/db/migrate/20200827153856_add_commentable_counter_cache_to_meetings.rb +1 -1
- data/db/migrate/20201016065302_fix_meetings_registration_terms.rb +1 -1
- data/db/migrate/20210310120731_add_followable_counter_cache_to_meetings.rb +1 -1
- data/db/migrate/20240712104245_create_decidim_meetings_meeting_link.rb +12 -0
- data/db/migrate/20240828103603_add_deleted_at_to_decidim_meetings_meetings.rb +8 -0
- data/decidim-meetings.gemspec +1 -1
- data/lib/decidim/api/agenda_item_type.rb +6 -7
- data/lib/decidim/api/agenda_type.rb +3 -4
- data/lib/decidim/api/meeting_type.rb +33 -41
- data/lib/decidim/api/meetings_type.rb +4 -5
- data/lib/decidim/api/service_type.rb +1 -1
- data/lib/decidim/meetings/admin_engine.rb +9 -1
- data/lib/decidim/meetings/component.rb +14 -4
- data/lib/decidim/meetings/download_your_data_user_answers_serializer.rb +13 -7
- data/lib/decidim/meetings/meeting_serializer.rb +70 -59
- data/lib/decidim/meetings/schema_org_event_meeting_serializer.rb +151 -0
- data/lib/decidim/meetings/seeds.rb +2 -4
- data/lib/decidim/meetings/test/factories.rb +8 -0
- data/lib/decidim/meetings/test/translated_event.rb +3 -3
- data/lib/decidim/meetings/version.rb +1 -1
- data/lib/decidim/meetings.rb +1 -0
- metadata +32 -21
- data/app/cells/decidim/meetings/meetings_map/show.erb +0 -16
- data/app/cells/decidim/meetings/meetings_map_cell.rb +0 -32
- data/app/commands/decidim/meetings/admin/destroy_meeting.rb +0 -21
- data/app/helpers/decidim/meetings/map_helper.rb +0 -21
- data/app/views/decidim/meetings/meetings/_actions.html.erb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcd3f09c335e14cfd8af7bb8e69aeebb463d7c1a857a8103160de1888501f327
|
4
|
+
data.tar.gz: f2e9d27de11c40f9cdf57b3ca2d12a4242c0817219e199825b2267077ced7b53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86fb431af3abf5c2fc4a5279c20ce5c1966569962d281e17cff0adf1760aa870b21c89766fb34aa005027cd864f7047f3fe864c0da247f4686da1a648fb85383
|
7
|
+
data.tar.gz: 3de5c0b9b0402c9cb690eb6091a71306db567cd9d9b4ff7b9511cf0f7205403a396d38a3fbd501b8ac1613f7eca890ce5d7a0700ae2673a9af73d3a6965e2264
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<button type="button" class="button button__sm md:button__lg button__transparent-secondary" data-dialog-close="meeting-cancelation-confirm-<%= model.id %>">
|
13
13
|
<span><%= t("close", scope: "decidim.shared.flag_modal") %></span>
|
14
14
|
</button>
|
15
|
-
<button type="submit" class="button button__sm md:button__lg
|
15
|
+
<button type="submit" class="button button__sm md:button__lg button__transparent-secondary">
|
16
16
|
<span><%= t("leave", scope: "decidim.meetings.meetings.show") %></span>
|
17
17
|
<%= icon "arrow-right-line" %>
|
18
18
|
</button>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="meeting__calendar-container">
|
2
2
|
<div class="meeting__calendar meeting__calendar__lg">
|
3
|
-
<div class="meeting__calendar-month">
|
3
|
+
<div class="meeting__calendar-month mb-4">
|
4
4
|
<span><%= l(start_time, format: !same_month? ? "%b" : "%B") %></span>
|
5
5
|
<span class="meeting__calendar-separator"><%= "-" if !same_month? %></span>
|
6
6
|
<span><%= l(end_time, format: "%b") if !same_month? %></span>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
</div>
|
17
17
|
<% if show_map? %>
|
18
18
|
<div class="meeting-list__block-map">
|
19
|
-
<%= cell "decidim/
|
19
|
+
<%= cell "decidim/map", collection, metadata_card: "decidim/meetings/meeting_card_metadata" %>
|
20
20
|
</div>
|
21
21
|
<% end %>
|
22
22
|
<div class="meeting-list__block-list">
|
@@ -9,14 +9,17 @@
|
|
9
9
|
disabled: !model.has_available_slots?
|
10
10
|
) %>
|
11
11
|
<% else %>
|
12
|
-
|
12
|
+
<% unless options[:hide_modal] %>
|
13
|
+
<%= render :registration_modal %>
|
14
|
+
<% end %>
|
13
15
|
<%= action_authorized_button_to(
|
14
16
|
:join,
|
15
17
|
i18n_join_text,
|
16
18
|
"#",
|
17
19
|
class: button_classes,
|
18
20
|
disabled: !model.has_available_slots?,
|
19
|
-
data: { "dialog-open": current_user.present? ? "meeting-registration-confirm-#{model.id}" : "loginModal" }
|
21
|
+
data: { "dialog-open": current_user.present? ? "meeting-registration-confirm-#{model.id}" : "loginModal" },
|
22
|
+
resource: model
|
20
23
|
) %>
|
21
24
|
<% end %>
|
22
25
|
<% end %>
|
@@ -6,7 +6,7 @@ module Decidim
|
|
6
6
|
class MeetingCardMetadataCell < Decidim::CardMetadataCell
|
7
7
|
alias meeting model
|
8
8
|
|
9
|
-
delegate :type_of_meeting, :start_time, :end_time, :
|
9
|
+
delegate :type_of_meeting, :start_time, :end_time, :withdrawn?, to: :meeting
|
10
10
|
|
11
11
|
alias start_date start_time
|
12
12
|
alias end_date end_time
|
@@ -20,10 +20,10 @@ module Decidim
|
|
20
20
|
private
|
21
21
|
|
22
22
|
def meeting_items
|
23
|
-
[start_date_item, type, comments_count_item
|
23
|
+
[start_date_item, type, comments_count_item] + taxonomy_items + [withdrawn_item]
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
26
|
+
def items_for_map
|
27
27
|
[dates_item, type].compact_blank.map do |item|
|
28
28
|
{
|
29
29
|
text: item[:text],
|
@@ -22,8 +22,20 @@ module Decidim
|
|
22
22
|
render
|
23
23
|
end
|
24
24
|
|
25
|
+
def url_extra_params
|
26
|
+
return options[:url_extra_params] if options[:url_extra_params]
|
27
|
+
return {} unless defined?(current_component)
|
28
|
+
return {} if current_component == meeting.component
|
29
|
+
|
30
|
+
{ previous_space: "#{current_space.class}##{current_space.id}" }
|
31
|
+
end
|
32
|
+
|
25
33
|
private
|
26
34
|
|
35
|
+
def current_space
|
36
|
+
@current_space ||= current_component.participatory_space
|
37
|
+
end
|
38
|
+
|
27
39
|
def metadata_cell
|
28
40
|
"decidim/meetings/meeting_card_metadata"
|
29
41
|
end
|
@@ -44,8 +44,7 @@ module Decidim
|
|
44
44
|
@copied_meeting = Decidim.traceability.create!(
|
45
45
|
Meeting,
|
46
46
|
form.current_user,
|
47
|
-
|
48
|
-
category: form.category,
|
47
|
+
taxonomies: form.taxonomies,
|
49
48
|
title: parsed_title,
|
50
49
|
description: parsed_description,
|
51
50
|
end_time: form.end_time,
|
@@ -6,16 +6,17 @@ module Decidim
|
|
6
6
|
# This command is executed when the user creates a Meeting from the admin
|
7
7
|
# panel.
|
8
8
|
class CreateMeeting < Decidim::Commands::CreateResource
|
9
|
-
fetch_form_attributes :
|
9
|
+
fetch_form_attributes :end_time, :start_time, :online_meeting_url, :registration_type,
|
10
10
|
:registration_url, :address, :latitude, :longitude, :location, :location_hints,
|
11
11
|
:private_meeting, :transparent, :registrations_enabled, :component, :iframe_embed_type,
|
12
|
-
:comments_enabled, :comments_start_time, :comments_end_time, :iframe_access_level
|
12
|
+
:comments_enabled, :taxonomizations, :comments_start_time, :comments_end_time, :iframe_access_level
|
13
13
|
|
14
14
|
protected
|
15
15
|
|
16
16
|
def run_after_hooks
|
17
17
|
create_services!
|
18
18
|
create_follow_form_resource(form.current_user)
|
19
|
+
link_components!
|
19
20
|
end
|
20
21
|
|
21
22
|
def attributes
|
@@ -47,6 +48,11 @@ module Decidim
|
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
51
|
+
def link_components!
|
52
|
+
resource.components = form.components
|
53
|
+
resource.save!
|
54
|
+
end
|
55
|
+
|
50
56
|
def create_follow_form_resource(user)
|
51
57
|
follow_form = Decidim::FollowForm.from_params(followable_gid: resource.to_signed_global_id.to_s).with_context(current_user: user)
|
52
58
|
Decidim::CreateFollow.call(follow_form)
|
@@ -6,9 +6,9 @@ module Decidim
|
|
6
6
|
# This command is executed when the user changes a Meeting from the admin
|
7
7
|
# panel.
|
8
8
|
class UpdateMeeting < Decidim::Commands::UpdateResource
|
9
|
-
fetch_form_attributes :
|
9
|
+
fetch_form_attributes :end_time, :start_time, :online_meeting_url, :registration_type,
|
10
10
|
:registration_url, :registrations_enabled, :address, :latitude, :longitude, :location,
|
11
|
-
:location_hints,
|
11
|
+
:location_hints, :taxonomizations,
|
12
12
|
:private_meeting, :transparent, :iframe_embed_type, :comments_enabled,
|
13
13
|
:comments_start_time, :comments_end_time, :iframe_access_level
|
14
14
|
|
@@ -18,6 +18,7 @@ module Decidim
|
|
18
18
|
send_notification if should_notify_followers?
|
19
19
|
schedule_upcoming_meeting_notification if resource.published? && start_time_changed?
|
20
20
|
update_services!
|
21
|
+
update_components!
|
21
22
|
end
|
22
23
|
|
23
24
|
def attributes
|
@@ -37,6 +38,11 @@ module Decidim
|
|
37
38
|
resource.save!
|
38
39
|
end
|
39
40
|
|
41
|
+
def update_components!
|
42
|
+
resource.components = form.components
|
43
|
+
resource.save!
|
44
|
+
end
|
45
|
+
|
40
46
|
def send_notification
|
41
47
|
Decidim::EventsManager.publish(
|
42
48
|
event: "decidim.events.meetings.meeting_updated",
|
@@ -5,9 +5,9 @@ module Decidim
|
|
5
5
|
# This command is executed when a participant or user group creates a Meeting from the public
|
6
6
|
# views.
|
7
7
|
class CreateMeeting < Decidim::Commands::CreateResource
|
8
|
-
fetch_form_attributes :
|
8
|
+
fetch_form_attributes :end_time, :start_time, :address, :latitude, :longitude,
|
9
9
|
:online_meeting_url, :registration_type, :registration_url, :available_slots,
|
10
|
-
:registrations_enabled, :component, :iframe_embed_type, :iframe_access_level
|
10
|
+
:registrations_enabled, :taxonomizations, :component, :iframe_embed_type, :iframe_access_level
|
11
11
|
|
12
12
|
protected
|
13
13
|
|
@@ -52,8 +52,6 @@ module Decidim
|
|
52
52
|
meeting,
|
53
53
|
current_user,
|
54
54
|
{
|
55
|
-
scope: form.scope,
|
56
|
-
category: form.category,
|
57
55
|
title: { I18n.locale => parsed_title },
|
58
56
|
description: { I18n.locale => parsed_description },
|
59
57
|
end_time: form.end_time,
|
@@ -73,7 +71,8 @@ module Decidim
|
|
73
71
|
type_of_meeting: form.clean_type_of_meeting,
|
74
72
|
online_meeting_url: form.online_meeting_url,
|
75
73
|
iframe_embed_type: form.iframe_embed_type,
|
76
|
-
iframe_access_level: form.iframe_access_level
|
74
|
+
iframe_access_level: form.iframe_access_level,
|
75
|
+
taxonomizations: form.taxonomizations
|
77
76
|
},
|
78
77
|
visibility: "public-only"
|
79
78
|
)
|
@@ -16,15 +16,20 @@ module Decidim
|
|
16
16
|
private
|
17
17
|
|
18
18
|
def base_query
|
19
|
-
Meeting
|
19
|
+
Meeting
|
20
|
+
.not_hidden
|
21
|
+
.where(component: current_component)
|
22
|
+
.or(MeetingLink.find_meetings(component: current_component))
|
23
|
+
.order(start_time: :desc)
|
24
|
+
.page(params[:page])
|
25
|
+
.per(15)
|
20
26
|
end
|
21
27
|
|
22
28
|
def filters
|
23
29
|
[
|
24
30
|
:with_any_type,
|
25
31
|
:is_upcoming_true,
|
26
|
-
:
|
27
|
-
:category_id_eq,
|
32
|
+
:taxonomies_part_of_contains,
|
28
33
|
:with_any_origin,
|
29
34
|
:closed_at_present
|
30
35
|
]
|
@@ -33,8 +38,7 @@ module Decidim
|
|
33
38
|
def filters_with_values
|
34
39
|
{
|
35
40
|
with_any_type: meeting_types,
|
36
|
-
|
37
|
-
category_id_eq: category_ids_hash(categories.first_class),
|
41
|
+
taxonomies_part_of_contains: taxonomy_ids_hash(available_root_taxonomies),
|
38
42
|
closed_at_present: %w(true false),
|
39
43
|
is_upcoming_true: %w(true false),
|
40
44
|
with_any_origin: %w(participants official user_group)
|
@@ -5,6 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This controller allows an admin to manage meetings from a Participatory Process
|
7
7
|
class MeetingsController < Admin::ApplicationController
|
8
|
+
include Decidim::Admin::HasTrashableResources
|
8
9
|
include Decidim::Meetings::Admin::Filterable
|
9
10
|
|
10
11
|
helper_method :blank_service
|
@@ -57,27 +58,6 @@ module Decidim
|
|
57
58
|
end
|
58
59
|
end
|
59
60
|
|
60
|
-
def destroy
|
61
|
-
enforce_permission_to(:destroy, :meeting, meeting:)
|
62
|
-
|
63
|
-
Decidim::Meetings::Admin::DestroyMeeting.call(meeting, current_user) do
|
64
|
-
on(:ok) do
|
65
|
-
flash[:notice] = I18n.t("meetings.destroy.success", scope: "decidim.meetings.admin")
|
66
|
-
redirect_to meetings_path
|
67
|
-
end
|
68
|
-
|
69
|
-
on(:invalid) do
|
70
|
-
flash.now[:alert] = I18n.t(
|
71
|
-
"meetings.destroy.invalid.proposals_count",
|
72
|
-
count: proposals.size,
|
73
|
-
scope: "decidim.meetings.admin"
|
74
|
-
)
|
75
|
-
|
76
|
-
render action: "index"
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
61
|
def publish
|
82
62
|
enforce_permission_to(:update, :meeting, meeting:)
|
83
63
|
|
@@ -112,12 +92,24 @@ module Decidim
|
|
112
92
|
|
113
93
|
private
|
114
94
|
|
95
|
+
def trashable_deleted_resource_type
|
96
|
+
:meeting
|
97
|
+
end
|
98
|
+
|
99
|
+
def trashable_deleted_collection
|
100
|
+
@trashable_deleted_collection ||= filtered_collection.only_deleted.deleted_at_desc
|
101
|
+
end
|
102
|
+
|
103
|
+
def trashable_deleted_resource
|
104
|
+
@trashable_deleted_resource ||= Meeting.with_deleted.where(component: current_component).find_by(id: params[:id])
|
105
|
+
end
|
106
|
+
|
115
107
|
def meetings
|
116
108
|
@meetings ||= filtered_collection
|
117
109
|
end
|
118
110
|
|
119
111
|
def meeting
|
120
|
-
@meeting ||=
|
112
|
+
@meeting ||= Meeting.where(component: current_component).find_by(id: params[:id])
|
121
113
|
end
|
122
114
|
|
123
115
|
def collection
|
@@ -23,8 +23,16 @@ module Decidim
|
|
23
23
|
Decidim::EngineRouter.main_proxy(current_component).join_meeting_registration_path(meeting)
|
24
24
|
end
|
25
25
|
|
26
|
+
def edit_questions_template
|
27
|
+
"decidim/meetings/admin/registration_form/edit_questions"
|
28
|
+
end
|
29
|
+
|
26
30
|
private
|
27
31
|
|
32
|
+
def i18n_questions_flashes_scope
|
33
|
+
"decidim.forms.admin.questionnaires"
|
34
|
+
end
|
35
|
+
|
28
36
|
def meeting
|
29
37
|
@meeting ||= Meeting.where(component: current_component).find(params[:meeting_id])
|
30
38
|
end
|
@@ -11,7 +11,6 @@ module Decidim
|
|
11
11
|
include Paginable
|
12
12
|
|
13
13
|
helper Decidim::FiltersHelper
|
14
|
-
helper Decidim::Meetings::MapHelper
|
15
14
|
helper Decidim::ResourceHelper
|
16
15
|
helper Decidim::ShortLinkHelper
|
17
16
|
|
@@ -42,11 +41,10 @@ module Decidim
|
|
42
41
|
with_any_date: "upcoming",
|
43
42
|
title_or_description_cont: "",
|
44
43
|
activity: "all",
|
45
|
-
|
44
|
+
with_any_taxonomies: nil,
|
46
45
|
with_any_space: nil,
|
47
46
|
with_any_type: nil,
|
48
|
-
with_any_origin: nil
|
49
|
-
with_any_global_category: nil
|
47
|
+
with_any_origin: nil
|
50
48
|
}
|
51
49
|
end
|
52
50
|
|
@@ -14,6 +14,7 @@ module Decidim
|
|
14
14
|
helper Decidim::ResourceVersionsHelper
|
15
15
|
helper Decidim::ShortLinkHelper
|
16
16
|
include Decidim::AttachmentsHelper
|
17
|
+
include Decidim::SanitizeHelper
|
17
18
|
|
18
19
|
helper_method :meetings, :meeting, :registration, :search, :tab_panel_items
|
19
20
|
|
@@ -59,6 +60,8 @@ module Decidim
|
|
59
60
|
def show
|
60
61
|
raise ActionController::RoutingError, "Not Found" unless meeting
|
61
62
|
|
63
|
+
maybe_show_redirect_notice!
|
64
|
+
|
62
65
|
return if meeting.current_user_can_visit_meeting?(current_user)
|
63
66
|
|
64
67
|
flash[:alert] = I18n.t("meeting.not_allowed", scope: "decidim.meetings")
|
@@ -120,12 +123,19 @@ module Decidim
|
|
120
123
|
end
|
121
124
|
|
122
125
|
def search_collection
|
123
|
-
Meeting
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
126
|
+
Meeting
|
127
|
+
.where(component: current_component)
|
128
|
+
.published
|
129
|
+
.not_hidden
|
130
|
+
.or(MeetingLink.find_meetings(component: current_component))
|
131
|
+
.visible_for(current_user)
|
132
|
+
.with_availability(
|
133
|
+
filter_params[:with_availability]
|
134
|
+
)
|
135
|
+
.includes(
|
136
|
+
:component,
|
137
|
+
attachments: :file_attachment
|
138
|
+
)
|
129
139
|
end
|
130
140
|
|
131
141
|
def meeting_form
|
@@ -168,6 +178,30 @@ module Decidim
|
|
168
178
|
}
|
169
179
|
] + attachments_tab_panel_items(@meeting)
|
170
180
|
end
|
181
|
+
|
182
|
+
def maybe_show_redirect_notice!
|
183
|
+
return unless previous_space
|
184
|
+
|
185
|
+
flash.now[:notice] = I18n.t(
|
186
|
+
"meetings.show.redirect_notice",
|
187
|
+
scope: "decidim.meetings",
|
188
|
+
previous_space_url: request.referer,
|
189
|
+
previous_space_name: decidim_escape_translated(previous_space.title),
|
190
|
+
current_space_name: decidim_escape_translated(current_component.participatory_space.title)
|
191
|
+
)
|
192
|
+
end
|
193
|
+
|
194
|
+
def previous_space
|
195
|
+
return @previous_space if @previous_space
|
196
|
+
return unless params[:previous_space]
|
197
|
+
|
198
|
+
previous_space_class, previous_space_id = params[:previous_space].split("#")
|
199
|
+
|
200
|
+
@previous_space = previous_space_class.constantize.find_by(id: previous_space_id)
|
201
|
+
@previous_space
|
202
|
+
rescue NameError, LoadError
|
203
|
+
nil
|
204
|
+
end
|
171
205
|
end
|
172
206
|
end
|
173
207
|
end
|
@@ -8,8 +8,7 @@ module Decidim
|
|
8
8
|
include TranslatableAttributes
|
9
9
|
|
10
10
|
attribute :services, Array[MeetingServiceForm]
|
11
|
-
attribute :
|
12
|
-
attribute :decidim_category_id, Integer
|
11
|
+
attribute :component_ids, Array[Integer]
|
13
12
|
attribute :private_meeting, Boolean
|
14
13
|
attribute :transparent, Boolean
|
15
14
|
attribute :registration_type, String
|
@@ -28,8 +27,8 @@ module Decidim
|
|
28
27
|
translatable_attribute :location_hints, String
|
29
28
|
|
30
29
|
validates :iframe_embed_type, inclusion: { in: Decidim::Meetings::Meeting.iframe_embed_types }
|
31
|
-
validates :title, translatable_presence: true
|
32
|
-
validates :description,
|
30
|
+
validates :title, :description, translatable_presence: true
|
31
|
+
validates :title, :description, translated_etiquette: true
|
33
32
|
validates :registration_type, presence: true
|
34
33
|
validates :registration_url, presence: true, url: true, if: ->(form) { form.on_different_platform? }
|
35
34
|
validates :type_of_meeting, presence: true
|
@@ -37,9 +36,6 @@ module Decidim
|
|
37
36
|
validates :online_meeting_url, url: true, if: ->(form) { form.online_meeting? || form.hybrid_meeting? }
|
38
37
|
validates :comments_start_time, date: { before: :comments_end_time, allow_blank: true, if: proc { |obj| obj.comments_end_time.present? } }
|
39
38
|
validates :comments_end_time, date: { after: :comments_start_time, allow_blank: true, if: proc { |obj| obj.comments_start_time.present? } }
|
40
|
-
validates :category, presence: true, if: ->(form) { form.decidim_category_id.present? }
|
41
|
-
validates :scope, presence: true, if: ->(form) { form.decidim_scope_id.present? }
|
42
|
-
validates :decidim_scope_id, scope_belongs_to_component: true, if: ->(form) { form.decidim_scope_id.present? }
|
43
39
|
validates :clean_type_of_meeting, presence: true
|
44
40
|
validates(
|
45
41
|
:iframe_access_level,
|
@@ -48,14 +44,11 @@ module Decidim
|
|
48
44
|
)
|
49
45
|
validate :embeddable_meeting_url
|
50
46
|
|
51
|
-
delegate :categories, to: :current_component
|
52
|
-
|
53
47
|
def map_model(model)
|
54
48
|
self.services = model.services.map do |service|
|
55
49
|
MeetingServiceForm.from_model(service)
|
56
50
|
end
|
57
51
|
|
58
|
-
self.decidim_category_id = model.categorization.decidim_category_id if model.categorization
|
59
52
|
self.type_of_meeting = model.type_of_meeting
|
60
53
|
|
61
54
|
presenter = MeetingEditionPresenter.new(model)
|
@@ -67,32 +60,25 @@ module Decidim
|
|
67
60
|
services.reject(&:deleted)
|
68
61
|
end
|
69
62
|
|
70
|
-
|
71
|
-
|
72
|
-
|
63
|
+
# linked components
|
64
|
+
def components
|
65
|
+
return [] if private_non_transparent_space?
|
73
66
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
def scope
|
80
|
-
@scope ||= @attributes["decidim_scope_id"].value ? current_component.scopes.find_by(id: @attributes["decidim_scope_id"].value) : current_component.scope
|
81
|
-
end
|
82
|
-
|
83
|
-
# Scope identifier
|
84
|
-
#
|
85
|
-
# Returns the scope identifier related to the meeting
|
86
|
-
def decidim_scope_id
|
87
|
-
super || scope&.id
|
67
|
+
if private_meeting && !transparent
|
68
|
+
[]
|
69
|
+
else
|
70
|
+
Decidim::Component.where(id: component_ids)
|
71
|
+
end
|
88
72
|
end
|
89
73
|
|
90
|
-
|
91
|
-
return unless current_component
|
74
|
+
delegate :private_non_transparent_space?, to: :current_component
|
92
75
|
|
93
|
-
|
76
|
+
def number_of_services
|
77
|
+
services.size
|
94
78
|
end
|
95
79
|
|
80
|
+
alias component current_component
|
81
|
+
|
96
82
|
def clean_type_of_meeting
|
97
83
|
type_of_meeting.presence
|
98
84
|
end
|
@@ -3,6 +3,8 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Meetings
|
5
5
|
class BaseMeetingForm < Decidim::Form
|
6
|
+
include Decidim::HasTaxonomyFormAttributes
|
7
|
+
|
6
8
|
attribute :address, String
|
7
9
|
attribute :latitude, Float
|
8
10
|
attribute :longitude, Float
|
@@ -18,6 +20,10 @@ module Decidim
|
|
18
20
|
validates :start_time, presence: true, date: { before: :end_time }
|
19
21
|
validates :end_time, presence: true, date: { after: :start_time }
|
20
22
|
|
23
|
+
def participatory_space_manifest
|
24
|
+
@participatory_space_manifest ||= current_component.participatory_space.manifest.name
|
25
|
+
end
|
26
|
+
|
21
27
|
def type_of_meeting_select
|
22
28
|
Decidim::Meetings::Meeting::TYPE_OF_MEETING.keys.map do |type|
|
23
29
|
[
|
@@ -9,8 +9,6 @@ module Decidim
|
|
9
9
|
attribute :location, String
|
10
10
|
attribute :location_hints, String
|
11
11
|
|
12
|
-
attribute :decidim_scope_id, Integer
|
13
|
-
attribute :decidim_category_id, Integer
|
14
12
|
attribute :user_group_id, Integer
|
15
13
|
attribute :registration_type, String
|
16
14
|
attribute :registrations_enabled, Boolean, default: false
|
@@ -21,8 +19,8 @@ module Decidim
|
|
21
19
|
attribute :iframe_access_level, String
|
22
20
|
|
23
21
|
validates :iframe_embed_type, inclusion: { in: Decidim::Meetings::Meeting.participants_iframe_embed_types }
|
24
|
-
validates :title, presence: true
|
25
|
-
validates :description, presence: true
|
22
|
+
validates :title, presence: true, etiquette: true
|
23
|
+
validates :description, presence: true, etiquette: true
|
26
24
|
validates :type_of_meeting, presence: true
|
27
25
|
validates :location, presence: true, if: ->(form) { form.in_person_meeting? || form.hybrid_meeting? }
|
28
26
|
validates :online_meeting_url, presence: true, url: true, if: ->(form) { form.online_meeting? || form.hybrid_meeting? }
|
@@ -30,9 +28,6 @@ module Decidim
|
|
30
28
|
validates :available_slots, numericality: { greater_than_or_equal_to: 0 }, presence: true, if: ->(form) { form.on_this_platform? }
|
31
29
|
validates :registration_terms, presence: true, if: ->(form) { form.on_this_platform? }
|
32
30
|
validates :registration_url, presence: true, url: true, if: ->(form) { form.on_different_platform? }
|
33
|
-
validates :category, presence: true, if: ->(form) { form.decidim_category_id.present? }
|
34
|
-
validates :scope, presence: true, if: ->(form) { form.decidim_scope_id.present? }
|
35
|
-
validates :decidim_scope_id, scope_belongs_to_component: true, if: ->(form) { form.decidim_scope_id.present? }
|
36
31
|
validates :clean_type_of_meeting, presence: true
|
37
32
|
validates(
|
38
33
|
:iframe_access_level,
|
@@ -41,10 +36,7 @@ module Decidim
|
|
41
36
|
)
|
42
37
|
validate :embeddable_meeting_url
|
43
38
|
|
44
|
-
delegate :categories, to: :current_component
|
45
|
-
|
46
39
|
def map_model(model)
|
47
|
-
self.decidim_category_id = model.categorization.decidim_category_id if model.categorization
|
48
40
|
presenter = MeetingEditionPresenter.new(model)
|
49
41
|
self.title = presenter.title(all_locales: false)
|
50
42
|
self.description = presenter.editor_description(all_locales: false)
|
@@ -56,26 +48,6 @@ module Decidim
|
|
56
48
|
|
57
49
|
alias component current_component
|
58
50
|
|
59
|
-
# Finds the Scope from the given decidim_scope_id, uses the component scope if missing.
|
60
|
-
#
|
61
|
-
# Returns a Decidim::Scope
|
62
|
-
def scope
|
63
|
-
@scope ||= @attributes["decidim_scope_id"].value ? current_component.scopes.find_by(id: @attributes["decidim_scope_id"].value) : current_component.scope
|
64
|
-
end
|
65
|
-
|
66
|
-
# Scope identifier
|
67
|
-
#
|
68
|
-
# Returns the scope identifier related to the meeting
|
69
|
-
def decidim_scope_id
|
70
|
-
super || scope&.id
|
71
|
-
end
|
72
|
-
|
73
|
-
def category
|
74
|
-
return unless current_component
|
75
|
-
|
76
|
-
@category ||= categories.find_by(id: decidim_category_id)
|
77
|
-
end
|
78
|
-
|
79
51
|
def clean_type_of_meeting
|
80
52
|
type_of_meeting.presence
|
81
53
|
end
|
@@ -7,7 +7,6 @@ module Decidim
|
|
7
7
|
#
|
8
8
|
module ApplicationHelper
|
9
9
|
include Decidim::MapHelper
|
10
|
-
include Decidim::Admin::ResourceScopeHelper
|
11
10
|
include Decidim::PaginateHelper
|
12
11
|
|
13
12
|
def tabs_id_for_service(service)
|
@@ -21,6 +20,17 @@ module Decidim
|
|
21
20
|
def tabs_id_for_agenda_item_child(agenda_item)
|
22
21
|
"meeting_agenda_item_#{agenda_item.to_param_child}"
|
23
22
|
end
|
23
|
+
|
24
|
+
def find_meeting_components_for_select
|
25
|
+
spaces = current_organization.public_participatory_spaces
|
26
|
+
meeting_components = Decidim::Component
|
27
|
+
.where(manifest_name: "meetings", participatory_space_id: spaces.pluck(:id))
|
28
|
+
.where.not(id: current_component.id)
|
29
|
+
|
30
|
+
meeting_components.map do |component|
|
31
|
+
[component.hierarchy_title, component.id]
|
32
|
+
end.sort_by(&:first)
|
33
|
+
end
|
24
34
|
end
|
25
35
|
end
|
26
36
|
end
|