decidim-conferences 0.27.5 → 0.27.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/conferences/conference_address/show.erb +2 -2
  3. data/app/cells/decidim/conferences/conference_m_cell.rb +0 -4
  4. data/app/cells/decidim/conferences/conference_speaker_cell.rb +1 -1
  5. data/app/cells/decidim/conferences/content_blocks/highlighted_conferences/show.erb +1 -1
  6. data/app/cells/decidim/conferences/photo_cell.rb +1 -1
  7. data/app/controllers/decidim/conferences/conference_widgets_controller.rb +11 -1
  8. data/app/events/decidim/conferences/conference_registration_notification_event.rb +10 -0
  9. data/app/permissions/decidim/conferences/permissions.rb +11 -0
  10. data/app/views/decidim/conferences/conference_program/_program_meeting.html.erb +1 -1
  11. data/config/locales/ar.yml +2 -0
  12. data/config/locales/bg.yml +611 -0
  13. data/config/locales/ca.yml +2 -2
  14. data/config/locales/es-MX.yml +1 -1
  15. data/config/locales/es-PY.yml +1 -1
  16. data/config/locales/es.yml +1 -1
  17. data/config/locales/fi.yml +1 -1
  18. data/config/locales/he-IL.yml +1 -0
  19. data/config/locales/hu.yml +2 -0
  20. data/config/locales/ja.yml +2 -0
  21. data/config/locales/lv.yml +1 -0
  22. data/config/locales/pl.yml +3 -0
  23. data/config/locales/pt-BR.yml +9 -0
  24. data/config/locales/sk.yml +1 -0
  25. data/config/locales/sr-CS.yml +4 -0
  26. data/config/locales/tr-TR.yml +1 -0
  27. data/decidim-conferences.gemspec +33 -0
  28. data/lib/decidim/conferences/admin_engine.rb +1 -1
  29. data/lib/decidim/conferences/test/factories.rb +68 -31
  30. data/lib/decidim/conferences/version.rb +1 -1
  31. metadata +15 -14
  32. data/config/environment.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98a81bd733a850a73a9c9cbd536bc8496069fbeaff54977c565e35025a2e882e
4
- data.tar.gz: 90f1cc1a169cc532b88b743dda0560997f9f31d57291c0d46b7f436d6b409151
3
+ metadata.gz: 873b7b4885e630d523b8fcaf40bc12581b95e52d9346f1516fe7e8398922ef45
4
+ data.tar.gz: f243423b5405868cf22de819d876bb3064ac1e744d350c94c318d1c31c4b672c
5
5
  SHA512:
6
- metadata.gz: 7c92d693c990153d68b3b43d236ab011fa59f6d3ee3af05dd278458c6e92712c9a64ce805be50b1d0294748af6f98df196437995c4c4f51ace4c5d8ae38da627
7
- data.tar.gz: 62a28b10eb414cb37916f8d75f42d532efc0a5266ae7846acf263f9b7ffa4d77adf65454f46a57c68401816b8cce5141ee984ad8ad8b7531b5b586a7dc0eef61
6
+ metadata.gz: 1fecffcbb0c34107a3c4e70342b0fb6116275ecf86bac4df7b518048fb3a83e14a97e02af1526fc997b8358647b902de7d64118aacd6535e3f05524e9730d33a
7
+ data.tar.gz: 8dda12135eaeae94872946c580bc87c222f98eedab80f62a6ab426a1dba2fa46489cac55fae7d0d53af9037b4de7f005d613dd37f456f1f57764fff9c3dc500b
@@ -1,11 +1,11 @@
1
1
  <div class="mb-s">
2
2
  <% if model.respond_to? :location %>
3
3
  <div>
4
- <strong><%= translated_attribute model.location %></strong><br>
4
+ <strong><%= decidim_escape_translated model.location %></strong><br>
5
5
  </div>
6
6
  <% end %>
7
7
  <div class="text-medium"><%= model.address %></div>
8
8
  <% if model.respond_to? :location_hints %>
9
- <div class="text-medium"><%= translated_attribute model.location_hints %></div>
9
+ <div class="text-medium"><%= decidim_escape_translated model.location_hints %></div>
10
10
  <% end %>
11
11
  </div>
@@ -14,10 +14,6 @@ module Decidim
14
14
 
15
15
  private
16
16
 
17
- def title
18
- decidim_html_escape(super)
19
- end
20
-
21
17
  def has_image?
22
18
  true
23
19
  end
@@ -60,7 +60,7 @@ module Decidim
60
60
  def short_bio
61
61
  return unless model.short_bio.presence
62
62
 
63
- translated_attribute model.short_bio
63
+ decidim_escape_translated model.short_bio
64
64
  end
65
65
 
66
66
  def twitter_handle
@@ -10,7 +10,7 @@
10
10
  <div aria-hidden="true" class="card__image-top"
11
11
  style="background-image:url('<%= conference.attached_uploader(:hero_image).path %>')"></div>
12
12
  <div class="card__content">
13
- <span class="card__title card__link"><%= translated_attribute conference.title %></span>
13
+ <span class="card__title card__link"><%= decidim_escape_translated conference.title %></span>
14
14
  </div>
15
15
  <% end %>
16
16
  </div>
@@ -26,7 +26,7 @@ module Decidim
26
26
  end
27
27
 
28
28
  def title
29
- translated_attribute model.title
29
+ decidim_escape_translated model.title
30
30
  end
31
31
 
32
32
  def short_description
@@ -5,10 +5,16 @@ module Decidim
5
5
  class ConferenceWidgetsController < Decidim::WidgetsController
6
6
  helper Decidim::SanitizeHelper
7
7
 
8
+ def show
9
+ enforce_permission_to :embed, :conference, conference: model if model
10
+
11
+ super
12
+ end
13
+
8
14
  private
9
15
 
10
16
  def model
11
- @model ||= Conference.find_by(slug: params[:conference_slug])
17
+ @model ||= Conference.where(organization: current_organization).published.find_by(slug: params[:conference_slug])
12
18
  end
13
19
 
14
20
  def current_participatory_space
@@ -18,6 +24,10 @@ module Decidim
18
24
  def iframe_url
19
25
  @iframe_url ||= conference_conference_widget_url(model)
20
26
  end
27
+
28
+ def permission_class_chain
29
+ ::Decidim.permissions_registry.chain_for(::Decidim::Conferences::ApplicationController)
30
+ end
21
31
  end
22
32
  end
23
33
  end
@@ -4,6 +4,7 @@ module Decidim
4
4
  module Conferences
5
5
  class ConferenceRegistrationNotificationEvent < Decidim::Events::BaseEvent
6
6
  include Decidim::Events::NotificationEvent
7
+ include Decidim::SanitizeHelper
7
8
 
8
9
  def notification_title
9
10
  I18n.t("notification_title", **i18n_options).html_safe
@@ -12,10 +13,19 @@ module Decidim
12
13
  def i18n_options
13
14
  {
14
15
  resource_title: resource_title,
16
+ resource_path: resource_path,
15
17
  resource_url: resource_url,
16
18
  scope: event_name
17
19
  }
18
20
  end
21
+
22
+ def resource_title
23
+ return unless resource
24
+
25
+ title = decidim_sanitize_translated(resource.title)
26
+
27
+ Decidim::ContentProcessor.render_without_format(title, links: false).html_safe
28
+ end
19
29
  end
20
30
  end
21
31
  end
@@ -16,6 +16,7 @@ module Decidim
16
16
  if permission_action.scope == :public
17
17
  public_list_conferences_action?
18
18
  public_read_conference_action?
19
+ public_embed_conference_action?
19
20
  public_list_speakers_action?
20
21
  public_list_program_action?
21
22
  public_list_media_links_action?
@@ -131,6 +132,16 @@ module Decidim
131
132
  toggle_allow(can_manage_conference?)
132
133
  end
133
134
 
135
+ def public_embed_conference_action?
136
+ return unless permission_action.action == :embed &&
137
+ [:conference, :participatory_space].include?(permission_action.subject) &&
138
+ conference
139
+
140
+ return disallow! unless conference.published?
141
+
142
+ allow!
143
+ end
144
+
134
145
  def public_list_speakers_action?
135
146
  return unless permission_action.action == :list &&
136
147
  permission_action.subject == :speakers
@@ -3,7 +3,7 @@
3
3
  <%= start_time.to_s(:time) %> - <%= end_time.to_s(:time) %>
4
4
  </div>
5
5
  <div class="column medium-10 programme-title">
6
- <%= link_to present(meeting).title, resource_locator(meeting).path %>
6
+ <%= link_to decidim_sanitize(present(meeting).title), resource_locator(meeting).path %>
7
7
  </div>
8
8
  </div>
9
9
  <div class="row">
@@ -58,6 +58,7 @@ ar:
58
58
  conference_meeting_ids: الاجتماعات ذات الصلة
59
59
  full_name: الاسم الكامل
60
60
  position: المنصب
61
+ twitter_handle: معرّف X
61
62
  user_id: المستخدم
62
63
  conference_user_role:
63
64
  email: البريد الإلكتروني
@@ -440,6 +441,7 @@ ar:
440
441
  invalid: حدثت مشكلة أثناء مغادرة هذا المؤتمر.
441
442
  success: لقد تركت المؤتمر بنجاح.
442
443
  conference_speaker:
444
+ go_to_twitter: الذهاب إلى X
443
445
  more_info: مزيد من المعلومات
444
446
  personal_website: موقع الويب الشخصي
445
447
  show: