decidim-admin 0.30.0.rc2 → 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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/app/commands/decidim/admin/unhide_resource.rb +1 -0
  3. data/app/controllers/decidim/admin/moderations_controller.rb +8 -3
  4. data/app/controllers/decidim/admin/organization_controller.rb +1 -1
  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/helpers/decidim/admin/settings_helper.rb +1 -0
  8. data/app/permissions/decidim/admin/permissions.rb +8 -0
  9. data/app/views/decidim/admin/moderations/_moderation-tr.html.erb +5 -1
  10. data/config/locales/ar.yml +7 -5
  11. data/config/locales/bg.yml +2 -2
  12. data/config/locales/bs-BA.yml +3 -2
  13. data/config/locales/ca-IT.yml +1404 -0
  14. data/config/locales/ca.yml +7 -5
  15. data/config/locales/cs.yml +3 -1
  16. data/config/locales/de.yml +8 -6
  17. data/config/locales/el.yml +4 -2
  18. data/config/locales/en.yml +2 -0
  19. data/config/locales/eo.yml +1 -0
  20. data/config/locales/es-MX.yml +4 -2
  21. data/config/locales/es-PY.yml +4 -2
  22. data/config/locales/es.yml +2 -0
  23. data/config/locales/eu.yml +34 -32
  24. data/config/locales/fi-plain.yml +4 -4
  25. data/config/locales/fi.yml +4 -4
  26. data/config/locales/fr-CA.yml +36 -3
  27. data/config/locales/fr.yml +36 -3
  28. data/config/locales/ga-IE.yml +1 -6
  29. data/config/locales/gl.yml +4 -1
  30. data/config/locales/he-IL.yml +6 -0
  31. data/config/locales/hu.yml +5 -5
  32. data/config/locales/id-ID.yml +5 -5
  33. data/config/locales/is-IS.yml +1 -6
  34. data/config/locales/it.yml +243 -3
  35. data/config/locales/ja.yml +4 -2
  36. data/config/locales/kaa.yml +5 -0
  37. data/config/locales/ko.yml +10 -2
  38. data/config/locales/lb.yml +6 -3
  39. data/config/locales/lt.yml +2 -0
  40. data/config/locales/lv.yml +3 -2
  41. data/config/locales/nl.yml +6 -3
  42. data/config/locales/no.yml +5 -2
  43. data/config/locales/pl.yml +3 -3
  44. data/config/locales/pt-BR.yml +2 -2
  45. data/config/locales/pt.yml +7 -4
  46. data/config/locales/ro-RO.yml +7 -1
  47. data/config/locales/ru.yml +5 -7
  48. data/config/locales/sk.yml +4 -5
  49. data/config/locales/sl.yml +7 -0
  50. data/config/locales/sq-AL.yml +13 -3
  51. data/config/locales/sr-CS.yml +3 -2
  52. data/config/locales/sv.yml +5 -4
  53. data/config/locales/th-TH.yml +4 -0
  54. data/config/locales/tr-TR.yml +5 -6
  55. data/config/locales/uk.yml +2 -7
  56. data/config/locales/zh-CN.yml +3 -4
  57. data/config/locales/zh-TW.yml +2 -0
  58. data/lib/decidim/admin/test/manage_hide_content_examples.rb +4 -3
  59. data/lib/decidim/admin/test/manage_moderations_examples.rb +1 -1
  60. data/lib/decidim/admin/version.rb +1 -1
  61. metadata +10 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26bfbf8e68bdc41e593b48bc9d1b89a69430c0d3aa7848a98bc65ca326c5bba2
4
- data.tar.gz: caee2c19de1daae78bf7e885ae79f67c61a278bba2f553654e7d9a6768b9a3f6
3
+ metadata.gz: b2daba5d2c690b03030a08511196d9ca36ebc870e8358f97d3161182013a42fd
4
+ data.tar.gz: d57c01e2f502d64c2ba1723af733ed39bd181f0a83412efaff63235acf49c248
5
5
  SHA512:
6
- metadata.gz: 881f684019ec01981278bd367050e381160662ed72d46df229f97ed62c0f564d3fc520f9351ab936244f33d4d1abf87df7bf776e843cac4d14f4d5f7b8a87e4b
7
- data.tar.gz: be0e2fc5ccc488c230cb5e7d39a9cfb9c1cafe12715dde1204325e3d45cd62cb85dd4e613b7c548383ef444832a1c044f172fc416ceb1a1202ea8a629e917374
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.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
@@ -48,7 +48,7 @@ module Decidim
48
48
  if (term = params[:term].to_s).present?
49
49
  query = if term.start_with?("@")
50
50
  nickname = term.delete("@")
51
- relation.where("nickname ILIKE ?", "#{nickname}%")
51
+ relation.where("nickname LIKE ?", "#{nickname}%")
52
52
  .order(Arel.sql(ActiveRecord::Base.sanitize_sql_array("similarity(nickname, '#{nickname}') DESC")))
53
53
  else
54
54
  relation.where("name ILIKE ?", "%#{term}%").or(
@@ -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
@@ -225,6 +225,7 @@ module Decidim
225
225
  content_tag(:button,
226
226
  t("#{name}_add", scope: i18n_scope),
227
227
  class: "button button__xs button__transparent-secondary js-add-taxonomy-filter",
228
+ type: "button",
228
229
  data: {
229
230
  url: decidim_admin.taxonomy_filters_selector_index_path(component_id: @component.id)
230
231
  })
@@ -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
- <%= 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>
@@ -556,8 +556,8 @@ ar:
556
556
  actions: أفعال
557
557
  created_at: أنشئت في
558
558
  document_number: رقم المستند
559
- name: اسم
560
- nickname: الاسم المستعار
559
+ name: الاسم
560
+ nickname: كنية
561
561
  phone: هاتف
562
562
  state: حالة
563
563
  users_count: عدد المشاركين
@@ -721,6 +721,8 @@ ar:
721
721
  title: مشارك جديد الفضاء الخاص المشارك.
722
722
  participatory_space_private_users_csv_imports:
723
723
  new:
724
+ csv_upload:
725
+ title: قم بتحميل ملف CSV الخاص بك
724
726
  destroy:
725
727
  button: حذف جميع المشاركين الخاصين
726
728
  empty: ليس لديك أي مشاركين خاصين.
@@ -857,14 +859,14 @@ ar:
857
859
  index:
858
860
  state:
859
861
  pending: قيد الانتظار
860
- rejected: مرفوض
861
- verified: التحقق
862
+ rejected: تم رفضه
863
+ verified: تم التحقق
862
864
  verify_via_csv: تحقق عبر CSV
863
865
  user_groups_csv_verifications:
864
866
  new:
865
867
  explanation: قم بتحميل ملف CSV الخاص بك. يجب أن يحتوي على رسائل البريد الإلكتروني الرسمية للمجموعات في مؤسستك في العمود الأول من الملف ، بدون رؤوس. سيتم التحقق من صحة المجموعات التي أكدت بريدها الإلكتروني والتي تحتوي على بريد إلكتروني ظاهر في ملف CSV.
866
868
  title: قم بتحميل ملف CSV الخاص بك
867
- upload: رفع
869
+ upload: حمّل
868
870
  users:
869
871
  create:
870
872
  error: كانت هناك مشكلة في دعوة هذا المشرف.
@@ -869,7 +869,7 @@ bg:
869
869
  success: Файлът във формат CSV беше качен успешно; изпращаме имейл с покана на участниците. Това може да отнеме известно време.
870
870
  new:
871
871
  csv_upload:
872
- title: Качете своя файл във формат CSV
872
+ title: Качете своя CSV файл
873
873
  destroy:
874
874
  button: Изтрийте всички частни участници
875
875
  confirm: Сигурни ли сте, че искате да изтриете всички частни участници? Това действие е необратимо, няма да можете да ги възстановите.
@@ -1052,7 +1052,7 @@ bg:
1052
1052
  index:
1053
1053
  state:
1054
1054
  pending: Изчакване
1055
- rejected: Отхвърлено
1055
+ rejected: Отхвърлен
1056
1056
  verified: Проверен
1057
1057
  verify_via_csv: Проверка чрез CSV
1058
1058
  user_groups_csv_verifications:
@@ -374,11 +374,12 @@ bs:
374
374
  user_group:
375
375
  fields:
376
376
  actions: Akcije
377
- created_at: Kreirano na
377
+ created_at: Stvoreno
378
378
  document_number: Broj dokumenta
379
379
  name: Ime
380
+ nickname: Nadimak
380
381
  phone: Telefon
381
- state: Država
382
+ state: Državno
382
383
  users_count: Broj učesnika
383
384
  moderations:
384
385
  report: