decidim-core 0.27.0.rc1 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-core might be problematic. Click here for more details.

Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/announcement_cell.rb +1 -1
  3. data/app/cells/decidim/content_blocks/cta/show.erb +1 -1
  4. data/app/cells/decidim/content_blocks/cta_cell.rb +1 -1
  5. data/app/cells/decidim/content_blocks/hero/show.erb +2 -2
  6. data/app/cells/decidim/content_blocks/hero_cell.rb +1 -0
  7. data/app/cells/decidim/content_blocks/highlighted_content_banner/show.erb +2 -2
  8. data/app/cells/decidim/content_blocks/stats_cell.rb +1 -0
  9. data/app/cells/decidim/content_blocks/sub_hero_cell.rb +1 -1
  10. data/app/cells/decidim/data_consent/category.erb +19 -19
  11. data/app/cells/decidim/data_consent/dialog.erb +12 -12
  12. data/app/cells/decidim/data_consent/modal.erb +13 -13
  13. data/app/cells/decidim/data_consent_cell.rb +3 -3
  14. data/app/commands/decidim/update_account.rb +3 -1
  15. data/app/controllers/concerns/decidim/resource_versions_concern.rb +4 -0
  16. data/app/controllers/decidim/devise/registrations_controller.rb +5 -1
  17. data/app/controllers/decidim/last_activities_controller.rb +1 -0
  18. data/app/events/decidim/resource_endorsed_event.rb +2 -1
  19. data/app/forms/decidim/account_form.rb +1 -1
  20. data/app/forms/decidim/user_group_form.rb +1 -1
  21. data/app/helpers/decidim/filters_helper.rb +5 -1
  22. data/app/helpers/decidim/sanitize_helper.rb +12 -3
  23. data/app/models/decidim/action_log.rb +9 -9
  24. data/app/models/decidim/notification.rb +11 -2
  25. data/app/models/decidim/user_base_entity.rb +1 -0
  26. data/app/packs/entrypoints/decidim_core.js +1 -1
  27. data/app/packs/src/decidim/account_form.js +68 -18
  28. data/app/packs/src/decidim/{cookie_consent → data_consent}/consent_manager.js +27 -24
  29. data/app/packs/src/decidim/data_consent/consent_manager.test.js +280 -0
  30. data/app/packs/src/decidim/{cookie_consent/cookie_consent.js → data_consent/index.js} +12 -12
  31. data/app/packs/src/decidim/input_character_counter.js +57 -34
  32. data/app/packs/src/decidim/sw/a2hs.js +10 -1
  33. data/app/packs/stylesheets/decidim/modules/_cards.scss +2 -0
  34. data/app/packs/stylesheets/decidim/modules/_comments.scss +2 -0
  35. data/app/packs/stylesheets/decidim/modules/{_cookie-consent.scss → _data-consent.scss} +10 -10
  36. data/app/packs/stylesheets/decidim/modules/_forms.scss +5 -0
  37. data/app/packs/stylesheets/decidim/modules/_modules.scss +1 -1
  38. data/app/permissions/decidim/permissions.rb +4 -2
  39. data/app/presenters/decidim/push_notification_presenter.rb +2 -1
  40. data/app/presenters/decidim/user_presenter.rb +4 -1
  41. data/app/scrubbers/decidim/admin_input_scrubber.rb +25 -0
  42. data/app/scrubbers/decidim/user_input_scrubber.rb +3 -5
  43. data/app/services/decidim/iframe_disabler.rb +2 -3
  44. data/app/services/decidim/notifications_digest_sending_decider.rb +6 -2
  45. data/app/services/decidim/send_push_notification.rb +14 -12
  46. data/app/views/decidim/account/_password_fields.html.erb +2 -2
  47. data/app/views/decidim/download_your_data/show.html.erb +1 -1
  48. data/app/views/decidim/notifications_settings/show.html.erb +65 -67
  49. data/app/views/decidim/pages/_standalone.html.erb +1 -1
  50. data/app/views/decidim/pages/_tabbed.html.erb +1 -1
  51. data/app/views/decidim/user_interests/show.html.erb +11 -13
  52. data/app/views/layouts/decidim/_application.html.erb +1 -1
  53. data/app/views/layouts/decidim/_data_consent_warning.html.erb +8 -0
  54. data/app/views/layouts/decidim/_main_footer.html.erb +1 -1
  55. data/config/locales/am-ET.yml +0 -1
  56. data/config/locales/ar.yml +0 -11
  57. data/config/locales/bg.yml +1 -10
  58. data/config/locales/ca.yml +20 -25
  59. data/config/locales/cs.yml +26 -31
  60. data/config/locales/da.yml +0 -1
  61. data/config/locales/de.yml +205 -11
  62. data/config/locales/el.yml +0 -9
  63. data/config/locales/en.yml +17 -22
  64. data/config/locales/es-MX.yml +21 -26
  65. data/config/locales/es-PY.yml +20 -25
  66. data/config/locales/es.yml +22 -27
  67. data/config/locales/et.yml +0 -1
  68. data/config/locales/eu.yml +4 -13
  69. data/config/locales/fi-plain.yml +17 -22
  70. data/config/locales/fi.yml +17 -22
  71. data/config/locales/fr-CA.yml +30 -21
  72. data/config/locales/fr.yml +43 -34
  73. data/config/locales/ga-IE.yml +1 -3
  74. data/config/locales/gl.yml +0 -11
  75. data/config/locales/hr.yml +0 -1
  76. data/config/locales/hu.yml +271 -10
  77. data/config/locales/id-ID.yml +0 -11
  78. data/config/locales/is-IS.yml +2 -1
  79. data/config/locales/it.yml +3 -12
  80. data/config/locales/ja.yml +31 -25
  81. data/config/locales/ko.yml +0 -1
  82. data/config/locales/lb.yml +0 -9
  83. data/config/locales/lt.yml +1949 -0
  84. data/config/locales/lv.yml +0 -9
  85. data/config/locales/mt.yml +0 -1
  86. data/config/locales/nl.yml +18 -12
  87. data/config/locales/no.yml +1 -10
  88. data/config/locales/oc-FR.yml +1 -0
  89. data/config/locales/om-ET.yml +0 -1
  90. data/config/locales/pl.yml +1 -10
  91. data/config/locales/pt-BR.yml +4 -13
  92. data/config/locales/pt.yml +1 -10
  93. data/config/locales/ro-RO.yml +0 -9
  94. data/config/locales/ru.yml +0 -2
  95. data/config/locales/si-LK.yml +0 -1
  96. data/config/locales/sk.yml +0 -12
  97. data/config/locales/so-SO.yml +0 -1
  98. data/config/locales/sv.yml +9 -14
  99. data/config/locales/sw-KE.yml +0 -1
  100. data/config/locales/ti-ER.yml +0 -1
  101. data/config/locales/tr-TR.yml +2 -11
  102. data/config/locales/uk.yml +1 -2
  103. data/config/locales/val-ES.yml +0 -1
  104. data/config/locales/vi.yml +0 -1
  105. data/config/locales/zh-CN.yml +2 -11
  106. data/config/locales/zh-TW.yml +0 -1
  107. data/config/routes.rb +20 -2
  108. data/lib/decidim/attributes/model.rb +9 -1
  109. data/lib/decidim/content_parsers/hashtag_parser.rb +1 -1
  110. data/lib/decidim/core/engine.rb +1 -1
  111. data/lib/decidim/core/test/shared_examples/resource_endorsed_event_examples.rb +60 -0
  112. data/lib/decidim/core/test/shared_examples/versions_controller_examples.rb +40 -0
  113. data/lib/decidim/core/test/shared_examples/with_endorsable_permissions_examples.rb +1 -1
  114. data/lib/decidim/core/test.rb +2 -0
  115. data/lib/decidim/core/version.rb +1 -1
  116. data/lib/decidim/core.rb +52 -13
  117. data/lib/decidim/dependency_resolver.rb +272 -0
  118. data/lib/decidim/events/simple_event.rb +1 -0
  119. data/lib/decidim/has_resource_permission.rb +0 -2
  120. data/lib/decidim/map/provider/dynamic_map/here.rb +46 -1
  121. data/lib/decidim/nicknamizable.rb +1 -1
  122. data/lib/decidim/translatable_attributes.rb +8 -1
  123. data/lib/decidim/url_option_resolver.rb +1 -1
  124. metadata +18 -13
  125. data/app/views/decidim/devise/registrations/edit.html.erb +0 -41
  126. data/app/views/layouts/decidim/_cookie_warning.html.erb +0 -8
@@ -1,7 +1,7 @@
1
- #cc-dialog-wrapper{
1
+ #dc-dialog-wrapper{
2
2
  z-index: 1000000;
3
3
 
4
- .cc-dialog{
4
+ .dc-dialog{
5
5
  position: fixed;
6
6
  background-color: $white;
7
7
  bottom: 0;
@@ -11,7 +11,7 @@
11
11
  width: unset;
12
12
  }
13
13
 
14
- .cc-button-wrapper{
14
+ .dc-button-wrapper{
15
15
  flex-direction: column;
16
16
  margin: 1rem 0;
17
17
 
@@ -36,7 +36,7 @@
36
36
  }
37
37
  }
38
38
 
39
- #cc-modal{
39
+ #dc-modal{
40
40
  background-color: $white;
41
41
 
42
42
  .category-wrapper{
@@ -47,7 +47,7 @@
47
47
  position: relative;
48
48
  justify-content: space-between;
49
49
 
50
- .cc-title{
50
+ .dc-title{
51
51
  &::before{
52
52
  border: solid #2d4156;
53
53
  border-width: 0 2px 2px 0;
@@ -68,12 +68,12 @@
68
68
  }
69
69
  }
70
70
 
71
- .cc-switch{
71
+ .dc-switch{
72
72
  padding: .5rem 0 0;
73
73
  }
74
74
  }
75
75
 
76
- .cookie-details-wrapper{
76
+ .dataconsent-details-wrapper{
77
77
  .detail-titles{
78
78
  border-bottom: 1px solid $medium-gray;
79
79
 
@@ -82,13 +82,13 @@
82
82
  }
83
83
  }
84
84
 
85
- .cookie-detail-row{
85
+ .dataconsent-detail-row{
86
86
  font-size: .6rem;
87
87
  }
88
88
  }
89
89
  }
90
90
 
91
- .cc-buttons-wrapper{
91
+ .dc-buttons-wrapper{
92
92
  justify-content: space-between;
93
93
  }
94
94
  }
@@ -108,7 +108,7 @@
108
108
  }
109
109
  }
110
110
 
111
- .cookie-warning{
111
+ .dataconsent-warning{
112
112
  flex-direction: column;
113
113
  font-size: 2rem;
114
114
  font-weight: $global-weight-bold;
@@ -77,6 +77,11 @@ label > [type="radio"]{
77
77
  margin-right: 1rem;
78
78
  flex-shrink: 0;
79
79
  }
80
+
81
+ &,
82
+ &.tiny{
83
+ height: auto;
84
+ }
80
85
  }
81
86
 
82
87
  .switch{
@@ -82,7 +82,7 @@
82
82
  //Additional elements
83
83
  @import "stylesheets/decidim/modules/share";
84
84
  @import "stylesheets/decidim/modules/help";
85
- @import "stylesheets/decidim/modules/cookie-consent";
85
+ @import "stylesheets/decidim/modules/data-consent";
86
86
  @import "stylesheets/decidim/modules/map";
87
87
  @import "stylesheets/decidim/modules/omnipresent_banner";
88
88
  @import "stylesheets/decidim/modules/wizard-steps";
@@ -116,9 +116,11 @@ module Decidim
116
116
  end
117
117
 
118
118
  def apply_endorsement_permissions
119
- return disallow! if !current_settings.endorsements_enabled || current_settings.endorsements_blocked
119
+ is_allowed = current_settings.endorsements_enabled &&
120
+ !current_settings.endorsements_blocked &&
121
+ authorized?(:endorse, resource: context.fetch(:resource, nil))
120
122
 
121
- allow!
123
+ toggle_allow(is_allowed)
122
124
  end
123
125
 
124
126
  def notification_action?
@@ -10,7 +10,8 @@ module Decidim
10
10
  end
11
11
 
12
12
  def body
13
- ActionView::Base.full_sanitizer.sanitize(event_class_instance.notification_title)
13
+ # Not using Rails sanitizers here because they escape HTML entities (i.e &) and we want to keep them
14
+ Nokogiri::HTML(event_class_instance.notification_title).text if event_class_instance.notification_title.present?
14
15
  end
15
16
 
16
17
  def icon
@@ -13,6 +13,8 @@ module Decidim
13
13
  # nickname presented in a twitter-like style
14
14
  #
15
15
  def nickname
16
+ return "" if __getobj__.blocked?
17
+
16
18
  "@#{__getobj__.nickname}"
17
19
  end
18
20
 
@@ -33,13 +35,14 @@ module Decidim
33
35
  end
34
36
 
35
37
  def avatar_url(variant = nil)
38
+ return default_avatar_url if __getobj__.blocked?
36
39
  return avatar.default_url unless avatar.attached?
37
40
 
38
41
  avatar.path(variant: variant)
39
42
  end
40
43
 
41
44
  def default_avatar_url
42
- attached_uploader.default_url
45
+ attached_uploader(:avatar).default_url
43
46
  end
44
47
 
45
48
  def profile_path
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ # Use this class as a scrubber to sanitize admin user input. The default
5
+ # scrubbed provided by Rails does not allow `iframe`s, and we're using
6
+ # them to embed videos, so we need to provide a whole new scrubber.
7
+ #
8
+ # Example:
9
+ #
10
+ # sanitize(@page.body, scrubber: Decidim::AdminInputScrubber.new)
11
+ #
12
+ # Lists of default tags and attributes are extracted from
13
+ # https://stackoverflow.com/a/35073814/2110884.
14
+ class AdminInputScrubber < UserInputScrubber
15
+ private
16
+
17
+ def custom_allowed_attributes
18
+ super + %w(frameborder allowfullscreen) - %w(onerror)
19
+ end
20
+
21
+ def custom_allowed_tags
22
+ super + %w(comment iframe)
23
+ end
24
+ end
25
+ end
@@ -1,9 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Decidim
4
- # Use this class as a scrubber to sanitize user input. The default
5
- # scrubbed provided by Rails does not allow `iframe`s, and we're using
6
- # them to embed videos, so we need to provide a whole new scrubber.
4
+ # Use this class as a scrubber to sanitize participant user input.
7
5
  #
8
6
  # Example:
9
7
  #
@@ -21,11 +19,11 @@ module Decidim
21
19
  private
22
20
 
23
21
  def custom_allowed_attributes
24
- Loofah::HTML5::SafeList::ALLOWED_ATTRIBUTES + %w(frameborder allowfullscreen) - %w(onerror)
22
+ Loofah::HTML5::SafeList::ALLOWED_ATTRIBUTES
25
23
  end
26
24
 
27
25
  def custom_allowed_tags
28
- Loofah::HTML5::SafeList::ALLOWED_ELEMENTS_WITH_LIBXML2 + %w(iframe)
26
+ Loofah::HTML5::SafeList::ALLOWED_ELEMENTS_WITH_LIBXML2
29
27
  end
30
28
  end
31
29
  end
@@ -18,9 +18,8 @@ module Decidim
18
18
 
19
19
  def disable_iframes(node)
20
20
  if node.name == "iframe"
21
- node.name = "div"
22
- old_classes = node.attributes["class"].value
23
- node.attributes["class"].value = old_classes.present? ? "#{old_classes} disabled-iframe" : "disabled-iframe"
21
+ orig_node = node.to_s
22
+ node.replace(%(<div class="disabled-iframe"><!-- #{orig_node} --></div>))
24
23
  end
25
24
 
26
25
  node.children.each do |child|
@@ -6,10 +6,14 @@ module Decidim
6
6
  def must_notify?(user, time: Time.now.utc)
7
7
  return true if user.digest_sent_at.blank?
8
8
 
9
+ # Note that we are checking whether the notifications were sent at any
10
+ # time during the assumed sending day moment to prevent potential issues
11
+ # during the sending if the digest_sent_at is set to some other moment
12
+ # than the exact beginning of that day.
9
13
  case user.notifications_sending_frequency.to_sym
10
14
  when :none then false
11
- when :daily then user.digest_sent_at < time - 1.day
12
- when :weekly then user.digest_sent_at < time - 1.week
15
+ when :daily then user.digest_sent_at <= (time - 1.day).end_of_day
16
+ when :weekly then user.digest_sent_at <= (time - 1.day - 1.week).end_of_day
13
17
  else true
14
18
  end
15
19
  end
@@ -18,18 +18,20 @@ module Decidim
18
18
  def perform(notification)
19
19
  return unless Rails.application.secrets.vapid[:enabled]
20
20
 
21
- notification.user.notifications_subscriptions.values.map do |subscription|
22
- message_params = notification_params(Decidim::PushNotificationPresenter.new(notification))
23
- payload = build_payload(message_params, subscription)
24
- # Capture webpush exceptions in order to avoid this call to be repeated by the background job runner
25
- # Webpush::Error class is the parent class of all defined errors
26
- begin
27
- Webpush.payload_send(**payload)
28
- rescue Webpush::Error => e
29
- Rails.logger.warn("[ERROR] Push notification delivery failed due to #{e.message}")
30
- nil
31
- end
32
- end.compact
21
+ I18n.with_locale(notification.user.locale || notification.user.organization.default_locale) do
22
+ notification.user.notifications_subscriptions.values.map do |subscription|
23
+ message_params = notification_params(Decidim::PushNotificationPresenter.new(notification))
24
+ payload = build_payload(message_params, subscription)
25
+ # Capture webpush exceptions in order to avoid this call to be repeated by the background job runner
26
+ # Webpush::Error class is the parent class of all defined errors
27
+ begin
28
+ Webpush.payload_send(**payload)
29
+ rescue Webpush::Error => e
30
+ Rails.logger.warn("[ERROR] Push notification delivery failed due to #{e.message}")
31
+ nil
32
+ end
33
+ end.compact
34
+ end
33
35
  end
34
36
 
35
37
  private
@@ -1,2 +1,2 @@
1
- <%= form.password_field :password, password_field_options_for(current_user).merge(value: form.object.password) %>
2
- <%= form.password_field :password_confirmation, password_field_options_for(current_user).except(:help_text).merge(value: form.object.password_confirmation) %>
1
+ <%= form.password_field :password, password_field_options_for(current_user) %>
2
+ <%= form.password_field :password_confirmation, password_field_options_for(current_user).except(:help_text) %>
@@ -1,7 +1,7 @@
1
1
  <% add_decidim_page_title(t("my_data", scope: "layouts.decidim.user_profile")) %>
2
2
  <% content_for(:subtitle) { t("my_data", scope: "layouts.decidim.user_profile") } %>
3
3
 
4
- <div class="row download-your-data">
4
+ <div class="download-your-data">
5
5
  <strong><%= t(".download_data") %></strong>
6
6
  <p><%= t(".download_data_description", user_email: current_user.email).html_safe %></p>
7
7
  <%= button_to t(".request_data"), export_download_your_data_path, class: "button", data: { disable: true } %>
@@ -1,87 +1,85 @@
1
1
  <% add_decidim_page_title(t("notifications_settings", scope: "layouts.decidim.user_profile")) %>
2
2
  <% content_for(:subtitle) { t("notifications_settings", scope: "layouts.decidim.user_profile") } %>
3
3
 
4
- <div class="row mb-m">
5
- <%= form_for(@notifications_settings, url: notifications_settings_path, method: :put, class: "user-form") do |f| %>
6
- <p><strong><%= t(".receive_notifications_about") %></strong></p>
7
- <div class="switch tiny switch-with-label notifications_from_own_activity">
8
- <%= f.label :notifications_from_own_activity do %>
9
- <%= f.check_box :notifications_from_own_activity, label: false, class: "switch-input" %>
10
- <span class="switch-paddle"></span>
11
- <span class="switch-label"><%= t(".own_activity") %></span>
12
- <% end %>
13
- </div>
14
- <div class="switch tiny switch-with-label notifications_from_followed">
15
- <%= f.label :notifications_from_followed do %>
16
- <%= f.check_box :notifications_from_followed, label: false, class: "switch-input" %>
17
- <span class="switch-paddle"></span>
18
- <span class="switch-label"><%= t(".everything_followed") %></span>
19
- <% end %>
20
- </div>
4
+ <%= form_for(@notifications_settings, url: notifications_settings_path, method: :put, class: "user-form") do |f| %>
5
+ <p><strong><%= t(".receive_notifications_about") %></strong></p>
6
+ <div class="switch tiny switch-with-label notifications_from_own_activity">
7
+ <%= f.label :notifications_from_own_activity do %>
8
+ <%= f.check_box :notifications_from_own_activity, label: false, class: "switch-input" %>
9
+ <span class="switch-paddle"></span>
10
+ <span class="switch-label"><%= t(".own_activity") %></span>
11
+ <% end %>
12
+ </div>
13
+ <div class="switch tiny switch-with-label notifications_from_followed">
14
+ <%= f.label :notifications_from_followed do %>
15
+ <%= f.check_box :notifications_from_followed, label: false, class: "switch-input" %>
16
+ <span class="switch-paddle"></span>
17
+ <span class="switch-label"><%= t(".everything_followed") %></span>
18
+ <% end %>
19
+ </div>
21
20
 
22
- <p><strong><%= t(".notifications_sending_frequency") %></strong></p>
23
- <%= f.collection_radio_buttons :notifications_sending_frequency, frequencies_collection, :first, :last, { checked: @notifications_settings.notifications_sending_frequency || "daily" } %>
21
+ <p><strong><%= t(".notifications_sending_frequency") %></strong></p>
22
+ <%= f.collection_radio_buttons :notifications_sending_frequency, frequencies_collection, :first, :last, { checked: @notifications_settings.notifications_sending_frequency || "daily" } %>
24
23
 
25
- <p><strong><%= t(".newsletters") %></strong></p>
26
- <div class="switch tiny switch-with-label newsletter_notifications">
27
- <label>
28
- <%= f.check_box :newsletter_notifications, label: false, class: "switch-input" %>
29
- <span class="switch-paddle"></span>
30
- <span class="switch-label"><%= t(".newsletter_notifications") %></span>
31
- </label>
32
- </div>
24
+ <p><strong><%= t(".newsletters") %></strong></p>
25
+ <div class="switch tiny switch-with-label newsletter_notifications">
26
+ <label>
27
+ <%= f.check_box :newsletter_notifications, label: false, class: "switch-input" %>
28
+ <span class="switch-paddle"></span>
29
+ <span class="switch-label"><%= t(".newsletter_notifications") %></span>
30
+ </label>
31
+ </div>
32
+
33
+ <p><strong><%= t(".direct_messages") %></strong></p>
34
+ <div class="switch tiny switch-with-label allow_public_contact">
35
+ <label>
36
+ <%= f.check_box :allow_public_contact, label: false, class: "switch-input" %>
37
+ <span class="switch-paddle"></span>
38
+ <span class="switch-label"><%= t(".allow_public_contact") %></span>
39
+ </label>
40
+ </div>
33
41
 
34
- <p><strong><%= t(".direct_messages") %></strong></p>
35
- <div class="switch tiny switch-with-label allow_public_contact">
42
+ <% if @notifications_settings.user_is_moderator?(current_user) %>
43
+ <p><strong><%= t(".administrators") %></strong></p>
44
+ <div class="switch tiny switch-with-label email_on_moderations">
36
45
  <label>
37
- <%= f.check_box :allow_public_contact, label: false, class: "switch-input" %>
46
+ <%= f.check_box :email_on_moderations, label: false, class: "switch-input" %>
38
47
  <span class="switch-paddle"></span>
39
- <span class="switch-label"><%= t(".allow_public_contact") %></span>
48
+ <span class="switch-label"><%= t(".email_on_moderations") %></span>
40
49
  </label>
41
50
  </div>
42
51
 
43
- <% if @notifications_settings.user_is_moderator?(current_user) %>
44
- <p><strong><%= t(".administrators") %></strong></p>
45
- <div class="switch tiny switch-with-label email_on_moderations">
52
+ <% Decidim.notification_settings_registry.manifests.filter{ |a| a.settings_area == :administrators }.each do |manifest| %>
53
+ <div class="switch tiny switch-with-label notification_settings">
46
54
  <label>
47
- <%= f.check_box :email_on_moderations, label: false, class: "switch-input" %>
55
+ <%= f.check_box "notification_settings[#{manifest.name}]",
56
+ checked: ["1", true].include?(current_user.notification_settings.fetch(manifest.name.to_s, manifest.default_value)),
57
+ label: false,
58
+ class: "switch-input" %>
48
59
  <span class="switch-paddle"></span>
49
- <span class="switch-label"><%= t(".email_on_moderations") %></span>
60
+ <span class="switch-label"><%= t(".notification_settings.#{manifest.name}") %></span>
50
61
  </label>
51
62
  </div>
52
-
53
- <% Decidim.notification_settings_registry.manifests.filter{ |a| a.settings_area == :administrators }.each do |manifest| %>
54
- <div class="switch tiny switch-with-label notification_settings">
55
- <label>
56
- <%= f.check_box "notification_settings[#{manifest.name}]",
57
- checked: ["1", true].include?(current_user.notification_settings.fetch(manifest.name.to_s, manifest.default_value)),
58
- label: false,
59
- class: "switch-input" %>
60
- <span class="switch-paddle"></span>
61
- <span class="switch-label"><%= t(".notification_settings.#{manifest.name}") %></span>
62
- </label>
63
- </div>
64
- <% end %>
65
-
66
63
  <% end %>
67
64
 
68
- <% if @notifications_settings.meet_push_notifications_requirements? %>
69
- <div class="push-notifications js-sw-mandatory">
70
- <p><strong><%= t(".push_notifications") %></strong></p>
71
- <p id="push-notifications-reminder" class="push-notifications__reminder"><i><%= t(".push_notifications_reminder") %></i></p>
72
- <div class="switch tiny switch-with-label allow_push_notifications">
73
- <label>
74
- <%= check_box_tag :allow_push_notifications, 0, false, class: "switch-input" %>
75
- <span class="switch-paddle"></span>
76
- <span class="switch-label"><%= t(".allow_push_notifications") %></span>
77
- </label>
78
- </div>
79
- </div>
65
+ <% end %>
80
66
 
81
- <input id="vapidPublicKey" name="vapid_public_key" type="hidden" value="<%= Base64.urlsafe_decode64(Rails.application.secrets.vapid[:public_key]).bytes %>">
82
- <input id="subKeys" name="sub_key" type="hidden" value="<%= current_user.notifications_subscriptions.keys %>">
83
- <% end %>
67
+ <% if @notifications_settings.meet_push_notifications_requirements? %>
68
+ <div class="push-notifications js-sw-mandatory">
69
+ <p><strong><%= t(".push_notifications") %></strong></p>
70
+ <p id="push-notifications-reminder" class="push-notifications__reminder"><i><%= t(".push_notifications_reminder") %></i></p>
71
+ <div class="switch tiny switch-with-label allow_push_notifications">
72
+ <label>
73
+ <%= check_box_tag :allow_push_notifications, 0, false, class: "switch-input" %>
74
+ <span class="switch-paddle"></span>
75
+ <span class="switch-label"><%= t(".allow_push_notifications") %></span>
76
+ </label>
77
+ </div>
78
+ </div>
84
79
 
85
- <%= f.submit t(".update_notifications_settings") %>
80
+ <input id="vapidPublicKey" name="vapid_public_key" type="hidden" value="<%= Base64.urlsafe_decode64(Rails.application.secrets.vapid[:public_key]).bytes %>">
81
+ <input id="subKeys" name="sub_key" type="hidden" value="<%= current_user.notifications_subscriptions.keys %>">
86
82
  <% end %>
87
- </div>
83
+
84
+ <%= f.submit t(".update_notifications_settings") %>
85
+ <% end %>
@@ -10,7 +10,7 @@
10
10
 
11
11
  <div class="columns small-12">
12
12
  <div class="card">
13
- <div class="card__content"><%= decidim_sanitize_editor translated_attribute page.content %></div>
13
+ <div class="card__content"><%= decidim_sanitize_editor_admin translated_attribute page.content %></div>
14
14
  </div>
15
15
  </div>
16
16
 
@@ -32,7 +32,7 @@
32
32
  <h2>
33
33
  <%= translated_attribute page.title %>
34
34
  </h2>
35
- <%= decidim_sanitize_editor translated_attribute page.content %>
35
+ <%= decidim_sanitize_editor_admin translated_attribute page.content %>
36
36
  </div>
37
37
  </div>
38
38
  </div>
@@ -1,17 +1,15 @@
1
1
  <% add_decidim_page_title(t("my_interests", scope: "layouts.decidim.user_profile")) %>
2
2
  <% content_for(:subtitle) { t("my_interests", scope: "layouts.decidim.user_profile") } %>
3
3
 
4
- <div class="row">
5
- <p><%= t(".select_your_interests") %></p>
6
- <%= form_for(@user_interests, url: user_interests_path, method: :put, class: "user-form") do |f| %>
7
- <p><strong><%= t(".my_interests") %></strong></p>
8
- <% if @user_interests.scopes.any? %>
9
- <div class="clearfix m-bottom">
10
- <%= render partial: "scopes", locals: { scopes: @user_interests.scopes, f: f } %>
11
- </div>
12
- <%= f.submit t(".update_my_interests") %>
13
- <% else %>
14
- <p><%= t(".no_scopes") %></p>
15
- <% end %>
4
+ <p><%= t(".select_your_interests") %></p>
5
+ <%= form_for(@user_interests, url: user_interests_path, method: :put, class: "user-form") do |f| %>
6
+ <p><strong><%= t(".my_interests") %></strong></p>
7
+ <% if @user_interests.scopes.any? %>
8
+ <div class="clearfix m-bottom">
9
+ <%= render partial: "scopes", locals: { scopes: @user_interests.scopes, f: f } %>
10
+ </div>
11
+ <%= f.submit t(".update_my_interests") %>
12
+ <% else %>
13
+ <p><%= t(".no_scopes") %></p>
16
14
  <% end %>
17
- </div>
15
+ <% end %>
@@ -23,6 +23,6 @@
23
23
  <%= render partial: "decidim/shared/login_modal" unless current_user %>
24
24
  <%= render partial: "decidim/shared/authorization_modal" %>
25
25
  <%= render partial: "layouts/decidim/decidim_javascript" %>
26
- <%= render partial: "layouts/decidim/cookie_warning" %>
26
+ <%= render partial: "layouts/decidim/data_consent_warning" %>
27
27
  </body>
28
28
  </html>
@@ -0,0 +1,8 @@
1
+ <div class="dataconsent-warning flex-center padding-1 hide">
2
+ <p>
3
+ <%= t("layouts.decidim.data_consent.warning.consent_required", categories: t("layouts.decidim.data_consent.warning.all_categories")) %>
4
+ </p>
5
+ <a href="#" class="button margin-vertical-2" data-open="dc-modal">
6
+ <%= t("change_settings", scope: "layouts.decidim.data_consent.warning") %>
7
+ </a>
8
+ </div>
@@ -22,7 +22,7 @@
22
22
  <% end %>
23
23
  <% end %>
24
24
  <li><%= link_to t("layouts.decidim.footer.download_open_data"), decidim.open_data_download_path %></li>
25
- <li><a href="#" data-open="cc-modal"><%= t("layouts.decidim.footer.cookie_settings") %></a></li>
25
+ <li><a href="#" data-open="dc-modal"><%= t("layouts.decidim.footer.data_consent_settings") %></a></li>
26
26
  </ul>
27
27
  </nav>
28
28
  </div>
@@ -1,2 +1 @@
1
- ---
2
1
  am:
@@ -824,12 +824,10 @@ ar:
824
824
  title: المحادثات
825
825
  reply:
826
826
  send: إرسال
827
- title: رد
828
827
  show:
829
828
  title: المحادثة مع %{usernames}
830
829
  start:
831
830
  send: إرسال
832
- title: بدء محادثة
833
831
  metrics:
834
832
  followers:
835
833
  description: عدد المشاركين الذين يتبعون مساحة المشاركة هذه
@@ -1216,15 +1214,6 @@ ar:
1216
1214
  updated_not_active: كلمة السر الخاصة بك تم تغييرها بنجاح.
1217
1215
  registrations:
1218
1216
  destroyed: تم إلغاء حسابك بنجاح. نحن نأمل ان نراك قريبا مره اخرى.
1219
- edit:
1220
- are_you_sure: هل أنت واثق؟
1221
- cancel_my_account: الغاء حسابي
1222
- currently_waiting_confirmation_for_email: 'حاليا في انتظار تأكيد ل: %{email}'
1223
- leave_blank_if_you_don_t_want_to_change_it: اتركه فارغا إذا كنت لا تريد تغييره
1224
- title: تحرير %{resource}
1225
- unhappy: تعيس؟
1226
- update: تحديث
1227
- we_need_your_current_password_to_confirm_your_changes: نحتاج كلمة المرور الحالية لتأكيد تغييراتك
1228
1217
  new:
1229
1218
  sign_up: انشئ حسابًا
1230
1219
  signed_up: أهلا بك! لقد اشتركت بنجاح
@@ -845,7 +845,7 @@ bg:
845
845
  title: Разговор с %{usernames}
846
846
  start:
847
847
  send: Изпрати
848
- title: Започнете разговор
848
+ title: Започни разговор
849
849
  metrics:
850
850
  followers:
851
851
  description: Брой участници, които следват това пространство
@@ -1280,15 +1280,6 @@ bg:
1280
1280
  updated_not_active: Паролата Ви беше променена успешно.
1281
1281
  registrations:
1282
1282
  destroyed: Вашият акаунт беше успешно отказан. Надяваме се скоро да се видим отново.
1283
- edit:
1284
- are_you_sure: Сигурни ли сте?
1285
- cancel_my_account: Откажи профила ми
1286
- currently_waiting_confirmation_for_email: 'В момента се чака потвърждение за: %{email}'
1287
- leave_blank_if_you_don_t_want_to_change_it: оставете празно, ако не желаете промяна
1288
- title: Редактирай %{resource}
1289
- unhappy: Недоволни?
1290
- update: Обновяване
1291
- we_need_your_current_password_to_confirm_your_changes: имаме нужда от текущата Ви парола, за да потвърдим Вашите промени
1292
1283
  new:
1293
1284
  sign_up: Регистрация
1294
1285
  signed_up: Добре дошли! Регистрирахте се успешно.