decidim-meetings 0.24.1 → 0.25.0.rc2
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/join_meeting_button/registration_confirm.erb +6 -0
- data/app/cells/decidim/meetings/join_meeting_button/show.erb +8 -6
- data/app/cells/decidim/meetings/meeting_m_cell.rb +4 -0
- data/app/cells/decidim/meetings/meeting_url/show.erb +7 -2
- data/app/cells/decidim/meetings/meeting_url_cell.rb +14 -2
- data/app/cells/decidim/meetings/meetings_map/show.erb +1 -1
- data/app/cells/decidim/meetings/meetings_map_cell.rb +1 -1
- data/app/cells/decidim/meetings/online_meeting_cell.rb +36 -0
- data/app/cells/decidim/meetings/online_meeting_link/show.erb +44 -0
- data/app/cells/decidim/meetings/online_meeting_link_cell.rb +27 -0
- data/app/cells/decidim/meetings/public_participants_list/show.erb +16 -0
- data/app/cells/decidim/meetings/public_participants_list_cell.rb +31 -0
- data/app/cells/decidim/meetings/question_responses/show.erb +7 -0
- data/app/cells/decidim/meetings/question_responses_cell.rb +72 -0
- data/app/commands/decidim/meetings/admin/close_meeting.rb +3 -0
- data/app/commands/decidim/meetings/admin/copy_meeting.rb +0 -9
- data/app/commands/decidim/meetings/admin/create_meeting.rb +4 -20
- data/app/commands/decidim/meetings/admin/destroy_meeting.rb +2 -0
- data/app/commands/decidim/meetings/admin/publish_meeting.rb +72 -0
- data/app/commands/decidim/meetings/admin/unpublish_meeting.rb +45 -0
- data/app/commands/decidim/meetings/admin/update_meeting.rb +6 -3
- data/app/commands/decidim/meetings/admin/update_question_status.rb +57 -0
- data/app/commands/decidim/meetings/admin/update_questionnaire.rb +93 -0
- data/app/commands/decidim/meetings/close_meeting.rb +2 -0
- data/app/commands/decidim/meetings/create_answer.rb +52 -0
- data/app/commands/decidim/meetings/create_meeting.rb +3 -1
- data/app/commands/decidim/meetings/join_meeting.rb +2 -1
- data/app/commands/decidim/meetings/update_meeting.rb +2 -1
- data/app/controllers/concerns/decidim/meetings/admin/filterable.rb +55 -0
- data/app/controllers/concerns/decidim/meetings/polls_resources.rb +29 -0
- data/app/controllers/decidim/meetings/admin/application_controller.rb +6 -2
- data/app/controllers/decidim/meetings/admin/invites_controller.rb +0 -2
- data/app/controllers/decidim/meetings/admin/meeting_closes_controller.rb +1 -1
- data/app/controllers/decidim/meetings/admin/meetings_controller.rb +46 -1
- data/app/controllers/decidim/meetings/admin/meetings_poll_controller.rb +107 -0
- data/app/controllers/decidim/meetings/calendars_controller.rb +8 -0
- data/app/controllers/decidim/meetings/live_events_controller.rb +29 -0
- data/app/controllers/decidim/meetings/meeting_closes_controller.rb +1 -1
- data/app/controllers/decidim/meetings/polls/answers_controller.rb +37 -0
- data/app/controllers/decidim/meetings/polls/questions_controller.rb +45 -0
- data/app/events/decidim/meetings/create_meeting_event.rb +16 -0
- data/app/forms/decidim/meetings/admin/answer_option_form.rb +24 -0
- data/app/forms/decidim/meetings/admin/close_meeting_form.rb +3 -1
- data/app/forms/decidim/meetings/admin/meeting_form.rb +12 -1
- data/app/forms/decidim/meetings/admin/question_form.rb +44 -0
- data/app/forms/decidim/meetings/admin/questionnaire_form.rb +19 -0
- data/app/forms/decidim/meetings/answer_choice_form.rb +14 -0
- data/app/forms/decidim/meetings/answer_form.rb +65 -0
- data/app/forms/decidim/meetings/close_meeting_form.rb +4 -0
- data/app/forms/decidim/meetings/join_meeting_form.rb +1 -0
- data/app/forms/decidim/meetings/meeting_form.rb +9 -0
- data/app/helpers/decidim/meetings/admin/filterable_helper.rb +13 -0
- data/app/helpers/decidim/meetings/application_helper.rb +3 -2
- data/app/helpers/decidim/meetings/map_helper.rb +1 -1
- data/app/helpers/decidim/meetings/meetings_helper.rb +21 -0
- data/app/models/decidim/meetings/answer.rb +48 -0
- data/app/models/decidim/meetings/answer_choice.rb +15 -0
- data/app/models/decidim/meetings/answer_option.rb +24 -0
- data/app/models/decidim/meetings/meeting.rb +88 -42
- data/app/models/decidim/meetings/poll.rb +19 -0
- data/app/models/decidim/meetings/question.rb +54 -0
- data/app/models/decidim/meetings/questionnaire.rb +23 -0
- data/app/models/decidim/meetings/registration.rb +2 -0
- data/app/packs/entrypoints/decidim_meetings.js +6 -0
- data/app/packs/entrypoints/decidim_meetings_admin.js +5 -0
- data/app/{assets/images/decidim/gamification/badges/attended_meetings.svg → packs/images/decidim/gamification/badges/decidim_gamification_badges_attended_meetings.svg} +0 -0
- data/app/{assets/images/decidim/meetings/icon.svg → packs/images/decidim/meetings/decidim_meetings.svg} +0 -0
- data/app/packs/src/decidim/meetings/admin/agendas.js +159 -0
- data/app/{assets/javascripts/decidim/meetings/admin/destroy_meeting_alert.js.es6 → packs/src/decidim/meetings/admin/destroy_meeting_alert.js} +0 -0
- data/app/{assets/javascripts/decidim/meetings/admin/meetings_form.js.es6 → packs/src/decidim/meetings/admin/meetings_form.js} +7 -4
- data/app/{assets/javascripts/decidim/meetings/admin/registrations_form.js.es6 → packs/src/decidim/meetings/admin/registrations_form.js} +0 -0
- data/app/{assets/javascripts/decidim/meetings/admin/registrations_invite_form.es6 → packs/src/decidim/meetings/admin/registrations_invite_form.js} +3 -3
- data/app/packs/src/decidim/meetings/meetings_form.js +54 -0
- data/app/packs/src/decidim/meetings/meetings_polls.js +41 -0
- data/app/packs/src/decidim/meetings/poll.component.js +166 -0
- data/app/packs/stylesheets/decidim/meetings/_header.scss +52 -0
- data/app/packs/stylesheets/decidim/meetings/_main.scss +178 -0
- data/app/packs/stylesheets/decidim/meetings/_meetings.scss +2 -0
- data/app/permissions/decidim/meetings/admin/permissions.rb +16 -8
- data/app/permissions/decidim/meetings/permissions.rb +42 -17
- data/app/presenters/decidim/meetings/admin_log/meeting_presenter.rb +5 -1
- data/app/presenters/decidim/meetings/meeting_presenter.rb +25 -25
- data/app/queries/decidim/meetings/filtered_meetings.rb +1 -1
- data/app/queries/decidim/meetings/metrics/meetings_metric_manage.rb +1 -1
- data/app/queries/decidim/meetings/questionnaire_user_answers.rb +29 -0
- data/app/serializers/decidim/meetings/data_portability_invite_serializer.rb +2 -1
- data/app/serializers/decidim/meetings/data_portability_registration_serializer.rb +2 -1
- data/app/serializers/decidim/meetings/registration_serializer.rb +3 -12
- data/app/services/decidim/meetings/calendar/component_calendar.rb +2 -2
- data/app/services/decidim/meetings/calendar/meeting_calendar.rb +33 -0
- data/app/services/decidim/meetings/calendar_renderer.rb +2 -0
- data/app/services/decidim/meetings/meeting_iframe_embedder.rb +86 -0
- data/app/services/decidim/meetings/meeting_search.rb +2 -2
- data/app/views/decidim/meetings/admin/agenda/_form.html.erb +1 -1
- data/app/views/decidim/meetings/admin/invite_join_meeting_mailer/invite.html.erb +4 -4
- data/app/views/decidim/meetings/admin/invites/_form.html.erb +1 -1
- data/app/views/decidim/meetings/admin/meeting_closes/_form.html.erb +16 -1
- data/app/views/decidim/meetings/admin/meeting_copies/_form.html.erb +1 -1
- data/app/views/decidim/meetings/admin/meetings/_form.html.erb +16 -1
- data/app/views/decidim/meetings/admin/meetings/index.html.erb +39 -11
- data/app/views/decidim/meetings/admin/poll/_answer_option.html.erb +34 -0
- data/app/views/decidim/meetings/admin/poll/_answer_option_template.html.erb +7 -0
- data/app/views/decidim/meetings/admin/poll/_form.html.erb +63 -0
- data/app/views/decidim/meetings/admin/poll/_question.html.erb +96 -0
- data/app/views/decidim/meetings/admin/poll/edit.html.erb +9 -0
- data/app/views/decidim/meetings/admin/registrations/_form.html.erb +1 -1
- data/app/views/decidim/meetings/directory/meetings/index.html.erb +4 -4
- data/app/views/decidim/meetings/directory/meetings/index.js.erb +2 -0
- data/app/views/decidim/meetings/layouts/live_event.html.erb +50 -0
- data/app/views/decidim/meetings/live_events/show.html.erb +12 -0
- data/app/views/decidim/meetings/meeting_closes/_form.html.erb +8 -1
- data/app/views/decidim/meetings/meeting_closes/edit.html.erb +1 -1
- data/app/views/decidim/meetings/meetings/_calendar_modal.html.erb +26 -0
- data/app/views/decidim/meetings/meetings/_filters.html.erb +1 -1
- data/app/views/decidim/meetings/meetings/_form.html.erb +6 -1
- data/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +1 -1
- data/app/views/decidim/meetings/meetings/_meeting_minutes.html.erb +7 -18
- data/app/views/decidim/meetings/meetings/edit.html.erb +1 -1
- data/app/views/decidim/meetings/meetings/index.html.erb +4 -4
- data/app/views/decidim/meetings/meetings/index.js.erb +1 -1
- data/app/views/decidim/meetings/meetings/new.html.erb +1 -1
- data/app/views/decidim/meetings/meetings/show.html.erb +13 -14
- data/app/views/decidim/meetings/polls/answers/_multiple_option.html.erb +13 -0
- data/app/views/decidim/meetings/polls/answers/_single_option.html.erb +19 -0
- data/app/views/decidim/meetings/polls/answers/create.js.erb +5 -0
- data/app/views/decidim/meetings/polls/questions/_closed_question.html.erb +7 -0
- data/app/views/decidim/meetings/polls/questions/_index.html.erb +5 -0
- data/app/views/decidim/meetings/polls/questions/_index_admin.html.erb +43 -0
- data/app/views/decidim/meetings/polls/questions/_published_question.html.erb +29 -0
- data/app/views/decidim/meetings/polls/questions/_question.html.erb +7 -0
- data/app/views/decidim/meetings/polls/questions/index.js.erb +5 -0
- data/app/views/decidim/meetings/polls/questions/index_admin.js.erb +5 -0
- data/app/views/decidim/meetings/registration_mailer/confirmation.html.erb +5 -2
- data/app/views/devise/mailer/join_meeting.html.erb +6 -6
- data/config/assets.rb +11 -0
- data/config/locales/ar.yml +3 -24
- data/config/locales/ca.yml +36 -27
- data/config/locales/cs.yml +74 -28
- data/config/locales/de.yml +22 -27
- data/config/locales/el.yml +3 -24
- data/config/locales/en.yml +112 -26
- data/config/locales/es-MX.yml +13 -27
- data/config/locales/es-PY.yml +13 -27
- data/config/locales/es.yml +13 -27
- data/config/locales/eu.yml +3 -24
- data/config/locales/fi-plain.yml +70 -26
- data/config/locales/fi.yml +72 -28
- data/config/locales/fr-CA.yml +19 -26
- data/config/locales/fr-LU.yml +534 -0
- data/config/locales/fr.yml +19 -26
- data/config/locales/gl.yml +46 -24
- data/config/locales/hu.yml +5 -24
- data/config/locales/id-ID.yml +3 -24
- data/config/locales/is-IS.yml +2 -22
- data/config/locales/it.yml +117 -23
- data/config/locales/ja.yml +148 -58
- data/config/locales/lb-LU.yml +1 -0
- data/config/locales/lv.yml +3 -24
- data/config/locales/nl.yml +70 -25
- data/config/locales/no.yml +5 -26
- data/config/locales/pl.yml +27 -38
- data/config/locales/pt-BR.yml +178 -23
- data/config/locales/pt.yml +3 -24
- data/config/locales/ro-RO.yml +38 -27
- data/config/locales/ru.yml +3 -24
- data/config/locales/sk.yml +3 -24
- data/config/locales/sv.yml +36 -27
- data/config/locales/tr-TR.yml +5 -27
- data/config/locales/uk.yml +3 -24
- data/config/locales/zh-CN.yml +3 -24
- data/db/migrate/20210217124802_add_registration_custom_content_to_meetings.rb +8 -0
- data/db/migrate/20210413050756_add_published_at_to_meetings.rb +7 -0
- data/db/migrate/20210413050917_update_published_at_to_existing_meetings.rb +20 -0
- data/db/migrate/20210430123416_add_public_participation_to_decidim_meetings_registrations.rb +7 -0
- data/db/migrate/20210506180226_merge_meetings_minutes_into_meetings_table.rb +48 -0
- data/db/migrate/20210512055802_create_decidim_meetings_polls.rb +10 -0
- data/db/migrate/20210512100333_drop_decidim_meetings_minutes_table.rb +77 -0
- data/db/migrate/20210518133236_merge_minutes_with_closing_report_in_meetings_table.rb +57 -0
- data/db/migrate/20210520084247_create_decidim_meetings_questionnaires.rb +11 -0
- data/db/migrate/20210520084253_create_decidim_meetings_questions.rb +15 -0
- data/db/migrate/20210520084321_create_decidim_meetings_answers.rb +13 -0
- data/db/migrate/20210520084330_create_decidim_meetings_answer_options.rb +10 -0
- data/db/migrate/20210520084337_create_decidim_meetings_answer_choices.rb +13 -0
- data/db/migrate/20210520134834_add_status_to_meetings_questions.rb +7 -0
- data/db/migrate/20210602040614_add_setting_embed_iframe_to_meetings.rb +7 -0
- data/lib/decidim/api/linked_resources_interface.rb +8 -1
- data/lib/decidim/api/meeting_type.rb +19 -4
- data/lib/decidim/api/meetings_type.rb +2 -2
- data/lib/decidim/meetings/admin_engine.rb +5 -1
- data/lib/decidim/meetings/api.rb +0 -1
- data/lib/decidim/meetings/component.rb +41 -6
- data/lib/decidim/meetings/data_portability_user_answers_serializer.rb +33 -0
- data/lib/decidim/meetings/engine.rb +10 -11
- data/lib/decidim/meetings/meeting_serializer.rb +1 -0
- data/lib/decidim/meetings/polls.rb +10 -0
- data/lib/decidim/meetings/test/factories.rb +85 -9
- data/lib/decidim/meetings/user_answers_serializer.rb +47 -0
- data/lib/decidim/meetings/version.rb +1 -1
- data/lib/decidim/meetings.rb +10 -0
- metadata +103 -113
- data/app/assets/config/decidim_meetings_manifest.js +0 -9
- data/app/assets/javascripts/decidim/meetings/admin/agendas.js.es6 +0 -158
- data/app/assets/javascripts/decidim/meetings/meetings_form.js.es6 +0 -54
- data/app/commands/decidim/meetings/admin/create_minutes.rb +0 -55
- data/app/commands/decidim/meetings/admin/update_minutes.rb +0 -63
- data/app/controllers/decidim/meetings/admin/minutes_controller.rb +0 -69
- data/app/forms/decidim/meetings/admin/minutes_form.rb +0 -20
- data/app/models/decidim/meetings/minutes.rb +0 -22
- data/app/presenters/decidim/meetings/admin_log/minutes_presenter.rb +0 -42
- data/app/views/decidim/meetings/admin/minutes/_form.html.erb +0 -23
- data/app/views/decidim/meetings/admin/minutes/edit.html.erb +0 -7
- data/app/views/decidim/meetings/admin/minutes/new.html.erb +0 -7
- data/app/views/decidim/meetings/meetings/_online_meeting_link.html.erb +0 -11
- data/config/locales/ja-JP.yml +0 -494
- data/lib/decidim/api/minutes_type.rb +0 -20
@@ -27,7 +27,7 @@ module Decidim
|
|
27
27
|
# Finds the Projects scoped to an array of components and filtered
|
28
28
|
# by a range of dates.
|
29
29
|
def query
|
30
|
-
meetings = Decidim::Meetings::Meeting.not_hidden.where(component: @components)
|
30
|
+
meetings = Decidim::Meetings::Meeting.not_hidden.published.where(component: @components)
|
31
31
|
meetings = meetings.where("created_at >= ?", @start_at) if @start_at.present?
|
32
32
|
meetings = meetings.where("created_at <= ?", @end_at) if @end_at.present?
|
33
33
|
meetings
|
@@ -30,7 +30,7 @@ module Decidim
|
|
30
30
|
spaces = Decidim.participatory_space_manifests.flat_map do |manifest|
|
31
31
|
manifest.participatory_spaces.call(@organization).public_spaces
|
32
32
|
end
|
33
|
-
@query = Decidim::Meetings::Meeting.where(component:
|
33
|
+
@query = Decidim::Meetings::Meeting.where(component: visible_components_from_spaces(spaces)).joins(:component)
|
34
34
|
.left_outer_joins(:category).visible
|
35
35
|
@query = @query.where("decidim_meetings_meetings.created_at <= ?", end_time)
|
36
36
|
@query = @query.group("decidim_categorizations.decidim_category_id",
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Meetings
|
5
|
+
# A class used to collect user answers for a questionnaire
|
6
|
+
class QuestionnaireUserAnswers < Rectify::Query
|
7
|
+
# Syntactic sugar to initialize the class and return the queried objects.
|
8
|
+
#
|
9
|
+
# questionnaire - a Questionnaire object
|
10
|
+
def self.for(questionnaire)
|
11
|
+
new(questionnaire).query
|
12
|
+
end
|
13
|
+
|
14
|
+
# Initializes the class.
|
15
|
+
#
|
16
|
+
# questionnaire = a Questionnaire object
|
17
|
+
def initialize(questionnaire)
|
18
|
+
@questionnaire = questionnaire
|
19
|
+
end
|
20
|
+
|
21
|
+
# Finds and group answers by user for each questionnaire's question.
|
22
|
+
def query
|
23
|
+
answers = Answer.joins(:question).where(questionnaire: @questionnaire)
|
24
|
+
|
25
|
+
answers.sort_by { |answer| answer.question.position }.group_by(&:user).values
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -26,7 +26,8 @@ module Decidim
|
|
26
26
|
attendees_count: resource.meeting.attendees_count,
|
27
27
|
attending_organizations: resource.meeting.attending_organizations,
|
28
28
|
closed_at: resource.meeting.closed_at,
|
29
|
-
closing_report: resource.meeting.closing_report
|
29
|
+
closing_report: resource.meeting.closing_report,
|
30
|
+
published_at: resource.meeting.published_at
|
30
31
|
}
|
31
32
|
}
|
32
33
|
end
|
@@ -24,7 +24,8 @@ module Decidim
|
|
24
24
|
attendees_count: resource.meeting.attendees_count,
|
25
25
|
attending_organizations: resource.meeting.attending_organizations,
|
26
26
|
closed_at: resource.meeting.closed_at,
|
27
|
-
closing_report: resource.meeting.closing_report
|
27
|
+
closing_report: resource.meeting.closing_report,
|
28
|
+
published_at: resource.meeting.published_at
|
28
29
|
}
|
29
30
|
}
|
30
31
|
end
|
@@ -21,18 +21,9 @@ module Decidim
|
|
21
21
|
private
|
22
22
|
|
23
23
|
def serialize_answers
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
answer = answers.find_by(question: question)
|
28
|
-
serialized.update("#{idx + 1}. #{translated_attribute(question.body)}" => normalize_body(answer))
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def normalize_body(answer)
|
33
|
-
return "" unless answer
|
34
|
-
|
35
|
-
answer.body || answer.choices.pluck(:body)
|
24
|
+
Decidim::Forms::UserAnswersSerializer.new(
|
25
|
+
resource.meeting.questionnaire.answers.where(user: resource.user)
|
26
|
+
).serialize
|
36
27
|
end
|
37
28
|
end
|
38
29
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Meetings
|
5
|
+
module Calendar
|
6
|
+
# This class handles how to convert a single meeting to the ICalendar
|
7
|
+
# format. It caches its result until the meeting is updated again.
|
8
|
+
# This class generates a ICalendar entry for an individual meeting.
|
9
|
+
class MeetingCalendar < BaseCalendar
|
10
|
+
# Renders the meeting in an ICalendar format. It caches the results in
|
11
|
+
# Rails' cache.
|
12
|
+
#
|
13
|
+
# Returns a String.
|
14
|
+
def events
|
15
|
+
Rails.cache.fetch(cache_key) do
|
16
|
+
MeetingToEvent.new(meeting).to_ical
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
alias meeting resource
|
23
|
+
|
24
|
+
# Defines the cache key for the given component.
|
25
|
+
#
|
26
|
+
# Returns a String.
|
27
|
+
def cache_key
|
28
|
+
"meetings-calendar-meeting-#{meeting.id}-#{meeting.updated_at.to_i}"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "cgi"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Meetings
|
7
|
+
# This class handles the streaming url to be included in the iframe present
|
8
|
+
# in the live event. For some services it's required to transforma a bit
|
9
|
+
# the structure of the URL.
|
10
|
+
class MeetingIframeEmbedder
|
11
|
+
# Public: Initializes the service.
|
12
|
+
# online_meeting_service_url - A String containing the url of the online meeting
|
13
|
+
def initialize(online_meeting_service_url)
|
14
|
+
@online_meeting_service_url = online_meeting_service_url
|
15
|
+
end
|
16
|
+
|
17
|
+
def embed_transformed_url(request_host)
|
18
|
+
return nil if parsed_online_meeting_uri.nil?
|
19
|
+
|
20
|
+
case parsed_online_meeting_uri.host
|
21
|
+
when "www.youtube.com"
|
22
|
+
transform_youtube_url(parsed_online_meeting_uri)
|
23
|
+
when "www.twitch.tv"
|
24
|
+
transform_twitch_url(parsed_online_meeting_uri, request_host)
|
25
|
+
else
|
26
|
+
online_meeting_service_url
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def embeddable?
|
31
|
+
return nil if parsed_online_meeting_uri.nil?
|
32
|
+
|
33
|
+
EMBEDDABLE_SERVICES.include?(parsed_online_meeting_uri.host)
|
34
|
+
end
|
35
|
+
|
36
|
+
def embed_code(request_host)
|
37
|
+
return nil if parsed_online_meeting_uri.nil?
|
38
|
+
|
39
|
+
%(
|
40
|
+
<iframe
|
41
|
+
allow="camera; microphone; fullscreen; display-capture; autoplay"
|
42
|
+
loading="lazy"
|
43
|
+
src="#{embed_transformed_url(request_host)}"
|
44
|
+
style="height: 100%; width: 100%; border: 0px;"
|
45
|
+
/>
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
EMBEDDABLE_SERVICES = %( www.youtube.com www.twitch.tv )
|
52
|
+
|
53
|
+
attr_accessor :online_meeting_service_url
|
54
|
+
|
55
|
+
# Youtube transformation consists on:
|
56
|
+
# 1. extract the video id from the parameter v
|
57
|
+
# 2. Create a new URL using the domain youtube-nocookie.com, converting it to an embed
|
58
|
+
# and appending the video id
|
59
|
+
def transform_youtube_url(uri)
|
60
|
+
return online_meeting_service_url if uri.query.blank?
|
61
|
+
|
62
|
+
video_id = CGI.parse(uri.query).fetch("v")&.first
|
63
|
+
|
64
|
+
return online_meeting_service_url if video_id.blank?
|
65
|
+
|
66
|
+
"https://www.youtube-nocookie.com/embed/#{video_id}"
|
67
|
+
end
|
68
|
+
|
69
|
+
# Twitch transformation consists on:
|
70
|
+
# 1. extract the video id from the third URL parameter
|
71
|
+
# 2. extract the request host
|
72
|
+
# 3. build the embed url using both the video ID and the request host as parent argument
|
73
|
+
def transform_twitch_url(uri, request_host)
|
74
|
+
_, param_name, video_id = *uri.path.split("/")
|
75
|
+
|
76
|
+
return online_meeting_service_url if video_id.blank? || param_name != "videos"
|
77
|
+
|
78
|
+
"https://player.twitch.tv/?video=#{video_id}&parent=#{request_host}"
|
79
|
+
end
|
80
|
+
|
81
|
+
def parsed_online_meeting_uri
|
82
|
+
@parsed_online_meeting_uri ||= URI.parse(online_meeting_service_url) if online_meeting_service_url.present?
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -11,9 +11,9 @@ module Decidim
|
|
11
11
|
# Public: Initializes the service.
|
12
12
|
# component - A Decidim::Component to get the meetings from.
|
13
13
|
# page - The page number to paginate the results.
|
14
|
-
# per_page - The number of
|
14
|
+
# per_page - The number of meetings to return per page.
|
15
15
|
def initialize(options = {})
|
16
|
-
scope = options.fetch(:scope, Meeting.
|
16
|
+
scope = options.fetch(:scope, Meeting.published)
|
17
17
|
super(scope, options)
|
18
18
|
end
|
19
19
|
|
@@ -1,8 +1,8 @@
|
|
1
|
-
<p><%= t("devise.mailer.invitation_instructions.hello", email: @user.name) %></p>
|
1
|
+
<p class="email-greeting"><%= t("devise.mailer.invitation_instructions.hello", email: @user.name) %></p>
|
2
2
|
|
3
|
-
<p>
|
3
|
+
<p class="email-instructions">
|
4
4
|
<%= t ".invited_you_to_join_a_meeting", invited_by: @invited_by.name, application: @user.organization.name %>
|
5
5
|
</p>
|
6
6
|
|
7
|
-
<p><%= link_to t(".decline", meeting_title: present(@meeting).title),routes.decline_invitation_meeting_registration_url(meeting_id: @meeting, participatory_space_id: @meeting.component.participatory_space) %>
|
8
|
-
<p><%= link_to t(".join", meeting_title: present(@meeting).title),routes.meeting_registration_url(meeting_id: @meeting, participatory_space_id: @meeting.component.participatory_space) %>
|
7
|
+
<p class="email-button email-button__cta cta-decline"><%= link_to t(".decline", meeting_title: present(@meeting).title),routes.decline_invitation_meeting_registration_url(meeting_id: @meeting, participatory_space_id: @meeting.component.participatory_space) %>
|
8
|
+
<p class="email-button email-button__cta cta-accept"><%= link_to t(".join", meeting_title: present(@meeting).title),routes.meeting_registration_url(meeting_id: @meeting, participatory_space_id: @meeting.component.participatory_space) %>
|
@@ -21,8 +21,23 @@
|
|
21
21
|
<%= form.number_field :contributions_count, min: 0 %>
|
22
22
|
</div>
|
23
23
|
</div>
|
24
|
+
|
25
|
+
<% if Decidim::Meetings.enable_proposal_linking %>
|
26
|
+
<div class="row column">
|
27
|
+
<%= proposals_picker(form, :proposals, proposals_picker_meeting_meeting_closes_path(meeting)) %>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
<div class="row column">
|
32
|
+
<%= form.text_field :video_url %>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div class="row column">
|
36
|
+
<%= form.text_field :audio_url %>
|
37
|
+
</div>
|
38
|
+
|
24
39
|
<div class="row column">
|
25
|
-
<%=
|
40
|
+
<%= form.check_box :closing_visible %>
|
26
41
|
</div>
|
27
42
|
</div>
|
28
43
|
</div>
|
@@ -38,6 +38,11 @@
|
|
38
38
|
<p class="help-text"><%= t(".online_meeting_url_help") %></p>
|
39
39
|
</div>
|
40
40
|
|
41
|
+
<div class="field" data-meeting-type="online">
|
42
|
+
<%= form.check_box :show_embedded_iframe %>
|
43
|
+
<p class="help-text"><%= t(".show_embedded_iframe_help") %></p>
|
44
|
+
</div>
|
45
|
+
|
41
46
|
<div class="row">
|
42
47
|
<div class="columns xlarge-6">
|
43
48
|
<%= form.datetime_field :start_time %>
|
@@ -84,9 +89,19 @@
|
|
84
89
|
<div class="row column" id="transparent">
|
85
90
|
<%= form.check_box :transparent %>
|
86
91
|
</div>
|
92
|
+
|
93
|
+
<div class="row column">
|
94
|
+
<%= form.check_box :customize_registration_email, :"data-toggle" => "customize_registration_email-div" %>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<div id="customize_registration_email-div" data-toggler=".hide" class="row column <%= @form.customize_registration_email? ? nil : "hide" %>">
|
98
|
+
<%= form.translated :editor, :registration_email_custom_content, lines: 10 %>
|
99
|
+
<p class="help-text"><%= t(".registration_email_help") %></p>
|
100
|
+
</div>
|
101
|
+
|
87
102
|
</div>
|
88
103
|
</div>
|
89
104
|
|
90
105
|
<%= render "services", form: form, id: tabs_id_for_service(blank_service) %>
|
91
106
|
|
92
|
-
<%=
|
107
|
+
<%= javascript_pack_tag "decidim_meetings_admin" %>
|
@@ -9,25 +9,44 @@
|
|
9
9
|
</h2>
|
10
10
|
</div>
|
11
11
|
|
12
|
+
<%= admin_filter_selector(:meetings) %>
|
12
13
|
<div class="card-section">
|
13
14
|
<div class="table-scroll">
|
14
15
|
<table class="table-list">
|
15
16
|
<thead>
|
16
17
|
<tr>
|
17
|
-
<th
|
18
|
-
|
19
|
-
|
20
|
-
<th
|
21
|
-
|
18
|
+
<th>
|
19
|
+
<%= sort_link(query, :id, t("models.meeting.fields.id", scope: "decidim.meetings"), default_order: :desc ) %>
|
20
|
+
</th>
|
21
|
+
<th>
|
22
|
+
<%= sort_link(query, :translated_title, t("models.meeting.fields.title", scope: "decidim.meetings"), default_order: :desc ) %>
|
23
|
+
</th>
|
24
|
+
<th>
|
25
|
+
<%= sort_link(query, :start_time, t("models.meeting.fields.start_time", scope: "decidim.meetings"), default_order: :desc ) %>
|
26
|
+
</th>
|
27
|
+
<th>
|
28
|
+
<%= sort_link(query, :end_time, t("models.meeting.fields.end_time", scope: "decidim.meetings"), default_order: :desc ) %>
|
29
|
+
</th>
|
30
|
+
<th>
|
31
|
+
<%= sort_link(query, :closed, t("models.meeting.fields.closed", scope: "decidim.meetings"), default_order: :desc ) %>
|
32
|
+
</th>
|
33
|
+
<% if maps_enabled? && Decidim::Map.available?(:static, :geocoding) %>
|
22
34
|
<th><%= t("models.meeting.fields.map", scope: "decidim.meetings") %></th>
|
23
35
|
<% end %>
|
24
|
-
|
36
|
+
<% if resource_with_scopes_enabled? %>
|
37
|
+
<th>
|
38
|
+
<%= sort_link(query, :scope_name, t("models.proposal.fields.scope", scope: "decidim.proposals") ) %>
|
39
|
+
</th>
|
40
|
+
<% end %>
|
25
41
|
<th class="actions"><%= t("actions.title", scope: "decidim.meetings") %></th>
|
26
42
|
</tr>
|
27
43
|
</thead>
|
28
44
|
<tbody>
|
29
45
|
<% meetings.each do |meeting| %>
|
30
46
|
<tr data-id="<%= meeting.id %>">
|
47
|
+
<td>
|
48
|
+
<%= meeting.id %><br>
|
49
|
+
</td>
|
31
50
|
<td>
|
32
51
|
<%= present(meeting).title %><br>
|
33
52
|
</td>
|
@@ -44,13 +63,23 @@
|
|
44
63
|
<td>
|
45
64
|
<%= humanize_boolean meeting.closed? %>
|
46
65
|
</td>
|
47
|
-
<% if Decidim::Map.available?(:static, :geocoding) %>
|
66
|
+
<% if maps_enabled? && Decidim::Map.available?(:static, :geocoding) %>
|
48
67
|
<td>
|
49
68
|
<%= static_map_link(meeting) %>
|
50
69
|
</td>
|
51
70
|
<% end %>
|
52
71
|
<%= td_resource_scope_for(meeting.scope) %>
|
53
72
|
<td class="table-list__actions">
|
73
|
+
<% if allowed_to? :update, :meeting, meeting: meeting %>
|
74
|
+
<% if meeting.published? %>
|
75
|
+
<%= icon_link_to "x", unpublish_meeting_path(meeting), t("actions.unpublish", scope: "decidim.admin"), method: :put, class: "action-icon--unpublish", data: { confirm: t("actions.unpublish", scope: "decidim.admin") } %>
|
76
|
+
<% else %>
|
77
|
+
<%= icon_link_to "check", publish_meeting_path(meeting), t("actions.publish", scope: "decidim.admin"), method: :put, class: "action-icon--publish" %>
|
78
|
+
<% end %>
|
79
|
+
<% else %>
|
80
|
+
<span class="action-space icon"></span>
|
81
|
+
<% end %>
|
82
|
+
|
54
83
|
<%= icon_link_to "eye", resource_locator(meeting).path, t("actions.preview", scope: "decidim.meetings"), class: "action-icon--preview", target: :blank %>
|
55
84
|
|
56
85
|
<% if allowed_to? :copy, :meeting, meeting: meeting %>
|
@@ -61,7 +90,7 @@
|
|
61
90
|
|
62
91
|
<% if allowed_to? :update, :meeting, meeting: meeting %>
|
63
92
|
<% if meeting.registration_disabled? %>
|
64
|
-
<%= icon "people", class: "action-icon action-icon--disabled", role: "img" %>
|
93
|
+
<%= icon "people", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.registrations", scope: "decidim.meetings") %>
|
65
94
|
<% else %>
|
66
95
|
<%= icon_link_to "people", meeting.on_this_platform? ? edit_meeting_registrations_path(meeting) : meeting.registration_url, t("actions.registrations", scope: "decidim.meetings"), class: "action-icon--registrations" %>
|
67
96
|
<% end %>
|
@@ -69,13 +98,12 @@
|
|
69
98
|
|
70
99
|
<% if allowed_to? :update, :meeting, meeting: meeting %>
|
71
100
|
<%= icon_link_to "pencil", edit_meeting_path(meeting), t("actions.edit", scope: "decidim.meetings"), class: "action-icon--edit" %>
|
72
|
-
<%= icon_link_to "clock", meeting.minutes.present? ? edit_meeting_minute_path(meeting, meeting.minutes) : new_meeting_minute_path(meeting), t("actions.minutes", scope: "decidim.meetings"), class: "action-icon--minutes" %>
|
73
101
|
<%= icon_link_to "calendar", meeting.agenda.present? ? edit_meeting_agenda_path(meeting, meeting.agenda) : new_meeting_agenda_path(meeting), t("actions.agenda", scope: "decidim.meetings"), class: "action-icon--agenda" %>
|
102
|
+
<%= icon_link_to "list", edit_meeting_poll_path(meeting), t("actions.manage_poll", scope: "decidim.meetings"), class: "action-icon--manage-poll-questionnaire" %>
|
74
103
|
<% else %>
|
75
104
|
<span class="action-space icon"></span>
|
76
105
|
<span class="action-space icon"></span>
|
77
106
|
<span class="action-space icon"></span>
|
78
|
-
<span class="action-space icon"></span>
|
79
107
|
<% end %>
|
80
108
|
|
81
109
|
<% if allowed_to? :close, :meeting, meeting: meeting %>
|
@@ -128,4 +156,4 @@
|
|
128
156
|
</div>
|
129
157
|
</div>
|
130
158
|
|
131
|
-
<%=
|
159
|
+
<%= javascript_pack_tag "decidim_meetings_admin" %>
|