decidim-core 0.30.0.rc1 → 0.30.0.rc3

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 (104) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/amendable/amendments/show.erb +1 -1
  3. data/app/cells/decidim/profile_actions/show.erb +1 -1
  4. data/app/cells/decidim/report_button/already_reported_modal.erb +2 -2
  5. data/app/cells/decidim/report_button/flag_modal.erb +13 -27
  6. data/app/cells/decidim/report_button_cell.rb +2 -8
  7. data/app/cells/decidim/report_user_button/already_reported_modal.erb +11 -0
  8. data/app/cells/decidim/report_user_button/flag_modal.erb +46 -0
  9. data/app/cells/decidim/report_user_button/show.erb +2 -0
  10. data/app/cells/decidim/report_user_button_cell.rb +59 -0
  11. data/app/cells/decidim/resource_types_filter/show.erb +1 -1
  12. data/app/cells/decidim/resource_types_filter_cell.rb +6 -6
  13. data/app/cells/decidim/user_activity/show.erb +1 -1
  14. data/app/commands/decidim/create_omniauth_registration.rb +14 -8
  15. data/app/controllers/decidim/profiles_controller.rb +2 -2
  16. data/app/controllers/decidim/user_activities_controller.rb +1 -1
  17. data/app/forms/decidim/account_form.rb +2 -2
  18. data/app/helpers/decidim/orders_helper.rb +2 -1
  19. data/app/helpers/decidim/participatory_space_helpers.rb +1 -1
  20. data/app/jobs/decidim/hide_child_resources_job.rb +24 -0
  21. data/app/jobs/decidim/migrate/paper_trail_job.rb +33 -0
  22. data/app/models/decidim/report.rb +1 -1
  23. data/app/models/decidim/user.rb +0 -4
  24. data/app/models/decidim/user_base_entity.rb +4 -0
  25. data/app/packs/src/decidim/map/provider/here.js +1 -1
  26. data/app/packs/src/decidim/sticky_footer.js +19 -0
  27. data/app/packs/stylesheets/decidim/_cards.scss +4 -0
  28. data/app/packs/stylesheets/decidim/_content_blocks.scss +1 -1
  29. data/app/packs/stylesheets/decidim/_hashtags.scss +5 -0
  30. data/app/packs/stylesheets/decidim/_login.scss +4 -0
  31. data/app/packs/stylesheets/decidim/_modal_authorization.scss +1 -1
  32. data/app/packs/stylesheets/decidim/_profile.scss +1 -1
  33. data/app/packs/stylesheets/decidim/application.scss +1 -0
  34. data/app/resolvers/decidim/meta_image_url_resolver.rb +1 -0
  35. data/app/services/decidim/static_map_generator.rb +1 -1
  36. data/app/views/decidim/devise/registrations/new.html.erb +1 -1
  37. data/app/views/decidim/devise/sessions/new.html.erb +1 -1
  38. data/app/views/decidim/devise/shared/_omniauth_buttons.html.erb +1 -1
  39. data/app/views/decidim/last_activities/index.html.erb +1 -1
  40. data/app/views/decidim/open_data/index.html.erb +1 -1
  41. data/app/views/decidim/shared/_orders.html.erb +2 -2
  42. data/config/locales/ar.yml +12 -25
  43. data/config/locales/bg.yml +8 -22
  44. data/config/locales/ca.yml +22 -34
  45. data/config/locales/cs.yml +24 -31
  46. data/config/locales/de.yml +17 -21
  47. data/config/locales/el.yml +8 -13
  48. data/config/locales/en.yml +4 -16
  49. data/config/locales/eo.yml +2 -0
  50. data/config/locales/es-MX.yml +16 -28
  51. data/config/locales/es-PY.yml +21 -33
  52. data/config/locales/es.yml +22 -34
  53. data/config/locales/eu.yml +61 -75
  54. data/config/locales/fi-plain.yml +20 -27
  55. data/config/locales/fi.yml +22 -29
  56. data/config/locales/fr-CA.yml +60 -20
  57. data/config/locales/fr.yml +60 -20
  58. data/config/locales/ga-IE.yml +2 -4
  59. data/config/locales/gl.yml +22 -13
  60. data/config/locales/hu.yml +7 -21
  61. data/config/locales/id-ID.yml +22 -13
  62. data/config/locales/is-IS.yml +10 -0
  63. data/config/locales/it.yml +22 -20
  64. data/config/locales/ja.yml +120 -21
  65. data/config/locales/lb.yml +19 -19
  66. data/config/locales/lt.yml +5 -17
  67. data/config/locales/lv.yml +16 -13
  68. data/config/locales/nl.yml +20 -17
  69. data/config/locales/no.yml +16 -16
  70. data/config/locales/pl.yml +4 -18
  71. data/config/locales/pt-BR.yml +8 -21
  72. data/config/locales/pt.yml +16 -16
  73. data/config/locales/ro-RO.yml +39 -20
  74. data/config/locales/ru.yml +23 -8
  75. data/config/locales/sk.yml +27 -16
  76. data/config/locales/sv.yml +46 -25
  77. data/config/locales/tr-TR.yml +21 -20
  78. data/config/locales/uk.yml +12 -1
  79. data/config/locales/zh-CN.yml +16 -13
  80. data/config/locales/zh-TW.yml +6 -16
  81. data/db/migrate/20240722215500_change_object_changes_on_versions.rb +4 -24
  82. data/lib/decidim/content_parsers/user_parser.rb +1 -1
  83. data/lib/decidim/core/test/shared_examples/reports_examples.rb +51 -0
  84. data/lib/decidim/core/test/shared_examples/social_share_examples.rb +21 -0
  85. data/lib/decidim/core/version.rb +1 -1
  86. data/lib/decidim/maintenance/import_models/category.rb +40 -8
  87. data/lib/decidim/maintenance/taxonomy_importer.rb +10 -0
  88. data/lib/decidim/map/provider/dynamic_map/here.rb +1 -40
  89. data/lib/decidim/map/provider/static_map/here.rb +34 -0
  90. data/lib/decidim/moderation_tools.rb +15 -2
  91. data/lib/decidim/nicknamizable.rb +1 -1
  92. data/lib/tasks/decidim_taxonomies.rake +6 -1
  93. data/lib/tasks/upgrade/clean_hidden_resources.rake +33 -0
  94. data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +23 -20
  95. data/lib/tasks/upgrade/migrations.rake +4 -1
  96. metadata +14 -14
  97. data/app/cells/decidim/author/flag.erb +0 -6
  98. data/app/cells/decidim/author/flag_user.erb +0 -14
  99. data/app/cells/decidim/flag_modal/flag_user.erb +0 -34
  100. data/app/cells/decidim/flag_modal/show.erb +0 -52
  101. data/app/cells/decidim/flag_modal_cell.rb +0 -56
  102. data/app/cells/decidim/profile_sidebar/show.erb +0 -167
  103. data/app/cells/decidim/profile_sidebar_cell.rb +0 -68
  104. data/app/packs/src/decidim/vendor/leaflet-tilelayer-here.js +0 -212
@@ -49,46 +49,7 @@ module Decidim
49
49
  private
50
50
 
51
51
  def language_code
52
- primary = I18n.locale.to_s
53
- secondary = primary.split("-")[0]
54
- available_language_codes[primary] || available_language_codes[secondary] || ""
55
- end
56
-
57
- def available_language_codes
58
- @available_language_codes ||= {
59
- "ar" => "ara", # Arabic
60
- "eu" => "baq", # Basque
61
- "ca" => "cat", # Catalan
62
- "zh" => "chi", # Chinese (simplified)
63
- # "" => "cht", # Chinese (traditional)
64
- "cs" => "cze", # Czech
65
- "da" => "dan", # Danish
66
- "nl" => "dut", # Dutch
67
- "en" => "eng", # English
68
- "fi" => "fin", # Finnish
69
- "fr" => "fre", # French
70
- "de" => "ger", # German
71
- "ga" => "gle", # Gaelic
72
- "el" => "gre", # Greek
73
- "he" => "heb", # Hebrew
74
- "hi" => "hin", # Hindi
75
- "id" => "ind", # Indonesian
76
- "it" => "ita", # Italian
77
- "no" => "nor", # Norwegian
78
- "fa" => "per", # Persian
79
- "pl" => "pol", # Polish
80
- "pt" => "por", # Portuguese
81
- "ru" => "rus", # Russian
82
- "si" => "sin", # Sinhalese
83
- "es" => "spa", # Spanish
84
- "sv" => "swe", # Swedish
85
- "th" => "tha", # Thai
86
- "tr" => "tur", # Turkish
87
- "uk" => "ukr", # Ukrainian
88
- "ur" => "urd", # Urdu
89
- "vi" => "vie", # Vietnamese
90
- "cy" => "wel" # Welsh
91
- }
52
+ I18n.locale.to_s
92
53
  end
93
54
  end
94
55
  end
@@ -6,8 +6,42 @@ module Decidim
6
6
  module StaticMap
7
7
  # The static map utility class for the HERE maps service
8
8
  class Here < ::Decidim::Map::StaticMap
9
+ def url(latitude:, longitude:, options: {})
10
+ map_url = configuration.fetch(:url, nil)
11
+ return super unless map_url
12
+
13
+ return super unless map_url.include?("mia/v3")
14
+
15
+ w = options[:width] || Decidim::Map::StaticMap::DEFAULT_SIZE
16
+ h = options[:height] || Decidim::Map::StaticMap::DEFAULT_SIZE
17
+
18
+ params = {
19
+ apiKey: configuration[:api_key],
20
+ overlay: "point:#{latitude},#{longitude};icon=cp;size=large|#{latitude},#{longitude};style=circle;width=50m;color=%231B9D2C60"
21
+ }
22
+
23
+ URI.parse("#{map_url}:radius=90/#{w}x#{h}/png8").tap do |uri|
24
+ uri.query = URI.encode_www_form(params)
25
+ end.to_s
26
+ end
27
+
9
28
  # @See Decidim::Map::StaticMap#url_params
10
29
  def url_params(latitude:, longitude:, options: {})
30
+ ActiveSupport::Deprecation.warn(
31
+ <<~DEPRECATION.strip
32
+ Please use a V3 version HERE maps.
33
+ For further information, see:
34
+ https://www.here.com/docs/bundle/map-image-migration-guide-v3/page/README.html
35
+ Also make sure your Decidim.maps configurations are using the
36
+ up to date format.
37
+ You need to change:
38
+ static_url = "https://image.maps.ls.hereapi.com/mia/1.6/mapview" if static_provider == "here" && static_url.blank?
39
+ to:
40
+ static_url = "https://image.maps.hereapi.com/mia/v3/base/mc/overlay" if static_provider == "here"
41
+ in your config/initializers/decidim.rb file.
42
+ DEPRECATION
43
+ )
44
+
11
45
  params = {
12
46
  c: "#{latitude}, #{longitude}",
13
47
  z: options[:zoom] || Decidim::Map::StaticMap::DEFAULT_ZOOM,
@@ -58,6 +58,8 @@ module Decidim
58
58
 
59
59
  # Public: Broadcasts a notification to the author of the resource that has been hidden
60
60
  def send_notification_to_author
61
+ return if affected_users.blank?
62
+
61
63
  data = {
62
64
  event: "decidim.events.reports.resource_hidden",
63
65
  event_class: Decidim::ResourceHiddenEvent,
@@ -65,13 +67,12 @@ module Decidim
65
67
  extra: {
66
68
  report_reasons:
67
69
  },
68
- affected_users: @reportable.try(:authors) || [@reportable.try(:normalized_author)]
70
+ affected_users:
69
71
  }
70
72
 
71
73
  Decidim::EventsManager.publish(**data)
72
74
  end
73
75
 
74
- # Public: hides the resource
75
76
  def hide_with_admin_log!
76
77
  Decidim.traceability.perform_action!(
77
78
  "hide",
@@ -91,10 +92,22 @@ module Decidim
91
92
  @reportable.moderation.update!(hidden_at: Time.current)
92
93
  @reportable.try(:touch)
93
94
  end
95
+
96
+ if @reportable.is_a?(Decidim::Comments::Commentable)
97
+ @reportable.comment_threads.each do |comment|
98
+ Decidim::HideChildResourcesJob.perform_later(comment, @current_user.id)
99
+ end
100
+ end
101
+
102
+ send_notification_to_author
94
103
  end
95
104
 
96
105
  private
97
106
 
107
+ def affected_users
108
+ @affected_users ||= (@reportable.try(:authors) || [@reportable.try(:normalized_author)]).select { |author| author.is_a?(Decidim::User) }
109
+ end
110
+
98
111
  def report_reasons
99
112
  @reportable.moderation.reports.pluck(:reason).uniq
100
113
  end
@@ -52,7 +52,7 @@ module Decidim
52
52
  candidate = name
53
53
 
54
54
  2.step do |n|
55
- return candidate if Decidim::UserBaseEntity.where("nickname ILIKE ?", candidate.downcase).where(scope).empty?
55
+ return candidate if Decidim::UserBaseEntity.where(nickname: candidate.downcase).where(scope).empty?
56
56
 
57
57
  candidate = numbered_variation_of(name, n)
58
58
  end
@@ -82,6 +82,7 @@ namespace :decidim do
82
82
  task :import_all_plans, [] => :environment do |_task, _args|
83
83
  Rails.root.glob("tmp/taxonomies/*_plan.json").each do |file|
84
84
  log.info "Importing plan from #{file}"
85
+ Rake::Task["decidim:taxonomies:import_plan"].reenable
85
86
  Rake::Task["decidim:taxonomies:import_plan"].invoke(file)
86
87
  end
87
88
  end
@@ -93,7 +94,10 @@ namespace :decidim do
93
94
 
94
95
  data = JSON.parse(File.read(file))
95
96
  taxonomies = data["taxonomy_map"]
96
- abort "No taxonomies found in the file" unless taxonomies && taxonomies&.any?
97
+ unless taxonomies && taxonomies&.any?
98
+ log.warn "No metric (categories) taxonomies found in the file"
99
+ next
100
+ end
97
101
 
98
102
  total = taxonomies.count
99
103
  taxonomies.each_with_index do |(id, object_id), index|
@@ -112,6 +116,7 @@ namespace :decidim do
112
116
  task :update_all_metrics, [] => :environment do |_task, _args|
113
117
  Rails.root.glob("tmp/taxonomies/*_result.json").each do |file|
114
118
  log.info "Processing metrics from #{file}"
119
+ Rake::Task["decidim:taxonomies:update_metrics"].reenable
115
120
  Rake::Task["decidim:taxonomies:update_metrics"].invoke(file)
116
121
  end
117
122
  end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :decidim do
4
+ namespace :upgrade do
5
+ namespace :clean do
6
+ desc "Removes all related resources from hidden resource"
7
+ task hidden_resources: :environment do
8
+ logger.info("Removing child resources for hidden parents...")
9
+ Decidim::Moderation.hidden.find_each do |moderation_for_hidden_resource|
10
+ reportable = moderation_for_hidden_resource.reportable
11
+
12
+ current_user = if Decidim.module_installed?(:ai)
13
+ reportable.organization.users.find_by!(email: Decidim::Ai::SpamDetection.reporting_user_email)
14
+ else
15
+ reportable.organization.admins.first
16
+ end
17
+
18
+ tool = Decidim::ModerationTools.new(reportable, current_user)
19
+ tool.hide!
20
+ rescue NameError => e
21
+ log_error "Could not hide child resources for reportable id #{moderation_for_hidden_resource.id} because: #{e.message}"
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ def log_error(msg)
28
+ puts msg
29
+ Rails.logger.error(msg)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -2,37 +2,40 @@
2
2
 
3
3
  namespace :decidim do
4
4
  namespace :upgrade do
5
- desc "Modifies nicknames with random numbers when exists similar ones case-insensitively"
6
- task fix_nickname_uniqueness: :environment do
7
- logger = Logger.new($stdout)
8
- logger.info("Updating conflicting user nicknames...")
5
+ desc "Modifies nickname of the user to lower case"
6
+ task :fix_nickname_casing => :environment do
7
+ logger.info("Fixing user nicknames case...")
9
8
 
10
- # list of users already changed in the process
11
9
  has_changed = []
12
-
13
10
  Decidim::User.not_deleted.find_each do |user|
14
- next if has_changed.include? user.id
15
-
16
- Decidim::User.where(organization: user.organization)
17
- .where("nickname ILIKE ?", user.nickname.downcase)
18
- .where.not(id: has_changed + [user.id])
19
- .not_deleted
20
- .order(:created_at)
21
- .each do |similar_user|
22
- # change her nickname to the lowercased one with numbers if needed
23
- begin
24
- update_user_nickname(similar_user, Decidim::UserBaseEntity.nicknamize(similar_user.nickname, organization: similar_user.organization))
25
- rescue ActiveRecord::RecordInvalid => e
26
- logger.warn("User ID (#{similar_user.id}) : #{e}")
11
+ user.nickname.downcase!
12
+
13
+ begin
14
+ if user.nickname_changed?
15
+ user.save!
16
+ has_changed << user.id
27
17
  end
28
- has_changed.append(similar_user.id)
18
+ rescue ActiveRecord::RecordInvalid
19
+ update_user_nickname(user, Decidim::UserBaseEntity.nicknamize(user.nickname, organization: user.organization))
20
+ has_changed << user.id
21
+ rescue ActiveRecord::RecordInvalid # rubocop:disable Lint/DuplicateRescueException
22
+ logger.warn("User ID (#{similar_user.id}) : #{e}")
29
23
  end
30
24
  end
31
25
  logger.info("Process terminated, #{has_changed.count} users nickname have been updated.")
32
26
  end
33
27
 
28
+ desc "Modifies nicknames with random numbers when exists similar ones case-insensitively"
29
+ task :fix_nickname_uniqueness => :environment do
30
+ Rake::Task["decidim:upgrade:fix_nickname_casing"].execute
31
+ end
32
+
34
33
  private
35
34
 
35
+ def logger
36
+ @logger ||= Logger.new($stdout)
37
+ end
38
+
36
39
  def send_notification_to(user)
37
40
  Decidim::EventsManager.publish(
38
41
  event: "decidim.events.nickname_event",
@@ -81,7 +81,10 @@ namespace :decidim do
81
81
 
82
82
  logger.warn("[Patch migration] Replacing content of #{File.basename(target_file)}")
83
83
 
84
- File.binwrite(target_file, new_source)
84
+ additional_comment = "# This file has been modified by `decidim upgrade:migrations` task on #{Time.now.utc}\n"
85
+ source = new_source.gsub(inserted_comment, "#{inserted_comment}#{additional_comment}")
86
+
87
+ File.binwrite(target_file, source)
85
88
  end
86
89
 
87
90
  def logger
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.30.0.rc1
4
+ version: 0.30.0.rc3
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: 2025-02-18 00:00:00.000000000 Z
13
+ date: 2025-03-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: concurrent-ruby
@@ -780,28 +780,28 @@ dependencies:
780
780
  requirements:
781
781
  - - '='
782
782
  - !ruby/object:Gem::Version
783
- version: 0.30.0.rc1
783
+ version: 0.30.0.rc3
784
784
  type: :development
785
785
  prerelease: false
786
786
  version_requirements: !ruby/object:Gem::Requirement
787
787
  requirements:
788
788
  - - '='
789
789
  - !ruby/object:Gem::Version
790
- version: 0.30.0.rc1
790
+ version: 0.30.0.rc3
791
791
  - !ruby/object:Gem::Dependency
792
792
  name: decidim-dev
793
793
  requirement: !ruby/object:Gem::Requirement
794
794
  requirements:
795
795
  - - '='
796
796
  - !ruby/object:Gem::Version
797
- version: 0.30.0.rc1
797
+ version: 0.30.0.rc3
798
798
  type: :development
799
799
  prerelease: false
800
800
  version_requirements: !ruby/object:Gem::Requirement
801
801
  requirements:
802
802
  - - '='
803
803
  - !ruby/object:Gem::Version
804
- version: 0.30.0.rc1
804
+ version: 0.30.0.rc3
805
805
  description: Adds core features so other engines can hook into the framework.
806
806
  email:
807
807
  - josepjaume@gmail.com
@@ -843,8 +843,6 @@ files:
843
843
  - app/cells/decidim/author/contact.erb
844
844
  - app/cells/decidim/author/date.erb
845
845
  - app/cells/decidim/author/endorsements.erb
846
- - app/cells/decidim/author/flag.erb
847
- - app/cells/decidim/author/flag_user.erb
848
846
  - app/cells/decidim/author/name.erb
849
847
  - app/cells/decidim/author/profile_minicard.erb
850
848
  - app/cells/decidim/author/show.erb
@@ -996,9 +994,6 @@ files:
996
994
  - app/cells/decidim/endorsers_list/full.erb
997
995
  - app/cells/decidim/endorsers_list/show.erb
998
996
  - app/cells/decidim/endorsers_list_cell.rb
999
- - app/cells/decidim/flag_modal/flag_user.erb
1000
- - app/cells/decidim/flag_modal/show.erb
1001
- - app/cells/decidim/flag_modal_cell.rb
1002
997
  - app/cells/decidim/follow_button/content.erb
1003
998
  - app/cells/decidim/follow_button/show.erb
1004
999
  - app/cells/decidim/follow_button_cell.rb
@@ -1074,8 +1069,6 @@ files:
1074
1069
  - app/cells/decidim/profile_actions/show.erb
1075
1070
  - app/cells/decidim/profile_actions_cell.rb
1076
1071
  - app/cells/decidim/profile_cell.rb
1077
- - app/cells/decidim/profile_sidebar/show.erb
1078
- - app/cells/decidim/profile_sidebar_cell.rb
1079
1072
  - app/cells/decidim/progress_bar/show.erb
1080
1073
  - app/cells/decidim/progress_bar_cell.rb
1081
1074
  - app/cells/decidim/public_participation/show.erb
@@ -1084,6 +1077,10 @@ files:
1084
1077
  - app/cells/decidim/report_button/flag_modal.erb
1085
1078
  - app/cells/decidim/report_button/show.erb
1086
1079
  - app/cells/decidim/report_button_cell.rb
1080
+ - app/cells/decidim/report_user_button/already_reported_modal.erb
1081
+ - app/cells/decidim/report_user_button/flag_modal.erb
1082
+ - app/cells/decidim/report_user_button/show.erb
1083
+ - app/cells/decidim/report_user_button_cell.rb
1087
1084
  - app/cells/decidim/reported_content/show.erb
1088
1085
  - app/cells/decidim/reported_content_cell.rb
1089
1086
  - app/cells/decidim/represent_user_group/show.erb
@@ -1416,10 +1413,12 @@ files:
1416
1413
  - app/jobs/decidim/export_participatory_space_job.rb
1417
1414
  - app/jobs/decidim/find_and_update_descendants_job.rb
1418
1415
  - app/jobs/decidim/hide_all_created_by_author_job.rb
1416
+ - app/jobs/decidim/hide_child_resources_job.rb
1419
1417
  - app/jobs/decidim/machine_translation_fields_job.rb
1420
1418
  - app/jobs/decidim/machine_translation_resource_job.rb
1421
1419
  - app/jobs/decidim/machine_translation_save_job.rb
1422
1420
  - app/jobs/decidim/metric_job.rb
1421
+ - app/jobs/decidim/migrate/paper_trail_job.rb
1423
1422
  - app/jobs/decidim/newsletters_opt_in_job.rb
1424
1423
  - app/jobs/decidim/notification_generator_for_recipient_job.rb
1425
1424
  - app/jobs/decidim/notification_generator_job.rb
@@ -1732,7 +1731,6 @@ files:
1732
1731
  - app/packs/src/decidim/utilities/dom.js
1733
1732
  - app/packs/src/decidim/utilities/text.js
1734
1733
  - app/packs/src/decidim/vendor/jquery-tmpl.js
1735
- - app/packs/src/decidim/vendor/leaflet-tilelayer-here.js
1736
1734
  - app/packs/src/decidim/vendor/tribute.js
1737
1735
  - app/packs/src/decidim/vizzs/areachart.js
1738
1736
  - app/packs/src/decidim/vizzs/index.js
@@ -1759,6 +1757,7 @@ files:
1759
1757
  - app/packs/stylesheets/decidim/_fonts.scss
1760
1758
  - app/packs/stylesheets/decidim/_footer.scss
1761
1759
  - app/packs/stylesheets/decidim/_forms.scss
1760
+ - app/packs/stylesheets/decidim/_hashtags.scss
1762
1761
  - app/packs/stylesheets/decidim/_header.scss
1763
1762
  - app/packs/stylesheets/decidim/_hero.scss
1764
1763
  - app/packs/stylesheets/decidim/_home.scss
@@ -3080,6 +3079,7 @@ files:
3080
3079
  - lib/tasks/decidim_taxonomies.rake
3081
3080
  - lib/tasks/decidim_webpacker_tasks.rake
3082
3081
  - lib/tasks/upgrade/clean.rake
3082
+ - lib/tasks/upgrade/clean_hidden_resources.rake
3083
3083
  - lib/tasks/upgrade/decidim_active_storage_migration_tasks.rake
3084
3084
  - lib/tasks/upgrade/decidim_attachments.rake
3085
3085
  - lib/tasks/upgrade/decidim_content_blocks_tasks.rake
@@ -1,6 +0,0 @@
1
- <button type="button" data-open="<%= current_user.present? ? "flagModal" : "loginModal" %>" title="<%= t("report", scope: "decidim.shared.flag_modal" ) %>" aria-controls="<%= current_user.present? ? "flagModal" : "loginModal" %>" aria-haspopup="true" tabindex="0">
2
- <%= icon "flag", aria_hidden: true, class: "icon--small", role: "img", "aria-hidden": true %>
3
- <span>
4
- <%= t("report", scope: "decidim.shared.flag_modal" ) %>
5
- </span>
6
- </button>
@@ -1,14 +0,0 @@
1
- <% if user_flaggable? && model.try(:id) != current_user.try(:id) %>
2
- <%= cell(
3
- "decidim/button",
4
- { icon: "flag-line", text: t("decidim.shared.flag_modal.report") },
5
- button_classes: "button button__sm button__text-secondary only:m-auto",
6
- html_options: {
7
- "data-open" => current_user.present? ? "flagUserModal" : "loginModal",
8
- "aria-controls" => current_user.present? ? "flagUserModal" : "loginModal",
9
- "aria-haspopup" => "dialog"
10
- }
11
- ) %>
12
-
13
- <%= cell("decidim/flag_modal", model).flag_user %>
14
- <% end %>
@@ -1,34 +0,0 @@
1
- <div class="flag-modal hidden" id="flagUserModal" data-reveal role="dialog" aria-modal="true" aria-labelledby="flagUserModal-label">
2
- <div>
3
- <h3 id="flagUserModal-label"><%= t("decidim.shared.flag_user_modal.title") %></h3>
4
- <button class="close-button" data-close aria-label="<%= t("decidim.shared.flag_user_modal.close") %>" type="button">
5
- <span aria-hidden="true">&times;</span>
6
- </button>
7
- </div>
8
- <% if model.reported_by? current_user %>
9
- <p><%= t("decidim.shared.flag_user_modal.already_reported") %></p>
10
- <% else %>
11
- <p><%= t("decidim.shared.flag_user_modal.description") %></p>
12
- <%= decidim_form_for report_form, url: decidim.report_user_path(sgid: model.to_sgid.to_s), method: :post do |f| %>
13
- <%= f.collection_radio_buttons :reason, [
14
- [:spam, t("decidim.shared.flag_user_modal.spam")],
15
- [:offensive, t("decidim.shared.flag_user_modal.offensive")],
16
- [:does_not_belong, t("decidim.shared.flag_user_modal.does_not_belong", organization_name: current_organization.name)]
17
- ], :first, :last do |builder| %>
18
- <%= builder.label { builder.radio_button + builder.text } %>
19
- <% end %>
20
- <%= f.text_area :details, rows: 4 %>
21
- <% if current_user&.admin? %>
22
- <%= f.check_box :block, label: t("decidim.shared.flag_user_modal.block"),
23
- include_hidden: false,
24
- data: {
25
- label_action: t("decidim.shared.flag_user_modal.block"),
26
- label_report: t("decidim.shared.flag_user_modal.report"),
27
- block: "true"
28
- } %>
29
- <%= f.check_box :hide, label: t("decidim.shared.flag_user_modal.hide"), label_options: { id: "block_and_hide" } %>
30
- <% end %>
31
- <%= f.submit t("decidim.shared.flag_user_modal.report") %>
32
- <% end %>
33
- <% end %>
34
- </div>
@@ -1,52 +0,0 @@
1
- <%= decidim_modal id: modal_id do %>
2
- <%= decidim_form_for report_form, url: decidim.report_path(sgid: model.to_sgid.to_s), method: :post, html: { id: nil, class: "modal__report form-defaults" } do |f| %>
3
- <div data-dialog-container>
4
- <%= icon "flag-line", class: "inline-block align-middle" %>
5
- <h3 data-dialog-title id="dialog-title-<%= modal_id %>">
6
- <%= t("decidim.shared.flag_modal.title") %>
7
- </h3>
8
-
9
- <% if model.reported_by? current_user %>
10
- <div>
11
- <p class="modal__report-text">
12
- <%= t("decidim.shared.flag_modal.already_reported") %>
13
- </p>
14
- </div>
15
- <% else %>
16
- <div>
17
- <p class="modal__report-text">
18
- <%= t("decidim.shared.flag_modal.description") %>
19
- </p>
20
- <fieldset>
21
- <legend><%= t("decidim.shared.flag_modal.reason") %></legend>
22
- <%= f.collection_radio_buttons :reason, [
23
- [:spam, t("decidim.shared.flag_modal.spam")],
24
- [:offensive, t("decidim.shared.flag_modal.offensive")],
25
- [:does_not_belong, t("decidim.shared.flag_modal.does_not_belong", organization_name: current_organization.name)]
26
- ], :first, :last do |builder| %>
27
- <div class="modal__report-container__radio">
28
- <%= builder.radio_button(id: builder.value) %>
29
- <label for="<%= builder.value %>">
30
- <%= builder.text %>
31
- </label>
32
- </div>
33
- <% end %>
34
- </fieldset>
35
- <% unless model.reported_by? current_user %>
36
- <%= f.text_area :details, class: "w-full rounded border min-h-[160px] border-text-gray-2 mt-2", id: "#{modal_id}_details", label_options: { for: "#{modal_id}_details", class: "text-gray-2" } %>
37
- <% end %>
38
- </div>
39
- <% end %>
40
- </div>
41
- <div data-dialog-actions>
42
- <% unless model.reported_by? current_user %>
43
- <button type="submit" class="button button__lg button__secondary">
44
- <span>
45
- <%= t("decidim.shared.flag_modal.report") %>
46
- </span>
47
- <%= icon "arrow-right-line" %>
48
- </button>
49
- <% end %>
50
- </div>
51
- <% end %>
52
- <% end %>
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- class FlagModalCell < Decidim::ViewModel
5
- include ActionView::Helpers::FormOptionsHelper
6
-
7
- def flag_user
8
- render
9
- end
10
-
11
- def cache_hash
12
- hash = []
13
- hash.push(I18n.locale)
14
- hash.push(current_user.try(:id))
15
- hash.push(model.reported_by?(current_user) ? 1 : 0)
16
- hash.push(model.class.name.gsub("::", ":"))
17
- hash.push(model.id)
18
- hash.join(Decidim.cache_key_separator)
19
- end
20
-
21
- private
22
-
23
- def frontend_administrable?
24
- author.respond_to?(:nickname) &&
25
- model.can_be_administered_by?(current_user) &&
26
- (model.respond_to?(:official?) && !model.official?)
27
- end
28
-
29
- def link_to_profile
30
- author.presenter.profile_url
31
- end
32
-
33
- def author
34
- model.try(:creator_identity) || model.try(:normalized_author)
35
- end
36
-
37
- def user_report_form
38
- Decidim::ReportForm.from_params(reason: "spam")
39
- end
40
-
41
- def modal_id
42
- options[:modal_id] || "flagModal"
43
- end
44
-
45
- def hide_checkbox_id
46
- @hide_checkbox_id ||= Digest::MD5.hexdigest("report_form_hide_#{model.class.name}_#{model.id}")
47
- end
48
-
49
- def report_form
50
- @report_form ||= begin
51
- context = { can_hide: model.try(:can_be_administered_by?, current_user) }
52
- Decidim::ReportForm.new(reason: "spam").with_context(context)
53
- end
54
- end
55
- end
56
- end