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
@@ -0,0 +1,33 @@
|
|
1
|
+
<table class="meeting-calendar__month">
|
2
|
+
<caption><%= month_name %></caption>
|
3
|
+
<thead>
|
4
|
+
<% abbr_day_names.each_with_index do |day, i| %>
|
5
|
+
<th><abbr title="<%= day_names[i] %>"><%= day %></abbr></th>
|
6
|
+
<% end %>
|
7
|
+
</thead>
|
8
|
+
<tbody>
|
9
|
+
<% weeks.each do |days| %>
|
10
|
+
<tr>
|
11
|
+
<% is_first_day = first_day_of_month?(days.first) %>
|
12
|
+
|
13
|
+
<% if is_first_day %>
|
14
|
+
<% (7 - days.length).times do %>
|
15
|
+
<td></td>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<% days.each do |day| %>
|
20
|
+
<%= content_tag :td, class: day_class(day) do %>
|
21
|
+
<time datetime="<%= day %>"><%= l(day, format: "%d") %></time>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<% if !is_first_day %>
|
26
|
+
<% (7 - days.length).times do %>
|
27
|
+
<td></td>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
30
|
+
</tr>
|
31
|
+
<% end %>
|
32
|
+
</tbody>
|
33
|
+
</table>
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Meetings
|
5
|
+
class MeetingMonthCell < Decidim::ViewModel
|
6
|
+
alias meetings model
|
7
|
+
|
8
|
+
delegate :month, to: :start_date
|
9
|
+
|
10
|
+
def show
|
11
|
+
render if meetings_in_this_month?
|
12
|
+
end
|
13
|
+
|
14
|
+
def meetings_in_this_month?
|
15
|
+
meetings.collect(&:start_time).map { |date| date.strftime("%m").to_i }.any? month
|
16
|
+
end
|
17
|
+
|
18
|
+
def month_days
|
19
|
+
start_date.to_date.all_month
|
20
|
+
end
|
21
|
+
|
22
|
+
def weeks
|
23
|
+
month_days.group_by do |day|
|
24
|
+
(1 - first_week_date_rotation).days.since(day).cweek
|
25
|
+
end.values
|
26
|
+
end
|
27
|
+
|
28
|
+
def month_name
|
29
|
+
@month_name ||= I18n.t("date.month_names")[month]
|
30
|
+
end
|
31
|
+
|
32
|
+
def abbr_day_names
|
33
|
+
@abbr_day_names ||= I18n.t("date.abbr_day_names").rotate(first_week_date_rotation)
|
34
|
+
end
|
35
|
+
|
36
|
+
def day_names
|
37
|
+
@day_names ||= I18n.t("date.day_names").rotate(first_week_date_rotation)
|
38
|
+
end
|
39
|
+
|
40
|
+
def first_day_of_month?(date)
|
41
|
+
date.day == 1
|
42
|
+
end
|
43
|
+
|
44
|
+
def day_class(date)
|
45
|
+
return "is-today" if date == Date.current
|
46
|
+
return if events.exclude?(date)
|
47
|
+
|
48
|
+
"is-#{date < Date.current ? "past" : "upcoming"}-event"
|
49
|
+
end
|
50
|
+
|
51
|
+
def beginning_of_week
|
52
|
+
@beginning_of_week ||= options[:beginning_of_week] || Date.beginning_of_week
|
53
|
+
end
|
54
|
+
|
55
|
+
def start_date
|
56
|
+
options[:start_date] || first_meeting.start_time
|
57
|
+
end
|
58
|
+
|
59
|
+
def events
|
60
|
+
options[:events] || meetings.select { |meeting| meeting.start_time.month == month }.map { |meeting| meeting.start_time.to_date }
|
61
|
+
end
|
62
|
+
|
63
|
+
def first_meeting
|
64
|
+
@first_meeting ||= meetings.first
|
65
|
+
end
|
66
|
+
|
67
|
+
def first_week_date_rotation
|
68
|
+
@first_week_date_rotation ||= Date::DAYS_INTO_WEEK[beginning_of_week.to_sym].to_i
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -2,45 +2,13 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module Meetings
|
5
|
-
# This cell renders the
|
6
|
-
# for
|
7
|
-
class MeetingSCell <
|
8
|
-
def meeting_path
|
9
|
-
resource_locator(model).path
|
10
|
-
end
|
11
|
-
|
12
|
-
def participatory_space_class_name
|
13
|
-
model.component.participatory_space.class.model_name.human
|
14
|
-
end
|
15
|
-
|
16
|
-
def participatory_space_title
|
17
|
-
decidim_escape_translated model.component.participatory_space.title
|
18
|
-
end
|
19
|
-
|
20
|
-
def participatory_space_path
|
21
|
-
resource_locator(model.component.participatory_space).path
|
22
|
-
end
|
23
|
-
|
5
|
+
# This cell renders the Search (:s) meeting card
|
6
|
+
# for a given instance of a Meeting
|
7
|
+
class MeetingSCell < Decidim::CardSCell
|
24
8
|
private
|
25
9
|
|
26
|
-
def
|
27
|
-
|
28
|
-
hash << I18n.locale.to_s
|
29
|
-
hash << model.cache_key_with_version
|
30
|
-
hash << Digest::MD5.hexdigest(model.component.cache_key_with_version)
|
31
|
-
hash << Digest::MD5.hexdigest(resource_image_path) if resource_image_path
|
32
|
-
hash << model.comments_count
|
33
|
-
hash << model.follows_count
|
34
|
-
hash << render_space? ? 1 : 0
|
35
|
-
|
36
|
-
if current_user
|
37
|
-
hash << current_user.cache_key_with_version
|
38
|
-
hash << current_user.follows?(model) ? 1 : 0
|
39
|
-
end
|
40
|
-
hash << Digest::MD5.hexdigest(model.author.cache_key_with_version)
|
41
|
-
hash << (model.must_render_translation?(current_organization) ? 1 : 0) if model.respond_to?(:must_render_translation?)
|
42
|
-
|
43
|
-
hash.join(Decidim.cache_key_separator)
|
10
|
+
def metadata_cell
|
11
|
+
"decidim/meetings/meeting_card_metadata"
|
44
12
|
end
|
45
13
|
end
|
46
14
|
end
|
@@ -1,31 +1,16 @@
|
|
1
1
|
<%= dynamic_map_for meetings_data_for_map(geocoded_meetings) do %>
|
2
2
|
<template id="marker-popup">
|
3
|
-
<div class="
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
</div>
|
12
|
-
<div class="card__datetime__time">${starTime}</div>
|
3
|
+
<div class="space-y-6">
|
4
|
+
<a href="${link}" class="card__list">
|
5
|
+
<div class="card__list-content">
|
6
|
+
<h3 class="h4 card__list-title">${title}</h3>
|
7
|
+
<div class="card__list-metadata">
|
8
|
+
{{each JSON.parse(items)}}
|
9
|
+
<span>{{html icon}}${text}</span>
|
10
|
+
{{/each}}
|
13
11
|
</div>
|
14
|
-
<div class="address card__extra">
|
15
|
-
<div class="address__icon">{{html icon}}</div>
|
16
|
-
<div class="address__details">
|
17
|
-
<strong>{{html location}}</strong><br>
|
18
|
-
<span>${address}</span><br>
|
19
|
-
<span>{{html locationHints}}</span>
|
20
|
-
</div>
|
21
|
-
</div>
|
22
|
-
</div>
|
23
|
-
<div class="map-info__button">
|
24
|
-
<a href="${link}" class="button button--sc">
|
25
|
-
<%= t("decidim.meetings.meetings_map.view_meeting") %>
|
26
|
-
</a>
|
27
12
|
</div>
|
28
|
-
</
|
13
|
+
</a>
|
29
14
|
</div>
|
30
15
|
</template>
|
31
16
|
<% end.html_safe %>
|
@@ -1,44 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<div class="card card--secondary">
|
4
|
-
<div class="card__content text-center">
|
5
|
-
<% if live? %>
|
6
|
-
<div class="heading1 text-primary">
|
7
|
-
<%= icon "audio", class: "heading4" %>
|
8
|
-
</div>
|
9
|
-
<div>
|
10
|
-
<strong class="heading5"><%= t("live_event", scope: "decidim.meetings.meetings.show") %></strong>
|
11
|
-
<% unless show_embed? %>
|
12
|
-
<p><small><%= t("micro_camera_permissions_warning", scope: "decidim.meetings.meetings.show") %></small></p>
|
13
|
-
<% end %>
|
14
|
-
</div>
|
15
|
-
<% end %>
|
1
|
+
<div class="meeting__online">
|
2
|
+
<%= icon "broadcast-line", class: "w-14 h-14 fill-current #{live? && online_meeting_url? ? "text-tertiary" : "text-gray"}" %>
|
16
3
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
<% end %>
|
28
|
-
</div>
|
29
|
-
<% end %>
|
4
|
+
<% if !online_meeting_url? %>
|
5
|
+
<p><%= t("link_available_soon", scope: "decidim.meetings.meetings.show") %></p>
|
6
|
+
<% elsif future? %>
|
7
|
+
<p><%= t("link_closed", scope: "decidim.meetings.meetings.show") %></p>
|
8
|
+
<% elsif live? %>
|
9
|
+
<p class="h3"><%= t("live_event", scope: "decidim.meetings.meetings.show") %></p>
|
10
|
+
|
11
|
+
<% if show_embed? %>
|
12
|
+
<div class="hidden md:block h-[60vh] w-full">
|
13
|
+
<%== embed_code(request.host) %>
|
30
14
|
</div>
|
31
|
-
|
15
|
+
<% else %>
|
16
|
+
<p><%= t("micro_camera_permissions_warning", scope: "decidim.meetings.meetings.show") %></p>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<%= link_to t("join_meeting", scope: "decidim.meetings.meetings.meeting"), live_event_url, target: "_blank", class: "button button__xl button__secondary", data: { "external-link": false } %>
|
32
20
|
<% end %>
|
33
|
-
|
34
|
-
<div class="card card--secondary">
|
35
|
-
<div class="card__content address">
|
36
|
-
<div class="address__info">
|
37
|
-
<%= icon "timer", role: "img", "aria-hidden": true, remove_icon_class: true, width: 40, height: 70 %>
|
38
|
-
<div class="address__details">
|
39
|
-
<span><%= t("link_available_soon", scope: "decidim.meetings.meetings.show") %></span>
|
40
|
-
</div>
|
41
|
-
</div>
|
42
|
-
</div>
|
43
|
-
</div>
|
44
|
-
<% end %>
|
21
|
+
</div>
|
@@ -1,16 +1,5 @@
|
|
1
|
-
<div id="list-of-public-participants" class="
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
</div>
|
6
|
-
<div class="columns large-12">
|
7
|
-
<%= cell(
|
8
|
-
"decidim/collapsible_list",
|
9
|
-
public_participants,
|
10
|
-
cell_name: "decidim/author",
|
11
|
-
cell_options: { extra_classes: ["author-data--small"] },
|
12
|
-
hidden_elements_count_i18n_key: "decidim.meetings.public_participants_list.hidden_participants_count"
|
13
|
-
) %>
|
14
|
-
</div>
|
15
|
-
</div>
|
1
|
+
<div id="list-of-public-participants" class="meeting__grid">
|
2
|
+
<% public_participants.each do |participant| %>
|
3
|
+
<%= cell "decidim/author", participant %>
|
4
|
+
<% end %>
|
16
5
|
</div>
|
@@ -18,7 +18,7 @@ module Decidim
|
|
18
18
|
# Executes the command. Broadcasts these events:
|
19
19
|
#
|
20
20
|
# - :ok when everything is valid.
|
21
|
-
# - :invalid if the form
|
21
|
+
# - :invalid if the form was not valid and we could not proceed.
|
22
22
|
#
|
23
23
|
# Returns nothing.
|
24
24
|
def call
|
@@ -20,7 +20,7 @@ module Decidim
|
|
20
20
|
# Executes the command. Broadcasts these events:
|
21
21
|
#
|
22
22
|
# - :ok when everything is valid.
|
23
|
-
# - :invalid if the form
|
23
|
+
# - :invalid if the form was not valid and we could not proceed.
|
24
24
|
#
|
25
25
|
# Returns nothing.
|
26
26
|
def call
|
@@ -37,7 +37,7 @@ module Decidim
|
|
37
37
|
|
38
38
|
def already_invited?
|
39
39
|
return false unless user.persisted?
|
40
|
-
return false unless meeting.invites.exists?(user:
|
40
|
+
return false unless meeting.invites.exists?(user:)
|
41
41
|
|
42
42
|
form.errors.add(:email, :already_invited)
|
43
43
|
true
|
@@ -58,8 +58,8 @@ module Decidim
|
|
58
58
|
Invite,
|
59
59
|
invited_by,
|
60
60
|
{
|
61
|
-
user
|
62
|
-
meeting
|
61
|
+
user:,
|
62
|
+
meeting:,
|
63
63
|
sent_at: Time.current
|
64
64
|
},
|
65
65
|
log_info
|
@@ -98,7 +98,7 @@ module Decidim
|
|
98
98
|
|
99
99
|
def invite_user_to_sign_up
|
100
100
|
user.skip_reconfirmation!
|
101
|
-
user.invite!(invited_by, invitation_instructions: "join_meeting", meeting:
|
101
|
+
user.invite!(invited_by, invitation_instructions: "join_meeting", meeting:)
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
@@ -18,7 +18,7 @@ module Decidim
|
|
18
18
|
# Executes the command. Broadcasts these events:
|
19
19
|
#
|
20
20
|
# - :ok when everything is valid.
|
21
|
-
# - :invalid if the form
|
21
|
+
# - :invalid if the form was not valid and we could not proceed.
|
22
22
|
#
|
23
23
|
# Returns nothing.
|
24
24
|
def call
|
@@ -18,7 +18,7 @@ module Decidim
|
|
18
18
|
# Executes the command. Broadcasts these events:
|
19
19
|
#
|
20
20
|
# - :ok when everything is valid.
|
21
|
-
# - :invalid if the form
|
21
|
+
# - :invalid if the form was not valid and we could not proceed.
|
22
22
|
#
|
23
23
|
# Returns nothing.
|
24
24
|
def call
|
@@ -15,13 +15,14 @@ module Decidim
|
|
15
15
|
def call
|
16
16
|
return broadcast(:invalid) if form.invalid?
|
17
17
|
|
18
|
-
|
18
|
+
with_events(with_transaction: true) do
|
19
19
|
create_meeting!
|
20
|
-
schedule_upcoming_meeting_notification
|
21
|
-
send_notification
|
22
20
|
end
|
23
21
|
|
24
22
|
create_follow_form_resource(form.current_user)
|
23
|
+
schedule_upcoming_meeting_notification
|
24
|
+
send_notification
|
25
|
+
|
25
26
|
broadcast(:ok, meeting)
|
26
27
|
end
|
27
28
|
|
@@ -29,6 +30,16 @@ module Decidim
|
|
29
30
|
|
30
31
|
attr_reader :meeting, :form
|
31
32
|
|
33
|
+
def event_arguments
|
34
|
+
{
|
35
|
+
resource: meeting,
|
36
|
+
extra: {
|
37
|
+
event_author: form.current_user,
|
38
|
+
locale:
|
39
|
+
}
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
32
43
|
def create_meeting!
|
33
44
|
parsed_title = Decidim::ContentProcessor.parse_with_processor(:hashtag, form.title, current_organization: form.current_organization).rewrite
|
34
45
|
parsed_description = Decidim::ContentProcessor.parse(form.description, current_organization: form.current_organization).rewrite
|
@@ -42,7 +42,7 @@ module Decidim
|
|
42
42
|
attr_reader :meeting, :user, :user_group, :registration, :registration_form
|
43
43
|
|
44
44
|
def accept_invitation
|
45
|
-
meeting.invites.find_by(user:
|
45
|
+
meeting.invites.find_by(user:)&.accept!
|
46
46
|
end
|
47
47
|
|
48
48
|
def answer_questionnaire
|
@@ -61,9 +61,9 @@ module Decidim
|
|
61
61
|
|
62
62
|
def create_registration
|
63
63
|
@registration = Decidim::Meetings::Registration.create!(
|
64
|
-
meeting
|
65
|
-
user
|
66
|
-
user_group
|
64
|
+
meeting:,
|
65
|
+
user:,
|
66
|
+
user_group:,
|
67
67
|
public_participation: registration_form.public_participation
|
68
68
|
)
|
69
69
|
end
|
@@ -107,7 +107,7 @@ module Decidim
|
|
107
107
|
resource: @meeting,
|
108
108
|
affected_users: participatory_space_admins,
|
109
109
|
extra: {
|
110
|
-
percentage:
|
110
|
+
percentage:
|
111
111
|
}
|
112
112
|
)
|
113
113
|
end
|
@@ -22,12 +22,12 @@ module Decidim
|
|
22
22
|
def call
|
23
23
|
return broadcast(:invalid) if form.invalid?
|
24
24
|
|
25
|
-
|
25
|
+
with_events(with_transaction: true) do
|
26
26
|
update_meeting!
|
27
|
-
send_notification if should_notify_followers?
|
28
|
-
schedule_upcoming_meeting_notification if start_time_changed?
|
29
27
|
end
|
30
28
|
|
29
|
+
send_notification if should_notify_followers?
|
30
|
+
schedule_upcoming_meeting_notification if start_time_changed?
|
31
31
|
broadcast(:ok, meeting)
|
32
32
|
end
|
33
33
|
|
@@ -35,6 +35,16 @@ module Decidim
|
|
35
35
|
|
36
36
|
attr_reader :form, :current_user, :meeting
|
37
37
|
|
38
|
+
def event_arguments
|
39
|
+
{
|
40
|
+
resource: meeting,
|
41
|
+
extra: {
|
42
|
+
event_author: form.current_user,
|
43
|
+
locale:
|
44
|
+
}
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
38
48
|
def update_meeting!
|
39
49
|
parsed_title = Decidim::ContentProcessor.parse_with_processor(:hashtag, form.title, current_organization: form.current_organization).rewrite
|
40
50
|
parsed_description = Decidim::ContentProcessor.parse(form.description, current_organization: form.current_organization).rewrite
|
@@ -18,11 +18,11 @@ module Decidim
|
|
18
18
|
with_any_date: "upcoming",
|
19
19
|
activity: "all",
|
20
20
|
with_availability: "",
|
21
|
-
with_any_scope:
|
22
|
-
with_any_category:
|
21
|
+
with_any_scope: nil,
|
22
|
+
with_any_category: nil,
|
23
23
|
with_any_state: nil,
|
24
|
-
with_any_origin:
|
25
|
-
with_any_type:
|
24
|
+
with_any_origin: nil,
|
25
|
+
with_any_type: nil
|
26
26
|
}
|
27
27
|
end
|
28
28
|
end
|
@@ -9,15 +9,15 @@ module Decidim
|
|
9
9
|
helper_method :meeting, :agenda, :blank_agenda_item, :blank_agenda_item_child
|
10
10
|
|
11
11
|
def new
|
12
|
-
enforce_permission_to
|
12
|
+
enforce_permission_to(:create, :agenda, meeting:)
|
13
13
|
|
14
14
|
@form = form(MeetingAgendaForm).instance
|
15
15
|
end
|
16
16
|
|
17
17
|
def create
|
18
|
-
enforce_permission_to
|
18
|
+
enforce_permission_to(:create, :agenda, meeting:)
|
19
19
|
|
20
|
-
@form = form(MeetingAgendaForm).from_params(params, meeting:
|
20
|
+
@form = form(MeetingAgendaForm).from_params(params, meeting:)
|
21
21
|
|
22
22
|
CreateAgenda.call(@form, meeting) do
|
23
23
|
on(:ok) do
|
@@ -33,15 +33,15 @@ module Decidim
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def edit
|
36
|
-
enforce_permission_to
|
36
|
+
enforce_permission_to(:update, :agenda, agenda:, meeting:)
|
37
37
|
|
38
38
|
@form = form(MeetingAgendaForm).from_model(agenda)
|
39
39
|
end
|
40
40
|
|
41
41
|
def update
|
42
|
-
enforce_permission_to
|
42
|
+
enforce_permission_to(:update, :agenda, agenda:, meeting:)
|
43
43
|
|
44
|
-
@form = form(MeetingAgendaForm).from_params(params, meeting:
|
44
|
+
@form = form(MeetingAgendaForm).from_params(params, meeting:)
|
45
45
|
|
46
46
|
UpdateAgenda.call(@form, agenda) do
|
47
47
|
on(:ok) do
|
@@ -9,7 +9,7 @@ module Decidim
|
|
9
9
|
helper_method :invites
|
10
10
|
|
11
11
|
def index
|
12
|
-
enforce_permission_to
|
12
|
+
enforce_permission_to(:read_invites, :meeting, meeting:)
|
13
13
|
|
14
14
|
@query = params[:q]
|
15
15
|
@status = params[:status]
|
@@ -18,7 +18,7 @@ module Decidim
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def create
|
21
|
-
enforce_permission_to
|
21
|
+
enforce_permission_to(:invite_attendee, :meeting, meeting:)
|
22
22
|
|
23
23
|
@form = form(MeetingRegistrationInviteForm).from_params(params)
|
24
24
|
|
@@ -42,7 +42,7 @@ module Decidim
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def invites
|
45
|
-
@invites ||= Decidim::
|
45
|
+
@invites ||= Decidim::Admin::Invites.for(meeting.invites, @query, @status).page(params[:page]).per(15)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
@@ -5,18 +5,16 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This controller allows an admin to manage meetings from a Participatory Process
|
7
7
|
class MeetingClosesController < Admin::ApplicationController
|
8
|
-
include Decidim::Proposals::Admin::Picker if Decidim::Meetings.enable_proposal_linking
|
9
|
-
|
10
8
|
helper_method :meeting
|
11
9
|
|
12
10
|
def edit
|
13
|
-
enforce_permission_to
|
11
|
+
enforce_permission_to(:close, :meeting, meeting:)
|
14
12
|
|
15
13
|
@form = form(Admin::CloseMeetingForm).from_model(meeting)
|
16
14
|
end
|
17
15
|
|
18
16
|
def update
|
19
|
-
enforce_permission_to
|
17
|
+
enforce_permission_to(:close, :meeting, meeting:)
|
20
18
|
|
21
19
|
@form = form(Admin::CloseMeetingForm).from_params(params.merge(proposals: meeting.sibling_scope(:proposals)))
|
22
20
|
|
@@ -9,15 +9,15 @@ module Decidim
|
|
9
9
|
helper_method :meeting, :blank_service
|
10
10
|
|
11
11
|
def new
|
12
|
-
enforce_permission_to
|
12
|
+
enforce_permission_to(:copy, :meeting, meeting:)
|
13
13
|
|
14
14
|
@form = form(MeetingForm).from_model(meeting)
|
15
15
|
end
|
16
16
|
|
17
17
|
def create
|
18
|
-
enforce_permission_to
|
18
|
+
enforce_permission_to(:copy, :meeting, meeting:)
|
19
19
|
|
20
|
-
@form = form(MeetingForm).from_params(params, current_component:
|
20
|
+
@form = form(MeetingForm).from_params(params, current_component:)
|
21
21
|
|
22
22
|
CopyMeeting.call(@form, meeting) do
|
23
23
|
on(:ok) do
|