decidim-core 0.27.6 → 0.27.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/cells/decidim/follow_button_cell.rb +1 -1
- data/app/cells/decidim/notification/moderated.erb +24 -0
- data/app/cells/decidim/notification_cell.rb +5 -1
- data/app/controllers/concerns/decidim/force_authentication.rb +1 -1
- data/app/controllers/concerns/decidim/use_organization_time_zone.rb +1 -1
- data/app/controllers/decidim/links_controller.rb +13 -1
- data/app/mailers/decidim/application_mailer.rb +40 -6
- data/app/presenters/decidim/admin_log/organization_presenter.rb +1 -1
- data/app/presenters/decidim/log/resource_presenter.rb +7 -1
- data/app/services/decidim/log/diff_changeset_calculator.rb +1 -1
- data/app/views/decidim/links/new.html.erb +2 -0
- data/config/locales/ar.yml +0 -1
- data/config/locales/bg.yml +410 -1
- data/config/locales/ca.yml +1 -0
- data/config/locales/cs.yml +0 -1
- data/config/locales/de.yml +3 -2
- data/config/locales/el.yml +4 -1
- data/config/locales/en.yml +1 -0
- data/config/locales/eo.yml +3 -0
- data/config/locales/es-MX.yml +5 -4
- data/config/locales/es-PY.yml +5 -4
- data/config/locales/es.yml +5 -4
- data/config/locales/eu.yml +1 -0
- data/config/locales/fi-plain.yml +1 -0
- data/config/locales/fi.yml +1 -0
- data/config/locales/fr-CA.yml +3 -2
- data/config/locales/fr.yml +1 -0
- data/config/locales/ga-IE.yml +5 -0
- data/config/locales/hu.yml +0 -1
- data/config/locales/it.yml +4 -1
- data/config/locales/ja.yml +2 -1
- data/config/locales/lb.yml +4 -1
- data/config/locales/lt.yml +4 -1
- data/config/locales/lv.yml +4 -1
- data/config/locales/nl.yml +4 -1
- data/config/locales/no.yml +4 -1
- data/config/locales/pl.yml +31 -0
- data/config/locales/pt-BR.yml +0 -1
- data/config/locales/pt.yml +4 -1
- data/config/locales/ro-RO.yml +1 -0
- data/config/locales/ru.yml +4 -0
- data/config/locales/sk.yml +4 -1
- data/config/locales/sl.yml +5 -0
- data/config/locales/sv.yml +4 -1
- data/config/locales/tr-TR.yml +2 -0
- data/config/locales/uk.yml +1 -0
- data/config/locales/zh-CN.yml +0 -1
- data/config/locales/zh-TW.yml +4 -1
- data/lib/decidim/core/test/factories.rb +9 -3
- data/lib/decidim/core/test/shared_examples/has_attachment_collections.rb +3 -3
- data/lib/decidim/core/test/shared_examples/has_attachments.rb +1 -1
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/events/base_event.rb +4 -0
- data/lib/decidim/form_builder.rb +13 -1
- data/lib/decidim/organization_settings.rb +10 -2
- metadata +11 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71d8e583cc9dcd7338a03de09eb24a8a06a913f5e411b74bf16e5c42d9802639
|
|
4
|
+
data.tar.gz: c7028f8e3b04ab7c04afb94e6c74cbc114af7f734b5e65ff53d6a31bc0b6683e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f7df735fa2c671d915577eee036cb64b06c3ef85f4ecd1c95a65e22affb625f2a136c1596e55a7250f473397165f2364db867bad3287ecc3ffe5231e234cdc44
|
|
7
|
+
data.tar.gz: fd264b6e1db71ec2e9b1fb0cc31a73ddadf7c3e2a3dbe7209001f87f52a3840bae8f4bd406f5c84767460fea73fbcbf18a9f950b82d91d5b23c47b1bd02f60fa
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<div class="card card--widget">
|
|
2
|
+
<ul class="card-data">
|
|
3
|
+
<li class="card-data__item">
|
|
4
|
+
<div class="card__link text-center">
|
|
5
|
+
<%= resource_icon notification.resource, class: "icon--large" %>
|
|
6
|
+
<span class="text-medium mt-xs" title="<%= l(notification.created_at) %>" data-tooltip="true" data-disable-hover="false">
|
|
7
|
+
<%= notification.created_at_in_words %>
|
|
8
|
+
</span>
|
|
9
|
+
</div>
|
|
10
|
+
</li>
|
|
11
|
+
<li class="card-data__item card-data__item--expand absolutes">
|
|
12
|
+
<div class="mr-s">
|
|
13
|
+
<span class="text-small"><%= notification.event_class.constantize.model_name.human %></span>
|
|
14
|
+
<br>
|
|
15
|
+
<%= t("decidim.notifications.show.moderated") %>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="right center mr-s">
|
|
18
|
+
<%= link_to model, remote: true, method: :delete, class: "mark-as-read-button" do %>
|
|
19
|
+
<%= icon "circle-x", class: "card__link", aria_label: t("mark_as_read", scope: "layouts.decidim.notifications_dashboard"), role: "img" %>
|
|
20
|
+
<% end %>
|
|
21
|
+
</div>
|
|
22
|
+
</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
@@ -17,7 +17,7 @@ module Decidim
|
|
|
17
17
|
# Breaks the request lifecycle, if user is not authenticated.
|
|
18
18
|
# Otherwise returns.
|
|
19
19
|
def ensure_authenticated!
|
|
20
|
-
return true unless current_organization
|
|
20
|
+
return true unless current_organization&.force_users_to_authenticate_before_access_organization
|
|
21
21
|
|
|
22
22
|
# Next stop: Let's check whether auth is ok
|
|
23
23
|
unless user_signed_in?
|
|
@@ -35,7 +35,19 @@ module Decidim
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def external_url
|
|
38
|
-
@external_url ||= URI.parse(
|
|
38
|
+
@external_url ||= URI.parse(escape_url(params[:external_url]))
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def escape_url(external_url)
|
|
42
|
+
before_fragment, fragment = external_url.split("#", 2)
|
|
43
|
+
escaped_before_fragment = URI::Parser.new.escape(before_fragment)
|
|
44
|
+
|
|
45
|
+
if fragment
|
|
46
|
+
escaped_fragment = URI::Parser.new.escape(fragment)
|
|
47
|
+
"#{escaped_before_fragment}##{escaped_fragment}"
|
|
48
|
+
else
|
|
49
|
+
escaped_before_fragment
|
|
50
|
+
end
|
|
39
51
|
end
|
|
40
52
|
end
|
|
41
53
|
end
|
|
@@ -7,23 +7,57 @@ module Decidim
|
|
|
7
7
|
include LocalisedMailer
|
|
8
8
|
include MultitenantAssetHost
|
|
9
9
|
after_action :set_smtp
|
|
10
|
+
after_action :set_from
|
|
10
11
|
|
|
11
12
|
default from: Decidim.config.mailer_sender
|
|
12
13
|
layout "decidim/mailer"
|
|
13
14
|
|
|
14
15
|
private
|
|
15
16
|
|
|
17
|
+
attr_reader :organization
|
|
18
|
+
|
|
16
19
|
def set_smtp
|
|
17
|
-
return if
|
|
20
|
+
return if organization.nil? || organization.smtp_settings.blank? || organization.smtp_settings.except("from", "from_label", "from_email").all?(&:blank?)
|
|
18
21
|
|
|
19
|
-
mail.from = @organization.smtp_settings["from"].presence || mail.from
|
|
20
22
|
mail.reply_to = mail.reply_to || Decidim.config.mailer_reply
|
|
21
23
|
mail.delivery_method.settings.merge!(
|
|
22
|
-
address:
|
|
23
|
-
port:
|
|
24
|
-
user_name:
|
|
25
|
-
password: Decidim::AttributeEncryptor.decrypt(
|
|
24
|
+
address: organization.smtp_settings["address"],
|
|
25
|
+
port: organization.smtp_settings["port"],
|
|
26
|
+
user_name: organization.smtp_settings["user_name"],
|
|
27
|
+
password: Decidim::AttributeEncryptor.decrypt(organization.smtp_settings["encrypted_password"])
|
|
26
28
|
) { |_k, o, v| v.presence || o }.compact_blank!
|
|
27
29
|
end
|
|
30
|
+
|
|
31
|
+
def set_from
|
|
32
|
+
return if organization.nil?
|
|
33
|
+
return if already_defined_name_in_mail?(mail.from.first)
|
|
34
|
+
|
|
35
|
+
mail.from = sender
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def sender
|
|
39
|
+
return Decidim.config.mailer_sender if return_mailer_sender?
|
|
40
|
+
return default_sender if organization.smtp_settings.blank?
|
|
41
|
+
return default_sender if organization.smtp_settings["from"].nil?
|
|
42
|
+
return default_sender if organization.smtp_settings["from"].empty?
|
|
43
|
+
|
|
44
|
+
smtp_settings_from = organization.smtp_settings["from"]
|
|
45
|
+
return smtp_settings_from if already_defined_name_in_mail?(smtp_settings_from)
|
|
46
|
+
|
|
47
|
+
email_address_with_name(smtp_settings_from, organization.name)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def default_sender
|
|
51
|
+
email_address_with_name(Decidim.config.mailer_sender, organization.name)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def already_defined_name_in_mail?(mail_address)
|
|
55
|
+
# if there is an space, there is already a name in the address
|
|
56
|
+
mail_address.match?(/ /)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def return_mailer_sender?
|
|
60
|
+
already_defined_name_in_mail?(Decidim.config.mailer_sender) && organization.smtp_settings.present?
|
|
61
|
+
end
|
|
28
62
|
end
|
|
29
63
|
end
|
|
@@ -10,6 +10,8 @@ module Decidim
|
|
|
10
10
|
# overwrite `BasePresenter#resource_presenter` to return your custom resource presenter.
|
|
11
11
|
# The only requirement for custom renderers is that they should respond to `present`.
|
|
12
12
|
class ResourcePresenter
|
|
13
|
+
include Decidim::SanitizeHelper
|
|
14
|
+
|
|
13
15
|
# Public: Initializes the presenter.
|
|
14
16
|
#
|
|
15
17
|
# resource - An instance of a model that can be located by
|
|
@@ -65,7 +67,11 @@ module Decidim
|
|
|
65
67
|
#
|
|
66
68
|
# Returns an HTML-safe String.
|
|
67
69
|
def present_resource_name
|
|
68
|
-
|
|
70
|
+
if resource.present? && resource.respond_to?(:presenter) && resource.presenter.respond_to?(:title)
|
|
71
|
+
resource.presenter.title(html_escape: true)
|
|
72
|
+
else
|
|
73
|
+
decidim_escape_translated(extra["title"]).html_safe
|
|
74
|
+
end
|
|
69
75
|
end
|
|
70
76
|
end
|
|
71
77
|
end
|
|
@@ -86,7 +86,7 @@ module Decidim
|
|
|
86
86
|
locales.flat_map do |locale|
|
|
87
87
|
previous_value = values.first.try(:[], locale)
|
|
88
88
|
new_value = values.last.try(:[], locale)
|
|
89
|
-
if previous_value == new_value
|
|
89
|
+
if previous_value == new_value || (previous_value.nil? && new_value.blank?)
|
|
90
90
|
nil
|
|
91
91
|
else
|
|
92
92
|
label = generate_label(attribute, locale)
|