decidim-core 0.29.2 → 0.29.4
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/address/show.erb +3 -3
- data/app/cells/decidim/author/show.erb +2 -4
- data/app/cells/decidim/content_blocks/participatory_space_extra_data/extra_data.erb +2 -2
- data/app/cells/decidim/participatory_space_dropdown_metadata/metadata.erb +4 -4
- 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/user_activity/show.erb +1 -1
- data/app/commands/decidim/create_omniauth_registration.rb +14 -8
- data/app/commands/decidim/create_report.rb +6 -7
- data/app/commands/decidim/invite_user.rb +1 -1
- data/app/commands/decidim/search.rb +14 -0
- data/app/controllers/concerns/decidim/participatory_space_context.rb +4 -1
- data/app/controllers/decidim/profiles_controller.rb +2 -2
- data/app/controllers/decidim/reports_controller.rb +7 -2
- data/app/controllers/decidim/user_activities_controller.rb +1 -1
- data/app/forms/decidim/account_form.rb +5 -2
- data/app/forms/decidim/omniauth_registration_form.rb +1 -1
- data/app/forms/decidim/registration_form.rb +1 -1
- data/app/helpers/decidim/menu_helper.rb +2 -2
- data/app/helpers/decidim/orders_helper.rb +2 -1
- data/app/helpers/decidim/paginate_helper.rb +1 -1
- data/app/helpers/decidim/participatory_space_helpers.rb +1 -1
- data/app/helpers/decidim/tooltip_helper.rb +4 -1
- data/app/jobs/decidim/hide_child_resources_job.rb +24 -0
- data/app/mailers/decidim/notifications_digest_mailer.rb +7 -1
- data/app/mailers/decidim/reported_mailer.rb +18 -2
- data/app/models/decidim/action_log.rb +1 -9
- 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/datepicker/datepicker_functions.js +3 -3
- data/app/packs/src/decidim/index.js +4 -2
- data/app/packs/src/decidim/input_character_counter.js +1 -1
- data/app/packs/src/decidim/map/provider/here.js +1 -1
- data/app/packs/stylesheets/decidim/_cards.scss +1 -1
- 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 +65 -40
- data/app/packs/stylesheets/decidim/application.scss +1 -0
- data/app/permissions/decidim/default_permissions.rb +2 -0
- data/app/presenters/decidim/log/user_presenter.rb +1 -0
- data/app/presenters/decidim/notification_to_mailer_presenter.rb +7 -3
- data/app/presenters/decidim/user_presenter.rb +1 -1
- data/app/queries/decidim/last_activity.rb +25 -0
- data/app/services/decidim/base_diff_renderer.rb +2 -0
- 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/messaging/conversations/_reply_form.html.erb +1 -2
- data/app/views/decidim/messaging/conversations/_start.html.erb +1 -1
- data/app/views/decidim/reported_mailer/hidden_automatically.html.erb +25 -0
- data/app/views/decidim/reported_mailer/hidden_manually.html.erb +25 -0
- 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/decidim/shared/_results_per_page.html.erb +1 -1
- data/app/views/kaminari/decidim/_page.html.erb +1 -1
- data/app/views/kaminari/decidim/_paginator.html.erb +1 -1
- data/app/views/layouts/decidim/_logo.html.erb +2 -2
- data/app/views/layouts/decidim/footer/_main_legal.html.erb +1 -1
- data/app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown_desktop.html.erb +5 -11
- data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +5 -5
- data/config/locales/ar.yml +41 -34
- data/config/locales/bg.yml +10 -30
- data/config/locales/bs-BA.yml +2 -0
- data/config/locales/ca-IT.yml +2122 -0
- data/config/locales/ca.yml +69 -30
- data/config/locales/cs.yml +73 -36
- data/config/locales/de.yml +64 -26
- data/config/locales/el.yml +10 -21
- data/config/locales/en.yml +56 -17
- data/config/locales/eo.yml +2 -0
- data/config/locales/es-MX.yml +69 -30
- data/config/locales/es-PY.yml +74 -35
- data/config/locales/es.yml +72 -33
- data/config/locales/eu.yml +128 -91
- data/config/locales/fi-plain.yml +44 -34
- data/config/locales/fi.yml +46 -36
- data/config/locales/fr-CA.yml +72 -29
- data/config/locales/fr.yml +71 -28
- data/config/locales/ga-IE.yml +4 -4
- data/config/locales/gl.yml +25 -20
- data/config/locales/hu.yml +9 -29
- data/config/locales/id-ID.yml +24 -21
- data/config/locales/is-IS.yml +10 -6
- data/config/locales/it.yml +35 -32
- data/config/locales/ja.yml +70 -30
- data/config/locales/lb.yml +24 -27
- data/config/locales/lt.yml +5 -23
- data/config/locales/lv.yml +18 -20
- data/config/locales/nl.yml +23 -23
- data/config/locales/no.yml +18 -21
- data/config/locales/pl.yml +7 -27
- data/config/locales/pt-BR.yml +11 -30
- data/config/locales/pt.yml +18 -21
- data/config/locales/ro-RO.yml +239 -92
- data/config/locales/ru.yml +23 -13
- data/config/locales/sk.yml +29 -23
- data/config/locales/sl.yml +4 -0
- data/config/locales/sr-CS.yml +2 -0
- data/config/locales/sv.yml +49 -37
- data/config/locales/tr-TR.yml +25 -28
- data/config/locales/uk.yml +12 -7
- data/config/locales/zh-CN.yml +18 -20
- data/config/locales/zh-TW.yml +8 -22
- data/db/migrate/20171212103803_create_unique_nicknames.rb +1 -1
- data/db/migrate/20180221101934_fix_nickname_index.rb +1 -1
- data/db/migrate/20180706104107_add_nickname_to_managed_users.rb +1 -1
- data/db/migrate/20181001124950_move_users_groups_to_users_table.rb +1 -1
- data/db/migrate/20190412131728_fix_user_names.rb +1 -1
- data/lib/decidim/asset_router/storage.rb +7 -2
- data/lib/decidim/attributes/time_with_zone.rb +5 -1
- data/lib/decidim/content_parsers/blob_parser.rb +10 -8
- data/lib/decidim/content_parsers/user_parser.rb +1 -1
- 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/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 +6 -9
- data/lib/decidim/reportable.rb +6 -2
- data/lib/decidim/translatable_attributes.rb +5 -1
- data/lib/tasks/upgrade/clean_hidden_resources.rake +33 -0
- data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +23 -20
- metadata +17 -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/app/views/decidim/reported_mailer/hide.html.erb +0 -9
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
|
@@ -62,7 +62,7 @@ module Decidim
|
|
62
62
|
final = super(value)
|
63
63
|
return unless final # Do not set the `nil` values for the parent hash
|
64
64
|
|
65
|
-
final = value_type.serialize(final) if value_type
|
65
|
+
final = value_type.serialize(final) if value_type && !attachment?(final)
|
66
66
|
|
67
67
|
public_send("#{name}=", field.merge(locale => final))
|
68
68
|
end
|
@@ -127,5 +127,9 @@ module Decidim
|
|
127
127
|
locale.to_s == try(:default_locale).to_s ||
|
128
128
|
locale.to_s == try(:current_organization).try(:default_locale).to_s
|
129
129
|
end
|
130
|
+
|
131
|
+
def attachment?(value)
|
132
|
+
value.is_a?(String) && value.include?(ActiveStorage.routes_prefix)
|
133
|
+
end
|
130
134
|
end
|
131
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
|
@@ -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, user.decidim_organization_id))
|
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.4
|
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-
|
13
|
+
date: 2025-06-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: concurrent-ruby
|
@@ -772,28 +772,28 @@ dependencies:
|
|
772
772
|
requirements:
|
773
773
|
- - '='
|
774
774
|
- !ruby/object:Gem::Version
|
775
|
-
version: 0.29.
|
775
|
+
version: 0.29.4
|
776
776
|
type: :development
|
777
777
|
prerelease: false
|
778
778
|
version_requirements: !ruby/object:Gem::Requirement
|
779
779
|
requirements:
|
780
780
|
- - '='
|
781
781
|
- !ruby/object:Gem::Version
|
782
|
-
version: 0.29.
|
782
|
+
version: 0.29.4
|
783
783
|
- !ruby/object:Gem::Dependency
|
784
784
|
name: decidim-dev
|
785
785
|
requirement: !ruby/object:Gem::Requirement
|
786
786
|
requirements:
|
787
787
|
- - '='
|
788
788
|
- !ruby/object:Gem::Version
|
789
|
-
version: 0.29.
|
789
|
+
version: 0.29.4
|
790
790
|
type: :development
|
791
791
|
prerelease: false
|
792
792
|
version_requirements: !ruby/object:Gem::Requirement
|
793
793
|
requirements:
|
794
794
|
- - '='
|
795
795
|
- !ruby/object:Gem::Version
|
796
|
-
version: 0.29.
|
796
|
+
version: 0.29.4
|
797
797
|
description: Adds core features so other engines can hook into the framework.
|
798
798
|
email:
|
799
799
|
- josepjaume@gmail.com
|
@@ -836,8 +836,6 @@ files:
|
|
836
836
|
- app/cells/decidim/author/contact.erb
|
837
837
|
- app/cells/decidim/author/date.erb
|
838
838
|
- app/cells/decidim/author/endorsements.erb
|
839
|
-
- app/cells/decidim/author/flag.erb
|
840
|
-
- app/cells/decidim/author/flag_user.erb
|
841
839
|
- app/cells/decidim/author/name.erb
|
842
840
|
- app/cells/decidim/author/profile_minicard.erb
|
843
841
|
- app/cells/decidim/author/show.erb
|
@@ -992,9 +990,6 @@ files:
|
|
992
990
|
- app/cells/decidim/endorsers_list_button/content.erb
|
993
991
|
- app/cells/decidim/endorsers_list_button_cell.rb
|
994
992
|
- app/cells/decidim/endorsers_list_cell.rb
|
995
|
-
- app/cells/decidim/flag_modal/flag_user.erb
|
996
|
-
- app/cells/decidim/flag_modal/show.erb
|
997
|
-
- app/cells/decidim/flag_modal_cell.rb
|
998
993
|
- app/cells/decidim/follow_button/content.erb
|
999
994
|
- app/cells/decidim/follow_button/show.erb
|
1000
995
|
- app/cells/decidim/follow_button_cell.rb
|
@@ -1063,8 +1058,6 @@ files:
|
|
1063
1058
|
- app/cells/decidim/profile_actions/show.erb
|
1064
1059
|
- app/cells/decidim/profile_actions_cell.rb
|
1065
1060
|
- app/cells/decidim/profile_cell.rb
|
1066
|
-
- app/cells/decidim/profile_sidebar/show.erb
|
1067
|
-
- app/cells/decidim/profile_sidebar_cell.rb
|
1068
1061
|
- app/cells/decidim/progress_bar/show.erb
|
1069
1062
|
- app/cells/decidim/progress_bar_cell.rb
|
1070
1063
|
- app/cells/decidim/public_participation/show.erb
|
@@ -1073,6 +1066,10 @@ files:
|
|
1073
1066
|
- app/cells/decidim/report_button/flag_modal.erb
|
1074
1067
|
- app/cells/decidim/report_button/show.erb
|
1075
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
|
1076
1073
|
- app/cells/decidim/reported_content/show.erb
|
1077
1074
|
- app/cells/decidim/reported_content_cell.rb
|
1078
1075
|
- app/cells/decidim/represent_user_group/show.erb
|
@@ -1398,6 +1395,7 @@ files:
|
|
1398
1395
|
- app/jobs/decidim/export_participatory_space_job.rb
|
1399
1396
|
- app/jobs/decidim/find_and_update_descendants_job.rb
|
1400
1397
|
- app/jobs/decidim/hide_all_created_by_author_job.rb
|
1398
|
+
- app/jobs/decidim/hide_child_resources_job.rb
|
1401
1399
|
- app/jobs/decidim/machine_translation_fields_job.rb
|
1402
1400
|
- app/jobs/decidim/machine_translation_resource_job.rb
|
1403
1401
|
- app/jobs/decidim/machine_translation_save_job.rb
|
@@ -1707,7 +1705,6 @@ files:
|
|
1707
1705
|
- app/packs/src/decidim/user_registrations.js
|
1708
1706
|
- app/packs/src/decidim/utilities/text.js
|
1709
1707
|
- app/packs/src/decidim/vendor/jquery-tmpl.js
|
1710
|
-
- app/packs/src/decidim/vendor/leaflet-tilelayer-here.js
|
1711
1708
|
- app/packs/src/decidim/vendor/tribute.js
|
1712
1709
|
- app/packs/src/decidim/vizzs/areachart.js
|
1713
1710
|
- app/packs/src/decidim/vizzs/index.js
|
@@ -1734,6 +1731,7 @@ files:
|
|
1734
1731
|
- app/packs/stylesheets/decidim/_fonts.scss
|
1735
1732
|
- app/packs/stylesheets/decidim/_footer.scss
|
1736
1733
|
- app/packs/stylesheets/decidim/_forms.scss
|
1734
|
+
- app/packs/stylesheets/decidim/_hashtags.scss
|
1737
1735
|
- app/packs/stylesheets/decidim/_header.scss
|
1738
1736
|
- app/packs/stylesheets/decidim/_hero.scss
|
1739
1737
|
- app/packs/stylesheets/decidim/_home.scss
|
@@ -2031,7 +2029,8 @@ files:
|
|
2031
2029
|
- app/views/decidim/pages/index.html.erb
|
2032
2030
|
- app/views/decidim/pages/show.html.erb
|
2033
2031
|
- app/views/decidim/profiles/show.html.erb
|
2034
|
-
- app/views/decidim/reported_mailer/
|
2032
|
+
- app/views/decidim/reported_mailer/hidden_automatically.html.erb
|
2033
|
+
- app/views/decidim/reported_mailer/hidden_manually.html.erb
|
2035
2034
|
- app/views/decidim/reported_mailer/report.html.erb
|
2036
2035
|
- app/views/decidim/scopes/_scopes_picker_input.html.erb
|
2037
2036
|
- app/views/decidim/scopes/picker.html.erb
|
@@ -2156,6 +2155,7 @@ files:
|
|
2156
2155
|
- config/locales/bg.yml
|
2157
2156
|
- config/locales/bn-BD.yml
|
2158
2157
|
- config/locales/bs-BA.yml
|
2158
|
+
- config/locales/ca-IT.yml
|
2159
2159
|
- config/locales/ca.yml
|
2160
2160
|
- config/locales/cs-CZ.yml
|
2161
2161
|
- config/locales/cs.yml
|
@@ -2798,6 +2798,7 @@ files:
|
|
2798
2798
|
- lib/decidim/core/test/shared_examples/searchable_results_examples.rb
|
2799
2799
|
- lib/decidim/core/test/shared_examples/share_link_examples.rb
|
2800
2800
|
- lib/decidim/core/test/shared_examples/simple_event.rb
|
2801
|
+
- lib/decidim/core/test/shared_examples/social_share_examples.rb
|
2801
2802
|
- lib/decidim/core/test/shared_examples/space_cell_changes_button_text_cta.rb
|
2802
2803
|
- lib/decidim/core/test/shared_examples/static_pages_examples.rb
|
2803
2804
|
- lib/decidim/core/test/shared_examples/statistics_cell_examples.rb
|
@@ -2987,6 +2988,7 @@ files:
|
|
2987
2988
|
- lib/tasks/decidim_robots.rake
|
2988
2989
|
- lib/tasks/decidim_tasks.rake
|
2989
2990
|
- lib/tasks/decidim_webpacker_tasks.rake
|
2991
|
+
- lib/tasks/upgrade/clean_hidden_resources.rake
|
2990
2992
|
- lib/tasks/upgrade/decidim_active_storage_migration_tasks.rake
|
2991
2993
|
- lib/tasks/upgrade/decidim_attachments.rake
|
2992
2994
|
- 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">×</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
|
@@ -1,167 +0,0 @@
|
|
1
|
-
<div class="card profile--sidebar">
|
2
|
-
<%= image_tag profile_user.avatar_url(:profile), class: "card__image card__image--larger", alt: "avatar #{profile_user.name}" %>
|
3
|
-
<div>
|
4
|
-
<h1>
|
5
|
-
<strong><%= profile_user.name %></strong>
|
6
|
-
<br>
|
7
|
-
<span>
|
8
|
-
<%= profile_user.nickname %> <br>
|
9
|
-
</span>
|
10
|
-
<% if user_flaggable? %>
|
11
|
-
<span class="user-report_link">
|
12
|
-
<%== cell("decidim/author", profile_user, from:profile_user).flag_user %>
|
13
|
-
</span>
|
14
|
-
|
15
|
-
<% end %>
|
16
|
-
<% if can_contact_user? %>
|
17
|
-
<span>
|
18
|
-
<%= link_to_current_or_new_conversation_with(profile_holder) %>
|
19
|
-
</span>
|
20
|
-
<% end %>
|
21
|
-
</h1>
|
22
|
-
<div>
|
23
|
-
<small><%= decidim_html_escape(profile_user.about.to_s) %></small>
|
24
|
-
</div>
|
25
|
-
<% if profile_user.personal_url.present? %>
|
26
|
-
<%= link_to html_truncate(profile_user.personal_url.gsub(%r{https?\:\/\/}, ""), length: 30), profile_user.personal_url, rel: "nofollow noopener noreferrer ugc" %>
|
27
|
-
<% end %>
|
28
|
-
</div>
|
29
|
-
<% if profile_user.badge.present? %>
|
30
|
-
<div>
|
31
|
-
<span>
|
32
|
-
<%= icon profile_user.badge, class: "author__verified", aria_label: t("decidim.profiles.show.officialized"), role: "img" %>
|
33
|
-
</span>
|
34
|
-
<span>
|
35
|
-
<%= officialization_text %>
|
36
|
-
</span>
|
37
|
-
</div>
|
38
|
-
<% end %>
|
39
|
-
<%= render_hook(:user_profile_bottom) %>
|
40
|
-
<div>
|
41
|
-
<div class="text-center">
|
42
|
-
<% if profile_user_can_follow? %>
|
43
|
-
<div>
|
44
|
-
<%= link_to profile_followers_path(nickname: profile_holder.nickname) do %>
|
45
|
-
<%= t("decidim.profiles.show.followers") %>
|
46
|
-
<div><strong><%= profile_user.followers_count %></strong></div>
|
47
|
-
<% end %>
|
48
|
-
</div>
|
49
|
-
<div>
|
50
|
-
<%= link_to profile_following_path(nickname: profile_holder.nickname) do %>
|
51
|
-
<%= t("decidim.profiles.show.following") %>
|
52
|
-
<div><strong><%= profile_user.following_count %></strong></div>
|
53
|
-
<% end %>
|
54
|
-
</div>
|
55
|
-
<% else %>
|
56
|
-
<div>
|
57
|
-
<%= link_to profile_followers_path(nickname: profile_holder.nickname) do %>
|
58
|
-
<%= t("decidim.profiles.show.followers") %>
|
59
|
-
<div><%= profile_user.followers_count %></div>
|
60
|
-
<% end %>
|
61
|
-
</div>
|
62
|
-
<div>
|
63
|
-
<%= link_to profile_members_path(nickname: profile_holder.nickname) do %>
|
64
|
-
<%= t("decidim.profiles.show.members") %>
|
65
|
-
<div><%= profile_user.members_count %></div>
|
66
|
-
<% end %>
|
67
|
-
</div>
|
68
|
-
<% end %>
|
69
|
-
</div>
|
70
|
-
</div>
|
71
|
-
|
72
|
-
<% if current_organization.badges_enabled? && badge_statuses.any? %>
|
73
|
-
<div>
|
74
|
-
<div>
|
75
|
-
<div class="row column">
|
76
|
-
<strong><%= t("decidim.profiles.sidebar.badges.title") %></strong>
|
77
|
-
<div>
|
78
|
-
<div data-tooltip data-position="top" title="<%= t("decidim.profiles.sidebar.badges.info") %>" data-yeti-box="badges-tooltip" data-toggle="badges-tooltip" data-resize="badges-tooltip" data-events="resize">
|
79
|
-
<%= icon "info", class: "icon--small", role: "img", "aria-hidden": true %>
|
80
|
-
</div>
|
81
|
-
</div>
|
82
|
-
</div>
|
83
|
-
<div class="row collapse">
|
84
|
-
<% badge_statuses.each do |status| %>
|
85
|
-
<div class="column">
|
86
|
-
<div>
|
87
|
-
<%= cell("decidim/badge", profile_holder, badge: status.badge, status:).call(:small) %>
|
88
|
-
</div>
|
89
|
-
</div>
|
90
|
-
<% end %>
|
91
|
-
</div>
|
92
|
-
</div>
|
93
|
-
</div>
|
94
|
-
<% end %>
|
95
|
-
</div>
|
96
|
-
|
97
|
-
<div class="row">
|
98
|
-
<div class="column">
|
99
|
-
<% if own_profile? %>
|
100
|
-
<div class="text-center">
|
101
|
-
<%= link_to decidim.account_path, class: "button" do %>
|
102
|
-
<span>
|
103
|
-
<%= t("decidim.profiles.user.edit_profile") %>
|
104
|
-
</span>
|
105
|
-
<% end %>
|
106
|
-
</div>
|
107
|
-
<% if user_groups_enabled? %>
|
108
|
-
<div class="text-center">
|
109
|
-
<%= link_to decidim.new_group_path, class: "button hollow" do %>
|
110
|
-
<span>
|
111
|
-
<%= t("decidim.profiles.user.create_user_group") %>
|
112
|
-
</span>
|
113
|
-
<% end %>
|
114
|
-
</div>
|
115
|
-
<% end %>
|
116
|
-
<% elsif logged_in? %>
|
117
|
-
<%= cell "decidim/follow_button", profile_holder %>
|
118
|
-
<% end %>
|
119
|
-
|
120
|
-
<% if user_groups_enabled? %>
|
121
|
-
<% if can_edit_user_group_profile? %>
|
122
|
-
<% if user_group_email_to_be_confirmed? %>
|
123
|
-
<div class="text-center">
|
124
|
-
<%= link_to decidim.group_email_confirmation_path(model.nickname), method: :post, class: "button hollow expanded" do %>
|
125
|
-
<span>
|
126
|
-
<%= t("decidim.profiles.user.resend_email_confirmation_instructions") %>
|
127
|
-
</span>
|
128
|
-
<% end %>
|
129
|
-
</div>
|
130
|
-
<% end %>
|
131
|
-
|
132
|
-
<div class="text-center">
|
133
|
-
<%= link_to t("decidim.profiles.user.edit_user_group"), edit_group_path(profile_holder.nickname) %>
|
134
|
-
</div>
|
135
|
-
<div class="text-center">
|
136
|
-
<%= link_to t("decidim.profiles.user.manage_user_group_users"), profile_group_members_path(profile_holder.nickname) %>
|
137
|
-
</div>
|
138
|
-
<div class="text-center">
|
139
|
-
<%= link_to t("decidim.profiles.user.manage_user_group_admins"), profile_group_admins_path(profile_holder.nickname) %>
|
140
|
-
</div>
|
141
|
-
<div class="text-center">
|
142
|
-
<%= link_to t("decidim.profiles.user.invite_user"), group_invites_path(profile_holder.nickname) %>
|
143
|
-
</div>
|
144
|
-
<% end %>
|
145
|
-
|
146
|
-
<% if can_join_user_group? %>
|
147
|
-
<div class="text-center">
|
148
|
-
<%= link_to decidim.group_join_requests_path(model.nickname), method: :post, class: "button hollow expanded" do %>
|
149
|
-
<span>
|
150
|
-
<%= t("decidim.profiles.user.join_user_group") %>
|
151
|
-
</span>
|
152
|
-
<% end %>
|
153
|
-
</div>
|
154
|
-
<% end %>
|
155
|
-
|
156
|
-
<% if can_leave_group? %>
|
157
|
-
<div class="text-center">
|
158
|
-
<%= link_to decidim.leave_group_path(model.nickname), method: :delete, data: { confirm: t("decidim.groups.actions.are_you_sure") }, class: "button hollow expanded" do %>
|
159
|
-
<span>
|
160
|
-
<%= t("decidim.profiles.user.leave_user_group") %>
|
161
|
-
</span>
|
162
|
-
<% end %>
|
163
|
-
</div>
|
164
|
-
<% end %>
|
165
|
-
<% end %>
|
166
|
-
</div>
|
167
|
-
</div>
|