decidim-core 0.29.1 → 0.29.3
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.
- checksums.yaml +4 -4
- data/app/cells/decidim/activity_cell.rb +0 -3
- data/app/cells/decidim/author/show.erb +5 -4
- data/app/cells/decidim/author_cell.rb +26 -0
- data/app/cells/decidim/card_s/show.erb +5 -3
- data/app/cells/decidim/diff_cell.rb +4 -0
- data/app/cells/decidim/newsletter_templates/image_text_cta_cell.rb +1 -1
- data/app/cells/decidim/participatory_space_dropdown_metadata/show.erb +5 -3
- data/app/cells/decidim/profile_actions/show.erb +1 -1
- data/app/cells/decidim/report_button/already_reported_modal.erb +2 -2
- data/app/cells/decidim/report_button/flag_modal.erb +13 -27
- data/app/cells/decidim/report_button_cell.rb +2 -8
- data/app/cells/decidim/report_user_button/already_reported_modal.erb +11 -0
- data/app/cells/decidim/report_user_button/flag_modal.erb +46 -0
- data/app/cells/decidim/report_user_button/show.erb +2 -0
- data/app/cells/decidim/report_user_button_cell.rb +59 -0
- data/app/cells/decidim/resource_types_filter/show.erb +1 -1
- data/app/cells/decidim/resource_types_filter_cell.rb +6 -6
- data/app/cells/decidim/translation_bar/show.erb +2 -2
- data/app/cells/decidim/translation_bar_cell.rb +1 -1
- data/app/cells/decidim/user_activity/show.erb +1 -1
- data/app/commands/decidim/create_omniauth_registration.rb +14 -8
- data/app/commands/decidim/create_report.rb +1 -6
- data/app/commands/decidim/destroy_account.rb +3 -0
- data/app/commands/decidim/search.rb +14 -0
- data/app/controllers/decidim/doorkeeper/credentials_controller.rb +1 -1
- data/app/controllers/decidim/links_controller.rb +1 -1
- data/app/controllers/decidim/profiles_controller.rb +6 -2
- data/app/controllers/decidim/reports_controller.rb +1 -1
- data/app/controllers/decidim/user_activities_controller.rb +1 -1
- data/app/forms/decidim/account_form.rb +5 -2
- data/app/helpers/concerns/decidim/user_role_checker.rb +46 -0
- data/app/helpers/decidim/cta_button_helper.rb +1 -1
- data/app/helpers/decidim/map_helper.rb +6 -1
- data/app/helpers/decidim/orders_helper.rb +2 -1
- data/app/helpers/decidim/participatory_space_helpers.rb +1 -1
- data/app/helpers/decidim/sanitize_helper.rb +11 -2
- data/app/jobs/decidim/hide_child_resources_job.rb +24 -0
- data/app/mailers/decidim/reported_mailer.rb +1 -0
- data/app/models/decidim/action_log.rb +1 -9
- data/app/models/decidim/attachment.rb +1 -1
- data/app/models/decidim/report.rb +1 -1
- data/app/models/decidim/user.rb +0 -4
- data/app/models/decidim/user_base_entity.rb +4 -0
- data/app/packs/src/decidim/append_redirect_url_to_modals.js +14 -6
- data/app/packs/src/decidim/datepicker/datepicker_functions.js +3 -3
- data/app/packs/src/decidim/direct_uploads/upload_field.js +21 -8
- data/app/packs/src/decidim/index.js +5 -0
- data/app/packs/src/decidim/map/provider/here.js +1 -1
- data/app/packs/src/decidim/remote_tooltips.js +38 -0
- data/app/packs/src/decidim/toggle.js +1 -1
- data/app/packs/src/decidim/tooltips.js +42 -22
- data/app/packs/stylesheets/decidim/_content_blocks.scss +4 -0
- data/app/packs/stylesheets/decidim/_hashtags.scss +5 -0
- data/app/packs/stylesheets/decidim/_header.scss +11 -5
- data/app/packs/stylesheets/decidim/_labels.scss +1 -1
- data/app/packs/stylesheets/decidim/_profile.scss +1 -1
- data/app/packs/stylesheets/decidim/_progress-bar.scss +1 -1
- data/app/packs/stylesheets/decidim/application.scss +1 -0
- data/app/packs/stylesheets/decidim/legacy/conference-diploma.scss +2 -1
- data/app/presenters/decidim/attachment_presenter.rb +1 -1
- data/app/presenters/decidim/log/user_presenter.rb +1 -0
- data/app/presenters/decidim/user_presenter.rb +1 -1
- data/app/services/decidim/base_diff_renderer.rb +28 -2
- data/app/services/decidim/email_notification_generator.rb +14 -5
- data/app/services/decidim/static_map_generator.rb +1 -1
- data/app/views/decidim/last_activities/index.html.erb +1 -1
- data/app/views/decidim/pages/_tabbed.html.erb +2 -2
- data/app/views/decidim/reported_mailer/hide.html.erb +17 -1
- data/app/views/decidim/reported_mailer/report.html.erb +1 -1
- data/app/views/decidim/searches/_count.html.erb +1 -1
- data/app/views/decidim/searches/_filters.html.erb +40 -38
- data/app/views/decidim/shared/_orders.html.erb +2 -2
- data/app/views/layouts/decidim/footer/_main_legal.html.erb +1 -1
- data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +1 -1
- data/config/locales/ar.yml +56 -27
- data/config/locales/bg.yml +10 -24
- data/config/locales/bn-BD.yml +1 -0
- data/config/locales/bs-BA.yml +100 -0
- data/config/locales/ca-IT.yml +2111 -0
- data/config/locales/ca.yml +70 -38
- data/config/locales/cs.yml +60 -32
- data/config/locales/de.yml +66 -38
- data/config/locales/el.yml +17 -15
- data/config/locales/en.yml +48 -16
- data/config/locales/eo.yml +2 -0
- data/config/locales/es-MX.yml +61 -29
- data/config/locales/es-PY.yml +66 -34
- data/config/locales/es.yml +71 -39
- data/config/locales/eu.yml +303 -261
- data/config/locales/fi-plain.yml +48 -28
- data/config/locales/fi.yml +85 -65
- data/config/locales/fr-CA.yml +64 -27
- data/config/locales/fr.yml +62 -25
- data/config/locales/ga-IE.yml +13 -4
- data/config/locales/gl.yml +33 -15
- data/config/locales/hu.yml +12 -26
- data/config/locales/id-ID.yml +32 -16
- data/config/locales/is-IS.yml +18 -2
- data/config/locales/it.yml +54 -27
- data/config/locales/ja.yml +70 -38
- data/config/locales/lb.yml +33 -22
- data/config/locales/lt.yml +10 -18
- data/config/locales/lv.yml +26 -15
- data/config/locales/nl.yml +33 -19
- data/config/locales/no.yml +27 -16
- data/config/locales/pl.yml +8 -22
- data/config/locales/pt-BR.yml +13 -25
- data/config/locales/pt.yml +32 -16
- data/config/locales/ro-RO.yml +500 -220
- data/config/locales/ru.yml +31 -8
- data/config/locales/sk.yml +38 -19
- data/config/locales/sl.yml +4 -0
- data/config/locales/sr-CS.yml +2 -0
- data/config/locales/sv.yml +29 -33
- data/config/locales/tr-TR.yml +34 -24
- data/config/locales/uk.yml +20 -3
- data/config/locales/zh-CN.yml +27 -15
- data/config/locales/zh-TW.yml +16 -16
- data/config/routes.rb +1 -0
- data/decidim-core.gemspec +4 -1
- data/lib/decidim/api/functions/component_list.rb +1 -1
- data/lib/decidim/api/functions/participatory_space_finder_base.rb +11 -1
- data/lib/decidim/api/interfaces/participatory_space_interface.rb +1 -1
- data/lib/decidim/api/types/component_type.rb +7 -0
- data/lib/decidim/api/types/user_group_type.rb +4 -0
- data/lib/decidim/api/types/user_type.rb +4 -0
- data/lib/decidim/asset_router/storage.rb +7 -2
- data/lib/decidim/attributes/rich_text.rb +38 -0
- data/lib/decidim/attributes/time_with_zone.rb +16 -2
- data/lib/decidim/attributes.rb +2 -0
- data/lib/decidim/content_parsers/blob_parser.rb +95 -0
- data/lib/decidim/content_parsers/user_parser.rb +1 -1
- data/lib/decidim/content_parsers.rb +1 -0
- data/lib/decidim/content_renderers/blob_renderer.rb +90 -0
- data/lib/decidim/content_renderers.rb +1 -0
- data/lib/decidim/core/engine.rb +29 -1
- data/lib/decidim/core/test/factories.rb +28 -0
- data/lib/decidim/core/test/shared_examples/authorable_interface_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +15 -2
- data/lib/decidim/core/test/shared_examples/reports_examples.rb +48 -6
- data/lib/decidim/core/test/shared_examples/social_share_examples.rb +32 -0
- data/lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb +26 -0
- data/lib/decidim/core/test/shared_examples/versions_controller_examples.rb +26 -0
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/diffy_extension.rb +18 -0
- data/lib/decidim/form_builder.rb +1 -1
- data/lib/decidim/map/autocomplete.rb +1 -0
- data/lib/decidim/map/provider/dynamic_map/here.rb +1 -40
- data/lib/decidim/map/provider/static_map/here.rb +34 -0
- data/lib/decidim/moderation_tools.rb +16 -2
- data/lib/decidim/nicknamizable.rb +1 -1
- data/lib/decidim/participatory_space_user.rb +4 -0
- data/lib/decidim/query_extensions.rb +0 -26
- data/lib/decidim/reportable.rb +6 -2
- data/lib/decidim/settings_manifest.rb +2 -0
- data/lib/decidim/translatable_attributes.rb +10 -1
- data/lib/tasks/upgrade/clean_hidden_resources.rake +33 -0
- data/lib/tasks/upgrade/decidim_fix_categorization.rake +34 -8
- data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +23 -20
- metadata +37 -15
- data/app/cells/decidim/author/flag.erb +0 -6
- data/app/cells/decidim/author/flag_user.erb +0 -14
- data/app/cells/decidim/flag_modal/flag_user.erb +0 -34
- data/app/cells/decidim/flag_modal/show.erb +0 -52
- data/app/cells/decidim/flag_modal_cell.rb +0 -56
- data/app/cells/decidim/profile_sidebar/show.erb +0 -167
- data/app/cells/decidim/profile_sidebar_cell.rb +0 -68
- data/app/packs/src/decidim/vendor/leaflet-tilelayer-here.js +0 -212
data/lib/decidim/reportable.rb
CHANGED
@@ -53,8 +53,12 @@ module Decidim
|
|
53
53
|
# Public: The reported content url
|
54
54
|
#
|
55
55
|
# Returns String
|
56
|
-
def reported_content_url
|
57
|
-
|
56
|
+
def reported_content_url(options = {})
|
57
|
+
if hidden?
|
58
|
+
ResourceLocatorPresenter.new(self).index(options)
|
59
|
+
else
|
60
|
+
ResourceLocatorPresenter.new(self).url(options)
|
61
|
+
end
|
58
62
|
end
|
59
63
|
|
60
64
|
# Public: The collection of attribute names that are considered
|
@@ -34,6 +34,7 @@ module Decidim
|
|
34
34
|
# end
|
35
35
|
#
|
36
36
|
# Returns nothing.
|
37
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
37
38
|
def translatable_attribute(name, type, **)
|
38
39
|
attribute(name, { String => Object }, default: {})
|
39
40
|
|
@@ -41,6 +42,8 @@ module Decidim
|
|
41
42
|
attribute_name = "#{name}_#{locale}".gsub("-", "__")
|
42
43
|
attribute(attribute_name, type, **)
|
43
44
|
|
45
|
+
value_type = attribute_types[attribute_name.to_s]
|
46
|
+
|
44
47
|
define_method attribute_name do
|
45
48
|
field = public_send(name) || {}
|
46
49
|
value =
|
@@ -51,7 +54,6 @@ module Decidim
|
|
51
54
|
# changed and the old value is still stored against the record.
|
52
55
|
field
|
53
56
|
end
|
54
|
-
value_type = self.class.attribute_types[attribute_name.to_s]
|
55
57
|
value_type ? value_type.cast(value) : value
|
56
58
|
end
|
57
59
|
|
@@ -60,12 +62,15 @@ module Decidim
|
|
60
62
|
final = super(value)
|
61
63
|
return unless final # Do not set the `nil` values for the parent hash
|
62
64
|
|
65
|
+
final = value_type.serialize(final) if value_type && !attachment?(final)
|
66
|
+
|
63
67
|
public_send("#{name}=", field.merge(locale => final))
|
64
68
|
end
|
65
69
|
|
66
70
|
yield(attribute_name, locale) if block_given?
|
67
71
|
end
|
68
72
|
end
|
73
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
69
74
|
|
70
75
|
def locales
|
71
76
|
Decidim.available_locales
|
@@ -122,5 +127,9 @@ module Decidim
|
|
122
127
|
locale.to_s == try(:default_locale).to_s ||
|
123
128
|
locale.to_s == try(:current_organization).try(:default_locale).to_s
|
124
129
|
end
|
130
|
+
|
131
|
+
def attachment?(value)
|
132
|
+
value.is_a?(String) && value.include?(ActiveStorage.routes_prefix)
|
133
|
+
end
|
125
134
|
end
|
126
135
|
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
|
@@ -8,9 +8,18 @@ namespace :decidim do
|
|
8
8
|
:"decidim:upgrade:clean:searchable_resources",
|
9
9
|
:"decidim:upgrade:clean:notifications",
|
10
10
|
:"decidim:upgrade:clean:follows",
|
11
|
-
:"decidim:upgrade:clean:action_logs"
|
11
|
+
:"decidim:upgrade:clean:action_logs",
|
12
|
+
:"decidim:upgrade:clean:clean_deleted_users",
|
13
|
+
:"decidim:upgrade:clean:fix_blocked_user_notification"
|
12
14
|
]
|
13
15
|
|
16
|
+
desc "Remove data from deleted users"
|
17
|
+
task clean_deleted_users: :environment do
|
18
|
+
logger = Logger.new($stdout)
|
19
|
+
logger.info("=== Removing extra data from deleted users")
|
20
|
+
Decidim::User.where.not(deleted_at: nil).update_all(personal_url: "", about: "", notifications_sending_frequency: "none") # rubocop:disable Rails/SkipsModelValidations
|
21
|
+
end
|
22
|
+
|
14
23
|
desc "Removes any action logs belonging to invalid resources"
|
15
24
|
task :action_logs, [] => :environment do
|
16
25
|
puts "=== Deleting Action logs\n"
|
@@ -100,15 +109,32 @@ namespace :decidim do
|
|
100
109
|
end
|
101
110
|
puts "===== Deleted #{invalid} invalid resources\n"
|
102
111
|
end
|
103
|
-
end
|
104
112
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
113
|
+
desc "Removes orphan categorizations"
|
114
|
+
task fix_orphan_categorizations: :environment do
|
115
|
+
logger = Logger.new($stdout)
|
116
|
+
logger.info("Removing orphan categorizations...")
|
117
|
+
|
118
|
+
Decidim::Categorization.find_each do |categorization|
|
119
|
+
categorization.destroy if categorization.categorizable.nil?
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
desc "Update all blocked users notifications_sending_frequency setting"
|
124
|
+
task fix_blocked_user_notification: :environment do
|
125
|
+
logger.info("=== Updating all blocked users notifications_sending_frequency ...")
|
126
|
+
blocked_users = 0
|
127
|
+
Decidim::User.blocked.where.not("notifications_sending_frequency = ?", "none").find_each do |blocked_user|
|
128
|
+
unless blocked_user.notifications_sending_frequency == "none"
|
129
|
+
blocked_user.update(notifications_sending_frequency: "none")
|
130
|
+
blocked_users += 1
|
131
|
+
end
|
132
|
+
end
|
133
|
+
logger.info("===== Updated #{blocked_users} blocked users")
|
134
|
+
end
|
109
135
|
|
110
|
-
|
111
|
-
|
136
|
+
def logger
|
137
|
+
@logger ||= Logger.new($stdout)
|
112
138
|
end
|
113
139
|
end
|
114
140
|
end
|
@@ -2,37 +2,40 @@
|
|
2
2
|
|
3
3
|
namespace :decidim do
|
4
4
|
namespace :upgrade do
|
5
|
-
desc "Modifies
|
6
|
-
task
|
7
|
-
logger
|
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 = []
|
10
|
+
Decidim::UserBaseEntity.not_deleted.find_each do |user|
|
11
|
+
user.nickname.downcase!
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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}")
|
13
|
+
begin
|
14
|
+
if user.nickname_changed?
|
15
|
+
user.save!
|
16
|
+
has_changed << user.id
|
27
17
|
end
|
28
|
-
|
18
|
+
rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotUnique
|
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 (#{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",
|
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.29.
|
4
|
+
version: 0.29.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,8 +10,22 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2025-04-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: concurrent-ruby
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - '='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.3.4
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - '='
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 1.3.4
|
15
29
|
- !ruby/object:Gem::Dependency
|
16
30
|
name: active_link_to
|
17
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -758,28 +772,28 @@ dependencies:
|
|
758
772
|
requirements:
|
759
773
|
- - '='
|
760
774
|
- !ruby/object:Gem::Version
|
761
|
-
version: 0.29.
|
775
|
+
version: 0.29.3
|
762
776
|
type: :development
|
763
777
|
prerelease: false
|
764
778
|
version_requirements: !ruby/object:Gem::Requirement
|
765
779
|
requirements:
|
766
780
|
- - '='
|
767
781
|
- !ruby/object:Gem::Version
|
768
|
-
version: 0.29.
|
782
|
+
version: 0.29.3
|
769
783
|
- !ruby/object:Gem::Dependency
|
770
784
|
name: decidim-dev
|
771
785
|
requirement: !ruby/object:Gem::Requirement
|
772
786
|
requirements:
|
773
787
|
- - '='
|
774
788
|
- !ruby/object:Gem::Version
|
775
|
-
version: 0.29.
|
789
|
+
version: 0.29.3
|
776
790
|
type: :development
|
777
791
|
prerelease: false
|
778
792
|
version_requirements: !ruby/object:Gem::Requirement
|
779
793
|
requirements:
|
780
794
|
- - '='
|
781
795
|
- !ruby/object:Gem::Version
|
782
|
-
version: 0.29.
|
796
|
+
version: 0.29.3
|
783
797
|
description: Adds core features so other engines can hook into the framework.
|
784
798
|
email:
|
785
799
|
- josepjaume@gmail.com
|
@@ -822,8 +836,6 @@ files:
|
|
822
836
|
- app/cells/decidim/author/contact.erb
|
823
837
|
- app/cells/decidim/author/date.erb
|
824
838
|
- app/cells/decidim/author/endorsements.erb
|
825
|
-
- app/cells/decidim/author/flag.erb
|
826
|
-
- app/cells/decidim/author/flag_user.erb
|
827
839
|
- app/cells/decidim/author/name.erb
|
828
840
|
- app/cells/decidim/author/profile_minicard.erb
|
829
841
|
- app/cells/decidim/author/show.erb
|
@@ -978,9 +990,6 @@ files:
|
|
978
990
|
- app/cells/decidim/endorsers_list_button/content.erb
|
979
991
|
- app/cells/decidim/endorsers_list_button_cell.rb
|
980
992
|
- app/cells/decidim/endorsers_list_cell.rb
|
981
|
-
- app/cells/decidim/flag_modal/flag_user.erb
|
982
|
-
- app/cells/decidim/flag_modal/show.erb
|
983
|
-
- app/cells/decidim/flag_modal_cell.rb
|
984
993
|
- app/cells/decidim/follow_button/content.erb
|
985
994
|
- app/cells/decidim/follow_button/show.erb
|
986
995
|
- app/cells/decidim/follow_button_cell.rb
|
@@ -1049,8 +1058,6 @@ files:
|
|
1049
1058
|
- app/cells/decidim/profile_actions/show.erb
|
1050
1059
|
- app/cells/decidim/profile_actions_cell.rb
|
1051
1060
|
- app/cells/decidim/profile_cell.rb
|
1052
|
-
- app/cells/decidim/profile_sidebar/show.erb
|
1053
|
-
- app/cells/decidim/profile_sidebar_cell.rb
|
1054
1061
|
- app/cells/decidim/progress_bar/show.erb
|
1055
1062
|
- app/cells/decidim/progress_bar_cell.rb
|
1056
1063
|
- app/cells/decidim/public_participation/show.erb
|
@@ -1059,6 +1066,10 @@ files:
|
|
1059
1066
|
- app/cells/decidim/report_button/flag_modal.erb
|
1060
1067
|
- app/cells/decidim/report_button/show.erb
|
1061
1068
|
- app/cells/decidim/report_button_cell.rb
|
1069
|
+
- app/cells/decidim/report_user_button/already_reported_modal.erb
|
1070
|
+
- app/cells/decidim/report_user_button/flag_modal.erb
|
1071
|
+
- app/cells/decidim/report_user_button/show.erb
|
1072
|
+
- app/cells/decidim/report_user_button_cell.rb
|
1062
1073
|
- app/cells/decidim/reported_content/show.erb
|
1063
1074
|
- app/cells/decidim/reported_content_cell.rb
|
1064
1075
|
- app/cells/decidim/represent_user_group/show.erb
|
@@ -1313,6 +1324,7 @@ files:
|
|
1313
1324
|
- app/forms/decidim/user_interest_scope_form.rb
|
1314
1325
|
- app/forms/decidim/user_interests_form.rb
|
1315
1326
|
- app/helpers/concerns/decidim/flash_helper_extensions.rb
|
1327
|
+
- app/helpers/concerns/decidim/user_role_checker.rb
|
1316
1328
|
- app/helpers/decidim/account_helper.rb
|
1317
1329
|
- app/helpers/decidim/action_authorization_helper.rb
|
1318
1330
|
- app/helpers/decidim/amendments_helper.rb
|
@@ -1383,6 +1395,7 @@ files:
|
|
1383
1395
|
- app/jobs/decidim/export_participatory_space_job.rb
|
1384
1396
|
- app/jobs/decidim/find_and_update_descendants_job.rb
|
1385
1397
|
- app/jobs/decidim/hide_all_created_by_author_job.rb
|
1398
|
+
- app/jobs/decidim/hide_child_resources_job.rb
|
1386
1399
|
- app/jobs/decidim/machine_translation_fields_job.rb
|
1387
1400
|
- app/jobs/decidim/machine_translation_resource_job.rb
|
1388
1401
|
- app/jobs/decidim/machine_translation_save_job.rb
|
@@ -1674,6 +1687,7 @@ files:
|
|
1674
1687
|
- app/packs/src/decidim/notifications_actions.js
|
1675
1688
|
- app/packs/src/decidim/password_toggler.js
|
1676
1689
|
- app/packs/src/decidim/remote_modal.js
|
1690
|
+
- app/packs/src/decidim/remote_tooltips.js
|
1677
1691
|
- app/packs/src/decidim/responsive_horizontal_tabs.js
|
1678
1692
|
- app/packs/src/decidim/results_listing.js
|
1679
1693
|
- app/packs/src/decidim/scroll_to_last_child.js
|
@@ -1691,7 +1705,6 @@ files:
|
|
1691
1705
|
- app/packs/src/decidim/user_registrations.js
|
1692
1706
|
- app/packs/src/decidim/utilities/text.js
|
1693
1707
|
- app/packs/src/decidim/vendor/jquery-tmpl.js
|
1694
|
-
- app/packs/src/decidim/vendor/leaflet-tilelayer-here.js
|
1695
1708
|
- app/packs/src/decidim/vendor/tribute.js
|
1696
1709
|
- app/packs/src/decidim/vizzs/areachart.js
|
1697
1710
|
- app/packs/src/decidim/vizzs/index.js
|
@@ -1718,6 +1731,7 @@ files:
|
|
1718
1731
|
- app/packs/stylesheets/decidim/_fonts.scss
|
1719
1732
|
- app/packs/stylesheets/decidim/_footer.scss
|
1720
1733
|
- app/packs/stylesheets/decidim/_forms.scss
|
1734
|
+
- app/packs/stylesheets/decidim/_hashtags.scss
|
1721
1735
|
- app/packs/stylesheets/decidim/_header.scss
|
1722
1736
|
- app/packs/stylesheets/decidim/_hero.scss
|
1723
1737
|
- app/packs/stylesheets/decidim/_home.scss
|
@@ -2138,6 +2152,9 @@ files:
|
|
2138
2152
|
- config/locales/ar.yml
|
2139
2153
|
- config/locales/bg-BG.yml
|
2140
2154
|
- config/locales/bg.yml
|
2155
|
+
- config/locales/bn-BD.yml
|
2156
|
+
- config/locales/bs-BA.yml
|
2157
|
+
- config/locales/ca-IT.yml
|
2141
2158
|
- config/locales/ca.yml
|
2142
2159
|
- config/locales/cs-CZ.yml
|
2143
2160
|
- config/locales/cs.yml
|
@@ -2641,6 +2658,7 @@ files:
|
|
2641
2658
|
- lib/decidim/attributes/localized_date.rb
|
2642
2659
|
- lib/decidim/attributes/model.rb
|
2643
2660
|
- lib/decidim/attributes/object.rb
|
2661
|
+
- lib/decidim/attributes/rich_text.rb
|
2644
2662
|
- lib/decidim/attributes/symbol.rb
|
2645
2663
|
- lib/decidim/attributes/time_with_zone.rb
|
2646
2664
|
- lib/decidim/authorable.rb
|
@@ -2664,6 +2682,7 @@ files:
|
|
2664
2682
|
- lib/decidim/content_blocks/has_related_components.rb
|
2665
2683
|
- lib/decidim/content_parsers.rb
|
2666
2684
|
- lib/decidim/content_parsers/base_parser.rb
|
2685
|
+
- lib/decidim/content_parsers/blob_parser.rb
|
2667
2686
|
- lib/decidim/content_parsers/hashtag_parser.rb
|
2668
2687
|
- lib/decidim/content_parsers/inline_images_parser.rb
|
2669
2688
|
- lib/decidim/content_parsers/link_parser.rb
|
@@ -2675,6 +2694,7 @@ files:
|
|
2675
2694
|
- lib/decidim/content_processor.rb
|
2676
2695
|
- lib/decidim/content_renderers.rb
|
2677
2696
|
- lib/decidim/content_renderers/base_renderer.rb
|
2697
|
+
- lib/decidim/content_renderers/blob_renderer.rb
|
2678
2698
|
- lib/decidim/content_renderers/hashtag_renderer.rb
|
2679
2699
|
- lib/decidim/content_renderers/link_renderer.rb
|
2680
2700
|
- lib/decidim/content_renderers/resource_renderer.rb
|
@@ -2777,6 +2797,7 @@ files:
|
|
2777
2797
|
- lib/decidim/core/test/shared_examples/searchable_results_examples.rb
|
2778
2798
|
- lib/decidim/core/test/shared_examples/share_link_examples.rb
|
2779
2799
|
- lib/decidim/core/test/shared_examples/simple_event.rb
|
2800
|
+
- lib/decidim/core/test/shared_examples/social_share_examples.rb
|
2780
2801
|
- lib/decidim/core/test/shared_examples/space_cell_changes_button_text_cta.rb
|
2781
2802
|
- lib/decidim/core/test/shared_examples/static_pages_examples.rb
|
2782
2803
|
- lib/decidim/core/test/shared_examples/statistics_cell_examples.rb
|
@@ -2966,6 +2987,7 @@ files:
|
|
2966
2987
|
- lib/tasks/decidim_robots.rake
|
2967
2988
|
- lib/tasks/decidim_tasks.rake
|
2968
2989
|
- lib/tasks/decidim_webpacker_tasks.rake
|
2990
|
+
- lib/tasks/upgrade/clean_hidden_resources.rake
|
2969
2991
|
- lib/tasks/upgrade/decidim_active_storage_migration_tasks.rake
|
2970
2992
|
- lib/tasks/upgrade/decidim_attachments.rake
|
2971
2993
|
- lib/tasks/upgrade/decidim_content_blocks_tasks.rake
|
@@ -2978,7 +3000,7 @@ files:
|
|
2978
3000
|
- lib/tasks/upgrade/decidim_user_moderation.rake
|
2979
3001
|
homepage: https://decidim.org
|
2980
3002
|
licenses:
|
2981
|
-
- AGPL-3.0
|
3003
|
+
- AGPL-3.0-or-later
|
2982
3004
|
metadata:
|
2983
3005
|
bug_tracker_uri: https://github.com/decidim/decidim/issues
|
2984
3006
|
documentation_uri: https://docs.decidim.org/
|
@@ -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">×</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
|