decidim-admin 0.29.1 → 0.29.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/app/commands/decidim/admin/block_user.rb +1 -0
  3. data/app/controllers/decidim/admin/block_user_controller.rb +1 -1
  4. data/app/controllers/decidim/admin/conflicts_controller.rb +1 -1
  5. data/app/controllers/decidim/admin/impersonations_controller.rb +1 -0
  6. data/app/controllers/decidim/admin/newsletters_controller.rb +2 -1
  7. data/app/forms/decidim/admin/help_section_form.rb +1 -1
  8. data/app/forms/decidim/admin/impersonate_user_form.rb +5 -0
  9. data/app/forms/decidim/admin/organization_appearance_form.rb +2 -2
  10. data/app/forms/decidim/admin/organization_form.rb +2 -2
  11. data/app/forms/decidim/admin/static_page_form.rb +1 -1
  12. data/app/forms/decidim/admin/transfer_user_form.rb +15 -0
  13. data/app/packs/src/decidim/admin/newsletters.js +18 -9
  14. data/app/packs/stylesheets/decidim/admin/_moderations.scss +8 -0
  15. data/app/queries/decidim/admin/newsletter_recipients.rb +9 -5
  16. data/app/views/decidim/admin/conflicts/edit.html.erb +21 -11
  17. data/app/views/decidim/admin/moderated_users/index.html.erb +2 -2
  18. data/app/views/decidim/admin/newsletter_templates/index.html.erb +0 -1
  19. data/app/views/decidim/admin/shared/landing_page_content_blocks/edit.html.erb +1 -1
  20. data/config/locales/ar.yml +48 -1
  21. data/config/locales/bn-BD.yml +1 -0
  22. data/config/locales/bs-BA.yml +525 -0
  23. data/config/locales/ca.yml +1 -1
  24. data/config/locales/de.yml +3 -3
  25. data/config/locales/es-MX.yml +3 -3
  26. data/config/locales/es-PY.yml +3 -3
  27. data/config/locales/es.yml +3 -3
  28. data/config/locales/eu.yml +143 -131
  29. data/config/locales/fi-plain.yml +3 -3
  30. data/config/locales/fi.yml +20 -20
  31. data/config/locales/fr-CA.yml +1 -1
  32. data/config/locales/gl.yml +2 -2
  33. data/config/locales/hu.yml +1 -1
  34. data/config/locales/id-ID.yml +4 -0
  35. data/config/locales/is-IS.yml +12 -0
  36. data/config/locales/it.yml +3 -3
  37. data/config/locales/ja.yml +5 -5
  38. data/config/locales/kaa.yml +0 -3
  39. data/config/locales/ko.yml +1 -1
  40. data/config/locales/lb.yml +4 -4
  41. data/config/locales/lv.yml +3 -2
  42. data/config/locales/nl.yml +1 -1
  43. data/config/locales/no.yml +1 -1
  44. data/config/locales/pl.yml +1 -1
  45. data/config/locales/pt.yml +4 -0
  46. data/config/locales/ro-RO.yml +2 -2
  47. data/config/locales/ru.yml +3 -1
  48. data/config/locales/sk.yml +3 -2
  49. data/config/locales/sl.yml +0 -2
  50. data/config/locales/sq-AL.yml +0 -3
  51. data/config/locales/sr-CS.yml +3 -3
  52. data/config/locales/sv.yml +2 -2
  53. data/config/locales/th-TH.yml +10 -0
  54. data/config/locales/tr-TR.yml +2 -2
  55. data/config/locales/uk.yml +3 -0
  56. data/config/locales/zh-CN.yml +0 -6
  57. data/config/routes.rb +1 -1
  58. data/decidim-admin.gemspec +1 -1
  59. data/lib/decidim/admin/engine.rb +1 -0
  60. data/lib/decidim/admin/version.rb +1 -1
  61. metadata +11 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3f285a47f80f5bdf3a2d992daab51c9945cbccd2c6f714ca15b2529b8923e79
4
- data.tar.gz: 8f4965b0ee06c4d6b5fa74418e52d36f03fe239da058d67927b713955e1211d4
3
+ metadata.gz: b5369e22c8aa5d1eef8398ca2971c4231fcdda8284df5350ca231b68e47e78cf
4
+ data.tar.gz: 28d412f0fbd4683f6031784abf212ba6341f0dd803a57eb167b9d1bf186f83a1
5
5
  SHA512:
6
- metadata.gz: ef1df3729f97261f2a3164eff704c5d503e6a4731daf5e5d586476c64f5f0eb4409234e107f82ce972ce1b2f697685e940d420c6d3d3ebc43d39db579c459540
7
- data.tar.gz: 6e21939582031fc8774833fbed42bf22647dc359b1e5fffe983e593092e89ad2959ebe94042602ac3ba32e0b2f7f61ff8c1ac8c9db3862884e88d3cad8e99e8f
6
+ metadata.gz: d25815c8206161af6f158106f8258abc3280cb05e03c528fb7e628479bae1c43551a4172014a181a09f66ec6eb24da6f0cfd55e4d3302fb0b8aa0391d0cfd430
7
+ data.tar.gz: 71a6522e75aed08bbdc65577cd76b2c69741d66f28b350c04dc02c1c92850e96fd50c481a23e02da804316f8eb24e5a1186dad94912eae6b2bb1072774d292fb
@@ -77,6 +77,7 @@ module Decidim
77
77
  form.user.block_id = @current_blocking.id
78
78
  form.user.extended_data["user_name"] = form.user.name
79
79
  form.user.name = "Blocked user"
80
+ form.user.notifications_sending_frequency = "none"
80
81
  form.user.save!
81
82
  end
82
83
  end
@@ -22,7 +22,7 @@ module Decidim
22
22
  BlockUser.call(@form) do
23
23
  on(:ok) do
24
24
  flash[:notice] = I18n.t("officializations.block.success", scope: "decidim.admin")
25
- redirect_to moderated_users_path(blocked: true), notice:
25
+ redirect_to moderated_users_path, notice:
26
26
  end
27
27
 
28
28
  on(:invalid) do
@@ -47,7 +47,7 @@ module Decidim
47
47
 
48
48
  on(:invalid) do
49
49
  flash.now[:alert] = I18n.t("error", scope: "decidim.admin.conflicts.transfer")
50
- redirect_to decidim.root_path
50
+ render action: "edit"
51
51
  end
52
52
  end
53
53
  end
@@ -29,6 +29,7 @@ module Decidim
29
29
 
30
30
  @form = form(ImpersonateUserForm).from_params(
31
31
  user:,
32
+ name: params[:impersonate_user][:name],
32
33
  handler_name:,
33
34
  reason: params[:impersonate_user][:reason],
34
35
  authorization: Decidim::AuthorizationHandler.handler_for(
@@ -108,7 +108,8 @@ module Decidim
108
108
  end
109
109
 
110
110
  def recipients_count
111
- data = params.permit(data: {}).to_h[:data]
111
+ data = params.permit(newsletter: {}).to_h[:newsletter]
112
+
112
113
  @form = form(SelectiveNewsletterForm).from_params(data)
113
114
  render plain: recipients_count_query
114
115
  end
@@ -9,7 +9,7 @@ module Decidim
9
9
  include TranslationsHelper
10
10
 
11
11
  attribute :id, String
12
- translatable_attribute :content, String
12
+ translatable_attribute :content, Decidim::Attributes::RichText
13
13
 
14
14
  def name
15
15
  multi_translation("activerecord.models.#{manifest.model_class_name.underscore}.other")
@@ -14,6 +14,7 @@ module Decidim
14
14
  attribute :handler_name, String
15
15
 
16
16
  validates :user, presence: true
17
+ validates :name, presence: true, unless: :persisted_user?
17
18
  validates :reason, presence: true, unless: :managed_user?
18
19
 
19
20
  private
@@ -21,6 +22,10 @@ module Decidim
21
22
  def managed_user?
22
23
  user && user.managed?
23
24
  end
25
+
26
+ def persisted_user?
27
+ user&.persisted?
28
+ end
24
29
  end
25
30
  end
26
31
  end
@@ -32,9 +32,9 @@ module Decidim
32
32
  attribute :tertiary_color, String
33
33
 
34
34
  translatable_attribute :cta_button_text, String
35
- translatable_attribute :description, String
35
+ translatable_attribute :description, Decidim::Attributes::RichText
36
36
  translatable_attribute :highlighted_content_banner_title, String
37
- translatable_attribute :highlighted_content_banner_short_description, String
37
+ translatable_attribute :highlighted_content_banner_short_description, Decidim::Attributes::RichText
38
38
  translatable_attribute :highlighted_content_banner_action_title, String
39
39
  translatable_attribute :highlighted_content_banner_action_subtitle, String
40
40
  translatable_attribute :omnipresent_banner_title, String
@@ -31,9 +31,9 @@ module Decidim
31
31
  attribute :customize_welcome_notification, Boolean
32
32
 
33
33
  translatable_attribute :welcome_notification_subject, String
34
- translatable_attribute :welcome_notification_body, String
34
+ translatable_attribute :welcome_notification_body, Decidim::Attributes::RichText
35
35
 
36
- translatable_attribute :admin_terms_of_service_body, String
36
+ translatable_attribute :admin_terms_of_service_body, Decidim::Attributes::RichText
37
37
 
38
38
  validates :welcome_notification_subject, :welcome_notification_body, translatable_presence: true, if: proc { |form| form.customize_welcome_notification }
39
39
 
@@ -9,7 +9,7 @@ module Decidim
9
9
  attribute :slug, String
10
10
  validates :title, translatable_presence: true
11
11
  translatable_attribute :title, String
12
- translatable_attribute :content, String
12
+ translatable_attribute :content, Decidim::Attributes::RichText
13
13
  attribute :changed_notably, Boolean
14
14
  attribute :allow_public_access, Boolean
15
15
  attribute :weight, Integer
@@ -14,6 +14,21 @@ module Decidim
14
14
 
15
15
  validates :current_user, presence: true
16
16
  validates :conflict, presence: true
17
+ validates :email, presence: true
18
+ validate :unique_email
19
+
20
+ private
21
+
22
+ def unique_email
23
+ return if conflict.blank?
24
+ return true if Decidim::UserBaseEntity.where(
25
+ organization: context.current_organization,
26
+ email:
27
+ ).where.not(id: [conflict.current_user.id, conflict.managed_user_id]).empty?
28
+
29
+ errors.add :email, :taken
30
+ false
31
+ end
17
32
  end
18
33
  end
19
34
  end
@@ -54,9 +54,9 @@ $(() => {
54
54
  $participatorySpacesForSelect.hide();
55
55
  }
56
56
 
57
- $(".form .spaces-block-tag").each(function(_i, blockTag) {
57
+ $(".form .spaces-block-tag").each(function (_i, blockTag) {
58
58
  const selectTag = $(blockTag).find(".chosen-select")
59
- selectTag.change(function() {
59
+ selectTag.change(function () {
60
60
  let optionSelected = selectTag.find("option:selected").val()
61
61
  if (optionSelected === "all") {
62
62
  selectTag.find("option").not(":first").prop("selected", true);
@@ -67,16 +67,25 @@ $(() => {
67
67
  });
68
68
  })
69
69
 
70
- $form.on("change", function() {
71
- let $data = $form.serializeJSON().newsletter;
72
- let $url = $form.data("recipients-count-newsletter-path");
70
+ $form.on("change", function(event) {
71
+ let formData = new FormData(event.target.closest("form"));
72
+ let url = $form.data("recipients-count-newsletter-path");
73
73
  const $modal = $("#recipients_count_spinner");
74
74
  $modal.removeClass("hide");
75
- $.get($url, {data: $data}, function(recipientsCount) {
76
- $("#recipients_count").text(recipientsCount);
77
- }).always(function() {
75
+
76
+ const xhr = new XMLHttpRequest();
77
+ xhr.open("POST", url, true);
78
+ xhr.onload = function() {
79
+ if (xhr.status === 200) {
80
+ $("#recipients_count").text(xhr.responseText);
81
+ }
78
82
  $modal.addClass("hide");
79
- });
83
+ };
84
+ xhr.onerror = function() {
85
+ $modal.addClass("hide");
86
+ };
87
+ // Send the form data
88
+ xhr.send(formData);
80
89
  })
81
90
  }
82
91
  });
@@ -29,6 +29,14 @@
29
29
  list-style: none;
30
30
  margin: 0;
31
31
 
32
+ li a {
33
+ @apply flex items-center;
34
+
35
+ svg {
36
+ @apply ml-1;
37
+ }
38
+ }
39
+
32
40
  .icon {
33
41
  @apply ml-2;
34
42
  }
@@ -20,11 +20,7 @@ module Decidim
20
20
  end
21
21
 
22
22
  def query
23
- recipients = Decidim::User.where(organization: @form.current_organization)
24
- .where.not(newsletter_notifications_at: nil)
25
- .where.not(email: nil)
26
- .where.not(confirmed_at: nil)
27
- .not_deleted
23
+ recipients = recipients_base_query
28
24
 
29
25
  recipients = recipients.interested_in_scopes(@form.scope_ids) if @form.scope_ids.present?
30
26
 
@@ -41,6 +37,14 @@ module Decidim
41
37
 
42
38
  private
43
39
 
40
+ def recipients_base_query
41
+ Decidim::User.available
42
+ .where(organization: @form.current_organization)
43
+ .where.not(newsletter_notifications_at: nil)
44
+ .where.not(email: nil)
45
+ .confirmed
46
+ end
47
+
44
48
  # Return the ids of the ParticipatorySpace selected
45
49
  # in form, grouped by type
46
50
  # This will be used to take followers and
@@ -27,18 +27,28 @@
27
27
  </div>
28
28
  </div>
29
29
 
30
- <%= decidim_form_for(@form, url: conflict_path, method: :put, html: { class: "form" }) do |f| %>
31
- <div class="card">
32
- <div class="card-section">
33
- <div class="row column">
34
- <%= f.text_field :reason, label: t("reason", scope: "decidim.admin.conflicts.transfer") %>
30
+ <div class="item__edit item__edit-1col">
31
+ <div class="item__edit-form">
32
+ <%= decidim_form_for(@form, url: conflict_path, method: :put, html: { class: "form form-defaults" }) do |f| %>
33
+ <div class="form__wrapper">
34
+ <div class="card pt-4">
35
+ <div class="card-section">
36
+ <div class="row column">
35
37
 
36
- <%= f.text_field :email, label: t("email", scope: "decidim.admin.conflicts.transfer") %>
38
+ <%= f.text_field :reason, label: t("reason", scope: "decidim.admin.conflicts.transfer") %>
39
+ </div>
40
+
41
+ <div class="row column">
42
+
43
+ <%= f.text_field :email, label: t("email", scope: "decidim.admin.conflicts.transfer") %>
44
+ </div>
45
+ </div>
46
+ </div>
37
47
  </div>
38
- </div>
39
- </div>
40
48
 
41
- <div class="form__wrapper-block flex-col-reverse md:flex-row justify-between">
42
- <%= f.submit t("title", scope: "decidim.admin.conflicts.transfer"), class: "button button__sm button__secondary" %>
49
+ <div class="form__wrapper-block flex-col-reverse md:flex-row justify-between">
50
+ <%= f.submit t("title", scope: "decidim.admin.conflicts.transfer"), class: "button button__sm button__secondary" %>
51
+ </div>
52
+ <% end %>
43
53
  </div>
44
- <% end %>
54
+ </div>
@@ -51,9 +51,9 @@
51
51
  <% end %>
52
52
  <% if allowed_to?(:block, :moderate_users) %>
53
53
  <% if moderation.user.blocked? %>
54
- <%= icon_link_to "forbid-2-line", user_block_path(user_id: moderation.user.id), t(".actions.unblock"), class: "action-icon action-icon--disabled", method: :delete %>
54
+ <%= icon_link_to "refresh-line", user_block_path(user_id: moderation.user.id), t(".actions.unblock"), class: "action-icon action-icon--disabled", method: :delete %>
55
55
  <% else %>
56
- <%= icon_link_to "forbid-2-line", new_user_block_path(user_id: moderation.user.id), t(".actions.block"), class: "action-icon action-icon" %>
56
+ <%= icon_link_to "lock-2-line", new_user_block_path(user_id: moderation.user.id), t(".actions.block"), class: "action-icon action-icon" %>
57
57
  <% end %>
58
58
  <% end %>
59
59
  </td>
@@ -3,7 +3,6 @@
3
3
  <div class="item_show__header">
4
4
  <h1 class="item_show__header-title">
5
5
  <%= t ".title" %>
6
- <%= link_to t("actions.newsletter.new", scope: "decidim.admin"), [:newsletter_templates], class: "button button__sm button__secondary expanded small new" %>
7
6
  </h1>
8
7
  </div>
9
8
 
@@ -6,7 +6,7 @@
6
6
  </div>
7
7
  <div class="item__edit item__edit-1col">
8
8
  <div class="item__edit-form">
9
- <%= decidim_form_for(@form, html: { class: "form-defaults form edit_content_block [&_button]:button [&_button]:button__sm [&_button]:button__secondary" }, url: resource_landing_page_content_block_path) do |form| %>
9
+ <%= decidim_form_for(@form, html: { class: "form-defaults form edit_content_block" }, url: resource_landing_page_content_block_path) do |form| %>
10
10
  <div class="form__wrapper">
11
11
  <div class="card py-4">
12
12
  <div class="card-section">
@@ -38,8 +38,12 @@ ar:
38
38
  user_group_id: إنشاء الاستيرادات ك
39
39
  newsletter:
40
40
  body: النص
41
+ send_to_all_users: إرسال إلى كافة المستخدمين
42
+ send_to_followers: إرسال إلى المتابِعين
43
+ send_to_participants: إرسال إلى المشتركين
41
44
  subject: الموضوع
42
45
  organization:
46
+ admin_terms_of_service_body: نص شروط الخدمة للمشرف
43
47
  alert_color: تنبيه
44
48
  available_authorizations: التراخيص المتاحة
45
49
  badges_enabled: تمكين الشارات
@@ -53,8 +57,12 @@ ar:
53
57
  enable_participatory_space_filters: تفعيل أختيارات فرز الفضاء التشاركي
54
58
  facebook_handler: مُعرّف حساب فيسبوك
55
59
  favicon: أيقونة
60
+ force_authentication: فرض المصادقة
61
+ force_users_to_authenticate_before_access_organization: إلزام المستخدمين على المصادقة قبل الدخول إلى المنظمة
62
+ from: البريد الإلكتروني للمرسل
56
63
  github_handler: مُعرّف حساب غِت هَب
57
64
  header_snippets: قصاصات رأس
65
+ highlight_alternative_color: تحديد، البديل
58
66
  highlight_color: تظليل
59
67
  highlighted_content_banner_action_subtitle: نص زر الإجراء
60
68
  highlighted_content_banner_action_title: عنوان زر الإجراء
@@ -85,9 +93,12 @@ ar:
85
93
  secondary_hosts: المستضيفين الثانويين
86
94
  send_welcome_notification: إرسال إشعار بالترحيب
87
95
  success_color: نجاح
96
+ tertiary_color: المستوى الثالث
88
97
  time_zone: المنطقة الزمنية
89
98
  tos_version: شروط وأحكام الخدمة
99
+ twitter_handler: X handler
90
100
  user_groups_enabled: تمكين المجموعات
101
+ users_registration_mode: وضع تسجيل المستخدمين
91
102
  warning_color: تحذير
92
103
  welcome_notification_body: محتوى إشعار الترحيب
93
104
  welcome_notification_subject: موضوع إشعار الترحيب
@@ -109,24 +120,46 @@ ar:
109
120
  settings:
110
121
  scope_id: المجال
111
122
  static_page:
123
+ allow_public_access: السماح بالوصول دون مصادقة
112
124
  changed_notably: كانت هناك تغييرات ملحوظة.
113
125
  content: المحتوى
114
126
  organization: المنظمة
115
127
  show_in_footer: تظهر في تذييل الصفحة
116
128
  slug: سبيكة العنوان الشبكي
117
129
  title: العنوان
130
+ topic_id: الموضوع
131
+ weight: موضع الطلب
118
132
  static_page_topic:
119
133
  description: وصف
134
+ name: عنوان الموضوع
120
135
  show_in_footer: تظهر في تذييل الصفحة
121
136
  title: العنوان
137
+ weight: موضع الطلب
122
138
  user_group_csv_verification:
123
139
  file: ملف
124
140
  errors:
125
141
  models:
142
+ newsletter:
143
+ attributes:
144
+ base:
145
+ at_least_one_space: حدد مساحة تشاركية واحدة على الأقل.
126
146
  organization:
127
147
  attributes:
128
148
  official_img_footer:
129
149
  allowed_file_content_types: ملف صورة غير صالح
150
+ participatory_space_private_user_csv_import:
151
+ attributes:
152
+ file:
153
+ malformed: خطأ في ملفّ الاستيراد، يرجى قراءة التعليمات بعناية والتأكد من أن ترميز الملف هو UTF-8.
154
+ user_group_csv_verification:
155
+ attributes:
156
+ file:
157
+ malformed: خطأ في ملفّ الاستيراد، يرجى قراءة التعليمات بعناية والتأكد من أن ترميز الملف هو UTF-8.
158
+ new_import:
159
+ attributes:
160
+ file:
161
+ invalid_file: الملف غير صالح، يرجى التأكد من تنسيق الملف بشكل صحيح.
162
+ invalid_mime_type: ملف من نوع MIME غير صالح.
130
163
  activerecord:
131
164
  attributes:
132
165
  decidim/static_page:
@@ -145,10 +178,15 @@ ar:
145
178
  admin:
146
179
  actions:
147
180
  add: إضافة
181
+ attachment:
182
+ new: إضافة مرفق
183
+ attachment_collection:
184
+ new: مجلد مرفقات جديد
148
185
  browse: تصفح
149
186
  category:
150
187
  new: فئة جديدة
151
188
  export: تصدير الكل
189
+ export-selection: تصدير الإختيار
152
190
  import: استيراد
153
191
  manage: تدبير
154
192
  newsletter:
@@ -295,6 +333,9 @@ ar:
295
333
  title: نقل
296
334
  'true': 'نعم'
297
335
  user_name: المستخدم
336
+ content_blocks:
337
+ edit:
338
+ title: محتويات الصفحة
298
339
  dashboard:
299
340
  show:
300
341
  view_more_logs: عرض المزيد من السجلات
@@ -430,6 +471,9 @@ ar:
430
471
  download_example_format: مثال كـ %{name}
431
472
  file_legend: إضافة ملف استيراد سيتم تحليله.
432
473
  import: استيراد
474
+ logs:
475
+ filters:
476
+ user: المستخدم
433
477
  managed_users:
434
478
  promotion:
435
479
  error: كانت هناك مشكلة في تعزيز المشارك المُدار.
@@ -507,6 +551,7 @@ ar:
507
551
  plural: جمع
508
552
  share_token:
509
553
  fields:
554
+ created_at: أنشئت في
510
555
  expires_at: تنتهي صلاحيته في
511
556
  token: رمز التشفير - Token
512
557
  user: تم الإنشاء بواسطة
@@ -600,7 +645,7 @@ ar:
600
645
  all_spaces: الكل
601
646
  confirm_deliver: هل أنت متأكد من أنك تريد تسليم هذه الرسالة الإخبارية؟ لا يمكن التراجع عن هذا الإجراء.
602
647
  deliver: تسليم النشرة الإخبارية
603
- none: لا شَيْء
648
+ none: لا شيء
604
649
  scopes_help: إرسال النشرة الإخبارية للمستخدمين الذين لديهم أي من المجالات المحددة تم تفعيله في إعدادات "اهتماماتي" لحسابهم.
605
650
  select_scopes: أختر للمستخدمين الذين فعلوا أي مجال محدد في إعدادات أهتماماتي لحساباتهم.
606
651
  title: حدد المستلمين للإرسال اليهم
@@ -779,10 +824,12 @@ ar:
779
824
  areas: المناطق
780
825
  authorization_workflows: طرق التحقق
781
826
  dashboard: لوحة القيادة
827
+ edit_landing_page: محتويات الصفحة
782
828
  edit_organization_appearance: تعديل مظهر الصفحة الرئيسية
783
829
  impersonatable_users: المشاركون في الإدارة
784
830
  impersonations: إدارة المشاركين
785
831
  menu: القائمة الرئيسية
832
+ page_topics: المواضيع
786
833
  pages: الصفحات
787
834
  panel: مدير
788
835
  participants: المشاركين
@@ -0,0 +1 @@
1
+ bn: