decidim-conferences 0.20.1 → 0.23.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/app/assets/images/decidim/conferences/conference.svg +1 -3
  4. data/app/cells/decidim/conferences/conference_m/footer.erb +1 -1
  5. data/app/cells/decidim/conferences/conference_m_cell.rb +4 -0
  6. data/app/cells/decidim/conferences/conference_speaker/show.erb +2 -2
  7. data/app/cells/decidim/conferences/content_blocks/highlighted_conferences/show.erb +9 -10
  8. data/app/cells/decidim/conferences/media_link/show.erb +2 -2
  9. data/app/cells/decidim/conferences/partner_cell.rb +1 -1
  10. data/app/cells/decidim/conferences/photo/show.erb +3 -5
  11. data/app/cells/decidim/conferences/photo_cell.rb +2 -2
  12. data/app/cells/decidim/conferences/photos_list/show.erb +1 -1
  13. data/app/cells/decidim/conferences/registration_type/join_conference.erb +1 -1
  14. data/app/cells/decidim/conferences/registration_type_cell.rb +2 -2
  15. data/app/commands/decidim/conferences/admin/create_conference.rb +3 -3
  16. data/app/commands/decidim/conferences/admin/create_conference_admin.rb +2 -1
  17. data/app/commands/decidim/conferences/admin/create_partner.rb +9 -9
  18. data/app/commands/decidim/conferences/admin/notify_role_assigned_to_conference.rb +22 -0
  19. data/app/commands/decidim/conferences/admin/update_conference.rb +13 -6
  20. data/app/commands/decidim/conferences/admin/update_conference_admin.rb +2 -1
  21. data/app/controllers/concerns/decidim/conferences/admin/filterable.rb +27 -0
  22. data/app/controllers/decidim/conferences/admin/conferences_controller.rb +4 -5
  23. data/app/events/decidim/conferences/conference_role_assigned_event.rb +30 -0
  24. data/app/forms/decidim/conferences/admin/conference_form.rb +5 -2
  25. data/app/forms/decidim/conferences/admin/conference_speaker_form.rb +12 -1
  26. data/app/forms/decidim/conferences/admin/diploma_form.rb +6 -2
  27. data/app/forms/decidim/conferences/admin/partner_form.rb +16 -1
  28. data/app/jobs/decidim/conferences/admin/send_conference_diploma_job.rb +1 -1
  29. data/app/models/decidim/conference.rb +28 -1
  30. data/app/models/decidim/conference_speaker.rb +5 -2
  31. data/app/models/decidim/conference_user_role.rb +1 -1
  32. data/app/models/decidim/conferences/media_link.rb +3 -0
  33. data/app/models/decidim/conferences/partner.rb +5 -1
  34. data/app/models/decidim/conferences/registration_type.rb +3 -0
  35. data/app/permissions/decidim/conferences/permissions.rb +9 -0
  36. data/app/presenters/decidim/conferences/conference_stats_presenter.rb +1 -1
  37. data/app/types/decidim/conferences/conference_media_link_type.rb +19 -0
  38. data/app/types/decidim/conferences/conference_partner_type.rb +20 -0
  39. data/app/types/decidim/conferences/conference_speaker_type.rb +24 -0
  40. data/app/types/decidim/conferences/conference_type.rb +45 -0
  41. data/app/views/decidim/conferences/_order_by_conferences.html.erb +1 -1
  42. data/app/views/decidim/conferences/admin/conference_invites/index.html.erb +2 -2
  43. data/app/views/decidim/conferences/admin/conference_speakers/index.html.erb +2 -2
  44. data/app/views/decidim/conferences/admin/conferences/index.html.erb +6 -3
  45. data/app/views/decidim/conferences/conference_program/_program_item.html.erb +6 -4
  46. data/app/views/decidim/conferences/conference_program/show.html.erb +6 -6
  47. data/app/views/decidim/conferences/conference_speakers/index.html.erb +1 -1
  48. data/app/views/decidim/conferences/conferences/_partners.html.erb +1 -1
  49. data/app/views/decidim/conferences/conferences/_promoted_conference.html.erb +3 -3
  50. data/app/views/decidim/conferences/conferences/show.html.erb +7 -13
  51. data/app/views/decidim/conferences/media/index.html.erb +3 -3
  52. data/app/views/decidim/conferences/registration_types/index.html.erb +1 -1
  53. data/app/views/layouts/decidim/_conference_hero.html.erb +4 -8
  54. data/app/views/layouts/decidim/_conferences_nav.html.erb +2 -2
  55. data/app/views/layouts/decidim/admin/conference.html.erb +2 -2
  56. data/app/views/layouts/decidim/conference.html.erb +4 -5
  57. data/config/locales/am-ET.yml +1 -0
  58. data/config/locales/bg-BG.yml +7 -0
  59. data/config/locales/bg.yml +7 -0
  60. data/config/locales/ca.yml +10 -0
  61. data/config/locales/cs.yml +20 -10
  62. data/config/locales/da-DK.yml +1 -0
  63. data/config/locales/da.yml +1 -0
  64. data/config/locales/de.yml +9 -0
  65. data/config/locales/el.yml +580 -0
  66. data/config/locales/en.yml +10 -0
  67. data/config/locales/eo.yml +1 -0
  68. data/config/locales/es-MX.yml +10 -0
  69. data/config/locales/es-PY.yml +10 -0
  70. data/config/locales/es.yml +10 -0
  71. data/config/locales/et-EE.yml +1 -0
  72. data/config/locales/et.yml +1 -0
  73. data/config/locales/fi-plain.yml +10 -0
  74. data/config/locales/fi.yml +14 -4
  75. data/config/locales/fr-CA.yml +581 -0
  76. data/config/locales/fr.yml +10 -0
  77. data/config/locales/ga-IE.yml +1 -0
  78. data/config/locales/hr-HR.yml +1 -0
  79. data/config/locales/hr.yml +1 -0
  80. data/config/locales/hu.yml +4 -0
  81. data/config/locales/is.yml +1 -0
  82. data/config/locales/it.yml +169 -159
  83. data/config/locales/ja-JP.yml +575 -0
  84. data/config/locales/ja.yml +576 -0
  85. data/config/locales/ko-KR.yml +1 -0
  86. data/config/locales/ko.yml +1 -0
  87. data/config/locales/lt-LT.yml +1 -0
  88. data/config/locales/lt.yml +1 -0
  89. data/config/locales/lv.yml +584 -0
  90. data/config/locales/mt-MT.yml +1 -0
  91. data/config/locales/mt.yml +1 -0
  92. data/config/locales/nl.yml +10 -0
  93. data/config/locales/no.yml +12 -3
  94. data/config/locales/om-ET.yml +1 -0
  95. data/config/locales/pl.yml +203 -193
  96. data/config/locales/pt-BR.yml +1 -1
  97. data/config/locales/pt.yml +238 -229
  98. data/config/locales/ro-RO.yml +536 -0
  99. data/config/locales/sk-SK.yml +585 -0
  100. data/config/locales/sk.yml +585 -0
  101. data/config/locales/sl.yml +42 -0
  102. data/config/locales/so-SO.yml +1 -0
  103. data/config/locales/sr-CS.yml +19 -0
  104. data/config/locales/sv.yml +25 -15
  105. data/config/locales/ti-ER.yml +1 -0
  106. data/config/locales/vi-VN.yml +1 -0
  107. data/config/locales/vi.yml +1 -0
  108. data/config/locales/zh-CN.yml +576 -0
  109. data/config/locales/zh-TW.yml +1 -0
  110. data/db/migrate/20200320105913_index_foreign_keys_in_decidim_conferences.rb +7 -0
  111. data/db/migrate/20200320105914_index_foreign_keys_in_decidim_conferences_conference_invites.rb +7 -0
  112. data/db/migrate/20200320105915_index_foreign_keys_in_decidim_conferences_conference_registrations.rb +7 -0
  113. data/db/seeds/city.jpeg +0 -0
  114. data/db/seeds/city2.jpeg +0 -0
  115. data/lib/decidim/conferences/admin_engine.rb +1 -0
  116. data/lib/decidim/conferences/participatory_space.rb +19 -12
  117. data/lib/decidim/conferences/test/factories.rb +19 -3
  118. data/lib/decidim/conferences/version.rb +1 -1
  119. metadata +57 -13
  120. 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: 073cb7b12f74449977cfec9e2d7adb06068471c034cd41bfd4d7bfb18a34e178
4
- data.tar.gz: 5f10e62f54d3a8511f565ef53c7b2d50ab49f1e75da0df5f89f35056efb36284
3
+ metadata.gz: bc39f070af5f74d0df9e719b82a4f432b6cdca3b8bdbe757850a79515d09d15c
4
+ data.tar.gz: f4118487febf6bbcdf61ad70b0340b4fb45814ed841d99c5a4d518f9f54f2646
5
5
  SHA512:
6
- metadata.gz: 5ab470eaa1b17bbd6cee13c6238fe492abd41f2888728dde9c650c7ac595b5af7852532740626726b457ca81933519c4673fcb66c81295d303ca2a65cb221145
7
- data.tar.gz: 3a7469d214456fb69eb48eeeb0afe2656df021d630dba27dc97beac8eafd751960f047dcbcbb6816f4f2db20ae795a48295fd356c51c16ff32814984619eec53
6
+ metadata.gz: 230abd77a63ce518148128481b7dd0a8dc0fd9c7e936f3268ddc80f8c9aa0bba49dfba6dc78d626b6012338ff5bd34fc0219db9cb78424f3612a269441c834e6
7
+ data.tar.gz: 73a102ec5e0d492ea75ccdac20b679ac93398f1ca6e31dd42961ac14c19bb2b1a8e4ea1e5ad1ef70b3af09f3189bcfed26357422025fca67f1f8f6f6e057ce79
data/README.md CHANGED
@@ -27,6 +27,8 @@ And then execute:
27
27
 
28
28
  ```bash
29
29
  bundle
30
+ bundle exec rails decidim_conferences:install:migrations
31
+ bundle exec rails db:migrate
30
32
  ```
31
33
 
32
34
  ## Contributing
@@ -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>
@@ -3,7 +3,7 @@
3
3
  <%= link_to(
4
4
  t(model.cta_button_text_key, scope: "layouts.decidim.conferences.conference"),
5
5
  resource_path,
6
- class: "card__button button button--sc secondary light small"
6
+ class: "card__button button button--sc small"
7
7
  ) %>
8
8
  </div>
9
9
  </div>
@@ -14,6 +14,10 @@ module Decidim
14
14
 
15
15
  private
16
16
 
17
+ def title
18
+ decidim_html_escape(super)
19
+ end
20
+
17
21
  def has_image?
18
22
  true
19
23
  end
@@ -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
- <article class="card card--conference card--mini">
10
- <%= link_to decidim_conferences.conference_path(conference), class: "card__link" do %>
11
- <div class="card__image-top"
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
- <%= link_to decidim_conferences.conference_path(conference), class: "card__link" do %>
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
- </article>
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), decidim_conferences.conferences_path, class: "button expanded hollow button--sc home-section__cta" %>
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 %></small>
7
+ <div class="text-small"><%= l(model.date, format: :decidim_short_with_month_name_short) %> · <%= model.link %></div>
8
8
  </div>
9
9
  </li>
@@ -19,7 +19,7 @@ module Decidim
19
19
  def logo
20
20
  return unless model.logo.presence
21
21
 
22
- "<div class='card p-m flex--cc'> #{image_tag model.logo.medium.url} </div>"
22
+ "<div class='card p-m flex--cc'> #{image_tag model.logo.medium.url, alt: "logo"} </div>"
23
23
  end
24
24
  end
25
25
  end
@@ -1,15 +1,13 @@
1
1
  <div class="column">
2
- <article class="card" data-open="media-picture-<%= index %>">
2
+ <div class="card" data-open="media-picture-<%= index %>">
3
3
  <div class="picture__content">
4
4
  <%= image_thumb %>
5
- <h5 class="card__title">
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
- </article>
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
- <h4 class="section-heading"><%= t("conferences.photos_list.show.related_photos", scope: "decidim") %></h4>
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.link_participatory_spaces_resources(participatory_processes, "included_participatory_processes")
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.link_participatory_spaces_resources(assemblies, "included_assemblies")
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.link_participatory_spaces_resources(consultations, "included_consultations")
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 < Rectify::Command
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
- form.attributes.slice(
53
- :name,
54
- :weight,
55
- :link,
56
- :partner_type,
57
- :logo,
58
- :remove_avatar
59
- ).merge(
60
- conference: conference
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.link_participatory_spaces_resources(participatory_processes, "included_participatory_processes")
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.link_participatory_spaces_resources(assemblies, "included_assemblies")
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.link_participatory_spaces_resources(consultations, "included_consultations")
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 < Rectify::Command
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::Paginable
11
+ include Decidim::Conferences::Admin::Filterable
12
12
 
13
13
  def index
14
14
  enforce_permission_to :read, :conference_list
15
- @conferences = paginate(collection)
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
- scope = OrganizationConferences.new(current_user.organization).query
74
- @current_conference ||= scope.where(slug: params[:slug]).or(
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, file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } }, file_content_type: { allow: ["image/jpeg", "image/png"] }
49
- validates :banner_image, file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } }, file_content_type: { allow: ["image/jpeg", "image/png"] }
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