decidim-core 0.30.0.rc3 → 0.30.0
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/participatory_space_dropdown_metadata/show.erb +5 -3
- data/app/commands/decidim/create_report.rb +1 -6
- data/app/commands/decidim/search.rb +14 -0
- data/app/controllers/decidim/reports_controller.rb +1 -1
- data/app/forms/decidim/account_form.rb +4 -1
- data/app/mailers/decidim/reported_mailer.rb +1 -0
- data/app/models/decidim/action_log.rb +1 -9
- data/app/packs/src/decidim/datepicker/datepicker_functions.js +3 -3
- data/app/packs/src/decidim/index.js +4 -2
- data/app/packs/stylesheets/decidim/_content_blocks.scss +4 -0
- data/app/packs/stylesheets/decidim/_header.scss +6 -2
- 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 +2 -0
- 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/layouts/decidim/footer/_main_legal.html.erb +1 -1
- data/config/locales/ar.yml +3 -3
- data/config/locales/bg.yml +2 -2
- data/config/locales/bs-BA.yml +2 -0
- data/config/locales/ca-IT.yml +2400 -0
- data/config/locales/ca.yml +24 -2
- data/config/locales/cs.yml +10 -2
- data/config/locales/de.yml +13 -4
- data/config/locales/el.yml +2 -2
- data/config/locales/en.yml +22 -0
- data/config/locales/es-MX.yml +25 -3
- data/config/locales/es-PY.yml +25 -3
- data/config/locales/es.yml +23 -1
- data/config/locales/eu.yml +52 -31
- data/config/locales/fi-plain.yml +4 -3
- data/config/locales/fi.yml +4 -3
- data/config/locales/fr-CA.yml +16 -4
- data/config/locales/fr.yml +15 -3
- data/config/locales/ga-IE.yml +2 -0
- data/config/locales/gl.yml +3 -1
- data/config/locales/hu.yml +2 -2
- data/config/locales/id-ID.yml +2 -2
- data/config/locales/it.yml +12 -6
- data/config/locales/ja.yml +71 -9
- data/config/locales/lb.yml +5 -3
- data/config/locales/lv.yml +2 -2
- data/config/locales/nl.yml +2 -0
- data/config/locales/no.yml +2 -0
- data/config/locales/pl.yml +2 -2
- data/config/locales/pt-BR.yml +3 -3
- data/config/locales/pt.yml +2 -0
- data/config/locales/ro-RO.yml +172 -0
- data/config/locales/sk.yml +2 -2
- data/config/locales/sr-CS.yml +2 -0
- data/config/locales/sv.yml +19 -1
- data/config/locales/tr-TR.yml +3 -3
- data/config/locales/zh-CN.yml +2 -2
- data/config/locales/zh-TW.yml +2 -0
- 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/core/test/shared_examples/reports_examples.rb +8 -15
- 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/moderation_tools.rb +14 -8
- data/lib/decidim/participatory_space_user.rb +1 -3
- data/lib/decidim/reportable.rb +6 -2
- data/lib/decidim/translatable_attributes.rb +5 -1
- data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +3 -3
- metadata +7 -7
- data/lib/tasks/upgrade/clean_hidden_resources.rake +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfb327cabebd03ca7eb5e5327c4c10f0e8f1509552e959206bf19c75032a4152
|
4
|
+
data.tar.gz: 8062e844f6cfa3e3777d0684e4f9e2e071b68355e9008639d7dbb06803b792ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c7420aa2cb261ced54ea359fdaa3b4ef515b573ff6ef5eb2665df5f1d41858e4e1f5c08381d07e9fda401671be922dd9585dbcef14ada0cb3af197aea7cd66d
|
7
|
+
data.tar.gz: beeb21d36c097492f708b4de337e040bef8940e0d872b5e8d0d319c5ec6ad6f416d2f8ca225f8569a8e241d2b1140a17e6b9834ea4321343398ee38a074116c9
|
@@ -3,7 +3,9 @@
|
|
3
3
|
<%= render :metadata %>
|
4
4
|
<%= cell "decidim/content_blocks/menu_breadcrumb_last_activity", model, hide_participatory_space: true %>
|
5
5
|
</div>
|
6
|
-
<
|
7
|
-
|
8
|
-
|
6
|
+
<nav role="navigation" aria-label="<%= t("decidim.accessibility.secondary_menu") %>">
|
7
|
+
<ul class="menu-bar__secondary-dropdown__menu">
|
8
|
+
<%= render :links %>
|
9
|
+
</ul>
|
10
|
+
</nav>
|
9
11
|
</div>
|
@@ -34,7 +34,7 @@ module Decidim
|
|
34
34
|
send_report_notification_to_moderators
|
35
35
|
|
36
36
|
if hideable?
|
37
|
-
hide!
|
37
|
+
@tool.hide!
|
38
38
|
send_hide_notification_to_moderators
|
39
39
|
end
|
40
40
|
|
@@ -72,11 +72,6 @@ module Decidim
|
|
72
72
|
hidden_by_admin? || (!@reportable.hidden? && moderation.report_count >= Decidim.max_reports_before_hiding)
|
73
73
|
end
|
74
74
|
|
75
|
-
def hide!
|
76
|
-
@tool.hide!
|
77
|
-
@tool.send_notification_to_author
|
78
|
-
end
|
79
|
-
|
80
75
|
def send_hide_notification_to_moderators
|
81
76
|
participatory_space_moderators.each do |moderator|
|
82
77
|
next unless moderator.email_on_moderations
|
@@ -37,6 +37,12 @@ module Decidim
|
|
37
37
|
klass.order_by_id_list(result_ids.take(HIGHLIGHTED_RESULTS_COUNT))
|
38
38
|
end
|
39
39
|
|
40
|
+
uncommentable_resources = uncommentable_resources(results) if results.present?
|
41
|
+
if uncommentable_resources.present?
|
42
|
+
results -= uncommentable_resources
|
43
|
+
results_count -= uncommentable_resources.count
|
44
|
+
end
|
45
|
+
|
40
46
|
results_by_type.update(class_name => {
|
41
47
|
count: results_count,
|
42
48
|
results:
|
@@ -89,5 +95,13 @@ module Decidim
|
|
89
95
|
query = query.global_search(I18n.transliterate(term)) if term.present?
|
90
96
|
query
|
91
97
|
end
|
98
|
+
|
99
|
+
def uncommentable_resources(results)
|
100
|
+
results.where(id: results.select { |obj| related_uncommentable_resources?(obj) }.map(&:id))
|
101
|
+
end
|
102
|
+
|
103
|
+
def related_uncommentable_resources?(object)
|
104
|
+
object.respond_to?(:commentable) && !object.commentable.commentable?
|
105
|
+
end
|
92
106
|
end
|
93
107
|
end
|
@@ -16,7 +16,7 @@ module Decidim
|
|
16
16
|
CreateReport.call(@form, reportable) do
|
17
17
|
on(:ok) do
|
18
18
|
flash[:notice] = I18n.t("decidim.reports.create.success")
|
19
|
-
|
19
|
+
redirect_to reportable.reload.reported_content_url
|
20
20
|
end
|
21
21
|
|
22
22
|
on(:invalid) do
|
@@ -21,7 +21,10 @@ module Decidim
|
|
21
21
|
|
22
22
|
validates :name, presence: true, format: { with: Decidim::User::REGEXP_NAME }
|
23
23
|
validates :email, presence: true, "valid_email_2/email": { disposable: true }
|
24
|
-
validates :nickname,
|
24
|
+
validates :nickname,
|
25
|
+
presence: true,
|
26
|
+
format: { with: Decidim::User::REGEXP_NICKNAME, message: :format },
|
27
|
+
length: { maximum: Decidim::User.nickname_max_length }
|
25
28
|
|
26
29
|
validates :nickname, length: { maximum: Decidim::User.nickname_max_length, allow_blank: true }
|
27
30
|
validates :password, password: { name: :name, email: :email, username: :nickname }, if: -> { password.present? }
|
@@ -25,6 +25,7 @@ module Decidim
|
|
25
25
|
with_user(user) do
|
26
26
|
@report = report
|
27
27
|
@participatory_space = @report.moderation.participatory_space
|
28
|
+
@reportable = @report.moderation.reportable
|
28
29
|
@organization = user.organization
|
29
30
|
@user = user
|
30
31
|
subject = I18n.t("hide.subject", scope: "decidim.reported_mailer")
|
@@ -157,15 +157,7 @@ module Decidim
|
|
157
157
|
|
158
158
|
def self.publicable_public_resource_types
|
159
159
|
@publicable_public_resource_types ||= public_resource_types
|
160
|
-
.select { |klass| klass.constantize.column_names.include?("published_at") }
|
161
|
-
end
|
162
|
-
|
163
|
-
def self.publicable_exceptions
|
164
|
-
@publicable_exceptions = %w(
|
165
|
-
Decidim::Blogs::Post
|
166
|
-
).select do |klass|
|
167
|
-
klass.safe_constantize.present?
|
168
|
-
end
|
160
|
+
.select { |klass| klass.constantize.column_names.include?("published_at") }
|
169
161
|
end
|
170
162
|
|
171
163
|
def self.ransackable_scopes(auth_object = nil)
|
@@ -29,12 +29,12 @@ export const formatInputDate = (date, formats) => {
|
|
29
29
|
const month = dateList[1];
|
30
30
|
const day = dateList[2];
|
31
31
|
|
32
|
-
if (formats.order === "d-
|
33
|
-
return `${
|
32
|
+
if (formats.order === "m-d-y") {
|
33
|
+
return `${month}${formats.separator}${day}${formats.separator}${year}`;
|
34
34
|
} else if (formats.order === "y-m-d") {
|
35
35
|
return `${year}${formats.separator}${month}${formats.separator}${day}`;
|
36
36
|
};
|
37
|
-
return `${
|
37
|
+
return `${day}${formats.separator}${month}${formats.separator}${year}`;
|
38
38
|
};
|
39
39
|
|
40
40
|
export const formatInputTime = (time, format, input) => {
|
@@ -71,7 +71,8 @@ import handleNotificationActions from "src/decidim/notifications_actions"
|
|
71
71
|
import RemoteModal from "src/decidim/remote_modal"
|
72
72
|
import selectActiveIdentity from "src/decidim/identity_selector_dialog"
|
73
73
|
import createTooltip from "src/decidim/tooltips"
|
74
|
-
|
74
|
+
// Temporary disabling this feature because we have a poor performance. See https://github.com/decidim/decidim/issues/14431
|
75
|
+
// import fetchRemoteTooltip from "src/decidim/remote_tooltips"
|
75
76
|
import createToggle from "src/decidim/toggle"
|
76
77
|
import {
|
77
78
|
createAccordion,
|
@@ -202,7 +203,8 @@ const initializer = (element = document) => {
|
|
202
203
|
// Initialize data-toggles
|
203
204
|
element.querySelectorAll("[data-toggle]").forEach((elem) => createToggle(elem))
|
204
205
|
|
205
|
-
|
206
|
+
// Temporary disabling this feature because we have a poor performance. See https://github.com/decidim/decidim/issues/14431
|
207
|
+
// element.querySelectorAll("[data-remote-tooltip]").forEach((elem) => fetchRemoteTooltip(elem))
|
206
208
|
|
207
209
|
element.querySelectorAll(".new_report").forEach((elem) => changeReportFormBehavior(elem))
|
208
210
|
|
@@ -167,7 +167,7 @@ header {
|
|
167
167
|
}
|
168
168
|
|
169
169
|
&__item {
|
170
|
-
@apply relative;
|
170
|
+
@apply flex relative;
|
171
171
|
}
|
172
172
|
|
173
173
|
&__search {
|
@@ -434,8 +434,12 @@ header {
|
|
434
434
|
@apply h4 md:h3;
|
435
435
|
}
|
436
436
|
|
437
|
+
nav {
|
438
|
+
@apply w-full md:w-1/4;
|
439
|
+
}
|
440
|
+
|
437
441
|
&__menu {
|
438
|
-
@apply w-full
|
442
|
+
@apply w-full bg-primary px-4 md:px-8 pt-0 pb-3 md:py-3 divide-y divide-gray-3 text-white;
|
439
443
|
|
440
444
|
> * {
|
441
445
|
@apply py-3 md:py-3.5;
|
@@ -46,6 +46,7 @@ module Decidim
|
|
46
46
|
# Returns an HTML-safe String.
|
47
47
|
def present_user
|
48
48
|
return h.content_tag(:span, present_user_name, class: "logs__log__author") if user.blank?
|
49
|
+
return I18n.t("decidim.profile.deleted") if user.respond_to?(:deleted?) && user.deleted?
|
49
50
|
|
50
51
|
h.link_to(
|
51
52
|
present_user_name,
|
@@ -41,6 +41,8 @@ module Decidim
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def parse_i18n_changeset(attribute, values, type, diff)
|
44
|
+
return diff unless values.last.is_a?(Hash)
|
45
|
+
|
44
46
|
(values.last.keys - ["machine_translations"]).each do |locale, _value|
|
45
47
|
first_value = values.first.try(:[], locale)
|
46
48
|
last_value = values.last.try(:[], locale)
|
@@ -1,9 +1,25 @@
|
|
1
1
|
<p class="email-greeting"><%= t(".hello", name: @user.name) %></p>
|
2
2
|
|
3
3
|
<p class="email-instructions">
|
4
|
-
<%= t(".report_html", url:
|
4
|
+
<%= t(".report_html", url: report_url ) %>
|
5
5
|
</p>
|
6
6
|
|
7
|
+
<p><b><%= t(".participatory_space") %></b></p>
|
8
|
+
<p><%= link_to translated_attribute(@participatory_space.title), resource_locator(@participatory_space).url %></p>
|
9
|
+
|
10
|
+
<p><b><%= t(".reason") %></b></p>
|
11
|
+
<p><%= t(@report.reason, organization_name: organization_name(@participatory_space.organization), scope: "decidim.shared.flag_modal") %></p>
|
12
|
+
|
13
|
+
<% if @report.details.present? %>
|
14
|
+
<p><b><%= t(".details") %></b></p>
|
15
|
+
<blockquote>
|
16
|
+
<%= @report.details %>
|
17
|
+
</blockquote>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<p><b><%= t(".content") %></b></p>
|
21
|
+
<%= reported_content_cell %>
|
22
|
+
|
7
23
|
<p class="email-button email-button__cta">
|
8
24
|
<%= link_to t(".manage_moderations"), manage_moderations_url %>
|
9
25
|
</p>
|
@@ -1,44 +1,46 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
<%
|
6
|
-
|
7
|
-
|
1
|
+
<nav role="navigation" aria-labelledby="search-results-title">
|
2
|
+
<div class="filter-container search__filter">
|
3
|
+
<button id="dropdown-trigger-search" data-component="dropdown" data-target="dropdown-menu-search" data-auto-close="true">
|
4
|
+
<%= content_tag :span, t("decidim.searches.filters_small_view.filter_by"), class: "#{"is-active" if params.dig(:filter, :with_resource_type) == nil}" %>
|
5
|
+
<% @blocks.each do |elements| %>
|
6
|
+
<% elements.each do |type, results| %>
|
7
|
+
<%= content_tag :span, class: "#{"is-active" if params.dig(:filter, :with_resource_type) == type}" do %>
|
8
|
+
<span><%= searchable_resource_human_name(type) %></span>
|
9
|
+
<% end %>
|
8
10
|
<% end %>
|
9
11
|
<% end %>
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<div id="dropdown-menu-search" aria-hidden="true">
|
15
|
-
<div>
|
16
|
-
<%= link_to main_search_path, class: "filter#{" is-active" if params.dig(:filter, :with_resource_type) == nil}" do %>
|
17
|
-
<%= resource_type_icon("all") %>
|
18
|
-
<span><%= t("all", scope: "decidim.searches.filters.state") %></span>
|
19
|
-
<span class="label ml-auto"><%= @results_count %></span>
|
20
|
-
<% end %>
|
21
|
-
</div>
|
22
|
-
<% @blocks.each do |elements| %>
|
12
|
+
<%= icon "arrow-down-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
|
13
|
+
<%= icon "arrow-up-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
|
14
|
+
</button>
|
15
|
+
<div id="dropdown-menu-search" aria-hidden="true">
|
23
16
|
<div>
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
<%= resource_type_icon(type) %>
|
29
|
-
<span><%= searchable_resource_human_name(type) %></span>
|
30
|
-
<span class="label ml-auto"><%= results[:count] %></span>
|
31
|
-
<% end %>
|
32
|
-
<% else %>
|
33
|
-
<%= content_tag :div, class: "filter#{" is-empty" if results[:count].zero?}" do %>
|
34
|
-
<%= resource_type_icon(type) %>
|
35
|
-
<span><%= searchable_resource_human_name(type) %></span>
|
36
|
-
<span class="label ml-auto"><%= results[:count] %></span>
|
37
|
-
<% end %>
|
38
|
-
<% end %>
|
39
|
-
</div>
|
17
|
+
<%= link_to main_search_path, class: "filter#{" is-active" if params.dig(:filter, :with_resource_type) == nil}" do %>
|
18
|
+
<%= resource_type_icon("all") %>
|
19
|
+
<span><%= t("all", scope: "decidim.searches.filters.state") %></span>
|
20
|
+
<span class="label ml-auto"><%= @results_count %></span>
|
40
21
|
<% end %>
|
41
22
|
</div>
|
42
|
-
|
23
|
+
<% @blocks.each do |elements| %>
|
24
|
+
<div>
|
25
|
+
<% elements.each do |type, results| %>
|
26
|
+
<div>
|
27
|
+
<% if results[:count].positive? %>
|
28
|
+
<%= link_to search_path_by_resource_type(type), class: "filter#{" is-active" if params.dig(:filter, :with_resource_type) == type}" do %>
|
29
|
+
<%= resource_type_icon(type) %>
|
30
|
+
<span><%= searchable_resource_human_name(type) %></span>
|
31
|
+
<span class="label ml-auto"><%= results[:count] %></span>
|
32
|
+
<% end %>
|
33
|
+
<% else %>
|
34
|
+
<%= content_tag :div, class: "filter#{" is-empty" if results[:count].zero?}" do %>
|
35
|
+
<%= resource_type_icon(type) %>
|
36
|
+
<span><%= searchable_resource_human_name(type) %></span>
|
37
|
+
<span class="label ml-auto"><%= results[:count] %></span>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
40
|
+
</div>
|
41
|
+
<% end %>
|
42
|
+
</div>
|
43
|
+
<% end %>
|
44
|
+
</div>
|
43
45
|
</div>
|
44
|
-
</
|
46
|
+
</nav>
|
@@ -3,6 +3,6 @@
|
|
3
3
|
<%= link_to t("layouts.decidim.footer.terms_of_service"), decidim.page_path("terms-of-service") %>
|
4
4
|
</li>
|
5
5
|
<li>
|
6
|
-
<a href="#" data-dialog-open="dc-modal"><%= t("layouts.decidim.footer.data_consent_settings") %></a>
|
6
|
+
<a href="#" role="button" data-dialog-open="dc-modal"><%= t("layouts.decidim.footer.data_consent_settings") %></a>
|
7
7
|
</li>
|
8
8
|
</ul>
|
data/config/locales/ar.yml
CHANGED
@@ -488,7 +488,7 @@ ar:
|
|
488
488
|
metrics:
|
489
489
|
name: مقاييس المنظمة
|
490
490
|
participatory_space_metrics:
|
491
|
-
name:
|
491
|
+
name: المشاركة في الأرقام
|
492
492
|
participatory_space_stats:
|
493
493
|
name: الإحصائيات
|
494
494
|
social_networks_metadata:
|
@@ -994,7 +994,7 @@ ar:
|
|
994
994
|
participants:
|
995
995
|
description: عدد المشاركين النشطين في المنظمة
|
996
996
|
object: المشاركين
|
997
|
-
title:
|
997
|
+
title: المشاركون
|
998
998
|
reported_users:
|
999
999
|
description: عدد المشاركين المبلّغ عنهم
|
1000
1000
|
user_reports:
|
@@ -1002,7 +1002,7 @@ ar:
|
|
1002
1002
|
users:
|
1003
1003
|
description: عدد المشاركين في المنظمة
|
1004
1004
|
object: المشاركين
|
1005
|
-
title:
|
1005
|
+
title: المشاركون
|
1006
1006
|
newsletter_mailer:
|
1007
1007
|
newsletter:
|
1008
1008
|
no_reply_notice: تم إرسال هذا البريد الإلكتروني من عنوان بريد إلكتروني للإشعارات لا يستقبل لا بريد إلكتروني وارد. يرجى عدم الرد على هذه الرسالة.
|
data/config/locales/bg.yml
CHANGED
@@ -92,7 +92,7 @@ bg:
|
|
92
92
|
decidim_with_month_name_short: "%d %b"
|
93
93
|
help:
|
94
94
|
date_format: 'Формат: дд/мм/гггг'
|
95
|
-
order:
|
95
|
+
order: d-m-y
|
96
96
|
separator: "/"
|
97
97
|
datetime:
|
98
98
|
distance_in_words:
|
@@ -539,7 +539,7 @@ bg:
|
|
539
539
|
metrics:
|
540
540
|
name: Показатели за организацията
|
541
541
|
participatory_space_metrics:
|
542
|
-
name:
|
542
|
+
name: Индикатори
|
543
543
|
participatory_space_stats:
|
544
544
|
name: Статистики
|
545
545
|
social_networks_metadata:
|