decidim-admin 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/commands/decidim/admin/unhide_resource.rb +1 -0
- data/app/controllers/decidim/admin/moderations_controller.rb +8 -3
- data/app/events/decidim/parent_hidden_event.rb +6 -0
- data/app/events/decidim/resource_hidden_event.rb +4 -0
- data/app/permissions/decidim/admin/permissions.rb +8 -0
- data/app/views/decidim/admin/moderations/_moderation-tr.html.erb +5 -1
- data/config/locales/ca-IT.yml +1404 -0
- data/config/locales/ca.yml +2 -0
- data/config/locales/cs.yml +2 -0
- data/config/locales/de.yml +5 -3
- data/config/locales/en.yml +2 -0
- data/config/locales/es-MX.yml +2 -0
- data/config/locales/es-PY.yml +2 -0
- data/config/locales/es.yml +2 -0
- data/config/locales/eu.yml +9 -7
- data/config/locales/fr-CA.yml +2 -0
- data/config/locales/fr.yml +2 -0
- data/config/locales/it.yml +232 -0
- data/config/locales/ja.yml +2 -0
- data/config/locales/ro-RO.yml +4 -0
- data/config/locales/sv.yml +1 -0
- data/lib/decidim/admin/test/manage_moderations_examples.rb +1 -1
- data/lib/decidim/admin/version.rb +1 -1
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2daba5d2c690b03030a08511196d9ca36ebc870e8358f97d3161182013a42fd
|
4
|
+
data.tar.gz: d57c01e2f502d64c2ba1723af733ed39bd181f0a83412efaff63235acf49c248
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8472029f6e4609819f6e09fdcca6413e35513c9b8091fe4fb12129137086ad1c67d40728a2bebec6e8fa10186fbfeb3a80e0b102e03639d5669c903a25901fb3
|
7
|
+
data.tar.gz: 7ddbe1c2eb351546b2b9d8fa5efdb59ade43f816bc487c728b1f33abb6801ee70095d6fae5d77a1f7e6c0e9b64e812041f5b3c2627328b0bd24d9099e8c018db
|
@@ -22,6 +22,7 @@ module Decidim
|
|
22
22
|
#
|
23
23
|
# Returns nothing.
|
24
24
|
def call
|
25
|
+
return broadcast(:parent_invalid) if @reportable.respond_to?(:commentable) && @reportable.commentable.try(:hidden?)
|
25
26
|
return broadcast(:invalid) unless unhideable?
|
26
27
|
|
27
28
|
@with_admin_log ? unhide_with_admin_log! : unhide!
|
@@ -57,12 +57,17 @@ module Decidim
|
|
57
57
|
Admin::UnhideResource.call(reportable, current_user) do
|
58
58
|
on(:ok) do
|
59
59
|
flash[:notice] = I18n.t("reportable.unhide.success", scope: "decidim.moderations.admin")
|
60
|
-
redirect_to moderations_path
|
60
|
+
redirect_to moderations_path(hidden: true)
|
61
|
+
end
|
62
|
+
|
63
|
+
on(:parent_invalid) do
|
64
|
+
flash[:alert] = I18n.t("reportable.unhide.parent_invalid", scope: "decidim.moderations.admin")
|
65
|
+
redirect_to moderations_path(hidden: true)
|
61
66
|
end
|
62
67
|
|
63
68
|
on(:invalid) do
|
64
|
-
flash
|
65
|
-
redirect_to moderations_path
|
69
|
+
flash[:alert] = I18n.t("reportable.unhide.invalid", scope: "decidim.moderations.admin")
|
70
|
+
redirect_to moderations_path(hidden: true)
|
66
71
|
end
|
67
72
|
end
|
68
73
|
end
|
@@ -3,6 +3,8 @@
|
|
3
3
|
module Decidim
|
4
4
|
module Admin
|
5
5
|
class Permissions < Decidim::DefaultPermissions
|
6
|
+
include Decidim::UserRoleChecker
|
7
|
+
|
6
8
|
def permissions
|
7
9
|
return permission_action if managed_user_action?
|
8
10
|
|
@@ -31,6 +33,8 @@ module Decidim
|
|
31
33
|
|
32
34
|
apply_global_moderations_permission_for_admin!
|
33
35
|
|
36
|
+
can_use_image_editor?
|
37
|
+
|
34
38
|
if user.admin? && admin_terms_accepted?
|
35
39
|
allow! if read_admin_log_action?
|
36
40
|
allow! if read_user_statistics_action?
|
@@ -284,6 +288,10 @@ module Decidim
|
|
284
288
|
def component
|
285
289
|
context.fetch(:component, nil)
|
286
290
|
end
|
291
|
+
|
292
|
+
def can_use_image_editor?
|
293
|
+
allow! if permission_action.subject == :editor_image && user_has_any_role?(user, nil, broad_check: true)
|
294
|
+
end
|
287
295
|
end
|
288
296
|
end
|
289
297
|
end
|
@@ -44,7 +44,11 @@
|
|
44
44
|
<%= icon_link_to "eye-line", hide_moderation_path(id: moderation), t("actions.hide", scope: "decidim.moderations"), class: "action-icon--hide", method: :put %>
|
45
45
|
<% end %>
|
46
46
|
<% if moderation.reportable.hidden? && allowed_to?(:unhide, authorization_scope) %>
|
47
|
-
|
47
|
+
<% if moderation.reportable.respond_to?(:commentable) && moderation.reportable.commentable.try(:hidden?) %>
|
48
|
+
<%= icon_with_tooltip "eye-line", t("actions.parent_hidden", scope: "decidim.moderations"), class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.parent_hidden", scope: "decidim.moderations") %>
|
49
|
+
<% else %>
|
50
|
+
<%= icon_link_to "eye-line", unhide_moderation_path(id: moderation), t("actions.unhide", scope: "decidim.moderations"), method: :put %>
|
51
|
+
<% end %>
|
48
52
|
<% end %>
|
49
53
|
</td>
|
50
54
|
</tr>
|