decidim-core 0.30.0.rc3 → 0.30.1
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 +1 -1
- 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/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/reports_controller.rb +7 -2
- data/app/forms/decidim/account_form.rb +4 -1
- data/app/forms/decidim/ephemeral_user_form.rb +1 -1
- 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/paginate_helper.rb +1 -1
- data/app/helpers/decidim/tooltip_helper.rb +4 -1
- 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/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/stylesheets/decidim/_cards.scss +1 -1
- data/app/packs/stylesheets/decidim/_content_blocks.scss +4 -0
- data/app/packs/stylesheets/decidim/_header.scss +60 -37
- data/app/packs/stylesheets/decidim/resource_history.scss +14 -4
- 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/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/_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 +3 -10
- data/config/locales/bg.yml +2 -9
- data/config/locales/bs-BA.yml +2 -0
- data/config/locales/ca-IT.yml +2411 -0
- data/config/locales/ca.yml +36 -3
- data/config/locales/cs.yml +33 -14
- data/config/locales/de.yml +39 -15
- data/config/locales/el.yml +2 -9
- data/config/locales/en.yml +34 -1
- data/config/locales/es-MX.yml +38 -5
- data/config/locales/es-PY.yml +38 -5
- data/config/locales/es.yml +35 -2
- data/config/locales/eu.yml +68 -35
- data/config/locales/fi-plain.yml +4 -18
- data/config/locales/fi.yml +4 -18
- data/config/locales/fr-CA.yml +30 -12
- data/config/locales/fr.yml +29 -11
- data/config/locales/ga-IE.yml +2 -0
- data/config/locales/gl.yml +3 -6
- data/config/locales/hu.yml +2 -9
- data/config/locales/id-ID.yml +2 -7
- data/config/locales/is-IS.yml +0 -5
- data/config/locales/it.yml +12 -11
- data/config/locales/ja.yml +87 -23
- data/config/locales/lb.yml +5 -8
- data/config/locales/lt.yml +0 -7
- data/config/locales/lv.yml +2 -7
- data/config/locales/nl.yml +2 -5
- data/config/locales/no.yml +2 -5
- data/config/locales/pl.yml +2 -9
- data/config/locales/pt-BR.yml +3 -10
- data/config/locales/pt.yml +2 -5
- data/config/locales/ro-RO.yml +165 -7
- data/config/locales/ru.yml +0 -5
- data/config/locales/sk.yml +2 -7
- data/config/locales/sr-CS.yml +2 -0
- data/config/locales/sv.yml +54 -12
- data/config/locales/tr-TR.yml +3 -8
- data/config/locales/uk.yml +0 -5
- data/config/locales/zh-CN.yml +2 -7
- data/config/locales/zh-TW.yml +2 -7
- 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/core/test/factories.rb +12 -0
- data/lib/decidim/core/test/shared_examples/map_examples.rb +2 -2
- 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/nicknamizable.rb +6 -9
- data/lib/decidim/participatory_space_user.rb +1 -3
- data/lib/decidim/private_download_helper.rb +3 -3
- data/lib/decidim/reportable.rb +6 -2
- data/lib/decidim/translatable_attributes.rb +5 -1
- data/lib/tasks/upgrade/clean.rake +9 -1
- data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +4 -4
- data/lib/tasks/upgrade/migrations.rake +2 -0
- metadata +9 -8
- data/app/views/decidim/reported_mailer/hide.html.erb +0 -9
- 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: 763791440d8acd9bfdb66f0afe4d1a738f362815fd237b20b703a6fdc89edfb8
|
4
|
+
data.tar.gz: e6ff16714f702a13b60bee8d4bce8fe03978be54bbeea60c779bb5aaf735661f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ca3eaa4281c6b5f676f1df20466d18f8cd1893a26645f5bdd1f00ed9efe413849250801ae49d3e8572a7ca66fe24c0fe09935fb972719b67083df9ff13b4143
|
7
|
+
data.tar.gz: '068568c77bcf227bb7ef783606a63e858d59992001cc2e36d88c97212bf89fac3acefde0568f3557b4af7aa518326db6f5f10e5188d2195211a1a2b356228789'
|
@@ -4,13 +4,13 @@
|
|
4
4
|
<%= icon "map-pin-line" %>
|
5
5
|
<div class="address">
|
6
6
|
<% if has_location? %>
|
7
|
-
<
|
7
|
+
<p class="address__location"><%= location %></p>
|
8
8
|
<% end %>
|
9
9
|
|
10
|
-
<
|
10
|
+
<p class="address__address"><%= address %></p>
|
11
11
|
|
12
12
|
<% if has_location_hints? %>
|
13
|
-
<
|
13
|
+
<p class="address__hints"><%= location_hints %></p>
|
14
14
|
<% end %>
|
15
15
|
</div>
|
16
16
|
</div>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%# If the options hash has the demo key it means we are in the decidim-design engine, so it is not a real-world scenario with actual users %>
|
2
2
|
<% tooltip = options.has_key?(:demo) ? { tooltip: render(:profile_minicard).html_safe } : nil %>
|
3
|
-
<%= content_tag(:
|
3
|
+
<%= content_tag(:p, class: :author, data: ) do %>
|
4
4
|
<%= content_tag :span, class: "author__container#{" is-compact" if layout == :compact}", data: tooltip do %>
|
5
5
|
<% if layout == :compact %>
|
6
6
|
<%= render :avatar %>
|
@@ -2,10 +2,10 @@
|
|
2
2
|
<div class="participatory-space__metadata-item">
|
3
3
|
<div class="participatory-space__metadata-item-title">
|
4
4
|
<%= icon item[:icon] %>
|
5
|
-
<
|
5
|
+
<h2><%= item[:title] %></h2>
|
6
6
|
</div>
|
7
7
|
<% if item[:text].present? %>
|
8
|
-
<%= content_tag :
|
8
|
+
<%= content_tag :p, item[:text] %>
|
9
9
|
<% elsif item[:partial].present? %>
|
10
10
|
<%= render item[:partial] %>
|
11
11
|
<% end %>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<h4 class="menu-bar__secondary-dropdown__title"><%= title %></h4>
|
2
|
-
|
3
|
-
|
2
|
+
<% if hashtag.present? %>
|
3
|
+
<div class="menu-bar__secondary-dropdown__metadata">
|
4
4
|
<span>
|
5
5
|
<%= icon "twitter-x-line", class: "text-gray fill-current" %>
|
6
6
|
<%= link_to "##{hashtag}", twitter_hashtag_url(hashtag), target: "_blank", class: "text-secondary underline" %>
|
7
7
|
</span>
|
8
|
-
|
9
|
-
|
8
|
+
</div>
|
9
|
+
<% end %>
|
@@ -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,16 +72,15 @@ 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
|
83
78
|
|
84
|
-
|
79
|
+
if hidden_by_admin?
|
80
|
+
ReportedMailer.hidden_manually(moderator, @report, current_user).deliver_later
|
81
|
+
else
|
82
|
+
ReportedMailer.hidden_automatically(moderator, @report).deliver_later
|
83
|
+
end
|
85
84
|
end
|
86
85
|
end
|
87
86
|
end
|
@@ -41,7 +41,7 @@ module Decidim
|
|
41
41
|
@user = Decidim::User.new(
|
42
42
|
name: form.name,
|
43
43
|
email: form.email.downcase,
|
44
|
-
nickname: UserBaseEntity.nicknamize(form.name,
|
44
|
+
nickname: UserBaseEntity.nicknamize(form.name, form.organization.id),
|
45
45
|
organization: form.organization,
|
46
46
|
admin: form.role == "admin",
|
47
47
|
roles: form.role == "admin" ? [] : [form.role].compact
|
@@ -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
|
@@ -9,6 +9,7 @@ module Decidim
|
|
9
9
|
|
10
10
|
included do
|
11
11
|
include Decidim::NeedsOrganization
|
12
|
+
include Decidim::UserRoleChecker
|
12
13
|
|
13
14
|
helper ParticipatorySpaceHelpers, IconHelper, ContextualHelpHelper
|
14
15
|
helper_method :current_participatory_space
|
@@ -81,8 +82,10 @@ module Decidim
|
|
81
82
|
return true unless current_participatory_space.try(:private_space?) &&
|
82
83
|
!current_participatory_space.try(:is_transparent?)
|
83
84
|
return false unless current_user
|
85
|
+
return true if current_user.admin?
|
86
|
+
return true if user_has_any_role?(current_user, current_participatory_space, broad_check: true)
|
84
87
|
|
85
|
-
|
88
|
+
current_participatory_space.users.include?(current_user)
|
86
89
|
end
|
87
90
|
|
88
91
|
def help_section
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
# Exposes the report resource so users can report a reportable.
|
5
|
+
# Unless the reportable is marked as hideable, the resource notice will change accordingly.
|
5
6
|
class ReportsController < Decidim::ApplicationController
|
6
7
|
include FormFactory
|
7
8
|
include NeedsPermission
|
@@ -15,8 +16,12 @@ module Decidim
|
|
15
16
|
|
16
17
|
CreateReport.call(@form, reportable) do
|
17
18
|
on(:ok) do
|
18
|
-
flash[:notice] =
|
19
|
-
|
19
|
+
flash[:notice] = if hideable?
|
20
|
+
I18n.t("decidim.reports.hide.success")
|
21
|
+
else
|
22
|
+
I18n.t("decidim.reports.create.success")
|
23
|
+
end
|
24
|
+
redirect_to reportable.reload.reported_content_url
|
20
25
|
end
|
21
26
|
|
22
27
|
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? }
|
@@ -39,7 +39,7 @@ module Decidim
|
|
39
39
|
@breadcrumb_root_menu ||= ::Decidim::BreadcrumbRootMenuPresenter.new(
|
40
40
|
:menu,
|
41
41
|
self,
|
42
|
-
container_options: { class: "menu-
|
42
|
+
container_options: { class: "menu-bar__dropdown-menu" }
|
43
43
|
)
|
44
44
|
end
|
45
45
|
|
@@ -47,7 +47,7 @@ module Decidim
|
|
47
47
|
@mobile_breadcrumb_root_menu ||= ::Decidim::BreadcrumbRootMenuPresenter.new(
|
48
48
|
:mobile_menu,
|
49
49
|
self,
|
50
|
-
container_options: { class: "menu-bar__main-
|
50
|
+
container_options: { class: "menu-bar__main-dropdown__top-menu" }
|
51
51
|
)
|
52
52
|
end
|
53
53
|
|
@@ -13,7 +13,7 @@ module Decidim
|
|
13
13
|
|
14
14
|
per_page = (params[:per_page] || paginate_params[:per_page] || Decidim::Paginable::OPTIONS.first).to_i
|
15
15
|
|
16
|
-
content_tag :div, class: "flex flex-col-reverse md:flex-row items-center justify-between gap-1 py-8 md:py-16", data: { pagination: "" } do
|
16
|
+
content_tag :div, class: "flex flex-col-reverse md:flex-row items-center justify-between gap-1 py-8 md:py-16 md:flex-wrap", data: { pagination: "" } do
|
17
17
|
template = ""
|
18
18
|
template += render(partial: "decidim/shared/results_per_page", locals: { per_page: }, formats: [:html]) if collection.total_pages.positive?
|
19
19
|
template += paginate collection, window: 2, outer_window: 1, theme: "decidim", params: paginate_params
|
@@ -5,7 +5,10 @@ module Decidim
|
|
5
5
|
# on the layout.
|
6
6
|
module TooltipHelper
|
7
7
|
def with_tooltip(title, opts = {}, &)
|
8
|
-
content_tag(:
|
8
|
+
content_tag(:p,
|
9
|
+
title:,
|
10
|
+
class: "inline-block",
|
11
|
+
data: { tooltip: content_tag(:p, title, id: opts[:id], class: opts[:class] || "bottom", role: "tooltip", "aria-hidden": "true") }) do
|
9
12
|
capture(&).html_safe
|
10
13
|
end
|
11
14
|
end
|
@@ -14,7 +14,13 @@ module Decidim
|
|
14
14
|
@organization = user.organization
|
15
15
|
@notifications_digest = Decidim::NotificationsDigestPresenter.new(user)
|
16
16
|
@display_see_more_message = notifications.size > SIZE_LIMIT
|
17
|
-
|
17
|
+
# Note that this could be improved by adding a "type" column to the notifications table
|
18
|
+
# This fix can generate lists of notifications that are below the SIZE_LIMIT
|
19
|
+
@notifications = notifications[0...SIZE_LIMIT].filter_map do |notification|
|
20
|
+
next unless notification.event_class_instance.respond_to?(:email_intro)
|
21
|
+
|
22
|
+
Decidim::NotificationToMailerPresenter.new(notification)
|
23
|
+
end
|
18
24
|
|
19
25
|
mail(to: user.email, subject: @notifications_digest.subject)
|
20
26
|
end
|
@@ -21,13 +21,29 @@ module Decidim
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
# This is used when a user with special rights (like an administrator, a space administrator or a moderator) hides a resource
|
25
|
+
def hidden_manually(user, report, current_user)
|
25
26
|
with_user(user) do
|
26
27
|
@report = report
|
27
28
|
@participatory_space = @report.moderation.participatory_space
|
29
|
+
@reportable = @report.moderation.reportable
|
30
|
+
@organization = user.organization
|
31
|
+
@user = user
|
32
|
+
@moderator = current_user
|
33
|
+
subject = I18n.t("hidden_manually.subject", scope: "decidim.reported_mailer", moderator: @moderator.name)
|
34
|
+
mail(to: user.email, subject:)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# This is meant to be used when a resource is hidden by an algorithm, such as the `decidim-ai` module, or the `Decidim.max_reports_before_hiding` feature.
|
39
|
+
def hidden_automatically(user, report)
|
40
|
+
with_user(user) do
|
41
|
+
@report = report
|
42
|
+
@participatory_space = @report.moderation.participatory_space
|
43
|
+
@reportable = @report.moderation.reportable
|
28
44
|
@organization = user.organization
|
29
45
|
@user = user
|
30
|
-
subject = I18n.t("
|
46
|
+
subject = I18n.t("hidden_automatically.subject", scope: "decidim.reported_mailer")
|
31
47
|
mail(to: user.email, subject:)
|
32
48
|
end
|
33
49
|
end
|
@@ -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
|
|
@@ -93,7 +93,7 @@ export default class InputCharacterCounter {
|
|
93
93
|
this.$srTarget = $(`#${screenReaderId}`);
|
94
94
|
if (!this.$srTarget.length) {
|
95
95
|
this.$srTarget = $(
|
96
|
-
`<span role="status" id="${screenReaderId}" class="sr-only remaining-character-count-sr" />`
|
96
|
+
`<span role="status" id="${screenReaderId}" class="sr-only remaining-character-count-sr" aria-hidden="true"/>`
|
97
97
|
);
|
98
98
|
this.$target.before(this.$srTarget);
|
99
99
|
}
|
@@ -163,7 +163,7 @@
|
|
163
163
|
/* shared styles */
|
164
164
|
&__highlight-metadata,
|
165
165
|
&__grid-metadata {
|
166
|
-
@apply mt-auto flex items-center justify-between flex-wrap text-sm text-gray-2 [&>*]:flex [&>*]:items-center [&>*]:gap-1 first:[&>*]:
|
166
|
+
@apply mt-auto flex items-center justify-between flex-wrap w-full text-sm text-gray-2 [&>*]:flex [&>*]:items-center [&>*]:gap-1 first:[&>*]:w-4/5;
|
167
167
|
|
168
168
|
svg {
|
169
169
|
@apply flex-none text-gray fill-current;
|
@@ -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 {
|
@@ -334,10 +334,6 @@ header {
|
|
334
334
|
&__dropdown-trigger {
|
335
335
|
@apply flex items-center justify-between text-white;
|
336
336
|
|
337
|
-
span {
|
338
|
-
@apply flex flex-wrap md:flex-nowrap gap-x-2.5 overflow-hidden text-white;
|
339
|
-
}
|
340
|
-
|
341
337
|
svg {
|
342
338
|
@apply w-6 h-6 fill-current;
|
343
339
|
}
|
@@ -373,54 +369,77 @@ header {
|
|
373
369
|
@apply absolute top-full left-0 bg-white rounded w-full bg-gray-5;
|
374
370
|
}
|
375
371
|
|
376
|
-
&
|
377
|
-
@apply
|
372
|
+
&__dropdown-menu {
|
373
|
+
@apply w-full md:w-1/4 bg-primary px-4 md:px-8 pt-0 pb-3 md:py-3 divide-y divide-gray-3 text-white;
|
378
374
|
|
379
|
-
|
380
|
-
|
381
|
-
|
375
|
+
> * {
|
376
|
+
@apply py-3 md:py-3.5;
|
377
|
+
}
|
382
378
|
|
383
|
-
|
384
|
-
|
379
|
+
a {
|
380
|
+
@apply flex items-center justify-start gap-1 font-semibold text-lg text-white;
|
381
|
+
|
382
|
+
span {
|
383
|
+
@apply min-w-0 truncate;
|
385
384
|
}
|
386
|
-
}
|
387
385
|
|
388
|
-
|
389
|
-
|
386
|
+
svg {
|
387
|
+
@apply flex-none fill-current;
|
388
|
+
}
|
390
389
|
}
|
390
|
+
}
|
391
391
|
|
392
|
-
|
393
|
-
|
394
|
-
}
|
392
|
+
&__main-dropdown {
|
393
|
+
@apply bg-white flex flex-row rounded-b shadow-lg text-black w-full lg:w-[1280px] h-screen md:h-auto;
|
395
394
|
|
396
|
-
&
|
397
|
-
@apply
|
395
|
+
&__left {
|
396
|
+
@apply flex flex-col justify-between p-4 md:p-8 space-y-5 hidden md:block md:w-3/4;
|
397
|
+
|
398
|
+
&-top {
|
399
|
+
@apply border-b-4 border-gray-3 pb-3;
|
400
|
+
}
|
398
401
|
}
|
399
402
|
|
400
|
-
&
|
401
|
-
@apply w-full
|
403
|
+
&__top {
|
404
|
+
@apply w-full px-4;
|
402
405
|
|
403
|
-
|
404
|
-
@apply
|
406
|
+
&-menu {
|
407
|
+
@apply w-full md:w-1/2 mt-0 grid md:grid-cols-2 gap-x-6 text-secondary;
|
408
|
+
|
409
|
+
> * {
|
410
|
+
@apply py-3 md:py-3.5 border-b last:border-0 border-gray-3;
|
405
411
|
|
406
|
-
|
407
|
-
|
408
|
-
|
412
|
+
/* since the grid has 2 columns, remove the border for these last 2 columns */
|
413
|
+
&:nth-last-child(-n + 2) {
|
414
|
+
@apply md:border-0;
|
415
|
+
}
|
409
416
|
}
|
410
|
-
}
|
411
417
|
|
412
|
-
|
413
|
-
|
418
|
+
a {
|
419
|
+
@apply flex items-center justify-start gap-1 font-semibold text-lg text-secondary;
|
414
420
|
|
415
|
-
|
416
|
-
|
417
|
-
|
421
|
+
span {
|
422
|
+
@apply min-w-0 truncate;
|
423
|
+
}
|
418
424
|
|
419
|
-
|
420
|
-
|
425
|
+
svg {
|
426
|
+
@apply flex-none fill-current;
|
427
|
+
}
|
421
428
|
}
|
422
429
|
}
|
423
430
|
}
|
431
|
+
|
432
|
+
&__bottom {
|
433
|
+
@apply hidden md:flex;
|
434
|
+
}
|
435
|
+
|
436
|
+
&__title {
|
437
|
+
@apply hidden h4 md:flex md:h3;
|
438
|
+
}
|
439
|
+
|
440
|
+
&__subtitle {
|
441
|
+
@apply hidden text-md md:flex md:text-lg text-gray-2 mt-5;
|
442
|
+
}
|
424
443
|
}
|
425
444
|
|
426
445
|
&__secondary-dropdown {
|
@@ -434,8 +453,12 @@ header {
|
|
434
453
|
@apply h4 md:h3;
|
435
454
|
}
|
436
455
|
|
456
|
+
nav {
|
457
|
+
@apply w-full md:w-1/4;
|
458
|
+
}
|
459
|
+
|
437
460
|
&__menu {
|
438
|
-
@apply w-full
|
461
|
+
@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
462
|
|
440
463
|
> * {
|
441
464
|
@apply py-3 md:py-3.5;
|
@@ -455,7 +478,7 @@ header {
|
|
455
478
|
}
|
456
479
|
|
457
480
|
&__metadata {
|
458
|
-
@apply flex items-center text-sm space-x-6
|
481
|
+
@apply flex items-center text-sm space-x-6 pb-6;
|
459
482
|
|
460
483
|
> span {
|
461
484
|
@apply flex items-center space-x-2;
|
@@ -13,19 +13,29 @@
|
|
13
13
|
}
|
14
14
|
|
15
15
|
&_content {
|
16
|
-
@apply flex flex-col lg:items-
|
16
|
+
@apply flex flex-col lg:items-start lg:flex-row lg:gap-2 lg:pt-[6px];
|
17
17
|
}
|
18
18
|
|
19
19
|
&_date {
|
20
|
-
@apply text-sm text-gray-2;
|
20
|
+
@apply text-sm text-gray-2 lg:pt-px;
|
21
21
|
}
|
22
22
|
}
|
23
23
|
|
24
24
|
&_text {
|
25
|
-
@apply flex flex-col
|
25
|
+
@apply flex flex-col relative max-w-[250px] md:max-w-[600px] lg:max-w-[400px];
|
26
|
+
}
|
27
|
+
|
28
|
+
&_text:has(.resource-link) {
|
29
|
+
.resource-link {
|
30
|
+
@apply md:ml-[-1px] lg:ml-[-106px];
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
&_text:not(:has(.resource-link)) a {
|
35
|
+
@apply md:ml-[-1px] lg:ml-[-106px];
|
26
36
|
}
|
27
37
|
|
28
38
|
&__line {
|
29
|
-
@apply absolute -left-[26px] lg:-left-[
|
39
|
+
@apply absolute -left-[26px] lg:-left-[134px] top-3.5 lg:top-[26px] w-px h-full lg:h-[90%] bg-secondary;
|
30
40
|
}
|
31
41
|
}
|
@@ -5,6 +5,8 @@ module Decidim
|
|
5
5
|
# actions by any kind of user. Also works as a default implementation so other
|
6
6
|
# components can inherit from it and get some convenience methods.
|
7
7
|
class DefaultPermissions
|
8
|
+
include Decidim::UserRoleChecker
|
9
|
+
|
8
10
|
def initialize(user, permission_action, context = {})
|
9
11
|
@user = user
|
10
12
|
@permission_action = permission_action
|
@@ -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,
|
@@ -14,15 +14,19 @@ module Decidim
|
|
14
14
|
delegate :url_helpers, to: "Decidim::Core::Engine.routes"
|
15
15
|
delegate :resource_title, to: :event
|
16
16
|
delegate :resource_url, to: :event
|
17
|
-
delegate :email_intro, to: :event
|
18
17
|
delegate :resource_path, to: :event
|
19
18
|
delegate :safe_resource_text, to: :event
|
20
19
|
|
20
|
+
def email_intro
|
21
|
+
event.email_intro if event.respond_to?(:email_intro)
|
22
|
+
end
|
23
|
+
|
21
24
|
def date_time
|
25
|
+
created_at_in_time_zone = created_at.in_time_zone(resource.organization.time_zone)
|
22
26
|
if frequency == :daily
|
23
|
-
|
27
|
+
I18n.l(created_at_in_time_zone, format: :time_of_day)
|
24
28
|
else
|
25
|
-
I18n.l(
|
29
|
+
I18n.l(created_at_in_time_zone, format: :decidim_short)
|
26
30
|
end
|
27
31
|
end
|
28
32
|
|