decidim-conferences 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +38 -0
- data/Rakefile +3 -0
- data/app/assets/config/admin/decidim_conferences_manifest.js +2 -0
- data/app/assets/config/decidim_conferences_manifest.js +2 -0
- data/app/assets/images/decidim/conferences/conference.svg +6 -0
- data/app/assets/javascripts/decidim/conferences/admin/conference_invite_form.es6 +25 -0
- data/app/assets/javascripts/decidim/conferences/admin/conference_speakers.js.es6 +26 -0
- data/app/assets/javascripts/decidim/conferences/admin/conferences.js.es6 +30 -0
- data/app/assets/javascripts/decidim/conferences/conferences.js.es6 +0 -0
- data/app/cells/decidim/conferences/conference_address/show.erb +11 -0
- data/app/cells/decidim/conferences/conference_address_cell.rb +11 -0
- data/app/cells/decidim/conferences/conference_cell.rb +19 -0
- data/app/cells/decidim/conferences/conference_m/footer.erb +9 -0
- data/app/cells/decidim/conferences/conference_m/tags.erb +1 -0
- data/app/cells/decidim/conferences/conference_m_cell.rb +38 -0
- data/app/cells/decidim/conferences/conference_speaker/show.erb +84 -0
- data/app/cells/decidim/conferences/conference_speaker_cell.rb +86 -0
- data/app/cells/decidim/conferences/content_blocks/highlighted_conferences/show.erb +31 -0
- data/app/cells/decidim/conferences/content_blocks/highlighted_conferences_cell.rb +28 -0
- data/app/cells/decidim/conferences/join_conference_button/registration_confirm.erb +15 -0
- data/app/cells/decidim/conferences/join_conference_button/show.erb +25 -0
- data/app/cells/decidim/conferences/join_conference_button_cell.rb +42 -0
- data/app/cells/decidim/conferences/linked_participatory_spaces/show.erb +10 -0
- data/app/cells/decidim/conferences/linked_participatory_spaces_cell.rb +44 -0
- data/app/cells/decidim/conferences/media_link/show.erb +9 -0
- data/app/cells/decidim/conferences/media_link_cell.rb +14 -0
- data/app/cells/decidim/conferences/partner/show.erb +11 -0
- data/app/cells/decidim/conferences/partner_cell.rb +24 -0
- data/app/cells/decidim/conferences/photo/show.erb +28 -0
- data/app/cells/decidim/conferences/photo_cell.rb +41 -0
- data/app/cells/decidim/conferences/photos_list/show.erb +8 -0
- data/app/cells/decidim/conferences/photos_list_cell.rb +17 -0
- data/app/commands/decidim/conferences/admin/copy_conference.rb +80 -0
- data/app/commands/decidim/conferences/admin/create_conference.rb +120 -0
- data/app/commands/decidim/conferences/admin/create_conference_admin.rb +112 -0
- data/app/commands/decidim/conferences/admin/create_conference_speaker.rb +81 -0
- data/app/commands/decidim/conferences/admin/create_media_link.rb +66 -0
- data/app/commands/decidim/conferences/admin/create_partner.rb +68 -0
- data/app/commands/decidim/conferences/admin/destroy_conference_admin.rb +53 -0
- data/app/commands/decidim/conferences/admin/destroy_conference_speaker.rb +56 -0
- data/app/commands/decidim/conferences/admin/destroy_media_link.rb +56 -0
- data/app/commands/decidim/conferences/admin/destroy_partner.rb +56 -0
- data/app/commands/decidim/conferences/admin/export_conference_registrations.rb +44 -0
- data/app/commands/decidim/conferences/admin/invite_user_to_join_conference.rb +107 -0
- data/app/commands/decidim/conferences/admin/publish_conference.rb +39 -0
- data/app/commands/decidim/conferences/admin/unpublish_conference.rb +39 -0
- data/app/commands/decidim/conferences/admin/update_conference.rb +161 -0
- data/app/commands/decidim/conferences/admin/update_conference_admin.rb +52 -0
- data/app/commands/decidim/conferences/admin/update_conference_speaker.rb +80 -0
- data/app/commands/decidim/conferences/admin/update_media_link.rb +64 -0
- data/app/commands/decidim/conferences/admin/update_partner.rb +63 -0
- data/app/commands/decidim/conferences/decline_invitation.rb +45 -0
- data/app/commands/decidim/conferences/join_conference.rb +88 -0
- data/app/commands/decidim/conferences/leave_conference.rb +52 -0
- data/app/constraints/decidim/conferences/current_component.rb +28 -0
- data/app/constraints/decidim/conferences/current_conference.rb +43 -0
- data/app/controllers/concerns/decidim/conferences/admin/conference_context.rb +19 -0
- data/app/controllers/decidim/conferences/admin/application_controller.rb +25 -0
- data/app/controllers/decidim/conferences/admin/categories_controller.rb +13 -0
- data/app/controllers/decidim/conferences/admin/component_permissions_controller.rb +14 -0
- data/app/controllers/decidim/conferences/admin/components_controller.rb +14 -0
- data/app/controllers/decidim/conferences/admin/concerns/conference_admin.rb +48 -0
- data/app/controllers/decidim/conferences/admin/conference_attachment_collections_controller.rb +26 -0
- data/app/controllers/decidim/conferences/admin/conference_attachments_controller.rb +27 -0
- data/app/controllers/decidim/conferences/admin/conference_copies_controller.rb +35 -0
- data/app/controllers/decidim/conferences/admin/conference_invites_controller.rb +55 -0
- data/app/controllers/decidim/conferences/admin/conference_publications_controller.rb +45 -0
- data/app/controllers/decidim/conferences/admin/conference_registrations_controller.rb +39 -0
- data/app/controllers/decidim/conferences/admin/conference_speakers_controller.rb +86 -0
- data/app/controllers/decidim/conferences/admin/conference_user_roles_controller.rb +101 -0
- data/app/controllers/decidim/conferences/admin/conferences_controller.rb +103 -0
- data/app/controllers/decidim/conferences/admin/exports_controller.rb +14 -0
- data/app/controllers/decidim/conferences/admin/media_links_controller.rb +82 -0
- data/app/controllers/decidim/conferences/admin/moderations_controller.rb +12 -0
- data/app/controllers/decidim/conferences/admin/partners_controller.rb +83 -0
- data/app/controllers/decidim/conferences/application_controller.rb +32 -0
- data/app/controllers/decidim/conferences/conference_program_controller.rb +50 -0
- data/app/controllers/decidim/conferences/conference_registrations_controller.rb +68 -0
- data/app/controllers/decidim/conferences/conference_speakers_controller.rb +39 -0
- data/app/controllers/decidim/conferences/conference_widgets_controller.rb +23 -0
- data/app/controllers/decidim/conferences/conferences_controller.rb +59 -0
- data/app/controllers/decidim/conferences/media_controller.rb +41 -0
- data/app/events/decidim/conferences/conference_registrations_enabled_event.rb +8 -0
- data/app/events/decidim/conferences/conference_registrations_over_percentage_event.rb +13 -0
- data/app/events/decidim/conferences/upcoming_conference_event.rb +8 -0
- data/app/events/decidim/conferences/update_conference_event.rb +8 -0
- data/app/forms/decidim/conferences/admin/conference_copy_form.rb +34 -0
- data/app/forms/decidim/conferences/admin/conference_form.rb +109 -0
- data/app/forms/decidim/conferences/admin/conference_registration_invite_form.rb +24 -0
- data/app/forms/decidim/conferences/admin/conference_speaker_form.rb +76 -0
- data/app/forms/decidim/conferences/admin/conference_user_role_form.rb +30 -0
- data/app/forms/decidim/conferences/admin/media_link_form.rb +42 -0
- data/app/forms/decidim/conferences/admin/partner_form.rb +53 -0
- data/app/helpers/decidim/conferences/admin/conference_speakers_helper.rb +14 -0
- data/app/helpers/decidim/conferences/admin/conferences_helper.rb +28 -0
- data/app/helpers/decidim/conferences/conference_program_helper.rb +21 -0
- data/app/helpers/decidim/conferences/media_attachments_helper.rb +29 -0
- data/app/helpers/decidim/conferences/partners_helper.rb +15 -0
- data/app/jobs/decidim/conferences/upcoming_conference_notification_job.rb +33 -0
- data/app/mailers/decidim/conferences/admin/invite_join_conference_mailer.rb +43 -0
- data/app/mailers/decidim/conferences/conference_registration_mailer.rb +44 -0
- data/app/models/decidim/conference.rb +90 -0
- data/app/models/decidim/conference_meeting.rb +9 -0
- data/app/models/decidim/conference_speaker.rb +34 -0
- data/app/models/decidim/conference_speaker_conference_meeting.rb +8 -0
- data/app/models/decidim/conference_user_role.rb +30 -0
- data/app/models/decidim/conferences/conference_invite.rb +38 -0
- data/app/models/decidim/conferences/conference_registration.rb +23 -0
- data/app/models/decidim/conferences/media_link.rb +17 -0
- data/app/models/decidim/conferences/partner.rb +25 -0
- data/app/permissions/decidim/conferences/permissions.rb +304 -0
- data/app/presenters/decidim/admin/conference_speaker_presenter.rb +18 -0
- data/app/presenters/decidim/conference_meeting_presenter.rb +7 -0
- data/app/presenters/decidim/conference_speaker_presenter.rb +42 -0
- data/app/presenters/decidim/conferences/admin_log/conference_invite_presenter.rb +35 -0
- data/app/presenters/decidim/conferences/admin_log/conference_speaker_presenter.rb +52 -0
- data/app/presenters/decidim/conferences/admin_log/conferences_presenter.rb +55 -0
- data/app/presenters/decidim/conferences/admin_log/conferences_user_role_presenter.rb +53 -0
- data/app/presenters/decidim/conferences/admin_log/media_link_presenter.rb +45 -0
- data/app/presenters/decidim/conferences/admin_log/partner_presenter.rb +47 -0
- data/app/presenters/decidim/conferences/admin_log/value_types/role_presenter.rb +22 -0
- data/app/presenters/decidim/conferences/conference_invite_presenter.rb +26 -0
- data/app/presenters/decidim/conferences/conference_stats_presenter.rb +52 -0
- data/app/presenters/decidim/log/value_types/conference_presenter.rb +28 -0
- data/app/queries/decidim/conferences/admin/admin_users.rb +39 -0
- data/app/queries/decidim/conferences/admin/conference_invites.rb +59 -0
- data/app/queries/decidim/conferences/admin/conference_speakers.rb +40 -0
- data/app/queries/decidim/conferences/conference_program_meetings.rb +17 -0
- data/app/queries/decidim/conferences/conference_program_meetings_by_day.rb +20 -0
- data/app/queries/decidim/conferences/conferences_with_user_role.rb +48 -0
- data/app/queries/decidim/conferences/organization_conferences.rb +16 -0
- data/app/queries/decidim/conferences/organization_prioritized_conferences.rb +21 -0
- data/app/queries/decidim/conferences/organization_published_conferences.rb +21 -0
- data/app/queries/decidim/conferences/prioritized_conferences.rb +13 -0
- data/app/queries/decidim/conferences/promoted_conferences.rb +12 -0
- data/app/queries/decidim/conferences/published_conferences.rb +12 -0
- data/app/queries/decidim/conferences/visible_conferences.rb +12 -0
- data/app/serializers/decidim/conferences/conference_registration_serializer.rb +18 -0
- data/app/serializers/decidim/conferences/data_portability_conference_invite_serializer.rb +31 -0
- data/app/serializers/decidim/conferences/data_portability_conference_registration_serializer.rb +28 -0
- data/app/uploaders/decidim/conferences/partner_logo_uploader.rb +15 -0
- data/app/views/decidim/conference_speakers/_conference_speaker.html.erb +1 -0
- data/app/views/decidim/conferences/_conference.html.erb +1 -0
- data/app/views/decidim/conferences/_order_by_conferences.html.erb +3 -0
- data/app/views/decidim/conferences/admin/conference_copies/_form.html.erb +37 -0
- data/app/views/decidim/conferences/admin/conference_copies/new.html.erb +7 -0
- data/app/views/decidim/conferences/admin/conference_invites/_form.html.erb +30 -0
- data/app/views/decidim/conferences/admin/conference_invites/index.html.erb +83 -0
- data/app/views/decidim/conferences/admin/conference_invites/new.html.erb +21 -0
- data/app/views/decidim/conferences/admin/conference_registrations/index.html.erb +43 -0
- data/app/views/decidim/conferences/admin/conference_speakers/_form.html.erb +61 -0
- data/app/views/decidim/conferences/admin/conference_speakers/edit.html.erb +7 -0
- data/app/views/decidim/conferences/admin/conference_speakers/index.html.erb +68 -0
- data/app/views/decidim/conferences/admin/conference_speakers/new.html.erb +7 -0
- data/app/views/decidim/conferences/admin/conference_user_roles/_form.html.erb +22 -0
- data/app/views/decidim/conferences/admin/conference_user_roles/edit.html.erb +7 -0
- data/app/views/decidim/conferences/admin/conference_user_roles/index.html.erb +65 -0
- data/app/views/decidim/conferences/admin/conference_user_roles/new.html.erb +7 -0
- data/app/views/decidim/conferences/admin/conferences/_form.html.erb +122 -0
- data/app/views/decidim/conferences/admin/conferences/edit.html.erb +18 -0
- data/app/views/decidim/conferences/admin/conferences/index.html.erb +65 -0
- data/app/views/decidim/conferences/admin/conferences/new.html.erb +11 -0
- data/app/views/decidim/conferences/admin/invite_join_conference_mailer/invite.html.erb +12 -0
- data/app/views/decidim/conferences/admin/media_links/_form.html.erb +25 -0
- data/app/views/decidim/conferences/admin/media_links/edit.html.erb +7 -0
- data/app/views/decidim/conferences/admin/media_links/index.html.erb +51 -0
- data/app/views/decidim/conferences/admin/media_links/new.html.erb +7 -0
- data/app/views/decidim/conferences/admin/partners/_form.html.erb +30 -0
- data/app/views/decidim/conferences/admin/partners/edit.html.erb +7 -0
- data/app/views/decidim/conferences/admin/partners/index.html.erb +56 -0
- data/app/views/decidim/conferences/admin/partners/new.html.erb +7 -0
- data/app/views/decidim/conferences/conference_program/_program_item.html.erb +31 -0
- data/app/views/decidim/conferences/conference_program/_program_meeting.html.erb +68 -0
- data/app/views/decidim/conferences/conference_program/show.html.erb +54 -0
- data/app/views/decidim/conferences/conference_registration_mailer/confirmation.html.erb +3 -0
- data/app/views/decidim/conferences/conference_speakers/index.html.erb +19 -0
- data/app/views/decidim/conferences/conference_widgets/show.html.erb +11 -0
- data/app/views/decidim/conferences/conferences/_conferences_sidebar.html.erb +11 -0
- data/app/views/decidim/conferences/conferences/_partners.html.erb +15 -0
- data/app/views/decidim/conferences/conferences/_promoted_conference.html.erb +27 -0
- data/app/views/decidim/conferences/conferences/_statistics.html.erb +10 -0
- data/app/views/decidim/conferences/conferences/index.html.erb +25 -0
- data/app/views/decidim/conferences/conferences/show.html.erb +105 -0
- data/app/views/decidim/conferences/media/_attachments.html.erb +6 -0
- data/app/views/decidim/conferences/media/index.html.erb +31 -0
- data/app/views/devise/mailer/join_conference.html.erb +13 -0
- data/app/views/devise/mailer/join_conference.text.erb +11 -0
- data/app/views/layouts/decidim/_conference_hero.html.erb +44 -0
- data/app/views/layouts/decidim/_conferences_nav.html.erb +90 -0
- data/app/views/layouts/decidim/admin/conference.html.erb +100 -0
- data/app/views/layouts/decidim/admin/conferences.html.erb +11 -0
- data/app/views/layouts/decidim/conference.html.erb +28 -0
- data/config/locales/ca.yml +464 -0
- data/config/locales/de.yml +464 -0
- data/config/locales/en.yml +467 -0
- data/config/locales/es-PY.yml +464 -0
- data/config/locales/es.yml +464 -0
- data/config/locales/eu.yml +464 -0
- data/config/locales/fi.yml +464 -0
- data/config/locales/fr.yml +464 -0
- data/config/locales/gl.yml +464 -0
- data/config/locales/hu.yml +464 -0
- data/config/locales/it.yml +464 -0
- data/config/locales/nl.yml +464 -0
- data/config/locales/pl.yml +476 -0
- data/config/locales/pt-BR.yml +464 -0
- data/config/locales/pt.yml +464 -0
- data/config/locales/ru.yml +1 -0
- data/config/locales/sv.yml +464 -0
- data/config/locales/uk.yml +1 -0
- data/db/migrate/20180626151505_add_conferences.rb +40 -0
- data/db/migrate/20180626152015_add_conference_user_roles.rb +17 -0
- data/db/migrate/20180702084256_add_conference_speakers.rb +19 -0
- data/db/migrate/20180706104306_add_conference_invites.rb +16 -0
- data/db/migrate/20180706104825_add_conference_registrations.rb +17 -0
- data/db/migrate/20181004144411_add_conferences_partner.rb +18 -0
- data/db/migrate/20181010133930_add_relation_between_speaker_and_meeting.rb +10 -0
- data/db/migrate/20181015100301_add_conference_media_link.rb +15 -0
- data/db/seeds/Exampledocument.pdf +0 -0
- data/db/seeds/city.jpeg +0 -0
- data/db/seeds/city2.jpeg +0 -0
- data/db/seeds/homepage_image.jpg +0 -0
- data/db/seeds/logo.png +0 -0
- data/lib/decidim/conferences.rb +12 -0
- data/lib/decidim/conferences/admin.rb +10 -0
- data/lib/decidim/conferences/admin_engine.rb +86 -0
- data/lib/decidim/conferences/engine.rb +80 -0
- data/lib/decidim/conferences/participatory_space.rb +177 -0
- data/lib/decidim/conferences/test/factories.rb +153 -0
- data/lib/decidim/conferences/version.rb +10 -0
- metadata +330 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
module ContentBlocks
|
6
|
+
class HighlightedConferencesCell < Decidim::ViewModel
|
7
|
+
delegate :current_organization, to: :controller
|
8
|
+
delegate :current_user, to: :controller
|
9
|
+
|
10
|
+
def show
|
11
|
+
render if highlighted_conferences.any?
|
12
|
+
end
|
13
|
+
|
14
|
+
def highlighted_conferences
|
15
|
+
OrganizationPrioritizedConferences.new(current_organization, current_user)
|
16
|
+
end
|
17
|
+
|
18
|
+
def i18n_scope
|
19
|
+
"decidim.conferences.pages.home.highlighted_conferences"
|
20
|
+
end
|
21
|
+
|
22
|
+
def decidim_conferences
|
23
|
+
Decidim::Conferences::Engine.routes.url_helpers
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="reveal" data-reveal id="conference-registration-confirm-<%= model.id %>">
|
2
|
+
<div class="row">
|
3
|
+
<div class="columns medium-10 medium-offset-1 help-text">
|
4
|
+
<%= decidim_sanitize translated_attribute(model.registration_terms) %>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
<div class="row">
|
8
|
+
<div class="columns medium-8 medium-offset-2">
|
9
|
+
<%= button_to t("confirm", scope: "decidim.conferences.conference.registration_confirm"), conference_conference_registration_path(model), class: "button expanded", data: { disable: true } %>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
<div class="text-center">
|
13
|
+
<button class="link" data-close><%= t("cancel", scope: "decidim.conferences.conference.registration_confirm") %></button>
|
14
|
+
</div>
|
15
|
+
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<% if model.registrations_enabled? %>
|
2
|
+
<% if model.has_registration_for? current_user %>
|
3
|
+
<% if allowed? %>
|
4
|
+
<%= button_to conference_conference_registration_path(model),
|
5
|
+
method: :delete,
|
6
|
+
class: "#{button_classes} secondary light",
|
7
|
+
data: { disable: true } do %>
|
8
|
+
<%= icon("check", class: "icon--small") %>
|
9
|
+
<%= t("going", scope: "decidim.conferences.conference.show") %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
<% else %>
|
13
|
+
<%= render :registration_confirm %>
|
14
|
+
<% if allowed? %>
|
15
|
+
<%= button_to i18n_join_text, "",
|
16
|
+
class: button_classes,
|
17
|
+
disabled: !model.has_available_slots?,
|
18
|
+
onclick: "event.preventDefault()",
|
19
|
+
data: { open: current_user.present? ? "conference-registration-confirm-#{model.id}" : "loginModal" } %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
<% if shows_remaining_slots? %>
|
23
|
+
<span><%= t("remaining_slots", scope: "decidim.conferences.conference.show", count: model.remaining_slots) %></span>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
# This cell renders the button to join a conference.
|
6
|
+
class JoinConferenceButtonCell < Decidim::ViewModel
|
7
|
+
include Decidim::LayoutHelper
|
8
|
+
include Decidim::SanitizeHelper
|
9
|
+
include Decidim::Conferences::Engine.routes.url_helpers
|
10
|
+
|
11
|
+
def show
|
12
|
+
render
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
delegate :current_user, to: :controller, prefix: false
|
18
|
+
|
19
|
+
def allowed?
|
20
|
+
options[:allowed]
|
21
|
+
end
|
22
|
+
|
23
|
+
def shows_remaining_slots?
|
24
|
+
options[:show_remaining_slots] && model.available_slots.positive?
|
25
|
+
end
|
26
|
+
|
27
|
+
def button_classes
|
28
|
+
return "button expanded button--sc" if big_button?
|
29
|
+
"button card__button button--sc small"
|
30
|
+
end
|
31
|
+
|
32
|
+
def big_button?
|
33
|
+
options[:big_button]
|
34
|
+
end
|
35
|
+
|
36
|
+
def i18n_join_text
|
37
|
+
return I18n.t("join", scope: "decidim.conferences.conference.show") if model.has_available_slots?
|
38
|
+
I18n.t("no_slots_available", scope: "decidim.conferences.conference.show")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% conference_spaces.each do |block_space| %>
|
2
|
+
<div class="section">
|
3
|
+
<h4 class="section-heading"><%= t("conferences.show.related_#{title(block_space)}", scope: "decidim") %></h4>
|
4
|
+
<div class="row small-up-1 medium-up-2 card-grid">
|
5
|
+
<% block_space.each do |space| %>
|
6
|
+
<%= card_for space %>
|
7
|
+
<% end %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
# This cell renders a collection of linked Participatory Space of current conference.
|
6
|
+
# `model` is the current conference
|
7
|
+
class LinkedParticipatorySpacesCell < Decidim::ViewModel
|
8
|
+
include Decidim::ApplicationHelper
|
9
|
+
include Decidim::CardHelper
|
10
|
+
|
11
|
+
def show
|
12
|
+
render
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def conference_spaces
|
18
|
+
[conference_participatory_processes, conference_assemblies, conference_consultations].compact
|
19
|
+
end
|
20
|
+
|
21
|
+
def conference_participatory_processes
|
22
|
+
processes = model.linked_participatory_space_resources(:participatory_processes, "included_participatory_processes")
|
23
|
+
return unless processes.any?
|
24
|
+
processes
|
25
|
+
end
|
26
|
+
|
27
|
+
def conference_assemblies
|
28
|
+
assemblies = model.linked_participatory_space_resources(:assemblies, "included_assemblies")
|
29
|
+
return unless assemblies.any?
|
30
|
+
assemblies
|
31
|
+
end
|
32
|
+
|
33
|
+
def conference_consultations
|
34
|
+
consultations = model.linked_participatory_space_resources(:consultations, "included_consultations")
|
35
|
+
return unless consultations.any?
|
36
|
+
consultations
|
37
|
+
end
|
38
|
+
|
39
|
+
def title(block_space)
|
40
|
+
block_space.first.class.name.demodulize.tableize
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<li>
|
2
|
+
<%= icon "external-link" %>
|
3
|
+
<div>
|
4
|
+
<%= link_to model.link, target: "_blank" do %>
|
5
|
+
<strong><%= translated_attribute(model.title) %> </strong>
|
6
|
+
<% end %>
|
7
|
+
<div class="text-small"><%= l(model.date, format: :decidim_short_with_month_name_short) %> · <%= model.link %></small>
|
8
|
+
</div>
|
9
|
+
</li>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
# This cell renders the media link card for an instance of a MediaLink
|
6
|
+
class MediaLinkCell < Decidim::ViewModel
|
7
|
+
include Decidim::LayoutHelper
|
8
|
+
|
9
|
+
def show
|
10
|
+
render
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% if model.link.presence %>
|
2
|
+
<%= link_to model.link, class: "partner-box column collapse text-center mb-m", target: "_blank" do %>
|
3
|
+
<%= logo %>
|
4
|
+
<%= name %>
|
5
|
+
<% end %>
|
6
|
+
<% else %>
|
7
|
+
<div class="partner-box column collapse text-center mb-m">
|
8
|
+
<%= logo %>
|
9
|
+
<%= name %>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
# This cell renders the partners card for an instance of a Partner
|
6
|
+
class PartnerCell < Decidim::ViewModel
|
7
|
+
def show
|
8
|
+
render
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def name
|
14
|
+
return unless model.name.presence
|
15
|
+
"<div class='text-medium'> #{model.name} </div>"
|
16
|
+
end
|
17
|
+
|
18
|
+
def logo
|
19
|
+
return unless model.logo.presence
|
20
|
+
"<div class='card p-m flex--cc'> #{image_tag model.logo.medium.url} </div>"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<div class="column">
|
2
|
+
<article class="card" data-open="media-picture-<%= index %>">
|
3
|
+
<div class="picture__content">
|
4
|
+
<%= image_thumb %>
|
5
|
+
<h5 class="card__title">
|
6
|
+
<strong><%= title %></strong>
|
7
|
+
</h5>
|
8
|
+
<div class="text-small">
|
9
|
+
<%= short_description %>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</article>
|
13
|
+
<div id="media-picture-<%= index %>" class="reveal picture__modal" data-reveal>
|
14
|
+
<div class="reveal__header">
|
15
|
+
<h3 class="reveal__title"><%= t("conferences.photo.show.photo", scope: "decidim") %></h3>
|
16
|
+
</div>
|
17
|
+
<%= image_big %>
|
18
|
+
<h5>
|
19
|
+
<strong><%= title %></strong>
|
20
|
+
</h5>
|
21
|
+
<div class="text-small">
|
22
|
+
<%= decidim_sanitize description %>
|
23
|
+
</div>
|
24
|
+
<button class="close-button" data-close aria-label="<%= t("conferences.photo.show.close_modal", scope: "decidim") %>" type="button">
|
25
|
+
<span aria-hidden="true">×</span>
|
26
|
+
</button>
|
27
|
+
</div>
|
28
|
+
</div>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
# This cell renders the media link card for an instance of a MediaLink
|
6
|
+
class PhotoCell < Decidim::ViewModel
|
7
|
+
include Decidim::ApplicationHelper
|
8
|
+
include Decidim::SanitizeHelper
|
9
|
+
|
10
|
+
def show
|
11
|
+
render
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def index
|
17
|
+
@options[:index]
|
18
|
+
end
|
19
|
+
|
20
|
+
def image_thumb
|
21
|
+
image_tag model.thumbnail_url
|
22
|
+
end
|
23
|
+
|
24
|
+
def image_big
|
25
|
+
image_tag model.big_url
|
26
|
+
end
|
27
|
+
|
28
|
+
def title
|
29
|
+
translated_attribute model.title
|
30
|
+
end
|
31
|
+
|
32
|
+
def short_description
|
33
|
+
decidim_sanitize html_truncate(description, length: 100, separator: "...")
|
34
|
+
end
|
35
|
+
|
36
|
+
def description
|
37
|
+
translated_attribute(model.description)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div class="section images">
|
2
|
+
<h4 class="section-heading"><%= t("conferences.photos_list.show.related_photos", scope: "decidim") %></h4>
|
3
|
+
<div class="row small-up-1 smallmedium-up-2 card-grid">
|
4
|
+
<% model.each_with_index do |photo, index| %>
|
5
|
+
<%= cell "decidim/conferences/photo", photo, index: index %>
|
6
|
+
<% end %>
|
7
|
+
</div>
|
8
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
# This cell renders the photos list
|
6
|
+
class PhotosListCell < Decidim::ViewModel
|
7
|
+
include Cell::ViewModel::Partial
|
8
|
+
include Decidim::ApplicationHelper
|
9
|
+
include Decidim::SanitizeHelper
|
10
|
+
|
11
|
+
def show
|
12
|
+
return unless model.any?
|
13
|
+
render
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
module Admin
|
6
|
+
# A command with all the business logic when copying a new participatory
|
7
|
+
# conference in the system.
|
8
|
+
class CopyConference < Rectify::Command
|
9
|
+
# Public: Initializes the command.
|
10
|
+
#
|
11
|
+
# form - A form object with the params.
|
12
|
+
# conference - An conference we want to duplicate
|
13
|
+
def initialize(form, conference)
|
14
|
+
@form = form
|
15
|
+
@conference = conference
|
16
|
+
end
|
17
|
+
|
18
|
+
# Executes the command. Broadcasts these events:
|
19
|
+
#
|
20
|
+
# - :ok when everything is valid.
|
21
|
+
# - :invalid if the form wasn't valid and we couldn't proceed.
|
22
|
+
#
|
23
|
+
# Returns nothing.
|
24
|
+
def call
|
25
|
+
return broadcast(:invalid) if form.invalid?
|
26
|
+
|
27
|
+
Conference.transaction do
|
28
|
+
copy_conference
|
29
|
+
copy_conference_categories if @form.copy_categories?
|
30
|
+
copy_conference_components if @form.copy_components?
|
31
|
+
end
|
32
|
+
|
33
|
+
broadcast(:ok, @copied_conference)
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
attr_reader :form
|
39
|
+
|
40
|
+
def copy_conference
|
41
|
+
@copied_conference = Conference.create!(
|
42
|
+
organization: @conference.organization,
|
43
|
+
title: form.title,
|
44
|
+
slogan: @conference.slogan,
|
45
|
+
slug: form.slug,
|
46
|
+
hashtag: @conference.hashtag,
|
47
|
+
description: @conference.description,
|
48
|
+
short_description: @conference.short_description,
|
49
|
+
location: @conference.location,
|
50
|
+
hero_image: @conference.hero_image,
|
51
|
+
banner_image: @conference.banner_image,
|
52
|
+
promoted: @conference.promoted,
|
53
|
+
scopes_enabled: @conference.scopes_enabled,
|
54
|
+
scope: @conference.scope,
|
55
|
+
objectives: @conference.objectives,
|
56
|
+
start_date: @conference.start_date,
|
57
|
+
end_date: @conference.end_date
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
def copy_conference_categories
|
62
|
+
@conference.categories.each do |category|
|
63
|
+
category_copied = category.dup
|
64
|
+
category_copied.participatory_space = @copied_conference
|
65
|
+
category_copied.save
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def copy_conference_components
|
70
|
+
@conference.components.each do |component|
|
71
|
+
component_copied = component.dup
|
72
|
+
component_copied.participatory_space = @copied_conference
|
73
|
+
component_copied.save
|
74
|
+
component.manifest.run_hooks(:copy, new_component: component_copied, old_component: component)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
module Admin
|
6
|
+
# A command with all the business logic when creating a new
|
7
|
+
# conference in the system.
|
8
|
+
class CreateConference < Rectify::Command
|
9
|
+
# Public: Initializes the command.
|
10
|
+
#
|
11
|
+
# form - A form object with the params.
|
12
|
+
def initialize(form)
|
13
|
+
@form = form
|
14
|
+
end
|
15
|
+
|
16
|
+
# Executes the command. Broadcasts these events:
|
17
|
+
#
|
18
|
+
# - :ok when everything is valid.
|
19
|
+
# - :invalid if the form wasn't valid and we couldn't proceed.
|
20
|
+
#
|
21
|
+
# Returns nothing.
|
22
|
+
def call
|
23
|
+
return broadcast(:invalid) if form.invalid?
|
24
|
+
|
25
|
+
if conference.persisted?
|
26
|
+
add_admins_as_followers(conference)
|
27
|
+
link_participatory_processes
|
28
|
+
link_assemblies
|
29
|
+
link_consultations
|
30
|
+
|
31
|
+
broadcast(:ok, conference)
|
32
|
+
send_notification
|
33
|
+
else
|
34
|
+
form.errors.add(:hero_image, conference.errors[:hero_image]) if conference.errors.include? :hero_image
|
35
|
+
form.errors.add(:banner_image, conference.errors[:banner_image]) if conference.errors.include? :banner_image
|
36
|
+
broadcast(:invalid)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
attr_reader :form
|
43
|
+
|
44
|
+
def conference
|
45
|
+
@conference ||= Decidim.traceability.create(
|
46
|
+
Conference,
|
47
|
+
form.current_user,
|
48
|
+
organization: form.current_organization,
|
49
|
+
title: form.title,
|
50
|
+
slogan: form.slogan,
|
51
|
+
slug: form.slug,
|
52
|
+
hashtag: form.hashtag,
|
53
|
+
description: form.description,
|
54
|
+
short_description: form.short_description,
|
55
|
+
objectives: form.objectives,
|
56
|
+
location: form.location,
|
57
|
+
scopes_enabled: form.scopes_enabled,
|
58
|
+
scope: form.scope,
|
59
|
+
start_date: form.start_date,
|
60
|
+
end_date: form.end_date,
|
61
|
+
hero_image: form.hero_image,
|
62
|
+
banner_image: form.banner_image,
|
63
|
+
promoted: form.promoted,
|
64
|
+
show_statistics: form.show_statistics,
|
65
|
+
registrations_enabled: form.registrations_enabled,
|
66
|
+
available_slots: form.available_slots || 0,
|
67
|
+
registration_terms: form.registration_terms
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
71
|
+
def add_admins_as_followers(conference)
|
72
|
+
conference.organization.admins.each do |admin|
|
73
|
+
form = Decidim::FollowForm
|
74
|
+
.from_params(followable_gid: conference.to_signed_global_id.to_s)
|
75
|
+
.with_context(
|
76
|
+
current_organization: conference.organization,
|
77
|
+
current_user: admin
|
78
|
+
)
|
79
|
+
|
80
|
+
Decidim::CreateFollow.new(form, admin).call
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def send_notification
|
85
|
+
Decidim::EventsManager.publish(
|
86
|
+
event: "decidim.events.conferences.registrations_enabled",
|
87
|
+
event_class: Decidim::Conferences::ConferenceRegistrationsEnabledEvent,
|
88
|
+
resource: conference,
|
89
|
+
recipient_ids: conference.followers.pluck(:id)
|
90
|
+
)
|
91
|
+
end
|
92
|
+
|
93
|
+
def participatory_processes
|
94
|
+
@participatory_processes ||= conference.participatory_space_sibling_scope(:participatory_processes).where(id: @form.participatory_processes_ids)
|
95
|
+
end
|
96
|
+
|
97
|
+
def link_participatory_processes
|
98
|
+
conference.link_participatory_spaces_resources(participatory_processes, "included_participatory_processes")
|
99
|
+
end
|
100
|
+
|
101
|
+
def assemblies
|
102
|
+
@assemblies ||= conference.participatory_space_sibling_scope(:assemblies).where(id: @form.assemblies_ids)
|
103
|
+
end
|
104
|
+
|
105
|
+
def link_assemblies
|
106
|
+
conference.link_participatory_spaces_resources(assemblies, "included_assemblies")
|
107
|
+
end
|
108
|
+
|
109
|
+
def consultations
|
110
|
+
@consultations ||= conference.participatory_space_sibling_scope(:consultations)
|
111
|
+
.where(id: @form.consultations_ids)
|
112
|
+
end
|
113
|
+
|
114
|
+
def link_consultations
|
115
|
+
conference.link_participatory_spaces_resources(consultations, "included_consultations")
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|