decidim-conferences 0.20.0 → 0.23.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/app/assets/images/decidim/conferences/conference.svg +1 -3
- data/app/cells/decidim/conferences/conference_m/footer.erb +1 -1
- data/app/cells/decidim/conferences/conference_m_cell.rb +4 -0
- data/app/cells/decidim/conferences/conference_speaker/show.erb +2 -2
- data/app/cells/decidim/conferences/content_blocks/highlighted_conferences/show.erb +9 -10
- data/app/cells/decidim/conferences/media_link/show.erb +2 -2
- data/app/cells/decidim/conferences/partner_cell.rb +1 -1
- data/app/cells/decidim/conferences/photo/show.erb +3 -5
- data/app/cells/decidim/conferences/photo_cell.rb +2 -2
- data/app/cells/decidim/conferences/photos_list/show.erb +1 -1
- data/app/cells/decidim/conferences/registration_type/join_conference.erb +1 -1
- data/app/cells/decidim/conferences/registration_type_cell.rb +2 -2
- data/app/commands/decidim/conferences/admin/create_conference.rb +3 -3
- data/app/commands/decidim/conferences/admin/create_conference_admin.rb +2 -1
- data/app/commands/decidim/conferences/admin/create_partner.rb +9 -9
- data/app/commands/decidim/conferences/admin/notify_role_assigned_to_conference.rb +22 -0
- data/app/commands/decidim/conferences/admin/update_conference.rb +13 -6
- data/app/commands/decidim/conferences/admin/update_conference_admin.rb +2 -1
- data/app/controllers/concerns/decidim/conferences/admin/filterable.rb +27 -0
- data/app/controllers/decidim/conferences/admin/conferences_controller.rb +4 -5
- data/app/events/decidim/conferences/conference_role_assigned_event.rb +30 -0
- data/app/forms/decidim/conferences/admin/conference_form.rb +5 -2
- data/app/forms/decidim/conferences/admin/conference_speaker_form.rb +12 -1
- data/app/forms/decidim/conferences/admin/diploma_form.rb +6 -2
- data/app/forms/decidim/conferences/admin/partner_form.rb +16 -1
- data/app/jobs/decidim/conferences/admin/send_conference_diploma_job.rb +1 -1
- data/app/models/decidim/conference.rb +28 -1
- data/app/models/decidim/conference_speaker.rb +5 -2
- data/app/models/decidim/conference_user_role.rb +1 -1
- data/app/models/decidim/conferences/media_link.rb +3 -0
- data/app/models/decidim/conferences/partner.rb +5 -1
- data/app/models/decidim/conferences/registration_type.rb +3 -0
- data/app/permissions/decidim/conferences/permissions.rb +9 -0
- data/app/presenters/decidim/conferences/conference_stats_presenter.rb +1 -1
- data/app/types/decidim/conferences/conference_media_link_type.rb +19 -0
- data/app/types/decidim/conferences/conference_partner_type.rb +20 -0
- data/app/types/decidim/conferences/conference_speaker_type.rb +24 -0
- data/app/types/decidim/conferences/conference_type.rb +45 -0
- data/app/views/decidim/conferences/_order_by_conferences.html.erb +1 -1
- data/app/views/decidim/conferences/admin/conference_invites/index.html.erb +2 -2
- data/app/views/decidim/conferences/admin/conference_speakers/index.html.erb +2 -2
- data/app/views/decidim/conferences/admin/conferences/index.html.erb +6 -3
- data/app/views/decidim/conferences/conference_program/_program_item.html.erb +6 -4
- data/app/views/decidim/conferences/conference_program/show.html.erb +6 -6
- data/app/views/decidim/conferences/conference_speakers/index.html.erb +1 -1
- data/app/views/decidim/conferences/conferences/_partners.html.erb +1 -1
- data/app/views/decidim/conferences/conferences/_promoted_conference.html.erb +3 -3
- data/app/views/decidim/conferences/conferences/show.html.erb +7 -13
- data/app/views/decidim/conferences/media/index.html.erb +3 -3
- data/app/views/decidim/conferences/registration_types/index.html.erb +1 -1
- data/app/views/layouts/decidim/_conference_hero.html.erb +4 -8
- data/app/views/layouts/decidim/_conferences_nav.html.erb +2 -2
- data/app/views/layouts/decidim/admin/conference.html.erb +2 -2
- data/app/views/layouts/decidim/conference.html.erb +4 -5
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +4 -2
- data/config/locales/bg-BG.yml +7 -0
- data/config/locales/bg.yml +7 -0
- data/config/locales/ca.yml +10 -0
- data/config/locales/cs.yml +20 -10
- data/config/locales/da-DK.yml +1 -0
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +9 -0
- data/config/locales/el-GR.yml +1 -0
- data/config/locales/el.yml +580 -0
- data/config/locales/en.yml +10 -0
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +10 -0
- data/config/locales/es-PY.yml +10 -0
- data/config/locales/es.yml +10 -0
- data/config/locales/et-EE.yml +1 -0
- data/config/locales/et.yml +1 -0
- data/config/locales/fi-plain.yml +10 -0
- data/config/locales/fi.yml +14 -4
- data/config/locales/fr-CA.yml +581 -0
- data/config/locales/fr.yml +10 -0
- data/config/locales/ga-IE.yml +1 -0
- data/config/locales/hr-HR.yml +1 -0
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +4 -0
- data/config/locales/is-IS.yml +1 -0
- data/config/locales/is.yml +1 -0
- data/config/locales/it.yml +169 -159
- data/config/locales/ja-JP.yml +575 -0
- data/config/locales/ja.yml +576 -0
- data/config/locales/ko-KR.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lt-LT.yml +1 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/lv.yml +584 -0
- data/config/locales/mt-MT.yml +1 -0
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +10 -0
- data/config/locales/no.yml +470 -7
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +203 -193
- data/config/locales/pt-BR.yml +1 -1
- data/config/locales/pt.yml +238 -229
- data/config/locales/ro-RO.yml +536 -0
- data/config/locales/sk-SK.yml +585 -0
- data/config/locales/sk.yml +585 -0
- data/config/locales/sl.yml +42 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +19 -0
- data/config/locales/sv.yml +24 -15
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/vi-VN.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +576 -0
- data/config/locales/zh-TW.yml +1 -0
- data/db/migrate/20200320105913_index_foreign_keys_in_decidim_conferences.rb +7 -0
- data/db/migrate/20200320105914_index_foreign_keys_in_decidim_conferences_conference_invites.rb +7 -0
- data/db/migrate/20200320105915_index_foreign_keys_in_decidim_conferences_conference_registrations.rb +7 -0
- data/db/seeds/city.jpeg +0 -0
- data/db/seeds/city2.jpeg +0 -0
- data/lib/decidim/conferences/admin_engine.rb +1 -0
- data/lib/decidim/conferences/participatory_space.rb +19 -12
- data/lib/decidim/conferences/test/factories.rb +19 -3
- data/lib/decidim/conferences/version.rb +1 -1
- metadata +60 -14
- data/app/views/decidim/conferences/conference_widgets/show.html.erb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d9a83482ea527bcdb77d7ec545122720864b72d3e3287e4ed6c4f2af3cc374a
|
4
|
+
data.tar.gz: e40f35304651a5a310652cfe748223ba411eda727b53a30bc0b03b78901360ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cecade8d5fe14ad8ac030a273a3b1a094dc45fc47e5b686d0676de69e1c9ee6a8cc190a11c264c91e034455f09dc12b19c531d8077b38b9dba9f2a6ada28df36
|
7
|
+
data.tar.gz: 66ea854a0efe0a70803c929aecaa6c9a4949b4966a4a3b2156c946f78868eb360a303e4eef2d6db95b493a591ec6e88ca24cec23458b9a1056ac318f9c8307a5
|
data/README.md
CHANGED
@@ -1,3 +1 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 8">
|
2
|
-
<path d="M2.91-.03a1 1 0 0 0-.13.03 1 1 0 0 0-.78 1v2a1 1 0 1 0 2 0v-2a1 1 0 0 0-1.09-1.03zm-2.56 2.03a.5.5 0 0 0-.34.5v.5c0 1.48 1.09 2.69 2.5 2.94v1.06h-.5c-.55 0-1 .45-1 1h4.01c0-.55-.45-1-1-1h-.5v-1.06c1.41-.24 2.5-1.46 2.5-2.94v-.5a.5.5 0 1 0-1 0v.5c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2v-.5a.5.5 0 0 0-.59-.5.5.5 0 0 0-.06 0z" transform="translate(1)"/>
|
3
|
-
</svg>
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 8"><path d="M2.91-.03a1 1 0 0 0-.13.03 1 1 0 0 0-.78 1v2a1 1 0 1 0 2 0v-2a1 1 0 0 0-1.09-1.03zm-2.56 2.03a.5.5 0 0 0-.34.5v.5c0 1.48 1.09 2.69 2.5 2.94v1.06h-.5c-.55 0-1 .45-1 1h4.01c0-.55-.45-1-1-1h-.5v-1.06c1.41-.24 2.5-1.46 2.5-2.94v-.5a.5.5 0 1 0-1 0v.5c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2v-.5a.5.5 0 0 0-.59-.5.5.5 0 0 0-.06 0z" transform="translate(1)"/></svg>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div class="column conference-speaker js-conference">
|
2
2
|
<div class="speaker-img-wrapper">
|
3
3
|
<div class="speaker-img">
|
4
|
-
<%= image_tag avatar.url %>
|
4
|
+
<%= image_tag avatar.url, alt: "speaker-image" %>
|
5
5
|
</div>
|
6
6
|
</div>
|
7
7
|
<div class="speaker-data">
|
@@ -26,7 +26,7 @@
|
|
26
26
|
<div class="column medium-6">
|
27
27
|
<div class="speaker-img-wrapper">
|
28
28
|
<div class="speaker-img">
|
29
|
-
<%= image_tag avatar.url %>
|
29
|
+
<%= image_tag avatar.url, alt: "speaker-image" %>
|
30
30
|
</div>
|
31
31
|
</div>
|
32
32
|
<div class="speaker-data">
|
@@ -6,17 +6,13 @@
|
|
6
6
|
large-up-4 card-grid">
|
7
7
|
<% highlighted_conferences.each do |conference| %>
|
8
8
|
<div class="column">
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
style="background-image:url(<%= conference.hero_image.url %>)"></div>
|
13
|
-
<% end %>
|
9
|
+
<%= link_to decidim_conferences.conference_path(conference), class: "card card--conference card--mini" do %>
|
10
|
+
<div aria-hidden="true" class="card__image-top"
|
11
|
+
style="background-image:url(<%= conference.hero_image.url %>)"></div>
|
14
12
|
<div class="card__content">
|
15
|
-
|
16
|
-
<h4 class="card__title"><%= translated_attribute conference.title %></h4>
|
17
|
-
<% end %>
|
13
|
+
<span class="card__title card__link"><%= translated_attribute conference.title %></span>
|
18
14
|
</div>
|
19
|
-
|
15
|
+
<% end %>
|
20
16
|
</div>
|
21
17
|
<% end %>
|
22
18
|
</div>
|
@@ -25,7 +21,10 @@
|
|
25
21
|
<div class="row" id="see-all-conferences">
|
26
22
|
<div class="columns small-centered small-12
|
27
23
|
smallmedium-8 medium-6 large-4">
|
28
|
-
<%= link_to t("see_all_conferences", scope: i18n_scope),
|
24
|
+
<%= link_to t("see_all_conferences", scope: i18n_scope),
|
25
|
+
decidim_conferences.conferences_path,
|
26
|
+
class: "button expanded hollow button--sc home-section__cta",
|
27
|
+
title: t("conferences_button_title", scope: i18n_scope) %>
|
29
28
|
</div>
|
30
29
|
</div>
|
31
30
|
</section>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<li>
|
2
|
-
<%= icon "external-link" %>
|
2
|
+
<%= icon "external-link", role: "img", "aria-hidden": true %>
|
3
3
|
<div>
|
4
4
|
<%= link_to model.link, target: "_blank" do %>
|
5
5
|
<strong><%= translated_attribute(model.title) %> </strong>
|
6
6
|
<% end %>
|
7
|
-
<div class="text-small"><%= l(model.date, format: :decidim_short_with_month_name_short) %> · <%= model.link %></
|
7
|
+
<div class="text-small"><%= l(model.date, format: :decidim_short_with_month_name_short) %> · <%= model.link %></div>
|
8
8
|
</div>
|
9
9
|
</li>
|
@@ -1,15 +1,13 @@
|
|
1
1
|
<div class="column">
|
2
|
-
<
|
2
|
+
<div class="card" data-open="media-picture-<%= index %>">
|
3
3
|
<div class="picture__content">
|
4
4
|
<%= image_thumb %>
|
5
|
-
|
6
|
-
<strong><%= title %></strong>
|
7
|
-
</h5>
|
5
|
+
<strong class="card__title"><%= title %></strong>
|
8
6
|
<div class="text-small">
|
9
7
|
<%= short_description %>
|
10
8
|
</div>
|
11
9
|
</div>
|
12
|
-
</
|
10
|
+
</div>
|
13
11
|
<div id="media-picture-<%= index %>" class="reveal picture__modal" data-reveal>
|
14
12
|
<div class="reveal__header">
|
15
13
|
<h3 class="reveal__title"><%= t("conferences.photo.show.photo", scope: "decidim") %></h3>
|
@@ -18,11 +18,11 @@ module Decidim
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def image_thumb
|
21
|
-
image_tag model.thumbnail_url
|
21
|
+
image_tag model.thumbnail_url, alt: t("alt", scope: "decidim.conferences.photo.image.attributes")
|
22
22
|
end
|
23
23
|
|
24
24
|
def image_big
|
25
|
-
image_tag model.big_url
|
25
|
+
image_tag model.big_url, alt: t("alt", scope: "decidim.conferences.photo.image.attributes")
|
26
26
|
end
|
27
27
|
|
28
28
|
def title
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="section images">
|
2
|
-
<
|
2
|
+
<h3 class="section-heading"><%= t("conferences.photos_list.show.related_photos", scope: "decidim") %></h3>
|
3
3
|
<div class="row small-up-1 smallmedium-up-2 card-grid">
|
4
4
|
<% model.each_with_index do |photo, index| %>
|
5
5
|
<%= cell "decidim/conferences/photo", photo, index: index %>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<% else %>
|
14
14
|
<%= render :registration_confirm %>
|
15
15
|
<% if allowed? %>
|
16
|
-
<%= button_to i18n_join_text, "",
|
16
|
+
<%= button_to i18n_join_text, "#",
|
17
17
|
class: button_classes,
|
18
18
|
disabled: !conference.has_available_slots? || conference.has_registration_for?(current_user),
|
19
19
|
style: "margin-bottom: 0;",
|
@@ -18,11 +18,11 @@ module Decidim
|
|
18
18
|
delegate :current_user, to: :controller, prefix: false
|
19
19
|
|
20
20
|
def title
|
21
|
-
translated_attribute model.title
|
21
|
+
decidim_sanitize translated_attribute model.title
|
22
22
|
end
|
23
23
|
|
24
24
|
def description
|
25
|
-
translated_attribute model.description
|
25
|
+
decidim_sanitize translated_attribute model.description
|
26
26
|
end
|
27
27
|
|
28
28
|
def price
|
@@ -85,7 +85,7 @@ module Decidim
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def link_participatory_processes
|
88
|
-
conference.
|
88
|
+
conference.link_participatory_space_resources(participatory_processes, "included_participatory_processes")
|
89
89
|
end
|
90
90
|
|
91
91
|
def assemblies
|
@@ -93,7 +93,7 @@ module Decidim
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def link_assemblies
|
96
|
-
conference.
|
96
|
+
conference.link_participatory_space_resources(assemblies, "included_assemblies")
|
97
97
|
end
|
98
98
|
|
99
99
|
def consultations
|
@@ -102,7 +102,7 @@ module Decidim
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def link_consultations
|
105
|
-
conference.
|
105
|
+
conference.link_participatory_space_resources(consultations, "included_consultations")
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# A command with all the business logic when creating a new conference
|
7
7
|
# admin in the system.
|
8
|
-
class CreateConferenceAdmin <
|
8
|
+
class CreateConferenceAdmin < NotifyRoleAssignedToConference
|
9
9
|
# Public: Initializes the command.
|
10
10
|
#
|
11
11
|
# form - A form object with the params.
|
@@ -57,6 +57,7 @@ module Decidim
|
|
57
57
|
conference: @conference
|
58
58
|
)
|
59
59
|
end
|
60
|
+
send_notification user
|
60
61
|
end
|
61
62
|
|
62
63
|
def existing_user
|
@@ -49,15 +49,15 @@ module Decidim
|
|
49
49
|
@partner = Decidim.traceability.create!(
|
50
50
|
Decidim::Conferences::Partner,
|
51
51
|
form.current_user,
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
52
|
+
{ conference: conference }.merge(
|
53
|
+
form.attributes.slice(
|
54
|
+
:name,
|
55
|
+
:weight,
|
56
|
+
:link,
|
57
|
+
:partner_type,
|
58
|
+
:logo,
|
59
|
+
:remove_avatar
|
60
|
+
)
|
61
61
|
),
|
62
62
|
log_info
|
63
63
|
)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
module Admin
|
6
|
+
# A command to notify users when a role is assigned for a Conference
|
7
|
+
class NotifyRoleAssignedToConference < Rectify::Command
|
8
|
+
def send_notification(user)
|
9
|
+
Decidim::EventsManager.publish(
|
10
|
+
event: "decidim.events.conferences.role_assigned",
|
11
|
+
event_class: Decidim::Conferences::ConferenceRoleAssignedEvent,
|
12
|
+
resource: form.current_participatory_space,
|
13
|
+
affected_users: [user],
|
14
|
+
extra: {
|
15
|
+
role: form.role
|
16
|
+
}
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -81,13 +81,20 @@ module Decidim
|
|
81
81
|
location: form.location,
|
82
82
|
start_date: form.start_date,
|
83
83
|
end_date: form.end_date,
|
84
|
-
hero_image: form.hero_image,
|
85
|
-
banner_image: form.banner_image,
|
86
84
|
promoted: form.promoted,
|
87
85
|
scopes_enabled: form.scopes_enabled,
|
88
86
|
scope: form.scope,
|
89
87
|
show_statistics: form.show_statistics
|
90
|
-
}
|
88
|
+
}.merge(uploader_attributes)
|
89
|
+
end
|
90
|
+
|
91
|
+
def uploader_attributes
|
92
|
+
{
|
93
|
+
hero_image: form.hero_image,
|
94
|
+
remove_hero_image: form.remove_hero_image,
|
95
|
+
banner_image: form.banner_image,
|
96
|
+
remove_banner_image: form.remove_banner_image
|
97
|
+
}.delete_if { |_k, val| val.is_a?(Decidim::ApplicationUploader) }
|
91
98
|
end
|
92
99
|
|
93
100
|
def send_notification_registrations_enabled
|
@@ -140,7 +147,7 @@ module Decidim
|
|
140
147
|
end
|
141
148
|
|
142
149
|
def link_participatory_processes
|
143
|
-
@conference.
|
150
|
+
@conference.link_participatory_space_resources(participatory_processes, "included_participatory_processes")
|
144
151
|
end
|
145
152
|
|
146
153
|
def assemblies
|
@@ -148,7 +155,7 @@ module Decidim
|
|
148
155
|
end
|
149
156
|
|
150
157
|
def link_assemblies
|
151
|
-
@conference.
|
158
|
+
@conference.link_participatory_space_resources(assemblies, "included_assemblies")
|
152
159
|
end
|
153
160
|
|
154
161
|
def consultations
|
@@ -157,7 +164,7 @@ module Decidim
|
|
157
164
|
end
|
158
165
|
|
159
166
|
def link_consultations
|
160
|
-
@conference.
|
167
|
+
@conference.link_participatory_space_resources(consultations, "included_consultations")
|
161
168
|
end
|
162
169
|
end
|
163
170
|
end
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# A command with all the business logic when updated a participatory
|
7
7
|
# process admin in the system.
|
8
|
-
class UpdateConferenceAdmin <
|
8
|
+
class UpdateConferenceAdmin < NotifyRoleAssignedToConference
|
9
9
|
# Public: Initializes the command.
|
10
10
|
#
|
11
11
|
# form - A form object with the params.
|
@@ -45,6 +45,7 @@ module Decidim
|
|
45
45
|
{ role: form.role },
|
46
46
|
log_info
|
47
47
|
)
|
48
|
+
send_notification user_role.user
|
48
49
|
end
|
49
50
|
end
|
50
51
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "active_support/concern"
|
4
|
+
|
5
|
+
module Decidim
|
6
|
+
module Conferences
|
7
|
+
module Admin
|
8
|
+
module Filterable
|
9
|
+
extend ActiveSupport::Concern
|
10
|
+
|
11
|
+
included do
|
12
|
+
include Decidim::Admin::Filterable
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def base_query
|
17
|
+
collection
|
18
|
+
end
|
19
|
+
|
20
|
+
def filters
|
21
|
+
[:published_at_null]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -8,11 +8,11 @@ module Decidim
|
|
8
8
|
class ConferencesController < Decidim::Conferences::Admin::ApplicationController
|
9
9
|
helper_method :current_conference, :current_participatory_space
|
10
10
|
layout "decidim/admin/conferences"
|
11
|
-
include Decidim::
|
11
|
+
include Decidim::Conferences::Admin::Filterable
|
12
12
|
|
13
13
|
def index
|
14
14
|
enforce_permission_to :read, :conference_list
|
15
|
-
@conferences =
|
15
|
+
@conferences = filtered_collection
|
16
16
|
end
|
17
17
|
|
18
18
|
def new
|
@@ -70,9 +70,8 @@ module Decidim
|
|
70
70
|
private
|
71
71
|
|
72
72
|
def current_conference
|
73
|
-
|
74
|
-
|
75
|
-
scope.where(id: params[:slug])
|
73
|
+
@current_conference ||= collection.where(slug: params[:slug]).or(
|
74
|
+
collection.where(id: params[:slug])
|
76
75
|
).first
|
77
76
|
end
|
78
77
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen-string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Conferences
|
5
|
+
class ConferenceRoleAssignedEvent < Decidim::Events::SimpleEvent
|
6
|
+
include Decidim::Events::NotificationEvent
|
7
|
+
include Decidim::Events::AuthorEvent
|
8
|
+
|
9
|
+
def notification_title
|
10
|
+
I18n.t("notification_title", i18n_options).html_safe
|
11
|
+
end
|
12
|
+
|
13
|
+
def i18n_role
|
14
|
+
I18n.t(extra["role"], "decidim.admin.models.conference_user_role.roles", default: extra["role"])
|
15
|
+
end
|
16
|
+
|
17
|
+
def i18n_options
|
18
|
+
{
|
19
|
+
resource_path: resource_path,
|
20
|
+
resource_title: resource_title,
|
21
|
+
resource_url: resource_url,
|
22
|
+
scope: event_name,
|
23
|
+
participatory_space_title: participatory_space_title,
|
24
|
+
participatory_space_url: participatory_space_url,
|
25
|
+
role: i18n_role
|
26
|
+
}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -8,6 +8,7 @@ module Decidim
|
|
8
8
|
#
|
9
9
|
class ConferenceForm < Form
|
10
10
|
include TranslatableAttributes
|
11
|
+
include Decidim::HasUploadValidations
|
11
12
|
|
12
13
|
translatable_attribute :title, String
|
13
14
|
translatable_attribute :slogan, String
|
@@ -45,13 +46,15 @@ module Decidim
|
|
45
46
|
validates :registration_terms, translatable_presence: true, if: ->(form) { form.registrations_enabled? }
|
46
47
|
validates :available_slots, numericality: { greater_than_or_equal_to: 0 }, if: ->(form) { form.registrations_enabled? }
|
47
48
|
|
48
|
-
validates :hero_image,
|
49
|
-
validates :banner_image,
|
49
|
+
validates :hero_image, passthru: { to: Decidim::Conference }
|
50
|
+
validates :banner_image, passthru: { to: Decidim::Conference }
|
50
51
|
validate :available_slots_greater_than_or_equal_to_registrations_count, if: ->(form) { form.registrations_enabled? && form.available_slots.positive? }
|
51
52
|
|
52
53
|
validates :start_date, presence: true, date: { before_or_equal_to: :end_date }
|
53
54
|
validates :end_date, presence: true, date: { after_or_equal_to: :start_date }
|
54
55
|
|
56
|
+
alias organization current_organization
|
57
|
+
|
55
58
|
def map_model(model)
|
56
59
|
self.scope_id = model.decidim_scope_id
|
57
60
|
end
|