decidim-meetings 0.27.9 → 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 +48 -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 +53 -76
- 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 +45 -74
- 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 +14 -94
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93a241fc0fd0001dca0742aa036870fad47d1920466304a88687ee9df038ac95
|
4
|
+
data.tar.gz: 92d9be9a5908337903a535eafc57283c431f09d32e6914561fbf1ce2987a1811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10652328d80c951307926aa7f23929def21662f4f17a663fcfd22e8972329fa244cc666aea9f86d67b18b2a851a6a42b4016c10ebed10855cceb4ab142c5db48
|
7
|
+
data.tar.gz: 364398407b41b687662b81f29a1db756d4f1ecab6e4bb9a9c7284fb9f02f76dc8579e871a237396b3cfce0595d7cfef10f7c862da10af62d05df8d674e800dc4
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "cell/partial"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Meetings
|
7
|
+
# This cell renders the list of public participanting
|
8
|
+
# organizations of a meeting.
|
9
|
+
#
|
10
|
+
# Example:
|
11
|
+
#
|
12
|
+
# cell("decidim/participating_organizations_list", meeting)
|
13
|
+
class AttendingOrganizationsListCell < PublicParticipantsListCell
|
14
|
+
private
|
15
|
+
|
16
|
+
def user_group_ids
|
17
|
+
model.user_group_registrations.user_group_ids
|
18
|
+
end
|
19
|
+
|
20
|
+
def user_groups
|
21
|
+
Decidim::UserGroup.where(id: user_group_ids)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Finds the public organizations (as user groups) of meeting
|
25
|
+
#
|
26
|
+
# Returns an Array of presented UserGroups
|
27
|
+
def public_participants
|
28
|
+
@public_participants ||= user_groups.map { |user_group| present(user_group) }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%= decidim_modal id: "meeting-cancelation-confirm-#{model.id}", class: "meeting__cancelation-modal" do %>
|
2
|
+
<%= decidim_form_for(registration_form, url: meeting_registration_path(model), method: :delete) do |form| %>
|
3
|
+
<div data-dialog-container>
|
4
|
+
<%= icon "door-open-line" %>
|
5
|
+
<h2 id="dialog-title-meeting-cancelation-confirm-<%= model.id %>" data-dialog-title><%= t("leave", scope: "decidim.meetings.meetings.show") %></h2>
|
6
|
+
<div>
|
7
|
+
|
8
|
+
<div id="dialog-desc-meeting-cancelation-confirm-<%= model.id %>" class="meeting__cancelation-modal__description"><%= t("leave_confirmation", scope: "decidim.meetings.meetings.show") %></div>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<div data-dialog-actions>
|
12
|
+
<button type="button" class="button button__sm md:button__lg button__transparent-secondary" data-dialog-close="meeting-cancelation-confirm-<%= model.id %>">
|
13
|
+
<span><%= t("close", scope: "decidim.shared.flag_modal") %></span>
|
14
|
+
</button>
|
15
|
+
<button type="submit" class="button button__sm md:button__lg button__secondary">
|
16
|
+
<span><%= t("leave", scope: "decidim.meetings.meetings.show") %></span>
|
17
|
+
<%= icon "arrow-right-line" %>
|
18
|
+
</button>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
@@ -1,13 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<%= icon icon_name %>
|
12
|
-
<% end %>
|
13
|
-
</div>
|
1
|
+
<%= render :cancelation_modal %>
|
2
|
+
<%= action_authorized_button_to(
|
3
|
+
:join,
|
4
|
+
"#",
|
5
|
+
class: button_classes,
|
6
|
+
data: { "dialog-open": "meeting-cancelation-confirm-#{model.id}" }
|
7
|
+
) do %>
|
8
|
+
<%= t("leave", scope: "decidim.meetings.meetings.show") %>
|
9
|
+
<%= icon icon_name %>
|
10
|
+
<% end %>
|
@@ -3,29 +3,19 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Meetings
|
5
5
|
module ContentBlocks
|
6
|
-
class HighlightedMeetingsCell < Decidim::ContentBlocks::
|
7
|
-
|
8
|
-
Decidim::Meetings::Meeting
|
9
|
-
.except_withdrawn
|
10
|
-
.published
|
11
|
-
.not_hidden
|
12
|
-
.upcoming
|
13
|
-
.visible_for(current_user)
|
14
|
-
.where(component: published_components)
|
15
|
-
end
|
6
|
+
class HighlightedMeetingsCell < Decidim::ContentBlocks::HighlightedElementsWithCellForListCell
|
7
|
+
private
|
16
8
|
|
17
|
-
def
|
18
|
-
|
9
|
+
def list_cell_path
|
10
|
+
"decidim/meetings/highlighted_meetings_for_component"
|
19
11
|
end
|
20
12
|
|
21
|
-
def
|
22
|
-
|
13
|
+
def see_all_path
|
14
|
+
meetings_directory_path if model.scope_name == "homepage"
|
23
15
|
end
|
24
16
|
|
25
|
-
|
26
|
-
|
27
|
-
def limit
|
28
|
-
geolocation_enabled? ? 4 : 8
|
17
|
+
def meetings_directory_path
|
18
|
+
Decidim::Meetings::DirectoryEngine.routes.url_helpers.root_path
|
29
19
|
end
|
30
20
|
end
|
31
21
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div class="meeting__calendar-container">
|
2
|
+
<div class="meeting__calendar meeting__calendar__lg">
|
3
|
+
<div class="meeting__calendar-month">
|
4
|
+
<span><%= l(start_time, format: !same_month? ? "%b" : "%B") %></span>
|
5
|
+
<span class="meeting__calendar-separator"><%= "-" if !same_month? %></span>
|
6
|
+
<span><%= l(end_time, format: "%b") if !same_month? %></span>
|
7
|
+
</div>
|
8
|
+
<div class="meeting__calendar-day">
|
9
|
+
<span><%= l(start_time, format: "%d") %></span>
|
10
|
+
<span class="meeting__calendar-separator"><%= "-" if !same_day? || !same_month? %></span>
|
11
|
+
<span><%= l(end_time, format: "%d") if !same_day? || !same_month? %></span>
|
12
|
+
</div>
|
13
|
+
<div class="meeting__calendar-time">
|
14
|
+
<time datetime="<%= start_time.iso8601 %>"><%= l(start_time, format: "%H:%M") %></time>
|
15
|
+
<span class="meeting__calendar-separator"><%= "-" %></span>
|
16
|
+
<time datetime="<%= end_time.iso8601 %>"><%= l(end_time, format: "%H:%M") %></time>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<%= static_map %>
|
21
|
+
|
22
|
+
<% if online? %>
|
23
|
+
<%= cell("decidim/address", meeting, online: true) %>
|
24
|
+
<% end %>
|
25
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render partial: "decidim/shared/static_map", formats: [:html], locals: { geolocalizable: meeting } %>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Meetings
|
5
|
+
# This cell renders the meeting dates range and the map if enabled and
|
6
|
+
# available
|
7
|
+
class DatesAndMapCell < Decidim::ViewModel
|
8
|
+
include Cell::ViewModel::Partial
|
9
|
+
include Decidim::MapHelper
|
10
|
+
|
11
|
+
alias meeting model
|
12
|
+
|
13
|
+
delegate :start_time, :end_time, :maps_enabled?, :online?, to: :meeting
|
14
|
+
delegate :snippets, to: :controller
|
15
|
+
|
16
|
+
def static_map
|
17
|
+
return render :static_map if display_map?
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def same_month?
|
23
|
+
start_time.month == end_time.month
|
24
|
+
end
|
25
|
+
|
26
|
+
def same_day?
|
27
|
+
start_time.day == end_time.day
|
28
|
+
end
|
29
|
+
|
30
|
+
def display_map?
|
31
|
+
maps_enabled? && !online?
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -1,34 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
<%# NOTE: Since this call can be called from outside decidim-meetings, frontend assets are required %>
|
2
|
+
|
3
|
+
<%= apply_meetings_pack_tags %>
|
4
|
+
|
5
|
+
<div class="content-block__title">
|
6
|
+
<h2 class="h2 decorator">
|
7
|
+
<%= single_component? ? translated_attribute(model.name) : t("decidim.components.meetings.name") %>
|
8
|
+
</h2>
|
9
|
+
<div class="label text-lg"><%= meetings_count %></div>
|
10
|
+
<% if see_all_path.present? %>
|
11
|
+
<%= link_to see_all_path, class: "button button__sm button__text-secondary" do %>
|
12
|
+
<span><%= t("decidim.participatory_spaces.highlighted_meetings.see_all") %></span>
|
13
|
+
<%= icon "arrow-right-line" %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
<% if show_map? %>
|
18
|
+
<div class="meeting-list__block-map">
|
19
|
+
<%= cell "decidim/meetings/meetings_map", collection %>
|
17
20
|
</div>
|
18
|
-
<%
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
<% past_meetings.each do |meeting| %>
|
25
|
-
<%= card_for meeting, size: :list_item %>
|
21
|
+
<% end %>
|
22
|
+
<div class="meeting-list__block-list">
|
23
|
+
<% if show_calendar? %>
|
24
|
+
<div class="meeting-list__block-list-aside">
|
25
|
+
<% calendar_months.each do |start_date| %>
|
26
|
+
<%= cell "decidim/meetings/meeting_month", collection, start_date: %>
|
26
27
|
<% end %>
|
27
28
|
</div>
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
<% end %>
|
30
|
+
<div class="card__list-list">
|
31
|
+
<span class="meeting-list__block-list-title"><%= title %></span>
|
32
|
+
<% collection.includes(:component).each do |meeting| %>
|
33
|
+
<%= cell "decidim/meetings/meeting_l", meeting, title_tag: :h3, **options.slice(:show_space) %>
|
34
|
+
<% end %>
|
33
35
|
</div>
|
34
|
-
|
36
|
+
</div>
|
@@ -8,41 +8,89 @@ module Decidim
|
|
8
8
|
# It is intended to be used in the `participatory_space_highlighted_elements`
|
9
9
|
# view hook.
|
10
10
|
class HighlightedMeetingsForComponentCell < Decidim::ViewModel
|
11
|
+
include Decidim::Meetings::ApplicationHelper
|
11
12
|
include Decidim::ComponentPathHelper
|
12
13
|
include Decidim::CardHelper
|
14
|
+
include Decidim::LayoutHelper
|
15
|
+
|
16
|
+
delegate :snippets, to: :controller
|
13
17
|
|
14
18
|
def show
|
15
|
-
render unless
|
19
|
+
render unless items_blank?
|
20
|
+
end
|
21
|
+
|
22
|
+
def items_blank?
|
23
|
+
meetings_count.zero?
|
16
24
|
end
|
17
25
|
|
18
26
|
private
|
19
27
|
|
28
|
+
def meetings_count
|
29
|
+
@meetings_count ||= meetings.size
|
30
|
+
end
|
31
|
+
|
32
|
+
def base_relation
|
33
|
+
@base_relation ||= Decidim::Meetings::Meeting.where(component: model)
|
34
|
+
.except_withdrawn
|
35
|
+
.published
|
36
|
+
.not_hidden
|
37
|
+
.visible_for(current_user)
|
38
|
+
end
|
39
|
+
|
40
|
+
def section_id
|
41
|
+
return "upcoming_meetings" if show_upcoming_meetings?
|
42
|
+
|
43
|
+
"past_meetings"
|
44
|
+
end
|
45
|
+
|
46
|
+
def collection
|
47
|
+
@collection ||= meetings.limit(limit)
|
48
|
+
end
|
49
|
+
|
20
50
|
def meetings
|
21
|
-
@meetings ||=
|
22
|
-
.except_withdrawn
|
23
|
-
.published
|
24
|
-
.not_hidden
|
25
|
-
.visible_for(current_user)
|
51
|
+
@meetings ||= show_upcoming_meetings? ? upcoming_meetings : past_meetings
|
26
52
|
end
|
27
53
|
|
28
|
-
def
|
29
|
-
|
54
|
+
def title
|
55
|
+
return t("upcoming_meetings", scope: "decidim.participatory_spaces.highlighted_meetings") if show_upcoming_meetings?
|
56
|
+
|
57
|
+
t("past_meetings", scope: "decidim.participatory_spaces.highlighted_meetings")
|
30
58
|
end
|
31
59
|
|
32
|
-
def
|
33
|
-
@
|
60
|
+
def show_upcoming_meetings?
|
61
|
+
@show_upcoming_meetings ||= options[:force_upcoming] || upcoming_meetings.present?
|
34
62
|
end
|
35
63
|
|
36
|
-
def
|
37
|
-
|
64
|
+
def show_map?
|
65
|
+
maps_active? && !all_online_meetings?
|
38
66
|
end
|
39
67
|
|
40
|
-
def
|
41
|
-
|
68
|
+
def maps_active?
|
69
|
+
Decidim::Map.available?(:geocoding, :dynamic)
|
42
70
|
end
|
43
71
|
|
44
|
-
def
|
45
|
-
|
72
|
+
def all_online_meetings?
|
73
|
+
collection.collect(&:type_of_meeting).all?("online")
|
74
|
+
end
|
75
|
+
|
76
|
+
def show_calendar?
|
77
|
+
@show_calendar ||= show_upcoming_meetings? && collection.minimum(:start_time).before?(2.months.from_now.beginning_of_month)
|
78
|
+
end
|
79
|
+
|
80
|
+
def calendar_months
|
81
|
+
[Date.current, Date.current.next_month]
|
82
|
+
end
|
83
|
+
|
84
|
+
def past_meetings
|
85
|
+
@past_meetings ||= base_relation.past.order(end_time: :desc, start_time: :desc)
|
86
|
+
end
|
87
|
+
|
88
|
+
def upcoming_meetings
|
89
|
+
@upcoming_meetings ||= base_relation.upcoming.order(:start_time, :end_time)
|
90
|
+
end
|
91
|
+
|
92
|
+
def single_component?
|
93
|
+
@single_component ||= model.is_a?(Decidim::Component)
|
46
94
|
end
|
47
95
|
|
48
96
|
def cache_hash
|
@@ -53,6 +101,18 @@ module Decidim
|
|
53
101
|
hash << I18n.locale.to_s
|
54
102
|
hash.join(Decidim.cache_key_separator)
|
55
103
|
end
|
104
|
+
|
105
|
+
def component_routes
|
106
|
+
Decidim::EngineRouter.main_proxy(model)
|
107
|
+
end
|
108
|
+
|
109
|
+
def limit
|
110
|
+
3
|
111
|
+
end
|
112
|
+
|
113
|
+
def see_all_path
|
114
|
+
@see_all_path ||= options[:see_all_path] || (single_component? && main_component_path(model))
|
115
|
+
end
|
56
116
|
end
|
57
117
|
end
|
58
118
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= decidim_modal id: "meeting-registration-confirm-#{model.id}", class: "meeting__registration-modal" do %>
|
2
|
+
<%= decidim_form_for(registration_form, url: meeting_registration_path(model), method: :post) do |form| %>
|
3
|
+
<div data-dialog-container>
|
4
|
+
<%= icon "login-circle-line" %>
|
5
|
+
<h2 id="dialog-title-meeting-registration-confirm-<%= model.id %>" data-dialog-title><%= t("join", scope: "decidim.meetings.meetings.show") %></h2>
|
6
|
+
<div>
|
7
|
+
|
8
|
+
<div class="form__wrapper">
|
9
|
+
<%= cell("decidim/represent_user_group", form) %>
|
10
|
+
<%= cell("decidim/public_participation", form) %>
|
11
|
+
<span class="meeting__registration-modal__terms"><%= registration_terms_text %></span>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
<div data-dialog-actions>
|
16
|
+
<button type="button" class="button button__sm md:button__lg button__transparent-secondary" data-dialog-close="meeting-registration-confirm-<%= model.id %>">
|
17
|
+
<span><%= i18n_cancel_text %></span>
|
18
|
+
</button>
|
19
|
+
<button type="submit" class="button button__sm md:button__lg button__secondary">
|
20
|
+
<span><%= i18n_confirm_text %></span>
|
21
|
+
<%= icon "arrow-right-line" %>
|
22
|
+
</button>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
@@ -6,23 +6,25 @@
|
|
6
6
|
i18n_join_text,
|
7
7
|
join_meeting_registration_path(model),
|
8
8
|
class: button_classes,
|
9
|
-
disabled: !model.has_available_slots
|
9
|
+
disabled: !model.has_available_slots?
|
10
10
|
) %>
|
11
11
|
<% else %>
|
12
|
-
<%= render :
|
12
|
+
<%= render :registration_modal %>
|
13
13
|
<%= action_authorized_button_to(
|
14
14
|
:join,
|
15
15
|
i18n_join_text,
|
16
16
|
"#",
|
17
17
|
class: button_classes,
|
18
18
|
disabled: !model.has_available_slots?,
|
19
|
-
data: { open: current_user.present? ? "meeting-registration-confirm-#{model.id}" : "loginModal" }
|
19
|
+
data: { "dialog-open": current_user.present? ? "meeting-registration-confirm-#{model.id}" : "loginModal" }
|
20
20
|
) %>
|
21
21
|
<% end %>
|
22
22
|
<% end %>
|
23
|
+
|
23
24
|
<% if shows_remaining_slots? %>
|
24
|
-
|
25
|
+
<%= render :remaining_slots %>
|
25
26
|
<% end %>
|
27
|
+
|
26
28
|
<% elsif model.on_different_platform? %>
|
27
29
|
<%= action_authorized_link_to(
|
28
30
|
:join,
|
@@ -10,6 +10,8 @@ module Decidim
|
|
10
10
|
include ActionView::Helpers::FormOptionsHelper
|
11
11
|
|
12
12
|
def show
|
13
|
+
return unless model.can_be_joined_by?(current_user) || model.on_different_platform?
|
14
|
+
|
13
15
|
render
|
14
16
|
end
|
15
17
|
|
@@ -22,13 +24,7 @@ module Decidim
|
|
22
24
|
end
|
23
25
|
|
24
26
|
def button_classes
|
25
|
-
|
26
|
-
|
27
|
-
"button card__button button--sc small"
|
28
|
-
end
|
29
|
-
|
30
|
-
def big_button?
|
31
|
-
options[:big_button]
|
27
|
+
"button button__xl button__secondary w-full"
|
32
28
|
end
|
33
29
|
|
34
30
|
def shows_remaining_slots?
|
@@ -5,18 +5,7 @@ module Decidim
|
|
5
5
|
# A cell to display when actions happen on a meeting.
|
6
6
|
class MeetingActivityCell < ActivityCell
|
7
7
|
def title
|
8
|
-
|
9
|
-
when "update"
|
10
|
-
I18n.t(
|
11
|
-
"decidim.meetings.last_activity.meeting_updated_at_html",
|
12
|
-
link: participatory_space_link
|
13
|
-
)
|
14
|
-
else
|
15
|
-
I18n.t(
|
16
|
-
"decidim.meetings.last_activity.new_meeting_at_html",
|
17
|
-
link: participatory_space_link
|
18
|
-
)
|
19
|
-
end
|
8
|
+
action == "update" ? I18n.t("decidim.meetings.last_activity.meeting_updated") : I18n.t("decidim.meetings.last_activity.new_meeting")
|
20
9
|
end
|
21
10
|
|
22
11
|
def resource_link_text
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Meetings
|
5
|
+
# This cell renders metadata for an instance of a Meeting
|
6
|
+
class MeetingCardMetadataCell < Decidim::CardMetadataCell
|
7
|
+
include Decidim::LayoutHelper
|
8
|
+
include ActionView::Helpers::DateHelper
|
9
|
+
|
10
|
+
alias meeting model
|
11
|
+
|
12
|
+
delegate :type_of_meeting, :start_time, :end_time, :category, :withdrawn?, to: :meeting
|
13
|
+
|
14
|
+
alias start_date start_time
|
15
|
+
alias end_date end_time
|
16
|
+
|
17
|
+
def initialize(*)
|
18
|
+
super
|
19
|
+
|
20
|
+
@items.prepend(*meeting_items)
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def meeting_items
|
26
|
+
[type, duration_item, comments_count_item, category_item, withdrawn_item]
|
27
|
+
end
|
28
|
+
|
29
|
+
def meeting_items_for_map
|
30
|
+
[dates_item, type].compact_blank.map do |item|
|
31
|
+
{
|
32
|
+
text: item[:text],
|
33
|
+
icon: icon(item[:icon]).html_safe
|
34
|
+
}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def type
|
39
|
+
{
|
40
|
+
text: t(type_of_meeting, scope: "decidim.meetings.meetings.filters.type_values"),
|
41
|
+
icon: resource_type_icon_key(type_of_meeting)
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
def official
|
46
|
+
return unless official?
|
47
|
+
|
48
|
+
{
|
49
|
+
text: t("decidim.meetings.models.meeting.fields.official_meeting"),
|
50
|
+
icon: "information-line"
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
def withdrawn_item
|
55
|
+
return unless withdrawn?
|
56
|
+
|
57
|
+
{
|
58
|
+
text: t("withdraw", scope: "decidim.meetings.types"),
|
59
|
+
icon: resource_type_icon_key("withdrawn")
|
60
|
+
}
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Meetings
|
5
5
|
# This cell renders the meeting card for an instance of a Meeting
|
6
|
-
# the default size is the
|
6
|
+
# the default size is the List Card (:l)
|
7
7
|
# also available the List Item Card (:list_item)
|
8
8
|
class MeetingCell < Decidim::ViewModel
|
9
9
|
include Decidim::SanitizeHelper
|
@@ -18,14 +18,10 @@ module Decidim
|
|
18
18
|
|
19
19
|
def card_size
|
20
20
|
case @options[:size]
|
21
|
-
when :highlighted_list_item
|
22
|
-
"decidim/meetings/meeting_highlighted_list_item"
|
23
|
-
when :list_item
|
24
|
-
"decidim/meetings/meeting_list_item"
|
25
21
|
when :s
|
26
22
|
"decidim/meetings/meeting_s"
|
27
23
|
else
|
28
|
-
"decidim/meetings/
|
24
|
+
"decidim/meetings/meeting_l"
|
29
25
|
end
|
30
26
|
end
|
31
27
|
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<time class="card__calendar" datetime="<%= meeting.start_time.iso8601 %>">
|
2
|
+
<div class="card__calendar-month"><%= l(meeting.start_time, format: "%b") %></div>
|
3
|
+
<div class="card__calendar-day"><%= l(meeting.start_time, format: "%d") %></div>
|
4
|
+
<div class="card__calendar-time"><%= l(meeting.start_time, format: "%H:%M") %></div>
|
5
|
+
</time>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "cell/partial"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Meetings
|
7
|
+
# This cell renders the List (:l) meeting card
|
8
|
+
# for an instance of a Meeting
|
9
|
+
class MeetingLCell < Decidim::CardLCell
|
10
|
+
delegate :component_settings, to: :controller
|
11
|
+
|
12
|
+
alias meeting model
|
13
|
+
|
14
|
+
def has_image?
|
15
|
+
true
|
16
|
+
end
|
17
|
+
|
18
|
+
def extra_class
|
19
|
+
"card__calendar-list__reset"
|
20
|
+
end
|
21
|
+
|
22
|
+
def image
|
23
|
+
render
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def metadata_cell
|
29
|
+
"decidim/meetings/meeting_card_metadata"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|