decidim-admin 0.27.5 → 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/commands/decidim/admin/destroy_category.rb +1 -1
- data/app/controllers/decidim/admin/application_controller.rb +1 -0
- data/app/controllers/decidim/admin/authorization_workflows_controller.rb +3 -1
- data/app/controllers/decidim/admin/conflicts_controller.rb +6 -0
- data/app/controllers/decidim/admin/impersonatable_users_controller.rb +1 -1
- data/app/controllers/decidim/admin/impersonations_controller.rb +1 -0
- data/app/controllers/decidim/admin/managed_users/impersonation_logs_controller.rb +2 -0
- data/app/controllers/decidim/admin/organization_controller.rb +7 -4
- data/app/events/decidim/component_published_event.rb +11 -0
- data/app/events/decidim/resource_hidden_event.rb +5 -1
- data/app/helpers/decidim/admin/admin_terms_helper.rb +1 -1
- data/app/helpers/decidim/admin/newsletters_helper.rb +1 -1
- data/app/packs/images/decidim/admin/.keep +0 -0
- data/app/views/decidim/admin/categories/index.html.erb +7 -1
- data/app/views/decidim/admin/resource_permissions/edit.html.erb +2 -2
- data/app/views/layouts/decidim/admin/_header.html.erb +3 -0
- data/app/views/layouts/decidim/admin/_js_configuration.html.erb +1 -0
- data/config/locales/ar.yml +1 -7
- data/config/locales/bg.yml +986 -3
- data/config/locales/cs.yml +2 -2
- data/config/locales/de.yml +10 -10
- data/config/locales/el.yml +0 -8
- data/config/locales/es-MX.yml +2 -2
- data/config/locales/es-PY.yml +2 -2
- data/config/locales/es.yml +3 -3
- data/config/locales/eu.yml +2 -2
- data/config/locales/fi.yml +2 -2
- data/config/locales/fr-CA.yml +1 -1
- data/config/locales/ga-IE.yml +0 -4
- data/config/locales/gl.yml +1 -7
- data/config/locales/he-IL.yml +53 -0
- data/config/locales/hu.yml +24 -11
- data/config/locales/id-ID.yml +3 -0
- data/config/locales/is-IS.yml +3 -0
- data/config/locales/it.yml +0 -8
- data/config/locales/ja.yml +2 -2
- data/config/locales/ko.yml +720 -0
- data/config/locales/lb.yml +1 -9
- data/config/locales/lt.yml +0 -8
- data/config/locales/lv.yml +6 -0
- data/config/locales/nl.yml +0 -8
- data/config/locales/no.yml +4 -8
- data/config/locales/pl.yml +12 -3
- data/config/locales/pt-BR.yml +19 -9
- data/config/locales/pt.yml +1 -9
- data/config/locales/ro-RO.yml +0 -8
- data/config/locales/ru.yml +3 -0
- data/config/locales/sk.yml +3 -0
- data/config/locales/sl.yml +3 -0
- data/config/locales/sq-AL.yml +479 -0
- data/config/locales/sr-CS.yml +3 -0
- data/config/locales/sv.yml +0 -8
- data/config/locales/th-TH.yml +100 -0
- data/config/locales/tr-TR.yml +3 -0
- data/config/locales/uk.yml +3 -0
- data/config/locales/zh-CN.yml +3 -0
- data/config/locales/zh-TW.yml +0 -8
- data/decidim-admin.gemspec +36 -0
- data/lib/decidim/admin/test/commands/destroy_category_examples.rb +9 -0
- data/lib/decidim/admin/test/manage_attachment_collections_examples.rb +15 -14
- data/lib/decidim/admin/test/manage_attachments_examples.rb +3 -3
- data/lib/decidim/admin/test/manage_categories_examples.rb +12 -9
- data/lib/decidim/admin/test/manage_moderations_examples.rb +0 -9
- data/lib/decidim/admin/version.rb +1 -1
- metadata +14 -13
- data/app/mailers/decidim/admin/application_mailer.rb +0 -12
- data/config/environment.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89af8ec67ceb6341a006d36411a053aeb1ddfe47cf8b87dfa01fa06d61c34305
|
4
|
+
data.tar.gz: 3c780a0d891e04f13f982a08ef8681506337333c863f9f4fdbac5a88097cff49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36629e02f1ddaa454e8e5c0ee531a3067782c4f90c21d00b981ff4a81a27c633a09c88b98a6ac89d4e69837b3f59a7d76a44c1c5295f74ce11870be5162d57f3
|
7
|
+
data.tar.gz: dd3651f270e9db52fb99a06d2a288cab0fb330ed1a860e722f5f3070e264f7f48a077d5a2d37fb15e8b7daefa5199e62e5e424e54ebf5299d41f23746f6abd9c
|
@@ -20,7 +20,7 @@ module Decidim
|
|
20
20
|
#
|
21
21
|
# Returns nothing.
|
22
22
|
def call
|
23
|
-
return broadcast(:invalid) if category.nil? || category.subcategories.any?
|
23
|
+
return broadcast(:invalid) if category.nil? || category.subcategories.any? || !category.unused?
|
24
24
|
|
25
25
|
destroy_category
|
26
26
|
broadcast(:ok)
|
@@ -30,6 +30,7 @@ module Decidim
|
|
30
30
|
helper Decidim::LanguageChooserHelper
|
31
31
|
helper Decidim::ComponentPathHelper
|
32
32
|
helper Decidim::SanitizeHelper
|
33
|
+
helper Decidim::Templates::Admin::ApplicationHelper if Decidim.module_installed?(:templates) && defined?(Decidim::Templates::Admin::ApplicationHelper)
|
33
34
|
|
34
35
|
default_form_builder Decidim::Admin::FormBuilder
|
35
36
|
|
@@ -8,7 +8,9 @@ module Decidim
|
|
8
8
|
def index
|
9
9
|
enforce_permission_to :index, :authorization_workflow
|
10
10
|
|
11
|
-
@workflows = Decidim::Verifications.admin_workflows
|
11
|
+
@workflows = Decidim::Verifications.admin_workflows.select do |manifest|
|
12
|
+
current_organization.available_authorizations.include?(manifest.name.to_s)
|
13
|
+
end
|
12
14
|
|
13
15
|
# Decidim::Verifications::Authorizations Query
|
14
16
|
@authorizations = Decidim::Verifications::Authorizations.new(
|
@@ -6,12 +6,16 @@ module Decidim
|
|
6
6
|
layout "decidim/admin/users"
|
7
7
|
|
8
8
|
def index
|
9
|
+
enforce_permission_to :index, :impersonatable_user
|
10
|
+
|
9
11
|
@conflicts = Decidim::Verifications::Conflict.joins(:current_user).where(
|
10
12
|
decidim_users: { decidim_organization_id: current_organization.id }
|
11
13
|
)
|
12
14
|
end
|
13
15
|
|
14
16
|
def edit
|
17
|
+
enforce_permission_to :index, :impersonatable_user
|
18
|
+
|
15
19
|
conflict = Decidim::Verifications::Conflict.find(params[:id])
|
16
20
|
|
17
21
|
@form = form(TransferUserForm).from_params(
|
@@ -22,6 +26,8 @@ module Decidim
|
|
22
26
|
end
|
23
27
|
|
24
28
|
def update
|
29
|
+
enforce_permission_to :index, :impersonatable_user
|
30
|
+
|
25
31
|
conflict = Decidim::Verifications::Conflict.find(params[:id])
|
26
32
|
|
27
33
|
@form = form(TransferUserForm).from_params(
|
@@ -44,13 +44,16 @@ module Decidim
|
|
44
44
|
respond_to do |format|
|
45
45
|
format.json do
|
46
46
|
if (term = params[:term].to_s).present?
|
47
|
-
query = relation.order(name: :asc)
|
48
47
|
query = if term.start_with?("@")
|
49
|
-
|
48
|
+
nickname = term.delete("@")
|
49
|
+
relation.where("nickname ILIKE ?", "#{nickname}%")
|
50
|
+
.order(Arel.sql(ActiveRecord::Base.sanitize_sql_array("similarity(nickname, '#{nickname}') DESC")))
|
50
51
|
else
|
51
|
-
|
52
|
-
|
52
|
+
relation.where("name ILIKE ?", "%#{term}%").or(
|
53
|
+
relation.where("email ILIKE ?", "%#{term}%")
|
53
54
|
)
|
55
|
+
.order(Arel.sql(ActiveRecord::Base.sanitize_sql_array("GREATEST(similarity(name, '#{term}'), similarity(email, '#{term}')) DESC")))
|
56
|
+
.order(Arel.sql(ActiveRecord::Base.sanitize_sql_array("(similarity(name, '#{term}') + similarity(email, '#{term}')) / 2 DESC")))
|
54
57
|
end
|
55
58
|
render json: query.all.collect { |u| { value: u.id, label: "#{u.name} (@#{u.nickname})" } }
|
56
59
|
else
|
@@ -2,5 +2,16 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
class ComponentPublishedEvent < Decidim::Events::SimpleEvent
|
5
|
+
# Public: The Hash of options to pass to the I18.t method.
|
6
|
+
def i18n_options
|
7
|
+
default_i18n_options.merge(event_interpolations)
|
8
|
+
end
|
9
|
+
|
10
|
+
def resource_title
|
11
|
+
return unless resource
|
12
|
+
|
13
|
+
title = decidim_sanitize_translated(resource.name)
|
14
|
+
Decidim::ContentProcessor.render_without_format(title, links: false).html_safe
|
15
|
+
end
|
5
16
|
end
|
6
17
|
end
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
class ResourceHiddenEvent < Decidim::Events::SimpleEvent
|
5
|
+
include Decidim::ApplicationHelper
|
6
|
+
|
5
7
|
i18n_attributes :resource_path, :report_reasons, :resource_type, :resource_content
|
6
8
|
|
7
9
|
def resource_path
|
@@ -23,7 +25,9 @@ module Decidim
|
|
23
25
|
end
|
24
26
|
|
25
27
|
def resource_content
|
26
|
-
translated_attribute(@resource[@resource.reported_attributes.first])
|
28
|
+
text = translated_attribute(@resource[@resource.reported_attributes.first])
|
29
|
+
|
30
|
+
decidim_sanitize(html_truncate(text, length: 100), strip_tags: true)
|
27
31
|
end
|
28
32
|
|
29
33
|
def resource_text
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
# This module includes helpers to show Admin Terms of Use
|
6
6
|
module AdminTermsHelper
|
7
7
|
def admin_terms_of_use_body
|
8
|
-
current_organization.admin_terms_of_use_body.
|
8
|
+
decidim_sanitize_admin(translated_attribute(current_organization.admin_terms_of_use_body)).html_safe
|
9
9
|
end
|
10
10
|
|
11
11
|
def announcement_body
|
@@ -74,7 +74,7 @@ module Decidim
|
|
74
74
|
else
|
75
75
|
Decidim.find_participatory_space_manifest(type["manifest_name"].to_sym)
|
76
76
|
.participatory_spaces.call(current_organization).where(id: type["ids"]).each do |space|
|
77
|
-
html += "<strong>#{
|
77
|
+
html += "<strong>#{decidim_escape_translated space.title}</strong>"
|
78
78
|
end
|
79
79
|
end
|
80
80
|
html += "<br/>"
|
File without changes
|
@@ -52,7 +52,13 @@
|
|
52
52
|
<% end %>
|
53
53
|
|
54
54
|
<% if allowed_to? :destroy, :category, category: subcategory %>
|
55
|
-
|
55
|
+
<% if subcategory.unused? %>
|
56
|
+
<%= icon_link_to "circle-x", category_path(current_participatory_space, subcategory), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %>
|
57
|
+
<% else %>
|
58
|
+
<span class="action-icon" title="<%= t("categories.index.category_used", scope: "decidim.admin") %>" data-tooltip="true" data-disable-hover="false">
|
59
|
+
<%= icon "delete-bin-line", class: "action-icon action-icon--disabled", role: "img", "aria-hidden": true %>
|
60
|
+
</span>
|
61
|
+
<% end %>
|
56
62
|
<% end %>
|
57
63
|
</td>
|
58
64
|
</tr>
|
@@ -6,9 +6,9 @@
|
|
6
6
|
<% if resource %>
|
7
7
|
-
|
8
8
|
<% if resource.is_a?(Decidim::Resourceable) %>
|
9
|
-
<%= link_to(
|
9
|
+
<%= link_to(decidim_escape_translated(resource.title).html_safe, resource_locator(resource).path) %>
|
10
10
|
<% else %>
|
11
|
-
<%=
|
11
|
+
<%= decidim_escape_translated(resource.title).html_safe %>
|
12
12
|
<% end %>
|
13
13
|
<% end %>
|
14
14
|
</h3>
|
@@ -1,5 +1,8 @@
|
|
1
1
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
2
2
|
<%= csrf_meta_tags %>
|
3
|
+
<%= legacy_favicon %>
|
4
|
+
<%= favicon %>
|
5
|
+
<%= apple_favicon %>
|
3
6
|
<%= stylesheet_pack_tag "decidim_admin", media: "all" %>
|
4
7
|
<%= javascript_pack_tag "decidim_admin", defer: false %>
|
5
8
|
<%= organization_colors %>
|
data/config/locales/ar.yml
CHANGED
@@ -319,8 +319,6 @@ ar:
|
|
319
319
|
view_more_logs: عرض المزيد من السجلات
|
320
320
|
welcome: أهلا بك على اللوح الإداري.
|
321
321
|
domain_whitelist:
|
322
|
-
form:
|
323
|
-
domain_too_short: نطاق الدومين قصير جداً
|
324
322
|
update:
|
325
323
|
error: فشل تحديث القائمة النطاقات المسموحة
|
326
324
|
success: تم تحديث النطاقات المسموحة بنجاح
|
@@ -719,11 +717,6 @@ ar:
|
|
719
717
|
organization_external_domain_whitelist:
|
720
718
|
edit:
|
721
719
|
update: تحديث
|
722
|
-
external_domain:
|
723
|
-
down: أسفل
|
724
|
-
external_domain: نطاق خارجي
|
725
|
-
remove: إزالة
|
726
|
-
up: أعلى
|
727
720
|
form:
|
728
721
|
add: إضافة إلى القائمة البيضاء
|
729
722
|
organization_homepage_content_blocks:
|
@@ -854,6 +847,7 @@ ar:
|
|
854
847
|
areas: المناطق
|
855
848
|
authorization_workflows: طرق التحقق
|
856
849
|
dashboard: لوحة القيادة
|
850
|
+
edit_organization_appearance: تعديل مظهر الصفحة الرئيسية
|
857
851
|
impersonatable_users: المشاركون في الإدارة
|
858
852
|
impersonations: إدارة المشاركين
|
859
853
|
pages: الصفحات
|