decidim-core 0.27.4 → 0.27.5
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/upload_modal/modal.erb +4 -1
- data/app/cells/decidim/upload_modal_cell.rb +8 -4
- data/app/cells/decidim/version_cell.rb +1 -1
- data/app/cells/decidim/versions_list_cell.rb +1 -1
- data/app/commands/decidim/endorse_resource.rb +2 -0
- data/app/commands/decidim/search.rb +1 -1
- data/app/commands/decidim/unendorse_resource.rb +1 -1
- data/app/controllers/concerns/decidim/force_authentication.rb +6 -2
- data/app/controllers/decidim/devise/registrations_controller.rb +1 -1
- data/app/controllers/decidim/links_controller.rb +1 -1
- data/app/controllers/decidim/searches_controller.rb +1 -1
- data/app/controllers/decidim/user_timeline_controller.rb +1 -1
- data/app/forms/decidim/account_form.rb +1 -1
- data/app/forms/decidim/notifications_settings_form.rb +0 -8
- data/app/forms/decidim/registration_form.rb +1 -1
- data/app/helpers/decidim/decidim_form_helper.rb +1 -0
- data/app/helpers/decidim/omniauth_helper.rb +2 -0
- data/app/helpers/decidim/resource_helper.rb +2 -0
- data/app/helpers/decidim/short_link_helper.rb +1 -1
- data/app/jobs/decidim/download_your_data_export_job.rb +2 -1
- data/app/jobs/decidim/open_data_job.rb +2 -0
- data/app/models/decidim/user.rb +9 -1
- data/app/packs/images/decidim/icons.svg +1 -1
- data/app/packs/images/decidim/vendor/social-share-button/x.svg +6 -0
- data/app/packs/src/decidim/autocomplete.js +11 -2
- data/app/packs/src/decidim/data_picker.js +1 -0
- data/app/packs/src/decidim/direct_uploads/upload_field.js +6 -4
- data/app/packs/src/decidim/direct_uploads/upload_modal.js +10 -8
- data/app/packs/src/decidim/direct_uploads/uploader.js +4 -1
- data/app/packs/src/decidim/geocoding/attach_input.js +4 -1
- data/app/packs/src/decidim/geocoding/provider/here.js +17 -21
- data/app/packs/src/decidim/geocoding/provider/photon.js +1 -1
- data/app/packs/src/decidim/utilities/text.js +17 -0
- data/app/packs/stylesheets/decidim/_variables.scss +1 -1
- data/app/packs/stylesheets/decidim/vendor/_social_share_button.scss +4 -0
- data/app/views/decidim/notifications_settings/show.html.erb +1 -1
- data/app/views/decidim/scopes/_scopes_picker_input.html.erb +1 -1
- data/app/views/decidim/searches/_filters.html.erb +3 -1
- data/app/views/decidim/shared/_share_modal.html.erb +1 -1
- data/app/views/decidim/shared/participatory_space_filters/_filters.html.erb +1 -1
- data/app/views/layouts/decidim/_social_media_links.html.erb +2 -2
- data/config/environment.rb +3 -0
- data/config/locales/ar.yml +8 -14
- data/config/locales/bg.yml +4 -16
- data/config/locales/ca.yml +12 -8
- data/config/locales/cs.yml +18 -14
- data/config/locales/de.yml +39 -35
- data/config/locales/el.yml +10 -13
- data/config/locales/en.yml +5 -1
- data/config/locales/eo.yml +2 -3
- data/config/locales/es-MX.yml +14 -10
- data/config/locales/es-PY.yml +14 -10
- data/config/locales/es.yml +10 -6
- data/config/locales/eu.yml +491 -342
- data/config/locales/fi-plain.yml +7 -3
- data/config/locales/fi.yml +18 -14
- data/config/locales/fr-CA.yml +15 -11
- data/config/locales/fr.yml +10 -6
- data/config/locales/ga-IE.yml +5 -5
- data/config/locales/gl.yml +2 -19
- data/config/locales/hu.yml +23 -16
- data/config/locales/id-ID.yml +4 -19
- data/config/locales/is-IS.yml +4 -2
- data/config/locales/it.yml +14 -14
- data/config/locales/ja.yml +23 -20
- data/config/locales/lb.yml +14 -14
- data/config/locales/lt.yml +56 -8
- data/config/locales/lv.yml +4 -16
- data/config/locales/nl.yml +12 -12
- data/config/locales/no.yml +7 -7
- data/config/locales/pl.yml +20 -6
- data/config/locales/pt-BR.yml +159 -6
- data/config/locales/pt.yml +7 -7
- data/config/locales/ro-RO.yml +4 -7
- data/config/locales/ru.yml +4 -17
- data/config/locales/sk.yml +5 -17
- data/config/locales/sl.yml +0 -5
- data/config/locales/sq-AL.yml +1 -0
- data/config/locales/sv.yml +33 -15
- data/config/locales/th-TH.yml +1 -0
- data/config/locales/tr-TR.yml +17 -12
- data/config/locales/uk.yml +3 -14
- data/config/locales/zh-CN.yml +6 -7
- data/config/locales/zh-TW.yml +0 -6
- data/db/migrate/20231027142329_change_default_value_for_decidim_endorsements.rb +11 -0
- data/db/seeds.rb +1 -0
- data/lib/decidim/core/test/factories.rb +2 -1
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +24 -0
- data/lib/decidim/core/test/shared_examples/errors.rb +2 -0
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +1 -1
- data/lib/decidim/endorsable.rb +1 -1
- data/lib/decidim/exporters.rb +10 -1
- data/lib/decidim/form_builder.rb +1 -0
- data/lib/decidim/has_category.rb +2 -2
- data/lib/tasks/upgrade/decidim_deduplicate_endorsements.rake +53 -0
- data/lib/tasks/upgrade/decidim_fix_short_url_resolver.rake +22 -0
- metadata +14 -10
- data/app/helpers/decidim/layout_helper.rb.orig +0 -225
- data/app/packs/stylesheets/decidim/modules/_dropdown_menu.scss +0 -9
- data/app/views/decidim/devise/registrations/new.html.erb.orig +0 -231
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c9b09dc6caf48cd1318acfd39efaef6e9aa95ed3527ff40c3974a56f409eeff7
|
|
4
|
+
data.tar.gz: bb6ca8ea6d9b57a37d6793757cd8a12bbcffdf63afd27924216f67af1d8acb14
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4003252d8eeae3f86cb4056380f4fb7aefe8a8e97f3935e97a970513ccdd05e9d6b9ca8658b56147b7bff0e306608472e656db871eae5bbb50ab9cfc1e629d4b
|
|
7
|
+
data.tar.gz: ce5aec4bd84ee34b87b5b7cc3f1afb08a1e6bcc3c34ff5cf1afa87d3ded13fe012f29a6a882fead250413f64db4a9b643770ca2c0e643e186ea51bb57a2e6c87
|
|
@@ -35,7 +35,10 @@
|
|
|
35
35
|
label: false,
|
|
36
36
|
multiple: true,
|
|
37
37
|
direct_upload: true,
|
|
38
|
-
data: {
|
|
38
|
+
data: {
|
|
39
|
+
direct_upload_url: direct_upload_url,
|
|
40
|
+
upload_validations_url: upload_validations_url
|
|
41
|
+
} %>
|
|
39
42
|
<span><%= t("decidim.forms.upload_help.dropzone") %></span>
|
|
40
43
|
</label>
|
|
41
44
|
</div>
|
|
@@ -156,15 +156,15 @@ module Decidim
|
|
|
156
156
|
end
|
|
157
157
|
|
|
158
158
|
def truncated_file_name_for(attachment, max_length = 31)
|
|
159
|
-
filename =
|
|
160
|
-
return filename if filename.length <= max_length
|
|
159
|
+
filename = determine_filename(attachment)
|
|
160
|
+
return decidim_html_escape(filename).html_safe if filename.length <= max_length
|
|
161
161
|
|
|
162
162
|
name = File.basename(filename, File.extname(filename))
|
|
163
|
-
name.truncate(max_length, omission: "...#{name.last((max_length / 2) - 3)}#{File.extname(filename)}")
|
|
163
|
+
decidim_html_escape(name.truncate(max_length, omission: "...#{name.last((max_length / 2) - 3)}#{File.extname(filename)}")).html_safe
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
def file_name_for(attachment)
|
|
167
|
-
determine_filename(attachment)
|
|
167
|
+
decidim_html_escape(determine_filename(attachment)).html_safe
|
|
168
168
|
end
|
|
169
169
|
|
|
170
170
|
def determine_filename(attachment)
|
|
@@ -205,6 +205,10 @@ module Decidim
|
|
|
205
205
|
Rails.application.class.routes.url_helpers.rails_direct_uploads_path
|
|
206
206
|
end
|
|
207
207
|
|
|
208
|
+
def upload_validations_url
|
|
209
|
+
Decidim::Core::Engine.routes.url_helpers.upload_validations_path
|
|
210
|
+
end
|
|
211
|
+
|
|
208
212
|
def form_object_class
|
|
209
213
|
form.object.class.to_s
|
|
210
214
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Decidim
|
|
4
4
|
# A command that will act as a search service, with all the business logic for performing searches.
|
|
5
5
|
class Search < Decidim::Command
|
|
6
|
-
ACCEPTED_FILTERS = [:
|
|
6
|
+
ACCEPTED_FILTERS = [:decidim_scope_id_in].freeze
|
|
7
7
|
HIGHLIGHTED_RESULTS_COUNT = 4
|
|
8
8
|
|
|
9
9
|
# Public: Initializes the command.
|
|
@@ -31,7 +31,7 @@ module Decidim
|
|
|
31
31
|
query = if @current_group.present?
|
|
32
32
|
@resource.endorsements.where(decidim_user_group_id: @current_group&.id)
|
|
33
33
|
else
|
|
34
|
-
@resource.endorsements.where(author: @current_user, decidim_user_group_id:
|
|
34
|
+
@resource.endorsements.where(author: @current_user, decidim_user_group_id: 0)
|
|
35
35
|
end
|
|
36
36
|
query.destroy_all
|
|
37
37
|
end
|
|
@@ -35,11 +35,15 @@ module Decidim
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def unauthorized_paths
|
|
38
|
-
|
|
39
|
-
%w(/locale) + Decidim::StaticPage.where(
|
|
38
|
+
default_unauthorized_paths + Decidim::StaticPage.where(
|
|
40
39
|
organization: current_organization,
|
|
41
40
|
allow_public_access: true
|
|
42
41
|
).pluck(Arel.sql("CONCAT('/pages/', slug)"))
|
|
43
42
|
end
|
|
43
|
+
|
|
44
|
+
def default_unauthorized_paths
|
|
45
|
+
# /locale is for changing the locale and /manifest.webmanifest to request PWA manifest
|
|
46
|
+
%w(/locale /manifest.webmanifest)
|
|
47
|
+
end
|
|
44
48
|
end
|
|
45
49
|
end
|
|
@@ -12,7 +12,7 @@ module Decidim
|
|
|
12
12
|
helper_method :activities, :resource_types, :user
|
|
13
13
|
|
|
14
14
|
def index
|
|
15
|
-
raise ActionController::RoutingError, "Not Found"
|
|
15
|
+
raise ActionController::RoutingError, "Not Found" unless user && current_user == user
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
private
|
|
@@ -24,7 +24,7 @@ module Decidim
|
|
|
24
24
|
validates :nickname, presence: true, format: { with: Decidim::User::REGEXP_NICKNAME }
|
|
25
25
|
|
|
26
26
|
validates :nickname, length: { maximum: Decidim::User.nickname_max_length, allow_blank: true }
|
|
27
|
-
validates :password, confirmation:
|
|
27
|
+
validates :password, confirmation: { message: I18n.t("errors.messages.password_confirmation_message") }
|
|
28
28
|
validates :password, password: { name: :name, email: :email, username: :nickname }, if: -> { password.present? }
|
|
29
29
|
validates :password_confirmation, presence: true, if: :password_present
|
|
30
30
|
validates :avatar, passthru: { to: Decidim::User }
|
|
@@ -44,14 +44,6 @@ module Decidim
|
|
|
44
44
|
allow_public_contact ? "all" : "followed-only"
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
def user_is_moderator?(user)
|
|
48
|
-
Decidim.participatory_space_manifests.map do |manifest|
|
|
49
|
-
participatory_space_type = manifest.model_class_name.constantize
|
|
50
|
-
return true if participatory_space_type.moderators(user.organization).exists?(id: user.id)
|
|
51
|
-
end
|
|
52
|
-
false
|
|
53
|
-
end
|
|
54
|
-
|
|
55
47
|
def meet_push_notifications_requirements?
|
|
56
48
|
Rails.application.secrets.dig(:vapid, :enabled) || false
|
|
57
49
|
end
|
|
@@ -17,7 +17,7 @@ module Decidim
|
|
|
17
17
|
validates :name, presence: true, format: { with: Decidim::User::REGEXP_NAME }
|
|
18
18
|
validates :nickname, presence: true, format: { with: Decidim::User::REGEXP_NICKNAME }, length: { maximum: Decidim::User.nickname_max_length }
|
|
19
19
|
validates :email, presence: true, "valid_email_2/email": { disposable: true }
|
|
20
|
-
validates :password, confirmation:
|
|
20
|
+
validates :password, confirmation: { message: I18n.t("errors.messages.password_confirmation_message") }
|
|
21
21
|
validates :password, password: { name: :name, email: :email, username: :nickname }
|
|
22
22
|
validates :password_confirmation, presence: true
|
|
23
23
|
validates :tos_agreement, allow_nil: false, acceptance: true
|
|
@@ -67,6 +67,8 @@ module Decidim
|
|
|
67
67
|
|
|
68
68
|
# Returns an instance of ResourceLocatorPresenter with the given resource
|
|
69
69
|
def resource_locator(resource)
|
|
70
|
+
return resource.resource_locator if resource.respond_to?(:resource_locator)
|
|
71
|
+
|
|
70
72
|
::Decidim::ResourceLocatorPresenter.new(resource)
|
|
71
73
|
end
|
|
72
74
|
|
|
@@ -21,7 +21,7 @@ module Decidim
|
|
|
21
21
|
target ||= respond_to?(:current_organization) && current_organization
|
|
22
22
|
target ||= Rails.application
|
|
23
23
|
|
|
24
|
-
mounted_engine = EngineResolver.new(_routes).mounted_name
|
|
24
|
+
mounted_engine = target.try(:mounted_engine) || EngineResolver.new(_routes).mounted_name
|
|
25
25
|
ShortLink.to(target, mounted_engine, **kwargs).short_url
|
|
26
26
|
end
|
|
27
27
|
end
|
|
@@ -11,6 +11,8 @@ module Decidim
|
|
|
11
11
|
raise "Couldn't generate Open Data export" unless exporter.export.positive?
|
|
12
12
|
|
|
13
13
|
organization.open_data_file.attach(io: File.open(path, "rb"), filename: organization.open_data_file_path)
|
|
14
|
+
# Deletes the temporary file file
|
|
15
|
+
File.delete(path)
|
|
14
16
|
end
|
|
15
17
|
end
|
|
16
18
|
end
|
data/app/models/decidim/user.rb
CHANGED
|
@@ -205,7 +205,7 @@ module Decidim
|
|
|
205
205
|
end
|
|
206
206
|
|
|
207
207
|
def admin_terms_accepted?
|
|
208
|
-
|
|
208
|
+
admin_terms_accepted_at.present?
|
|
209
209
|
end
|
|
210
210
|
|
|
211
211
|
# Whether this user can be verified against some authorization or not.
|
|
@@ -269,6 +269,14 @@ module Decidim
|
|
|
269
269
|
password_updated_at < Decidim.config.admin_password_expiration_days.days.ago
|
|
270
270
|
end
|
|
271
271
|
|
|
272
|
+
def moderator?
|
|
273
|
+
Decidim.participatory_space_manifests.map do |manifest|
|
|
274
|
+
participatory_space_type = manifest.model_class_name.constantize
|
|
275
|
+
return true if participatory_space_type.moderators(organization).exists?(id: id)
|
|
276
|
+
end
|
|
277
|
+
false
|
|
278
|
+
end
|
|
279
|
+
|
|
272
280
|
protected
|
|
273
281
|
|
|
274
282
|
# Overrides devise email required validation.
|