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
@@ -12,26 +12,21 @@ module Decidim
|
|
12
12
|
include Decidim::SanitizeHelper
|
13
13
|
include Decidim::CheckBoxesTreeHelper
|
14
14
|
include Decidim::RichTextEditorHelper
|
15
|
+
include ::Decidim::FollowableHelper
|
15
16
|
|
16
17
|
def filter_origin_values
|
17
|
-
|
18
|
-
|
19
|
-
origin_values << TreePoint.new("participants", t("decidim.meetings.meetings.filters.origin_values.participants")) # todo
|
20
|
-
if current_organization.user_groups_enabled?
|
21
|
-
origin_values << TreePoint.new("user_group", t("decidim.meetings.meetings.filters.origin_values.user_groups")) # todo
|
22
|
-
end
|
23
|
-
# if current_organization.user_groups_enabled? and component_settings enabled enabled
|
18
|
+
origin_keys = %w(official participants)
|
19
|
+
origin_keys << "user_group" if current_organization.user_groups_enabled?
|
24
20
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
)
|
21
|
+
origin_values = flat_filter_values(*origin_keys, scope: "decidim.meetings.meetings.filters.origin_values")
|
22
|
+
origin_values.prepend(["", t("all", scope: "decidim.meetings.meetings.filters.origin_values")])
|
23
|
+
|
24
|
+
filter_tree_from_array(origin_values)
|
29
25
|
end
|
30
26
|
|
31
27
|
def filter_type_values
|
32
|
-
type_values =
|
33
|
-
|
34
|
-
type_values << TreePoint.new(type, t("decidim.meetings.meetings.filters.type_values.#{type}"))
|
28
|
+
type_values = flat_filter_values(*Decidim::Meetings::Meeting::TYPE_OF_MEETING.keys, scope: "decidim.meetings.meetings.filters.type_values").map do |args|
|
29
|
+
TreePoint.new(*args)
|
35
30
|
end
|
36
31
|
|
37
32
|
TreeNode.new(
|
@@ -41,23 +36,16 @@ module Decidim
|
|
41
36
|
end
|
42
37
|
|
43
38
|
def filter_date_values
|
44
|
-
|
45
|
-
["all", t("decidim.meetings.meetings.filters.date_values.all")],
|
46
|
-
["upcoming", t("decidim.meetings.meetings.filters.date_values.upcoming")],
|
47
|
-
["past", t("decidim.meetings.meetings.filters.date_values.past")]
|
48
|
-
]
|
39
|
+
flat_filter_values(:all, :upcoming, :past, scope: "decidim.meetings.meetings.filters.date_values")
|
49
40
|
end
|
50
41
|
|
51
42
|
# Options to filter meetings by activity.
|
52
43
|
def activity_filter_values
|
53
|
-
|
54
|
-
["all", t("decidim.meetings.meetings.filters.all")],
|
55
|
-
["my_meetings", t("decidim.meetings.meetings.filters.my_meetings")]
|
56
|
-
]
|
44
|
+
flat_filter_values(:all, :my_meetings, scope: "decidim.meetings.meetings.filters")
|
57
45
|
end
|
58
46
|
|
59
47
|
# If the meeting is official or the rich text editor is enabled on the
|
60
|
-
# frontend, the meeting body is considered as safe content; that
|
48
|
+
# frontend, the meeting body is considered as safe content; that is unless
|
61
49
|
# the meeting comes from a collaborative_draft or a participatory_text.
|
62
50
|
def safe_content?
|
63
51
|
rich_text_editor_in_public_views? || safe_content_admin?
|
@@ -90,12 +78,17 @@ module Decidim
|
|
90
78
|
end
|
91
79
|
|
92
80
|
def online_or_hybrid_meeting?(meeting)
|
93
|
-
meeting.
|
81
|
+
meeting.online? || meeting.hybrid?
|
94
82
|
end
|
95
83
|
|
96
84
|
def iframe_embed_or_live_event_page?(meeting)
|
97
85
|
%w(embed_in_meeting_page open_in_live_event_page).include? meeting.iframe_embed_type
|
98
86
|
end
|
87
|
+
|
88
|
+
def apply_meetings_pack_tags
|
89
|
+
append_stylesheet_pack_tag("decidim_meetings", media: "all")
|
90
|
+
append_javascript_pack_tag("decidim_meetings")
|
91
|
+
end
|
99
92
|
end
|
100
93
|
end
|
101
94
|
end
|
@@ -13,11 +13,12 @@ module Decidim
|
|
13
13
|
include Decidim::Comments::CommentsHelper
|
14
14
|
include Decidim::SanitizeHelper
|
15
15
|
include Decidim::CheckBoxesTreeHelper
|
16
|
+
include Decidim::IconHelper
|
17
|
+
include Decidim::FiltersHelper
|
16
18
|
|
17
19
|
def filter_type_values
|
18
|
-
type_values =
|
19
|
-
|
20
|
-
type_values << TreePoint.new(type, t("decidim.meetings.meetings.filters.type_values.#{type}"))
|
20
|
+
type_values = flat_filter_values(*Decidim::Meetings::Meeting::TYPE_OF_MEETING.keys, scope: "decidim.meetings.meetings.filters.type_values").map do |args|
|
21
|
+
TreePoint.new(*args)
|
21
22
|
end
|
22
23
|
|
23
24
|
TreeNode.new(
|
@@ -27,53 +28,19 @@ module Decidim
|
|
27
28
|
end
|
28
29
|
|
29
30
|
def filter_date_values
|
30
|
-
[
|
31
|
-
["all", t("decidim.meetings.meetings.filters.date_values.all")],
|
32
|
-
["upcoming", t("decidim.meetings.meetings.filters.date_values.upcoming")],
|
33
|
-
["past", t("decidim.meetings.meetings.filters.date_values.past")]
|
34
|
-
]
|
35
|
-
end
|
36
|
-
|
37
|
-
def directory_filter_scopes_values
|
38
|
-
main_scopes = current_organization.scopes.top_level
|
39
|
-
|
40
|
-
scopes_values = main_scopes.includes(:scope_type, :children).flat_map do |scope|
|
41
|
-
TreeNode.new(
|
42
|
-
TreePoint.new(scope.id.to_s, translated_attribute(scope.name, current_organization)),
|
43
|
-
scope_children_to_tree(scope)
|
44
|
-
)
|
45
|
-
end
|
46
|
-
|
47
|
-
scopes_values.prepend(TreePoint.new("global", t("decidim.scopes.global")))
|
48
|
-
|
49
|
-
TreeNode.new(
|
50
|
-
TreePoint.new("", t("decidim.meetings.application_helper.filter_scope_values.all")),
|
51
|
-
scopes_values
|
52
|
-
)
|
53
|
-
end
|
54
|
-
|
55
|
-
def scope_children_to_tree(scope)
|
56
|
-
return unless scope.children.any?
|
57
|
-
|
58
|
-
scope.children.includes(:scope_type, :children).flat_map do |child|
|
59
|
-
TreeNode.new(
|
60
|
-
TreePoint.new(child.id.to_s, translated_attribute(child.name, current_organization)),
|
61
|
-
scope_children_to_tree(child)
|
62
|
-
)
|
63
|
-
end
|
31
|
+
%w(all upcoming past).map { |k| [k, t(k, scope: "decidim.meetings.meetings.filters.date_values")] }
|
64
32
|
end
|
65
33
|
|
66
34
|
def directory_meeting_spaces_values
|
67
35
|
participatory_spaces = current_organization.public_participatory_spaces
|
68
36
|
|
69
37
|
spaces = participatory_spaces.collect(&:model_name).uniq.map do |participatory_space|
|
70
|
-
|
38
|
+
[participatory_space.name.underscore, participatory_space.human(count: 2)]
|
71
39
|
end
|
72
40
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
)
|
41
|
+
spaces.prepend(["", t("decidim.meetings.application_helper.filter_meeting_space_values.all")])
|
42
|
+
|
43
|
+
filter_tree_from_array(spaces)
|
77
44
|
end
|
78
45
|
|
79
46
|
def directory_filter_categories_values
|
@@ -92,7 +59,7 @@ module Decidim
|
|
92
59
|
key_point = current_participatory_space.class.name.gsub("::", "__") + current_participatory_space.id.to_s
|
93
60
|
|
94
61
|
TreeNode.new(
|
95
|
-
TreePoint.new(key_point,
|
62
|
+
TreePoint.new(key_point, translated_attribute(current_participatory_space.title, current_organization)),
|
96
63
|
categories_values
|
97
64
|
)
|
98
65
|
end
|
@@ -104,24 +71,9 @@ module Decidim
|
|
104
71
|
)
|
105
72
|
end
|
106
73
|
|
107
|
-
def directory_filter_origin_values
|
108
|
-
origin_values = []
|
109
|
-
origin_values << TreePoint.new("official", t("decidim.meetings.meetings.filters.origin_values.official"))
|
110
|
-
origin_values << TreePoint.new("participants", t("decidim.meetings.meetings.filters.origin_values.participants"))
|
111
|
-
origin_values << TreePoint.new("user_group", t("decidim.meetings.meetings.filters.origin_values.user_groups")) if current_organization.user_groups_enabled?
|
112
|
-
|
113
|
-
TreeNode.new(
|
114
|
-
TreePoint.new("", t("decidim.meetings.meetings.filters.origin_values.all")),
|
115
|
-
origin_values
|
116
|
-
)
|
117
|
-
end
|
118
|
-
|
119
74
|
# Options to filter meetings by activity.
|
120
75
|
def activity_filter_values
|
121
|
-
[
|
122
|
-
["all", t("decidim.meetings.meetings.filters.all")],
|
123
|
-
["my_meetings", t("decidim.meetings.meetings.filters.my_meetings")]
|
124
|
-
]
|
76
|
+
%w(all my_meetings).map { |k| [k, t(k, scope: "decidim.meetings.meetings.filters")] }
|
125
77
|
end
|
126
78
|
|
127
79
|
protected
|
@@ -12,15 +12,8 @@ module Decidim
|
|
12
12
|
geocoded_meetings = meetings.select(&:geocoded_and_valid?)
|
13
13
|
geocoded_meetings.map do |meeting|
|
14
14
|
meeting.slice(:latitude, :longitude, :address).merge(title: translated_attribute(meeting.title),
|
15
|
-
|
16
|
-
|
17
|
-
startTimeMonth: l(meeting.start_time, format: "%B"),
|
18
|
-
startTimeYear: l(meeting.start_time, format: "%Y"),
|
19
|
-
startTime: "#{meeting.start_time.strftime("%H:%M")} - #{meeting.end_time.strftime("%H:%M")}",
|
20
|
-
icon: icon("meetings", width: 40, height: 70, remove_icon_class: true),
|
21
|
-
location: translated_attribute(meeting.location),
|
22
|
-
locationHints: decidim_html_escape(translated_attribute(meeting.location_hints)),
|
23
|
-
link: resource_locator(meeting).path)
|
15
|
+
link: resource_locator(meeting).path,
|
16
|
+
items: cell("decidim/meetings/meeting_card_metadata", meeting).send(:meeting_items_for_map).to_json)
|
24
17
|
end
|
25
18
|
end
|
26
19
|
end
|
@@ -8,6 +8,7 @@ module Decidim
|
|
8
8
|
include Decidim::Meetings::ApplicationHelper
|
9
9
|
include Decidim::TranslationsHelper
|
10
10
|
include Decidim::ResourceHelper
|
11
|
+
include Decidim::EndorsableHelper
|
11
12
|
|
12
13
|
# Public: truncates the meeting description
|
13
14
|
#
|
@@ -19,7 +20,7 @@ module Decidim
|
|
19
20
|
link = resource_locator(meeting).path
|
20
21
|
description = CGI.unescapeHTML present(meeting).description
|
21
22
|
tail = "... #{link_to(t("read_more", scope: "decidim.meetings"), link)}".html_safe
|
22
|
-
CGI.unescapeHTML html_truncate(description, max_length
|
23
|
+
CGI.unescapeHTML html_truncate(description, max_length:, tail:)
|
23
24
|
end
|
24
25
|
|
25
26
|
# Public: The css class applied based on the meeting type to
|
@@ -30,10 +31,10 @@ module Decidim
|
|
30
31
|
# Returns a String.
|
31
32
|
def meeting_type_badge_css_class(type)
|
32
33
|
case type
|
33
|
-
when "
|
34
|
+
when "withdraw"
|
34
35
|
"alert"
|
35
|
-
when "transparent"
|
36
|
-
"
|
36
|
+
when "private", "transparent"
|
37
|
+
"reverse"
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
@@ -84,7 +85,7 @@ module Decidim
|
|
84
85
|
def display_duration_agenda_items(agenda_item_id, index, agenda_items_times)
|
85
86
|
html = ""
|
86
87
|
if agenda_item_id == agenda_items_times[index][:agenda_item_id]
|
87
|
-
html += "[
|
88
|
+
html += "[#{agenda_items_times[index][:start_time].strftime("%H:%M")} - #{agenda_items_times[index][:end_time].strftime("%H:%M")}]"
|
88
89
|
end
|
89
90
|
html.html_safe
|
90
91
|
end
|
@@ -30,7 +30,7 @@ module Decidim
|
|
30
30
|
@locator = Decidim::ResourceLocatorPresenter.new(@meeting)
|
31
31
|
|
32
32
|
subject = I18n.t("invite.subject", scope: "decidim.meetings.mailer.invite_join_meeting_mailer")
|
33
|
-
mail(to: user.email, subject:
|
33
|
+
mail(to: user.email, subject:)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -27,8 +27,8 @@ module Decidim
|
|
27
27
|
include Decidim::Publicable
|
28
28
|
include Decidim::FilterableResource
|
29
29
|
|
30
|
-
TYPE_OF_MEETING =
|
31
|
-
|
30
|
+
TYPE_OF_MEETING = { in_person: 0, online: 10, hybrid: 20 }.freeze
|
31
|
+
REGISTRATION_TYPES = { registration_disabled: 0, on_this_platform: 10, on_different_platform: 20 }.freeze
|
32
32
|
|
33
33
|
translatable_fields :title, :description, :location, :location_hints, :closing_report, :registration_terms
|
34
34
|
|
@@ -48,6 +48,8 @@ module Decidim
|
|
48
48
|
|
49
49
|
enum iframe_access_level: [:all, :signed_in, :registered], _prefix: true
|
50
50
|
enum iframe_embed_type: [:none, :embed_in_meeting_page, :open_in_live_event_page, :open_in_new_tab], _prefix: true
|
51
|
+
enum type_of_meeting: TYPE_OF_MEETING
|
52
|
+
enum registration_type: REGISTRATION_TYPES, _scopes: false
|
51
53
|
|
52
54
|
component_manifest_name "meetings"
|
53
55
|
|
@@ -82,7 +84,7 @@ module Decidim
|
|
82
84
|
scope :visible_for, lambda { |user|
|
83
85
|
(all.distinct if user&.admin?) ||
|
84
86
|
if user.present?
|
85
|
-
spaces = Decidim.participatory_space_registry.manifests.filter_map do |manifest|
|
87
|
+
(spaces = Decidim.participatory_space_registry.manifests.filter_map do |manifest|
|
86
88
|
table_name = manifest.model_class_name.constantize.try(:table_name)
|
87
89
|
next if table_name.blank?
|
88
90
|
|
@@ -90,8 +92,8 @@ module Decidim
|
|
90
92
|
name: table_name.singularize,
|
91
93
|
class_name: manifest.model_class_name
|
92
94
|
}
|
93
|
-
end
|
94
|
-
user_role_queries = spaces.map do |space|
|
95
|
+
end)
|
96
|
+
(user_role_queries = spaces.map do |space|
|
95
97
|
roles_table = "#{space[:name]}_user_roles"
|
96
98
|
next unless connection.table_exists?(roles_table)
|
97
99
|
|
@@ -101,7 +103,7 @@ module Decidim
|
|
101
103
|
(SELECT CONCAT(#{roles_table}.#{space[:name]}_id, '-#{space[:class_name]}')
|
102
104
|
FROM #{roles_table} WHERE #{roles_table}.decidim_user_id = ?)
|
103
105
|
"
|
104
|
-
end
|
106
|
+
end)
|
105
107
|
|
106
108
|
query = "
|
107
109
|
decidim_meetings_meetings.private_meeting = ?
|
@@ -133,12 +135,7 @@ module Decidim
|
|
133
135
|
|
134
136
|
scope :authored_by, ->(author) { where(decidim_author_id: author) }
|
135
137
|
|
136
|
-
scope_search_multi :with_any_type, TYPE_OF_MEETING.
|
137
|
-
|
138
|
-
TYPE_OF_MEETING.each do |type|
|
139
|
-
scope type.to_sym, -> { where(type_of_meeting: type.to_sym) }
|
140
|
-
scope "not_#{type}".to_sym, -> { where.not(type_of_meeting: type.to_sym) }
|
141
|
-
end
|
138
|
+
scope_search_multi :with_any_type, TYPE_OF_MEETING.keys
|
142
139
|
|
143
140
|
searchable_fields({
|
144
141
|
scope_id: :decidim_scope_id,
|
@@ -204,7 +201,7 @@ module Decidim
|
|
204
201
|
end
|
205
202
|
|
206
203
|
def has_registration_for?(user)
|
207
|
-
registrations.where(user:
|
204
|
+
registrations.where(user:).any?
|
208
205
|
end
|
209
206
|
|
210
207
|
def maps_enabled?
|
@@ -241,7 +238,7 @@ module Decidim
|
|
241
238
|
end
|
242
239
|
|
243
240
|
def current_user_can_visit_meeting?(user)
|
244
|
-
Decidim::Meetings::Meeting.visible_for(user).exists?(id:
|
241
|
+
Decidim::Meetings::Meeting.visible_for(user).exists?(id:)
|
245
242
|
end
|
246
243
|
|
247
244
|
def iframe_access_level_allowed_for_user?(user)
|
@@ -325,24 +322,6 @@ module Decidim
|
|
325
322
|
[normalized_author.name]
|
326
323
|
end
|
327
324
|
|
328
|
-
TYPE_OF_MEETING.each do |type|
|
329
|
-
define_method("#{type}_meeting?") do
|
330
|
-
type_of_meeting == type
|
331
|
-
end
|
332
|
-
end
|
333
|
-
|
334
|
-
def registration_disabled?
|
335
|
-
registration_type == "registration_disabled"
|
336
|
-
end
|
337
|
-
|
338
|
-
def on_this_platform?
|
339
|
-
registration_type == "on_this_platform"
|
340
|
-
end
|
341
|
-
|
342
|
-
def on_different_platform?
|
343
|
-
registration_type == "on_different_platform"
|
344
|
-
end
|
345
|
-
|
346
325
|
def has_contributions?
|
347
326
|
!!contributions_count && contributions_count.positive?
|
348
327
|
end
|
@@ -35,7 +35,7 @@ module Decidim
|
|
35
35
|
|
36
36
|
# Public: returns whether the questionnaire is answered by the user or not.
|
37
37
|
def answered_by?(user)
|
38
|
-
questionnaire.answers.where({ user
|
38
|
+
questionnaire.answers.where({ user:, question: self }).any? if questionnaire.questions.present? && user.present?
|
39
39
|
end
|
40
40
|
|
41
41
|
def number_of_options
|
data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_attended_meetings.svg
CHANGED
@@ -1 +1,42 @@
|
|
1
|
-
<svg
|
1
|
+
<svg width="540" height="540" viewBox="0 0 540 540" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M302.378 437.25L189.266 462.408L183.67 437.248" fill="#3E4C5C" fill-opacity="0.25"/>
|
3
|
+
<path d="M302.378 437.25L189.266 462.408L183.67 437.248" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
4
|
+
<path d="M418.25 255.25L451.36 404.113L418.25 411.478" fill="#3E4C5C" fill-opacity="0.25"/>
|
5
|
+
<path d="M418.25 255.25L451.36 404.113L418.25 411.478" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
6
|
+
<path d="M265.625 102.75L378.736 77.5918L383.175 98.5523" fill="#3E4C5C" fill-opacity="0.25"/>
|
7
|
+
<path d="M265.625 102.75L378.736 77.5918L383.175 98.5523" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linejoin="round"/>
|
8
|
+
<path d="M149.751 284.748L116.641 135.886L149.751 128.521" fill="#3E4C5C" fill-opacity="0.25"/>
|
9
|
+
<path d="M149.751 284.748L116.641 135.886L149.751 128.521" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
10
|
+
<path d="M418.25 147.25V437.25H149.75V412.25" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
11
|
+
<path d="M149.75 330.75V102.75H377.75" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
12
|
+
<path d="M155.147 410.434L432.51 133.071C444.323 121.258 444.402 102.184 432.687 90.4676C420.97 78.7521 401.897 78.8311 390.084 90.6446L112.72 368.008L88.8633 434.291L155.147 410.434Z" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
13
|
+
<path d="M418.189 147.39L432.508 133.071C444.322 121.258 444.401 102.184 432.685 90.4676C420.969 78.7521 401.895 78.8311 390.082 90.6446L375.764 104.964" fill="#3E4C5C" fill-opacity="0.5"/>
|
14
|
+
<path d="M418.189 147.39L432.508 133.071C444.322 121.258 444.401 102.184 432.685 90.4676C420.969 78.7521 401.895 78.8311 390.082 90.6446L375.764 104.964" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
15
|
+
<path d="M375.764 104.963L418.19 147.389" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10"/>
|
16
|
+
<path d="M358.086 122.641L400.511 165.067" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10"/>
|
17
|
+
<path d="M113.738 366.893L135.25 367.479V385.75H154.873L155.098 410.491" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
18
|
+
<path d="M155.146 385.685L388.138 152.694L369.046 133.602L135.347 367.301L135.25 385.75L155.146 385.685Z" fill="#3E4C5C" fill-opacity="0.25" stroke="#3E4C5C" stroke-width="4" stroke-miterlimit="10"/>
|
19
|
+
<path d="M88.8145 434.34L100.345 402.303L120.851 422.809L88.8145 434.34Z" fill="#3E4C5C"/>
|
20
|
+
<path d="M77.6306 282.866C77.6306 275.522 68.2971 265.189 59.9531 265.189C67.6306 265.189 77.6306 255.023 77.6306 247.512C77.6306 255.023 85.9636 265.189 95.3081 265.189C85.7971 265.189 77.6306 275.523 77.6306 282.866Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
21
|
+
<path d="M452.191 88.1777C455.919 88.1777 458.941 85.1557 458.941 81.4277C458.941 77.6998 455.919 74.6777 452.191 74.6777C448.463 74.6777 445.441 77.6998 445.441 81.4277C445.441 85.1557 448.463 88.1777 452.191 88.1777Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
22
|
+
<path d="M443.942 73.0596L433.336 62.4531" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
23
|
+
<path d="M460.912 90.0293L471.519 100.636" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
24
|
+
<path d="M460.559 73.4131L471.165 62.8066" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
25
|
+
<path d="M443.942 90.0293L433.336 100.636" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
26
|
+
<path d="M133.346 449.398L120.266 462.48" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
27
|
+
<path d="M115.669 467.076L102.588 480.158" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
28
|
+
<path d="M132.993 480.158L119.912 467.076" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
29
|
+
<path d="M115.315 462.48L102.234 449.398" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
30
|
+
<path d="M461.297 482.526C461.297 482.526 450.514 484.544 448.039 487.018C445.565 489.491 443.548 500.275 443.548 500.275C443.548 500.275 441.53 489.493 439.056 487.018C436.583 484.544 425.799 482.526 425.799 482.526C425.799 482.526 436.837 480.253 439.056 478.035C441.275 475.816 443.548 464.777 443.548 464.777C443.548 464.777 445.565 475.56 448.039 478.035C450.513 480.509 461.297 482.526 461.297 482.526Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
31
|
+
<path d="M448.433 231.903C453.018 231.903 456.735 228.186 456.735 223.601C456.735 219.016 453.018 215.299 448.433 215.299C443.848 215.299 440.131 219.016 440.131 223.601C440.131 228.186 443.848 231.903 448.433 231.903Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
32
|
+
<path d="M430.482 226.817C432.258 226.817 433.698 225.377 433.698 223.601C433.698 221.825 432.258 220.385 430.482 220.385C428.705 220.385 427.266 221.825 427.266 223.601C427.266 225.377 428.705 226.817 430.482 226.817Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
33
|
+
<path d="M448.431 244.767C450.208 244.767 451.648 243.327 451.648 241.55C451.648 239.774 450.208 238.334 448.431 238.334C446.655 238.334 445.215 239.774 445.215 241.55C445.215 243.327 446.655 244.767 448.431 244.767Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
34
|
+
<path d="M466.384 226.817C468.16 226.817 469.6 225.377 469.6 223.601C469.6 221.825 468.16 220.385 466.384 220.385C464.608 220.385 463.168 221.825 463.168 223.601C463.168 225.377 464.608 226.817 466.384 226.817Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
35
|
+
<path d="M448.433 208.866C450.209 208.866 451.649 207.426 451.649 205.65C451.649 203.873 450.209 202.434 448.433 202.434C446.657 202.434 445.217 203.873 445.217 205.65C445.217 207.426 446.657 208.866 448.433 208.866Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
36
|
+
<path d="M149.373 49.209L176.825 76.6615" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
37
|
+
<path d="M176.825 49.209L149.373 76.6615" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
38
|
+
<path d="M154 62.7227H140.5" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
39
|
+
<path d="M173 62.7227H186.5" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
40
|
+
<path d="M163.5 72.2227V85.7227" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
41
|
+
<path d="M163.5 53.2227V39.7227" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
42
|
+
</svg>
|
@@ -2,7 +2,6 @@ import AutoButtonsByPositionComponent from "src/decidim/admin/auto_buttons_by_po
|
|
2
2
|
import AutoLabelByPositionComponent from "src/decidim/admin/auto_label_by_position.component"
|
3
3
|
import createSortList from "src/decidim/admin/sort_list.component"
|
4
4
|
import createDynamicFields from "src/decidim/admin/dynamic_fields.component"
|
5
|
-
import createQuillEditor from "src/decidim/editor"
|
6
5
|
|
7
6
|
const wrapperSelector = ".meeting-agenda-items";
|
8
7
|
const fieldSelector = ".meeting-agenda-item";
|
@@ -69,8 +68,8 @@ const createDynamicFieldsForAgendaItemChilds = (fieldId) => {
|
|
69
68
|
onAddField: ($field) => {
|
70
69
|
createSortableListChild();
|
71
70
|
|
72
|
-
$field.
|
73
|
-
|
71
|
+
$field[0].querySelectorAll(".editor-container").forEach((el) => {
|
72
|
+
window.createEditor(el);
|
74
73
|
});
|
75
74
|
|
76
75
|
autoLabelByPositionChild.run();
|
@@ -124,7 +123,7 @@ createDynamicFields({
|
|
124
123
|
createSortableList();
|
125
124
|
|
126
125
|
$field.find(".editor-container").each((idx, el) => {
|
127
|
-
|
126
|
+
window.createEditor(el);
|
128
127
|
});
|
129
128
|
|
130
129
|
autoLabelByPosition.run();
|
@@ -7,16 +7,24 @@ $(() => {
|
|
7
7
|
const $reservedSlots = $form.find("#meeting_reserved_slots");
|
8
8
|
const $customizeRegistrationEmail = $form.find("#meeting_customize_registration_email");
|
9
9
|
|
10
|
+
$customizeRegistrationEmail.on("click", (event) => {
|
11
|
+
|
12
|
+
if (event.target.checked) {
|
13
|
+
$("#customize_registration_email-div").removeClass("hidden");
|
14
|
+
} else {
|
15
|
+
$("#customize_registration_email-div").addClass("hidden");
|
16
|
+
}
|
17
|
+
})
|
18
|
+
|
10
19
|
const toggleDisabledFields = () => {
|
11
20
|
const enabled = $registrationsEnabled.prop("checked");
|
12
21
|
$availableSlots.attr("disabled", !enabled);
|
13
22
|
$reservedSlots.attr("disabled", !enabled);
|
14
23
|
$customizeRegistrationEmail.attr("disabled", !enabled);
|
15
24
|
|
16
|
-
$form.
|
17
|
-
|
18
|
-
|
19
|
-
})
|
25
|
+
$form[0].querySelectorAll(".editor-container .ProseMirror").forEach((node) => {
|
26
|
+
node.editor.setOptions({ editable: enabled });
|
27
|
+
});
|
20
28
|
};
|
21
29
|
|
22
30
|
$registrationsEnabled.on("change", toggleDisabledFields);
|
@@ -62,7 +62,7 @@ $(() => {
|
|
62
62
|
|
63
63
|
createFieldDependentInputs({
|
64
64
|
controllerField: $("#meeting_iframe_embed_type"),
|
65
|
-
wrapperSelector: "
|
65
|
+
wrapperSelector: "main",
|
66
66
|
dependentFieldsSelector: ".iframe-fields--access-level",
|
67
67
|
dependentInputSelector: "input",
|
68
68
|
enablingCondition: ($field) => {
|
@@ -1,8 +1,5 @@
|
|
1
1
|
/* eslint id-length: ["error", { "exceptions": ["$"] }] */
|
2
2
|
|
3
|
-
import createOptionAttachedInputs from "src/decidim/forms/option_attached_inputs.component"
|
4
|
-
import createMaxChoicesAlertComponent from "src/decidim/forms/max_choices_alert.component"
|
5
|
-
|
6
3
|
/**
|
7
4
|
* A plain Javascript component that handles questions from polls in meetings:
|
8
5
|
* - fetches them via Ajax
|
@@ -78,7 +75,6 @@ export default class PollComponent {
|
|
78
75
|
this._updateCounter();
|
79
76
|
this._setQuestionsState(this.$element);
|
80
77
|
this._pollQuestions();
|
81
|
-
this._addValidations();
|
82
78
|
});
|
83
79
|
}
|
84
80
|
|
@@ -114,7 +110,7 @@ export default class PollComponent {
|
|
114
110
|
|
115
111
|
/**
|
116
112
|
* Initializes the state of a single question with two types of modifications:
|
117
|
-
* - sets the is-new class if the question is new (
|
113
|
+
* - sets the is-new class if the question is new (does not exist in the internal list)
|
118
114
|
* - sets the state to open if it was open in the internal list
|
119
115
|
* @private
|
120
116
|
* @param {jQuery} $el - The HTML container for the questionnaire.
|
@@ -167,27 +163,4 @@ export default class PollComponent {
|
|
167
163
|
this.$counter.html(`(${questionsCount})`);
|
168
164
|
}
|
169
165
|
}
|
170
|
-
|
171
|
-
_addValidations() {
|
172
|
-
$(".js-radio-button-collection, .js-check-box-collection").each((idx, el) => {
|
173
|
-
createOptionAttachedInputs({
|
174
|
-
wrapperField: $(el),
|
175
|
-
controllerFieldSelector: "input[type=radio], input[type=checkbox]",
|
176
|
-
dependentInputSelector: "input[type=text], input[type=hidden]"
|
177
|
-
});
|
178
|
-
});
|
179
|
-
|
180
|
-
$.unique($(".js-check-box-collection").parents(".answer")).each((idx, el) => {
|
181
|
-
const maxChoices = $(el).data("max-choices");
|
182
|
-
if (maxChoices) {
|
183
|
-
createMaxChoicesAlertComponent({
|
184
|
-
wrapperField: $(el),
|
185
|
-
controllerFieldSelector: "input[type=checkbox]",
|
186
|
-
controllerCollectionSelector: ".js-check-box-collection",
|
187
|
-
alertElement: $(el).find(".max-choices-alert"),
|
188
|
-
maxChoices: maxChoices
|
189
|
-
});
|
190
|
-
}
|
191
|
-
});
|
192
|
-
}
|
193
166
|
}
|