decidim-admin 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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/commands/decidim/admin/unhide_resource.rb +1 -0
  3. data/app/controllers/decidim/admin/impersonations_controller.rb +1 -1
  4. data/app/controllers/decidim/admin/moderations_controller.rb +8 -3
  5. data/app/events/decidim/parent_hidden_event.rb +6 -0
  6. data/app/events/decidim/resource_hidden_event.rb +4 -0
  7. data/app/packs/src/decidim/admin/global_moderations.js +21 -18
  8. data/app/packs/src/decidim/admin/managed_moderated_users.js +21 -19
  9. data/app/permissions/decidim/admin/permissions.rb +6 -0
  10. data/app/views/decidim/admin/moderations/_moderation-tr.html.erb +5 -1
  11. data/config/locales/ar.yml +0 -2
  12. data/config/locales/bg.yml +0 -9
  13. data/config/locales/ca-IT.yml +1404 -0
  14. data/config/locales/ca.yml +5 -3
  15. data/config/locales/cs.yml +3 -1
  16. data/config/locales/de.yml +5 -3
  17. data/config/locales/el.yml +0 -9
  18. data/config/locales/en.yml +2 -0
  19. data/config/locales/es-MX.yml +6 -4
  20. data/config/locales/es-PY.yml +6 -4
  21. data/config/locales/es.yml +4 -2
  22. data/config/locales/eu.yml +15 -13
  23. data/config/locales/fi-plain.yml +0 -9
  24. data/config/locales/fi.yml +0 -9
  25. data/config/locales/fr-CA.yml +4 -2
  26. data/config/locales/fr.yml +4 -2
  27. data/config/locales/gl.yml +1 -4
  28. data/config/locales/hu.yml +1 -10
  29. data/config/locales/id-ID.yml +1 -2
  30. data/config/locales/is-IS.yml +1 -0
  31. data/config/locales/it.yml +225 -2
  32. data/config/locales/ja.yml +2 -9
  33. data/config/locales/kaa.yml +0 -3
  34. data/config/locales/ko.yml +0 -3
  35. data/config/locales/lb.yml +0 -2
  36. data/config/locales/lt.yml +0 -9
  37. data/config/locales/lv.yml +0 -2
  38. data/config/locales/nl.yml +1 -4
  39. data/config/locales/no.yml +0 -3
  40. data/config/locales/pl.yml +0 -9
  41. data/config/locales/pt-BR.yml +0 -9
  42. data/config/locales/pt.yml +0 -2
  43. data/config/locales/ro-RO.yml +4 -3
  44. data/config/locales/ru.yml +1 -0
  45. data/config/locales/sk.yml +1 -2
  46. data/config/locales/sl.yml +0 -4
  47. data/config/locales/sq-AL.yml +2 -9
  48. data/config/locales/sv.yml +9 -6
  49. data/config/locales/tr-TR.yml +324 -3
  50. data/config/locales/uk.yml +1 -0
  51. data/config/locales/zh-CN.yml +0 -2
  52. data/config/locales/zh-TW.yml +0 -3
  53. data/lib/decidim/admin/test/manage_moderations_examples.rb +1 -1
  54. data/lib/decidim/admin/version.rb +1 -1
  55. metadata +10 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc29cc3a462ef48acdc919c381daf77729a0812fa6a9b2ec20dc3beb39a2395a
4
- data.tar.gz: 2ff8e7ae1555b59e367e45df699d3a0e6587ab332f9c93ec89142d7b05a736d6
3
+ metadata.gz: 5d9a36f20b03c890e4ffaaa64ed9d80deb07ef73ee4f550d950840c08623a125
4
+ data.tar.gz: 5eaccb3a7f2327f244c9a8b8b71bc4bd923cf763b1d63ed5ddf7fd4d76f69e67
5
5
  SHA512:
6
- metadata.gz: 785a41246c5611c557618399411934dc97f83199c8b2414ab331c64df9837241f7d5fb4f329b0535e3cd775bb336adcba749c3addabebef4de25549d1e129f3c
7
- data.tar.gz: 6181f1c0a56f33861f544316a1020d2d5a68a348a1f20e32b75ad6eeaac3de39dedff8d3ad1a0fefd626d1c8b04ee5e391eb89875c709d31776dab5783b9ae2b
6
+ metadata.gz: 939bd69210abf20272825c2b7b7d5a7089727e32fb7ec0667adb338e2d8dec379150ddb54b24a48fdb3a2aba3d02ce8c52702071394f8a40f2d126245f24826f
7
+ data.tar.gz: 34c44b4ef00e560f6d71ab6f5476df3d7fb8387962ed06b92d877d51163d7b13f9d22919d406a550cd745c04fdebd81c5968c376171d92ebc2330e4849217f0e
@@ -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!
@@ -99,7 +99,7 @@ module Decidim
99
99
  managed: true,
100
100
  name: params.dig(:impersonate_user, :name)
101
101
  ) do |u|
102
- u.nickname = Decidim::UserBaseEntity.nicknamize(u.name, organization: current_organization)
102
+ u.nickname = Decidim::UserBaseEntity.nicknamize(u.name, current_organization.id)
103
103
  u.admin = false
104
104
  u.tos_agreement = true
105
105
  end
@@ -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.now[:alert] = I18n.t("reportable.unhide.invalid", scope: "decidim.moderations.admin")
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
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ class ParentHiddenEvent < Decidim::ResourceHiddenEvent
5
+ end
6
+ end
@@ -6,6 +6,10 @@ module Decidim
6
6
 
7
7
  i18n_attributes :resource_path, :report_reasons, :resource_type, :resource_content
8
8
 
9
+ def self.types
10
+ [:email]
11
+ end
12
+
9
13
  def resource_path
10
14
  @resource.reported_content_url
11
15
  end
@@ -108,26 +108,29 @@ document.addEventListener("DOMContentLoaded", () => {
108
108
  });
109
109
 
110
110
  // select all checkboxes
111
- document.querySelector(".js-check-all").addEventListener("change", function () {
112
- const isChecked = this.checked;
113
- const checkboxes = document.querySelectorAll(".js-check-all-moderations");
114
-
115
- checkboxes.forEach((checkbox) => {
116
- checkbox.checked = isChecked;
117
- const row = checkbox.closest("tr");
118
- if (row) {
119
- row.classList.toggle("selected", isChecked);
111
+ const moderatedContentList = document.getElementById("moderations_bulk");
112
+ if (moderatedContentList !== null) {
113
+ moderatedContentList.addEventListener("change", function () {
114
+ const isChecked = this.checked;
115
+ const checkboxes = document.querySelectorAll(".js-check-all-moderations");
116
+
117
+ checkboxes.forEach((checkbox) => {
118
+ checkbox.checked = isChecked;
119
+ const row = checkbox.closest("tr");
120
+ if (row) {
121
+ row.classList.toggle("selected", isChecked);
122
+ }
123
+ });
124
+
125
+ if (isChecked) {
126
+ showBulkActionsButton();
127
+ } else {
128
+ hideBulkActionsButton();
120
129
  }
121
- });
122
130
 
123
- if (isChecked) {
124
- showBulkActionsButton();
125
- } else {
126
- hideBulkActionsButton();
127
- }
128
-
129
- selectedModerationsCountUpdate();
130
- });
131
+ selectedModerationsCountUpdate();
132
+ });
133
+ }
131
134
 
132
135
  // moderation checkbox change
133
136
  document.querySelector(".table-list").addEventListener("change", (event) => {
@@ -108,27 +108,29 @@ document.addEventListener("DOMContentLoaded", () => {
108
108
  });
109
109
 
110
110
  // Select all checkboxes
111
- document.querySelector(".js-check-all").addEventListener("change", function () {
112
- const isChecked = this.checked;
113
- const checkboxes = document.querySelectorAll(".js-check-all-moderated_users");
114
-
115
- checkboxes.forEach((checkbox) => {
116
- checkbox.checked = isChecked;
117
- const row = checkbox.closest("tr");
118
- if (row) {
119
- row.classList.toggle("selected", isChecked);
111
+ const moderatedUsersList = document.getElementById("moderated_users_bulk");
112
+ if (moderatedUsersList !== null) {
113
+ moderatedUsersList.addEventListener("change", function () {
114
+ const isChecked = this.checked;
115
+ const checkboxes = document.querySelectorAll(".js-check-all-moderated_users");
116
+
117
+ checkboxes.forEach((checkbox) => {
118
+ checkbox.checked = isChecked;
119
+ const row = checkbox.closest("tr");
120
+ if (row) {
121
+ row.classList.toggle("selected", isChecked);
122
+ }
123
+ });
124
+
125
+ if (isChecked) {
126
+ showBulkActionsButton();
127
+ } else {
128
+ hideBulkActionsButton();
120
129
  }
121
- });
122
-
123
- if (isChecked) {
124
- showBulkActionsButton();
125
- } else {
126
- hideBulkActionsButton();
127
- }
128
-
129
- selectedModeratedUsersCountUpdate();
130
- });
131
130
 
131
+ selectedModeratedUsersCountUpdate();
132
+ });
133
+ }
132
134
  // moderated users checkbox change
133
135
  document.querySelector(".table-list").addEventListener("change", (event) => {
134
136
  if (!event.target.matches(".js-check-all-moderated_users")) {
@@ -31,6 +31,8 @@ module Decidim
31
31
 
32
32
  apply_global_moderations_permission_for_admin!
33
33
 
34
+ can_use_image_editor?
35
+
34
36
  if user.admin? && admin_terms_accepted?
35
37
  allow! if read_admin_log_action?
36
38
  allow! if read_user_statistics_action?
@@ -284,6 +286,10 @@ module Decidim
284
286
  def component
285
287
  context.fetch(:component, nil)
286
288
  end
289
+
290
+ def can_use_image_editor?
291
+ allow! if permission_action.subject == :editor_image && user_has_any_role?(user, nil, broad_check: true)
292
+ end
287
293
  end
288
294
  end
289
295
  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
- <%= icon_link_to "eye-line", unhide_moderation_path(id: moderation), t("actions.unhide", scope: "decidim.moderations"), method: :put %>
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>
@@ -698,8 +698,6 @@ ar:
698
698
  edit:
699
699
  update: تحديث
700
700
  form:
701
- colors:
702
- colors_title: ألوان المنظمة
703
701
  cta_button_text_help: يمكنك الكتابة فوق نص زر Call To Action في الصفحة الرئيسية لكل لغة متاحة في مؤسستك. إذا لم يتم تعيينها ، سيتم استخدام القيمة الافتراضية. يظهر زر Call To Action في الصفحة الرئيسية بين نص الترحيب والوصف.
704
702
  homepage_appearance_title: تحرير مظهر الصفحة الرئيسية
705
703
  homepage_highlighted_content_banner_title: لافتة المحتوى الراقي
@@ -819,15 +819,6 @@ bg:
819
819
  edit:
820
820
  update: Актуализация
821
821
  form:
822
- colors:
823
- choose_color: Изберете основен цвят
824
- colors_title: Цветове на организацията
825
- colors_warning_html: Внимание! Промяната на тези цветове може да наруши контрастите на достъпността. Можете да проверите контраста на Вашия избор с <a href="https://webaim.org/resources/contrastchecker">WebAIM Contrast Checker</a> или други подобни инструменти.
826
- explanation: Този инструмент ви помага да изберете цветова схема, съставена от нюанси, разположени на еднакво разстояние около цветното колело, която ще се използва в уебсайта на организацията.
827
- legend_html: Основни цветове на приложението, базирани на <a href="https://www.color-meanings.com/triadic-colors/">Триаден алгоритъм</a>. <i>Вторичният</i> цвят се изчислява автоматично от основния цвят и наситеността, която сте избрали.
828
- saturation: Наситеност
829
- title: Палитра
830
- update_suggested_colors: Обнови предложените цветове
831
822
  cta_button_path_help_html: 'Можете да презапишете къде да води бутонът, призоваващ към действие, на началната страница. Тук използвайте частични пътища, а не пълни URL адреси. Допуска се използването на букви, цифри, тирета, наклонени черти и пътят трябва да започва с буква. Бутонът, призоваващ към действие, се показва на началната страница между текста за добре дошли и описанието. Пример: %{url}'
832
823
  cta_button_text_help: Можете да презапишете текста на бутона, призоваващ към действие, в началната страница за всеки наличен език във вашата организация. Ако не е зададено, ще се използва стойността по подразбиране. Бутонът, призоваващ към действие, се показва на началната страница между текста за добре дошли и описанието.
833
824
  header_snippets: