decidim-core 0.31.5 → 0.31.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/amendable/amend_button_card/show.erb +2 -2
  3. data/app/cells/decidim/author_cell.rb +0 -4
  4. data/app/cells/decidim/card_metadata_cell.rb +1 -1
  5. data/app/cells/decidim/comments_button_cell.rb +9 -1
  6. data/app/cells/decidim/content_blocks/cta_settings_form/show.erb +1 -1
  7. data/app/cells/decidim/content_blocks/hero_settings_form/show.erb +2 -2
  8. data/app/cells/decidim/content_blocks/highlighted_content_banner_cell.rb +1 -1
  9. data/app/cells/decidim/content_blocks/highlighted_content_banner_settings_form/show.erb +1 -1
  10. data/app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb +1 -1
  11. data/app/cells/decidim/content_blocks/participatory_space_hero_settings_form/show.erb +1 -1
  12. data/app/cells/decidim/content_blocks/static_page/section_settings_form/show.erb +3 -1
  13. data/app/cells/decidim/content_blocks/static_page/summary_settings_form/show.erb +3 -1
  14. data/app/cells/decidim/content_blocks/static_page/two_pane_section_settings_form/show.erb +4 -2
  15. data/app/cells/decidim/data_consent/category.erb +20 -33
  16. data/app/cells/decidim/footer_topics/show.erb +5 -8
  17. data/app/cells/decidim/participatory_space_dropdown_metadata/links.erb +1 -1
  18. data/app/cells/decidim/resource_types_filter/show.erb +2 -2
  19. data/app/cells/decidim/share_widget/qr_code_modal.erb +1 -1
  20. data/app/commands/decidim/destroy_account.rb +12 -1
  21. data/app/commands/decidim/multiple_attachments_methods.rb +28 -27
  22. data/app/controllers/concerns/decidim/devise_controllers.rb +10 -0
  23. data/app/events/decidim/amendable/amendment_base_event.rb +7 -1
  24. data/app/helpers/decidim/menu_helper.rb +0 -2
  25. data/app/jobs/decidim/process_inactive_participant_job.rb +0 -7
  26. data/app/mailers/decidim/delete_user_mailer.rb +14 -0
  27. data/app/mailers/decidim/participants_account_mailer.rb +0 -16
  28. data/app/models/decidim/moderation.rb +1 -1
  29. data/app/models/decidim/participatory_space_private_user.rb +1 -1
  30. data/app/models/decidim/user.rb +2 -2
  31. data/app/models/decidim/user_base_entity.rb +17 -2
  32. data/app/models/decidim/user_moderation.rb +1 -1
  33. data/app/packs/src/decidim/controllers/accordion/accordion.test.js +196 -42
  34. data/app/packs/src/decidim/controllers/accordion/controller.js +93 -17
  35. data/app/packs/src/decidim/controllers/dropdown/controller.js +6 -0
  36. data/app/packs/src/decidim/controllers/dropdown/dropdown.test.js +28 -0
  37. data/app/packs/src/decidim/controllers/form_validator/form_validator.js +6 -6
  38. data/app/packs/src/decidim/controllers/form_validator/form_validator.test.js +23 -1
  39. data/app/packs/src/decidim/controllers/mention/controller.js +296 -140
  40. data/app/packs/src/decidim/controllers/mention/input_mentions.test.js +120 -457
  41. data/app/packs/src/decidim/controllers/multiple_mentions/controller.js +68 -32
  42. data/app/packs/src/decidim/controllers/multiple_mentions/input_multiple_mentions.test.js +30 -23
  43. data/app/packs/src/decidim/controllers/password_toggler/controller.js +22 -1
  44. data/app/packs/src/decidim/controllers/password_toggler/password_toggler.test.js +11 -20
  45. data/app/packs/src/decidim/direct_uploads/upload_field.js +4 -4
  46. data/app/packs/src/decidim/direct_uploads/upload_modal.js +12 -7
  47. data/app/packs/src/decidim/geocoding/reverse_geocoding.js +15 -5
  48. data/app/packs/src/decidim/geocoding/reverse_geocoding.test.js +197 -0
  49. data/app/packs/src/decidim/index.js +4 -3
  50. data/app/packs/src/decidim/map/controller.js +10 -1
  51. data/app/packs/src/decidim/refactor/moved/focus_guard.js +12 -12
  52. data/app/packs/src/decidim/refactor/moved/focus_guard.test.js +136 -0
  53. data/app/packs/src/decidim/sw/sw.js +1 -1
  54. data/app/packs/src/decidim/utilities/text.js +6 -6
  55. data/app/packs/stylesheets/decidim/_cards.scss +1 -1
  56. data/app/packs/stylesheets/decidim/_conversations.scss +14 -0
  57. data/app/packs/stylesheets/decidim/_cookies.scss +13 -5
  58. data/app/packs/stylesheets/decidim/_documents.scss +1 -1
  59. data/app/packs/stylesheets/decidim/_editor_suggestions.scss +49 -0
  60. data/app/packs/stylesheets/decidim/_floating_help.scss +1 -1
  61. data/app/packs/stylesheets/decidim/_footer.scss +33 -1
  62. data/app/packs/stylesheets/decidim/_participatory_spaces.scss +1 -1
  63. data/app/packs/stylesheets/decidim/_tom_select.scss +23 -0
  64. data/app/packs/stylesheets/decidim/application.scss +2 -0
  65. data/app/packs/stylesheets/decidim/editor.scss +2 -33
  66. data/app/packs/stylesheets/decidim/geocoding_addons.scss +10 -2
  67. data/app/presenters/decidim/footer_menu_presenter.rb +2 -4
  68. data/app/presenters/decidim/menu_item_presenter.rb +9 -3
  69. data/app/presenters/decidim/stats_presenter.rb +1 -1
  70. data/app/resolvers/decidim/meta_image_url_resolver.rb +7 -0
  71. data/app/uploaders/decidim/image_uploader.rb +1 -1
  72. data/app/views/decidim/delete_user_mailer/delete.html.erb +6 -0
  73. data/app/views/decidim/gamification/badges/index.html.erb +1 -1
  74. data/app/views/decidim/homepage/show.html.erb +1 -1
  75. data/app/views/decidim/last_activities/index.html.erb +1 -1
  76. data/app/views/decidim/messaging/conversations/_error_modal.html.erb +11 -19
  77. data/app/views/decidim/messaging/conversations/error.js.erb +12 -7
  78. data/app/views/decidim/newsletters/unsubscribe.html.erb +1 -1
  79. data/app/views/decidim/offline/show.html.erb +1 -1
  80. data/app/views/decidim/pages/index.html.erb +1 -1
  81. data/app/views/decidim/profiles/show.html.erb +1 -1
  82. data/app/views/decidim/searches/_filters.html.erb +1 -1
  83. data/app/views/decidim/shared/_resource_actions.html.erb +4 -4
  84. data/app/views/decidim/user_activities/index.html.erb +1 -1
  85. data/app/views/layouts/decidim/_wrapper.html.erb +2 -2
  86. data/app/views/layouts/decidim/footer/_main.html.erb +1 -1
  87. data/app/views/layouts/decidim/footer/_main_links.html.erb +56 -28
  88. data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +1 -1
  89. data/app/views/layouts/decidim/shared/_layout_center.html.erb +1 -1
  90. data/app/views/layouts/decidim/shared/_layout_item.html.erb +1 -1
  91. data/app/views/layouts/decidim/shared/_layout_two_col.html.erb +1 -1
  92. data/config/locales/ar.yml +0 -25
  93. data/config/locales/bg.yml +0 -25
  94. data/config/locales/ca-IT.yml +37 -33
  95. data/config/locales/ca.yml +37 -33
  96. data/config/locales/cs.yml +12 -31
  97. data/config/locales/de.yml +5 -42
  98. data/config/locales/el.yml +0 -22
  99. data/config/locales/en.yml +36 -32
  100. data/config/locales/es-MX.yml +36 -32
  101. data/config/locales/es-PY.yml +36 -32
  102. data/config/locales/es.yml +36 -32
  103. data/config/locales/eu.yml +72 -70
  104. data/config/locales/fi-plain.yml +37 -32
  105. data/config/locales/fi.yml +37 -32
  106. data/config/locales/fr-CA.yml +16 -28
  107. data/config/locales/fr.yml +16 -28
  108. data/config/locales/gl.yml +0 -22
  109. data/config/locales/hu.yml +0 -22
  110. data/config/locales/id-ID.yml +0 -21
  111. data/config/locales/is-IS.yml +0 -6
  112. data/config/locales/it.yml +1 -20
  113. data/config/locales/ja.yml +52 -44
  114. data/config/locales/lb.yml +0 -23
  115. data/config/locales/lt.yml +0 -24
  116. data/config/locales/lv.yml +0 -21
  117. data/config/locales/nl.yml +0 -23
  118. data/config/locales/no.yml +0 -23
  119. data/config/locales/pl.yml +4 -27
  120. data/config/locales/pt-BR.yml +2 -40
  121. data/config/locales/pt.yml +0 -23
  122. data/config/locales/ro-RO.yml +1 -32
  123. data/config/locales/ru.yml +0 -8
  124. data/config/locales/sk.yml +1 -39
  125. data/config/locales/sv.yml +6 -36
  126. data/config/locales/tr-TR.yml +0 -24
  127. data/config/locales/uk.yml +0 -6
  128. data/config/locales/zh-CN.yml +0 -21
  129. data/config/locales/zh-TW.yml +0 -24
  130. data/db/migrate/20250217192438_convert_user_groups_into_users.rb +3 -2
  131. data/decidim-core.gemspec +3 -0
  132. data/lib/decidim/api/functions/user_entity_list.rb +2 -0
  133. data/lib/decidim/attachment_attributes.rb +58 -9
  134. data/lib/decidim/command.rb +1 -1
  135. data/lib/decidim/content_renderers/base_renderer.rb +112 -0
  136. data/lib/decidim/content_renderers/blob_renderer.rb +4 -7
  137. data/lib/decidim/content_renderers/mention_resource_renderer.rb +10 -6
  138. data/lib/decidim/content_renderers/resource_renderer.rb +16 -7
  139. data/lib/decidim/content_renderers/user_renderer.rb +11 -9
  140. data/lib/decidim/core/content_blocks/registry_manager.rb +4 -4
  141. data/lib/decidim/core/engine.rb +8 -0
  142. data/lib/decidim/core/test/factories.rb +3 -0
  143. data/lib/decidim/core/test/shared_examples/admin_resource_gallery_examples.rb +10 -10
  144. data/lib/decidim/core/test/shared_examples/amendable/amendment_event_examples.rb +2 -2
  145. data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +3 -3
  146. data/lib/decidim/core/test/shared_examples/comments_examples.rb +32 -6
  147. data/lib/decidim/core/test/shared_examples/has_space_in_mcell_examples.rb +2 -1
  148. data/lib/decidim/core/test/shared_examples/resource_liked_event_examples.rb +3 -3
  149. data/lib/decidim/core/version.rb +1 -1
  150. data/lib/decidim/core.rb +1 -1
  151. data/lib/decidim/map/autocomplete.rb +4 -3
  152. data/lib/decidim/map/dynamic_map.rb +3 -1
  153. data/lib/decidim/searchable.rb +5 -0
  154. data/lib/decidim/view_model.rb +1 -1
  155. data/lib/tasks/decidim_mailers_tasks.rake +31 -9
  156. metadata +32 -10
  157. data/app/commands/decidim/gallery_methods.rb +0 -107
  158. data/app/packs/src/decidim/vendor/tribute.js +0 -1890
  159. data/app/packs/stylesheets/decidim/_tribute.scss +0 -36
  160. data/app/views/decidim/participants_account_mailer/removal_notification.html.erb +0 -11
@@ -30,7 +30,7 @@ shared_examples_for "resource liked event" do
30
30
 
31
31
  describe "email_subject" do
32
32
  it "is generated correctly" do
33
- expect(subject.email_subject).to eq("#{author_presenter.nickname} has performed a new like")
33
+ expect(subject.email_subject).to eq("#{author_presenter.name} has performed a new like")
34
34
  end
35
35
  end
36
36
 
@@ -38,7 +38,7 @@ shared_examples_for "resource liked event" do
38
38
  let(:resource_title) { decidim_sanitize_translated(resource.title) }
39
39
  it "is generated correctly" do
40
40
  expect(subject.email_intro)
41
- .to eq("#{author.name} #{author_presenter.nickname}, who you are following, " \
41
+ .to eq("#{author.name}, who you are following, " \
42
42
  "has just liked \"#{resource_title}\" and we think it may be interesting to you. Check it out and contribute:")
43
43
  end
44
44
  end
@@ -51,7 +51,7 @@ shared_examples_for "resource liked event" do
51
51
  .to include("The <a href=\"#{resource_path}\">#{resource_title}</a> #{resource_type} has been liked by ")
52
52
 
53
53
  expect(subject.notification_title)
54
- .to include("<a href=\"/profiles/#{author.nickname}\">#{author.name} #{author_presenter.nickname}</a>.")
54
+ .to include("<a href=\"/profiles/#{author.nickname}\">#{author.name}</a>.")
55
55
  end
56
56
  end
57
57
 
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-core version.
5
5
  module Core
6
6
  def self.version
7
- "0.31.5"
7
+ "0.31.7"
8
8
  end
9
9
  end
10
10
  end
data/lib/decidim/core.rb CHANGED
@@ -295,7 +295,7 @@ module Decidim
295
295
 
296
296
  # Users that have not logged in for this period of time will be deleted
297
297
  config_accessor :delete_inactive_users_after_days do
298
- Decidim::Env.new("DELETE_INACTIVE_USERS_AFTER_DAYS", 365).to_i
298
+ Decidim::Env.new("DECIDIM_DELETE_INACTIVE_USERS_AFTER_DAYS", 365).to_i
299
299
  end
300
300
 
301
301
  # The minimum allowed inactivity period for deleting participants.
@@ -37,19 +37,20 @@ module Decidim
37
37
  template.snippets.add(:decidim_geocoding_scripts, template.append_javascript_pack_tag("decidim_geocoding"))
38
38
  template.snippets.add(:decidim_geocoding_styles, template.append_stylesheet_pack_tag("decidim_geocoding"))
39
39
 
40
- template.content_tag(:div, class: "geocoding-container") do
40
+ template.content_tag(:div, class: "geocoding") do
41
41
  template.text_field(
42
42
  object_name,
43
43
  method,
44
44
  options.merge("data-decidim-geocoding" => view_options.to_json)
45
45
  ) +
46
- template.content_tag(:div, class: "input-group-button user-device-location") do
47
- template.content_tag(:button, class: "button button__sm md:button__sm button__text-secondary", type: "button", data: {
46
+ template.content_tag(:div, class: "input-group-button geocoding__locate") do
47
+ template.content_tag(:button, class: "button button__sm md:button__sm button__text-secondary geocoding__button", type: "button", data: {
48
48
  input: "#{object_name}_#{method}",
49
49
  latitude: "#{object_name}_latitude",
50
50
  longitude: "#{object_name}_longitude",
51
51
  error_no_location: I18n.t("errors.no_device_location", scope: "decidim.proposals.forms"),
52
52
  error_unsupported: I18n.t("errors.device_not_supported", scope: "decidim.proposals.forms"),
53
+ locating_text: I18n.t("locating", scope: "decidim.proposals.forms"),
53
54
  url: Decidim::Core::Engine.routes.url_helpers.locate_path
54
55
  }) do
55
56
  icon("map-pin-line", role: "img", "aria-hidden": true) + " #{I18n.t("use_my_location", scope: "decidim.proposals.forms")}"
@@ -30,7 +30,9 @@ module Decidim
30
30
  def builder_options
31
31
  {
32
32
  marker_color: organization.colors.fetch("primary", "#e02d2d"),
33
- tile_layer: tile_layer_configuration
33
+ tile_layer: tile_layer_configuration,
34
+ zoom_in_text: I18n.t("zoom_in", scope: "decidim.map.dynamic"),
35
+ zoom_out_text: I18n.t("zoom_out", scope: "decidim.map.dynamic")
34
36
  }
35
37
  end
36
38
 
@@ -117,6 +117,11 @@ module Decidim
117
117
  searchables_in_org.find_each do |sr|
118
118
  next if sr.blank?
119
119
 
120
+ unless sr.locale.in?(org.available_locales)
121
+ sr.destroy
122
+ next
123
+ end
124
+
120
125
  sr.update(contents_to_searchable_resource_attributes(fields, sr.locale))
121
126
  end
122
127
  end
@@ -79,7 +79,7 @@ module Decidim
79
79
  end
80
80
 
81
81
  def perform_caching?
82
- cache_hash.present?
82
+ super && cache_hash.present?
83
83
  end
84
84
 
85
85
  def cache_hash
@@ -4,20 +4,42 @@ namespace :decidim do
4
4
  namespace :mailers do
5
5
  desc "Sends the notification digest email with the daily report"
6
6
  task notifications_digest_daily: :environment do
7
- notifications_digest(:daily)
7
+ time = Time.now.utc
8
+ target_users = Decidim::User.where(notifications_sending_frequency: :daily)
9
+
10
+ target_users.find_in_batches do |batch|
11
+ notification_users =
12
+ Decidim::Notification
13
+ .daily(time)
14
+ .where(decidim_user_id: batch.pluck(:id))
15
+ .select(:decidim_user_id)
16
+ .distinct
17
+ .pluck(:decidim_user_id)
18
+
19
+ notification_users.each do |user_id|
20
+ Decidim::EmailNotificationsDigestGeneratorJob.perform_later(user_id, :daily, time:)
21
+ end
22
+ end
8
23
  end
9
24
 
10
25
  desc "Sends the notification digest email with the weekly report"
11
26
  task notifications_digest_weekly: :environment do
12
- notifications_digest(:weekly)
13
- end
14
- end
27
+ time = Time.now.utc
28
+ target_users = Decidim::User.where(notifications_sending_frequency: :weekly)
29
+
30
+ target_users.find_in_batches do |batch|
31
+ notification_users =
32
+ Decidim::Notification
33
+ .weekly(time)
34
+ .where(decidim_user_id: batch.pluck(:id))
35
+ .select(:decidim_user_id)
36
+ .distinct
37
+ .pluck(:decidim_user_id)
15
38
 
16
- def notifications_digest(frequency)
17
- target_users = Decidim::User.where(notifications_sending_frequency: frequency)
18
- time = Time.now.utc
19
- target_users.find_each do |user|
20
- Decidim::EmailNotificationsDigestGeneratorJob.perform_later(user.id, frequency, time:)
39
+ notification_users.each do |user_id|
40
+ Decidim::EmailNotificationsDigestGeneratorJob.perform_later(user_id, :weekly, time:)
41
+ end
42
+ end
21
43
  end
22
44
  end
23
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.5
4
+ version: 0.31.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2026-05-12 00:00:00.000000000 Z
13
+ date: 2026-07-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: concurrent-ruby
@@ -648,6 +648,26 @@ dependencies:
648
648
  - - "~>"
649
649
  - !ruby/object:Gem::Version
650
650
  version: '6.0'
651
+ - !ruby/object:Gem::Dependency
652
+ name: rack-proxy
653
+ requirement: !ruby/object:Gem::Requirement
654
+ requirements:
655
+ - - "~>"
656
+ - !ruby/object:Gem::Version
657
+ version: 0.8.3
658
+ - - "<"
659
+ - !ruby/object:Gem::Version
660
+ version: '1.0'
661
+ type: :runtime
662
+ prerelease: false
663
+ version_requirements: !ruby/object:Gem::Requirement
664
+ requirements:
665
+ - - "~>"
666
+ - !ruby/object:Gem::Version
667
+ version: 0.8.3
668
+ - - "<"
669
+ - !ruby/object:Gem::Version
670
+ version: '1.0'
651
671
  - !ruby/object:Gem::Dependency
652
672
  name: rails
653
673
  requirement: !ruby/object:Gem::Requirement
@@ -828,28 +848,28 @@ dependencies:
828
848
  requirements:
829
849
  - - '='
830
850
  - !ruby/object:Gem::Version
831
- version: 0.31.5
851
+ version: 0.31.7
832
852
  type: :development
833
853
  prerelease: false
834
854
  version_requirements: !ruby/object:Gem::Requirement
835
855
  requirements:
836
856
  - - '='
837
857
  - !ruby/object:Gem::Version
838
- version: 0.31.5
858
+ version: 0.31.7
839
859
  - !ruby/object:Gem::Dependency
840
860
  name: decidim-dev
841
861
  requirement: !ruby/object:Gem::Requirement
842
862
  requirements:
843
863
  - - '='
844
864
  - !ruby/object:Gem::Version
845
- version: 0.31.5
865
+ version: 0.31.7
846
866
  type: :development
847
867
  prerelease: false
848
868
  version_requirements: !ruby/object:Gem::Requirement
849
869
  requirements:
850
870
  - - '='
851
871
  - !ruby/object:Gem::Version
852
- version: 0.31.5
872
+ version: 0.31.7
853
873
  description: Adds core features so other engines can hook into the framework.
854
874
  email:
855
875
  - josepjaume@gmail.com
@@ -1195,7 +1215,6 @@ files:
1195
1215
  - app/commands/decidim/delete_follow.rb
1196
1216
  - app/commands/decidim/destroy_account.rb
1197
1217
  - app/commands/decidim/destroy_ephemeral_user.rb
1198
- - app/commands/decidim/gallery_methods.rb
1199
1218
  - app/commands/decidim/invite_user.rb
1200
1219
  - app/commands/decidim/invite_user_again.rb
1201
1220
  - app/commands/decidim/like_resource.rb
@@ -1430,6 +1449,7 @@ files:
1430
1449
  - app/mailers/decidim/application_mailer.rb
1431
1450
  - app/mailers/decidim/block_user_mailer.rb
1432
1451
  - app/mailers/decidim/decidim_devise_mailer.rb
1452
+ - app/mailers/decidim/delete_user_mailer.rb
1433
1453
  - app/mailers/decidim/export_mailer.rb
1434
1454
  - app/mailers/decidim/messaging/conversation_mailer.rb
1435
1455
  - app/mailers/decidim/newsletter_mailer.rb
@@ -1712,6 +1732,7 @@ files:
1712
1732
  - app/packs/src/decidim/geocoding/provider/here.js
1713
1733
  - app/packs/src/decidim/geocoding/provider/photon.js
1714
1734
  - app/packs/src/decidim/geocoding/reverse_geocoding.js
1735
+ - app/packs/src/decidim/geocoding/reverse_geocoding.test.js
1715
1736
  - app/packs/src/decidim/identity_selector_dialog.js
1716
1737
  - app/packs/src/decidim/index.js
1717
1738
  - app/packs/src/decidim/map.js
@@ -1734,6 +1755,7 @@ files:
1734
1755
  - app/packs/src/decidim/refactor/moved/check_boxes_tree.js
1735
1756
  - app/packs/src/decidim/refactor/moved/delayed.js
1736
1757
  - app/packs/src/decidim/refactor/moved/focus_guard.js
1758
+ - app/packs/src/decidim/refactor/moved/focus_guard.test.js
1737
1759
  - app/packs/src/decidim/refactor/moved/history.js
1738
1760
  - app/packs/src/decidim/refactor/moved/i18n.js
1739
1761
  - app/packs/src/decidim/refactor/moved/i18n.test.js
@@ -1754,7 +1776,6 @@ files:
1754
1776
  - app/packs/src/decidim/utilities/dom.js
1755
1777
  - app/packs/src/decidim/utilities/text.js
1756
1778
  - app/packs/src/decidim/vendor/jquery-tmpl.js
1757
- - app/packs/src/decidim/vendor/tribute.js
1758
1779
  - app/packs/stylesheets/decidim/_accordion.scss
1759
1780
  - app/packs/stylesheets/decidim/_actions.scss
1760
1781
  - app/packs/stylesheets/decidim/_activity.scss
@@ -1769,6 +1790,7 @@ files:
1769
1790
  - app/packs/stylesheets/decidim/_datepicker.scss
1770
1791
  - app/packs/stylesheets/decidim/_documents.scss
1771
1792
  - app/packs/stylesheets/decidim/_dropdown.scss
1793
+ - app/packs/stylesheets/decidim/_editor_suggestions.scss
1772
1794
  - app/packs/stylesheets/decidim/_emoji.scss
1773
1795
  - app/packs/stylesheets/decidim/_filters.scss
1774
1796
  - app/packs/stylesheets/decidim/_flash.scss
@@ -1809,9 +1831,9 @@ files:
1809
1831
  - app/packs/stylesheets/decidim/_tabs_x.scss
1810
1832
  - app/packs/stylesheets/decidim/_tags.scss
1811
1833
  - app/packs/stylesheets/decidim/_toggle_switch.scss
1834
+ - app/packs/stylesheets/decidim/_tom_select.scss
1812
1835
  - app/packs/stylesheets/decidim/_tooltip.scss
1813
1836
  - app/packs/stylesheets/decidim/_tos.scss
1814
- - app/packs/stylesheets/decidim/_tribute.scss
1815
1837
  - app/packs/stylesheets/decidim/_typography.scss
1816
1838
  - app/packs/stylesheets/decidim/_versions.scss
1817
1839
  - app/packs/stylesheets/decidim/_vertical_tabs.scss
@@ -2001,6 +2023,7 @@ files:
2001
2023
  - app/views/decidim/application/_radio_accordion.html.erb
2002
2024
  - app/views/decidim/authorization_modals/show.html.erb
2003
2025
  - app/views/decidim/block_user_mailer/notify.html.erb
2026
+ - app/views/decidim/delete_user_mailer/delete.html.erb
2004
2027
  - app/views/decidim/devise/confirmations/new.html.erb
2005
2028
  - app/views/decidim/devise/invitations/edit.html.erb
2006
2029
  - app/views/decidim/devise/omniauth_registrations/new.html.erb
@@ -2068,7 +2091,6 @@ files:
2068
2091
  - app/views/decidim/pages/index.html.erb
2069
2092
  - app/views/decidim/pages/show.html.erb
2070
2093
  - app/views/decidim/participants_account_mailer/inactivity_notification.html.erb
2071
- - app/views/decidim/participants_account_mailer/removal_notification.html.erb
2072
2094
  - app/views/decidim/participatory_space_private_users/_participatory_space_private_user.html.erb
2073
2095
  - app/views/decidim/profiles/show.html.erb
2074
2096
  - app/views/decidim/qr/show.html.erb
@@ -1,107 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- # A module with all the gallery common methods
5
- # Allows to create several image attachments at once
6
- module GalleryMethods
7
- private
8
-
9
- def build_gallery(attached_to = nil)
10
- @gallery = []
11
- @form.add_photos.compact_blank.each do |photo|
12
- if photo.is_a?(Hash) && photo.has_key?(:id)
13
- update_attachment_title_for(photo)
14
- next
15
- end
16
-
17
- @gallery << Attachment.new(
18
- title: photos_title(photo),
19
- attached_to: attached_to || gallery_attached_to,
20
- file: photos_signed_id(photo), # Define attached_to before this
21
- content_type: photos_content_type(photo)
22
- )
23
- end
24
- end
25
-
26
- def update_attachment_title_for(photo)
27
- Decidim::Attachment.find(photo[:id]).update(title: photos_title(photo))
28
- end
29
-
30
- def image?(signed_id)
31
- blob(signed_id).content_type.start_with? "image"
32
- end
33
-
34
- def gallery_invalid?
35
- @gallery.each do |photo|
36
- if photo.invalid? && photo.errors.has_key?(:file)
37
- @form.errors.add(:add_photos, photo.errors[:file])
38
- return true
39
- end
40
- end
41
- false
42
- end
43
-
44
- def create_gallery(first_weight: 0)
45
- weight = first_weight
46
- # Add the weights first to the old photos
47
- @form.photos.each do |photo|
48
- photo.update!(weight:)
49
- weight += 1
50
- end
51
- @gallery.map! do |photo|
52
- photo.weight = weight
53
- photo.attached_to = gallery_attached_to
54
- photo.save!
55
- weight += 1
56
- @form.photos << photo
57
- end
58
- end
59
-
60
- def photo_cleanup!
61
- gallery_attached_to.photos.each do |photo|
62
- next unless @form.photos.map(&:id).exclude?(photo.id)
63
-
64
- photo.destroy! if (@form.respond_to?(:documents) && @form.documents.map(&:id).exclude?(photo.id)) || !@form.respond_to?(:documents)
65
- end
66
- # manually reset cached photos
67
- gallery_attached_to.reload
68
- gallery_attached_to.instance_variable_set(:@photos, nil)
69
- end
70
-
71
- # maybe a custom settings options would be nice
72
- def gallery_allowed?
73
- true
74
- end
75
-
76
- def process_gallery?
77
- gallery_allowed? && @form.add_photos.any?
78
- end
79
-
80
- def gallery_attached_to
81
- return @attached_to if @attached_to.present?
82
- return form.current_organization if form.respond_to?(:current_organization)
83
-
84
- form.current_component.organization if form.respond_to?(:current_component)
85
- end
86
-
87
- def photos_signed_id(photo)
88
- return photo[:file] if photo.is_a?(Hash)
89
-
90
- photo
91
- end
92
-
93
- def photos_title(photo)
94
- return { I18n.locale => photo[:title] } if photo.is_a?(Hash) && photo.has_key?(:title)
95
-
96
- { I18n.locale => "" }
97
- end
98
-
99
- def photos_content_type(photo)
100
- blob(photos_signed_id(photo)).content_type
101
- end
102
-
103
- def blob(signed_id)
104
- ActiveStorage::Blob.find_signed(signed_id)
105
- end
106
- end
107
- end