decidim-core 0.29.3 → 0.29.4

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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/address/show.erb +3 -3
  3. data/app/cells/decidim/author/show.erb +2 -4
  4. data/app/cells/decidim/content_blocks/participatory_space_extra_data/extra_data.erb +2 -2
  5. data/app/cells/decidim/participatory_space_dropdown_metadata/metadata.erb +4 -4
  6. data/app/commands/decidim/create_report.rb +5 -1
  7. data/app/commands/decidim/invite_user.rb +1 -1
  8. data/app/controllers/concerns/decidim/participatory_space_context.rb +4 -1
  9. data/app/controllers/decidim/reports_controller.rb +6 -1
  10. data/app/forms/decidim/omniauth_registration_form.rb +1 -1
  11. data/app/forms/decidim/registration_form.rb +1 -1
  12. data/app/helpers/decidim/menu_helper.rb +2 -2
  13. data/app/helpers/decidim/paginate_helper.rb +1 -1
  14. data/app/helpers/decidim/tooltip_helper.rb +4 -1
  15. data/app/mailers/decidim/notifications_digest_mailer.rb +7 -1
  16. data/app/mailers/decidim/reported_mailer.rb +17 -2
  17. data/app/packs/src/decidim/input_character_counter.js +1 -1
  18. data/app/packs/stylesheets/decidim/_cards.scss +1 -1
  19. data/app/packs/stylesheets/decidim/_header.scss +54 -35
  20. data/app/permissions/decidim/default_permissions.rb +2 -0
  21. data/app/presenters/decidim/notification_to_mailer_presenter.rb +7 -3
  22. data/app/queries/decidim/last_activity.rb +25 -0
  23. data/app/views/decidim/messaging/conversations/_reply_form.html.erb +1 -2
  24. data/app/views/decidim/messaging/conversations/_start.html.erb +1 -1
  25. data/app/views/decidim/reported_mailer/hidden_manually.html.erb +25 -0
  26. data/app/views/decidim/shared/_results_per_page.html.erb +1 -1
  27. data/app/views/kaminari/decidim/_page.html.erb +1 -1
  28. data/app/views/kaminari/decidim/_paginator.html.erb +1 -1
  29. data/app/views/layouts/decidim/_logo.html.erb +2 -2
  30. data/app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown_desktop.html.erb +5 -11
  31. data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +5 -5
  32. data/config/locales/ar.yml +0 -6
  33. data/config/locales/bg.yml +0 -6
  34. data/config/locales/ca-IT.yml +12 -1
  35. data/config/locales/ca.yml +12 -1
  36. data/config/locales/cs.yml +18 -4
  37. data/config/locales/de.yml +16 -2
  38. data/config/locales/el.yml +0 -6
  39. data/config/locales/en.yml +12 -1
  40. data/config/locales/es-MX.yml +13 -2
  41. data/config/locales/es-PY.yml +13 -2
  42. data/config/locales/es.yml +12 -1
  43. data/config/locales/eu.yml +17 -5
  44. data/config/locales/fi-plain.yml +0 -6
  45. data/config/locales/fi.yml +0 -6
  46. data/config/locales/fr-CA.yml +14 -4
  47. data/config/locales/fr.yml +14 -4
  48. data/config/locales/gl.yml +0 -5
  49. data/config/locales/hu.yml +0 -6
  50. data/config/locales/id-ID.yml +0 -5
  51. data/config/locales/is-IS.yml +0 -5
  52. data/config/locales/it.yml +0 -5
  53. data/config/locales/ja.yml +16 -6
  54. data/config/locales/lb.yml +0 -5
  55. data/config/locales/lt.yml +0 -6
  56. data/config/locales/lv.yml +0 -5
  57. data/config/locales/nl.yml +0 -5
  58. data/config/locales/no.yml +0 -5
  59. data/config/locales/pl.yml +0 -6
  60. data/config/locales/pt-BR.yml +0 -6
  61. data/config/locales/pt.yml +0 -5
  62. data/config/locales/ro-RO.yml +0 -10
  63. data/config/locales/ru.yml +0 -5
  64. data/config/locales/sk.yml +0 -5
  65. data/config/locales/sv.yml +28 -12
  66. data/config/locales/tr-TR.yml +1 -5
  67. data/config/locales/uk.yml +0 -5
  68. data/config/locales/zh-CN.yml +0 -5
  69. data/config/locales/zh-TW.yml +0 -6
  70. data/db/migrate/20171212103803_create_unique_nicknames.rb +1 -1
  71. data/db/migrate/20180221101934_fix_nickname_index.rb +1 -1
  72. data/db/migrate/20180706104107_add_nickname_to_managed_users.rb +1 -1
  73. data/db/migrate/20181001124950_move_users_groups_to_users_table.rb +1 -1
  74. data/db/migrate/20190412131728_fix_user_names.rb +1 -1
  75. data/lib/decidim/core/version.rb +1 -1
  76. data/lib/decidim/nicknamizable.rb +6 -9
  77. data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +1 -1
  78. metadata +8 -7
  79. /data/app/views/decidim/reported_mailer/{hide.html.erb → hidden_automatically.html.erb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28b3c4ae291bd29e865f8c3d4b18ac88f4e1e28e5f40b658b650c8fbff2773be
4
- data.tar.gz: 4e3784db851ce1e0b3c857aba4bfbc4afae28f9b4c0567d071dfaa5bd37aa3eb
3
+ metadata.gz: c870efc9a61fb35a4d203542d3c151236fa734857034cd0218962c0d8a5889a2
4
+ data.tar.gz: 870b0671cef65194a32e2fc33e430b92bab41f347c8b1068fe954dcc8e5b2990
5
5
  SHA512:
6
- metadata.gz: fa92b90aaaee207b64a405dabfc14217e5e10138de033c3a06fcd5261209840a34b28a41efa8139c9c83dea1f0b7bf4ade861058855f575505feb1f3740b2da1
7
- data.tar.gz: d2714c0d00b670dc1e7245088175d6a8b1d84f1f34d30234cb55a5834940f53ca14c5c170ae913732d5ee6d6c8de8024c3e5c16e5e1697f8a2c3b3e0f8ee7999
6
+ metadata.gz: 3370c446ba0ebc647b221e031500993fd56719e96908a38832d62497103893295a46a33da7eadb42f110f119a4f4abf634cfd8c5a8ae707009c9a186ca31352b
7
+ data.tar.gz: babce000ab8d7cd3fa51f6c8f81a2e5d6791817dda5e3336369af31316d8d7ba061e85cb38fd5f97885100b74f06f61e05b109d91fc9d1b67c2f49dc77e96c34
@@ -4,13 +4,13 @@
4
4
  <%= icon "map-pin-line" %>
5
5
  <div class="address">
6
6
  <% if has_location? %>
7
- <div class="address__location"><%= location %></div>
7
+ <p class="address__location"><%= location %></p>
8
8
  <% end %>
9
9
 
10
- <div class="address__address"><%= address %></div>
10
+ <p class="address__address"><%= address %></p>
11
11
 
12
12
  <% if has_location_hints? %>
13
- <div class="address__hints"><%= location_hints %></div>
13
+ <p class="address__hints"><%= location_hints %></p>
14
14
  <% end %>
15
15
  </div>
16
16
  </div>
@@ -1,7 +1,5 @@
1
- <%# If the options hash has the demo key it means we are in the decidim-design engine, so it is not a real-world scenario with actual users %>
2
- <% tooltip = options.has_key?(:demo) ? { tooltip: render(:profile_minicard).html_safe } : nil %>
3
- <%= content_tag(:span, class: :author, data: ) do %>
4
- <%= content_tag :span, class: "author__container#{" is-compact" if layout == :compact}", data: tooltip do %>
1
+ <%= content_tag(:p, class: :author, data: ) do %>
2
+ <%= content_tag :span, class: "author__container#{" is-compact" if layout == :compact}" do %>
5
3
  <% if layout == :compact %>
6
4
  <%= render :avatar %>
7
5
 
@@ -2,10 +2,10 @@
2
2
  <div class="participatory-space__metadata-item">
3
3
  <div class="participatory-space__metadata-item-title">
4
4
  <%= icon item[:icon] %>
5
- <span><%= item[:title] %></span>
5
+ <h2><%= item[:title] %></h2>
6
6
  </div>
7
7
  <% if item[:text].present? %>
8
- <%= content_tag :span, item[:text] %>
8
+ <%= content_tag :p, item[:text] %>
9
9
  <% elsif item[:partial].present? %>
10
10
  <%= render item[:partial] %>
11
11
  <% end %>
@@ -1,9 +1,9 @@
1
1
  <h4 class="menu-bar__secondary-dropdown__title"><%= title %></h4>
2
- <div class="menu-bar__secondary-dropdown__metadata">
3
- <% if hashtag.present? %>
2
+ <% if hashtag.present? %>
3
+ <div class="menu-bar__secondary-dropdown__metadata">
4
4
  <span>
5
5
  <%= icon "twitter-x-line", class: "text-gray fill-current" %>
6
6
  <%= link_to "##{hashtag}", twitter_hashtag_url(hashtag), target: "_blank", class: "text-secondary underline" %>
7
7
  </span>
8
- <% end %>
9
- </div>
8
+ </div>
9
+ <% end %>
@@ -76,7 +76,11 @@ module Decidim
76
76
  participatory_space_moderators.each do |moderator|
77
77
  next unless moderator.email_on_moderations
78
78
 
79
- ReportedMailer.hide(moderator, @report).deliver_later
79
+ if hidden_by_admin?
80
+ ReportedMailer.hidden_manually(moderator, @report, current_user).deliver_later
81
+ else
82
+ ReportedMailer.hidden_automatically(moderator, @report).deliver_later
83
+ end
80
84
  end
81
85
  end
82
86
 
@@ -41,7 +41,7 @@ module Decidim
41
41
  @user = Decidim::User.new(
42
42
  name: form.name,
43
43
  email: form.email.downcase,
44
- nickname: UserBaseEntity.nicknamize(form.name, organization: form.organization),
44
+ nickname: UserBaseEntity.nicknamize(form.name, form.organization.id),
45
45
  organization: form.organization,
46
46
  admin: form.role == "admin",
47
47
  roles: form.role == "admin" ? [] : [form.role].compact
@@ -9,6 +9,7 @@ module Decidim
9
9
 
10
10
  included do
11
11
  include Decidim::NeedsOrganization
12
+ include Decidim::UserRoleChecker
12
13
 
13
14
  helper ParticipatorySpaceHelpers, IconHelper, ContextualHelpHelper
14
15
  helper_method :current_participatory_space
@@ -81,8 +82,10 @@ module Decidim
81
82
  return true unless current_participatory_space.try(:private_space?) &&
82
83
  !current_participatory_space.try(:is_transparent?)
83
84
  return false unless current_user
85
+ return true if current_user.admin?
86
+ return true if user_has_any_role?(current_user, current_participatory_space, broad_check: true)
84
87
 
85
- current_user.admin || current_participatory_space.users.include?(current_user)
88
+ current_participatory_space.users.include?(current_user)
86
89
  end
87
90
 
88
91
  def help_section
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  # Exposes the report resource so users can report a reportable.
5
+ # Unless the reportable is marked as hideable, the resource notice will change accordingly.
5
6
  class ReportsController < Decidim::ApplicationController
6
7
  include FormFactory
7
8
  include NeedsPermission
@@ -15,7 +16,11 @@ module Decidim
15
16
 
16
17
  CreateReport.call(@form, reportable) do
17
18
  on(:ok) do
18
- flash[:notice] = I18n.t("decidim.reports.create.success")
19
+ flash[:notice] = if hideable?
20
+ I18n.t("decidim.reports.hide.success")
21
+ else
22
+ I18n.t("decidim.reports.create.success")
23
+ end
19
24
  redirect_to reportable.reload.reported_content_url
20
25
  end
21
26
 
@@ -25,7 +25,7 @@ module Decidim
25
25
  end
26
26
 
27
27
  def normalized_nickname
28
- UserBaseEntity.nicknamize(nickname || name, organization: current_organization)
28
+ UserBaseEntity.nicknamize(nickname || name, current_organization.id)
29
29
  end
30
30
  end
31
31
  end
@@ -37,7 +37,7 @@ module Decidim
37
37
  end
38
38
 
39
39
  def generate_nickname(name, organization)
40
- Decidim::UserBaseEntity.nicknamize(name, organization:)
40
+ Decidim::UserBaseEntity.nicknamize(name, organization.id)
41
41
  end
42
42
 
43
43
  def valid_users
@@ -39,7 +39,7 @@ module Decidim
39
39
  @breadcrumb_root_menu ||= ::Decidim::BreadcrumbRootMenuPresenter.new(
40
40
  :menu,
41
41
  self,
42
- container_options: { class: "menu-bar__main-dropdown__menu" }
42
+ container_options: { class: "menu-bar__dropdown-menu" }
43
43
  )
44
44
  end
45
45
 
@@ -47,7 +47,7 @@ module Decidim
47
47
  @mobile_breadcrumb_root_menu ||= ::Decidim::BreadcrumbRootMenuPresenter.new(
48
48
  :mobile_menu,
49
49
  self,
50
- container_options: { class: "menu-bar__main-dropdown__menu" }
50
+ container_options: { class: "menu-bar__main-dropdown__top-menu" }
51
51
  )
52
52
  end
53
53
 
@@ -13,7 +13,7 @@ module Decidim
13
13
 
14
14
  per_page = (params[:per_page] || paginate_params[:per_page] || Decidim::Paginable::OPTIONS.first).to_i
15
15
 
16
- content_tag :div, class: "flex flex-col-reverse md:flex-row items-center justify-between gap-1 py-8 md:py-16", data: { pagination: "" } do
16
+ content_tag :div, class: "flex flex-col-reverse md:flex-row items-center justify-between gap-1 py-8 md:py-16 md:flex-wrap", data: { pagination: "" } do
17
17
  template = ""
18
18
  template += render(partial: "decidim/shared/results_per_page", locals: { per_page: }, formats: [:html]) if collection.total_pages.positive?
19
19
  template += paginate collection, window: 2, outer_window: 1, theme: "decidim", params: paginate_params
@@ -5,7 +5,10 @@ module Decidim
5
5
  # on the layout.
6
6
  module TooltipHelper
7
7
  def with_tooltip(title, opts = {}, &)
8
- content_tag(:span, title:, data: { tooltip: content_tag(:div, title, id: opts[:id], class: opts[:class] || "bottom", role: "tooltip", "aria-hidden": "true") }) do
8
+ content_tag(:p,
9
+ title:,
10
+ class: "inline-block",
11
+ data: { tooltip: content_tag(:p, title, id: opts[:id], class: opts[:class] || "bottom", role: "tooltip", "aria-hidden": "true") }) do
9
12
  capture(&).html_safe
10
13
  end
11
14
  end
@@ -14,7 +14,13 @@ module Decidim
14
14
  @organization = user.organization
15
15
  @notifications_digest = Decidim::NotificationsDigestPresenter.new(user)
16
16
  @display_see_more_message = notifications.size > SIZE_LIMIT
17
- @notifications = notifications[0...SIZE_LIMIT].map { |notification| Decidim::NotificationToMailerPresenter.new(notification) }
17
+ # Note that this could be improved by adding a "type" column to the notifications table
18
+ # This fix can generate lists of notifications that are below the SIZE_LIMIT
19
+ @notifications = notifications[0...SIZE_LIMIT].filter_map do |notification|
20
+ next unless notification.event_class_instance.respond_to?(:email_intro)
21
+
22
+ Decidim::NotificationToMailerPresenter.new(notification)
23
+ end
18
24
 
19
25
  mail(to: user.email, subject: @notifications_digest.subject)
20
26
  end
@@ -21,14 +21,29 @@ module Decidim
21
21
  end
22
22
  end
23
23
 
24
- def hide(user, report)
24
+ # This is used when a user with special rights (like an administrator, a space administrator or a moderator) hides a resource
25
+ def hidden_manually(user, report, current_user)
25
26
  with_user(user) do
26
27
  @report = report
27
28
  @participatory_space = @report.moderation.participatory_space
28
29
  @reportable = @report.moderation.reportable
29
30
  @organization = user.organization
30
31
  @user = user
31
- subject = I18n.t("hide.subject", scope: "decidim.reported_mailer")
32
+ @moderator = current_user
33
+ subject = I18n.t("hidden_manually.subject", scope: "decidim.reported_mailer", moderator: @moderator.name)
34
+ mail(to: user.email, subject:)
35
+ end
36
+ end
37
+
38
+ # This is meant to be used when a resource is hidden by an algorithm, such as the `decidim-ai` module, or the `Decidim.max_reports_before_hiding` feature.
39
+ def hidden_automatically(user, report)
40
+ with_user(user) do
41
+ @report = report
42
+ @participatory_space = @report.moderation.participatory_space
43
+ @reportable = @report.moderation.reportable
44
+ @organization = user.organization
45
+ @user = user
46
+ subject = I18n.t("hidden_automatically.subject", scope: "decidim.reported_mailer")
32
47
  mail(to: user.email, subject:)
33
48
  end
34
49
  end
@@ -93,7 +93,7 @@ export default class InputCharacterCounter {
93
93
  this.$srTarget = $(`#${screenReaderId}`);
94
94
  if (!this.$srTarget.length) {
95
95
  this.$srTarget = $(
96
- `<span role="status" id="${screenReaderId}" class="sr-only remaining-character-count-sr" />`
96
+ `<span role="status" id="${screenReaderId}" class="sr-only remaining-character-count-sr" aria-hidden="true"/>`
97
97
  );
98
98
  this.$target.before(this.$srTarget);
99
99
  }
@@ -159,7 +159,7 @@
159
159
  /* shared styles */
160
160
  &__highlight-metadata,
161
161
  &__grid-metadata {
162
- @apply mt-auto flex items-center justify-between flex-wrap text-sm text-gray-2 [&>*]:flex [&>*]:items-center [&>*]:gap-1 first:[&>*]:flex-none;
162
+ @apply mt-auto flex items-center justify-between flex-wrap w-full text-sm text-gray-2 [&>*]:flex [&>*]:items-center [&>*]:gap-1 first:[&>*]:w-4/5;
163
163
 
164
164
  svg {
165
165
  @apply flex-none text-gray fill-current;
@@ -334,10 +334,6 @@ header {
334
334
  &__dropdown-trigger {
335
335
  @apply flex items-center justify-between text-white;
336
336
 
337
- span {
338
- @apply flex flex-wrap md:flex-nowrap gap-x-2.5 overflow-hidden text-white;
339
- }
340
-
341
337
  svg {
342
338
  @apply w-6 h-6 fill-current;
343
339
  }
@@ -373,54 +369,77 @@ header {
373
369
  @apply absolute top-full left-0 bg-white rounded w-full bg-gray-5;
374
370
  }
375
371
 
376
- &__main-dropdown {
377
- @apply bg-white divide-y divide-gray-3 rounded-b shadow-lg text-black w-full lg:w-[1280px] h-screen md:h-auto;
372
+ &__dropdown-menu {
373
+ @apply w-full md:w-1/4 bg-primary px-4 md:px-8 pt-0 pb-3 md:py-3 divide-y divide-gray-3 text-white;
378
374
 
379
- &__bottom,
380
- &__top {
381
- @apply flex flex-col md:flex-row justify-between p-4 md:p-8 gap-x-8;
375
+ > * {
376
+ @apply py-3 md:py-3.5;
377
+ }
382
378
 
383
- &-right {
384
- @apply hidden md:block md:w-1/2;
379
+ a {
380
+ @apply flex items-center justify-start gap-1 font-semibold text-lg text-white;
381
+
382
+ span {
383
+ @apply min-w-0 truncate;
385
384
  }
386
- }
387
385
 
388
- &__bottom {
389
- @apply hidden md:flex;
386
+ svg {
387
+ @apply flex-none fill-current;
388
+ }
390
389
  }
390
+ }
391
391
 
392
- &__title {
393
- @apply hidden h4 md:flex md:h3;
394
- }
392
+ &__main-dropdown {
393
+ @apply bg-white flex flex-row rounded-b shadow-lg text-black w-full lg:w-[1280px] h-screen md:h-auto;
395
394
 
396
- &__subtitle {
397
- @apply hidden text-md md:flex md:text-lg text-gray-2 mt-5;
395
+ &__left {
396
+ @apply flex flex-col justify-between p-4 md:p-8 space-y-5 hidden md:block md:w-3/4;
397
+
398
+ &-top {
399
+ @apply border-b-4 border-gray-3 pb-3;
400
+ }
398
401
  }
399
402
 
400
- &__menu {
401
- @apply w-full md:w-1/2 mt-0 grid md:grid-cols-2 gap-x-6 text-secondary;
403
+ &__top {
404
+ @apply w-full px-4;
402
405
 
403
- > * {
404
- @apply py-3 md:py-3.5 border-b last:border-0 border-gray-3;
406
+ &-menu {
407
+ @apply w-full md:w-1/2 mt-0 grid md:grid-cols-2 gap-x-6 text-secondary;
405
408
 
406
- /* since the grid has 2 columns, remove the border for these last 2 columns */
407
- &:nth-last-child(-n + 2) {
408
- @apply md:border-0;
409
+ > * {
410
+ @apply py-3 md:py-3.5 border-b last:border-0 border-gray-3;
411
+
412
+ /* since the grid has 2 columns, remove the border for these last 2 columns */
413
+ &:nth-last-child(-n + 2) {
414
+ @apply md:border-0;
415
+ }
409
416
  }
410
- }
411
417
 
412
- a {
413
- @apply flex items-center justify-start gap-1 font-semibold text-lg text-secondary;
418
+ a {
419
+ @apply flex items-center justify-start gap-1 font-semibold text-lg text-secondary;
414
420
 
415
- span {
416
- @apply min-w-0 truncate;
417
- }
421
+ span {
422
+ @apply min-w-0 truncate;
423
+ }
418
424
 
419
- svg {
420
- @apply flex-none fill-current;
425
+ svg {
426
+ @apply flex-none fill-current;
427
+ }
421
428
  }
422
429
  }
423
430
  }
431
+
432
+ &__bottom {
433
+ @apply hidden md:flex;
434
+ }
435
+
436
+ &__title {
437
+ @apply hidden h4 md:flex md:h3;
438
+ }
439
+
440
+ &__subtitle {
441
+ @apply hidden text-md md:flex md:text-lg text-gray-2 mt-5;
442
+ }
424
443
  }
425
444
 
426
445
  &__secondary-dropdown {
@@ -459,7 +478,7 @@ header {
459
478
  }
460
479
 
461
480
  &__metadata {
462
- @apply flex items-center text-sm space-x-6 py-8;
481
+ @apply flex items-center text-sm space-x-6 pb-6;
463
482
 
464
483
  > span {
465
484
  @apply flex items-center space-x-2;
@@ -5,6 +5,8 @@ module Decidim
5
5
  # actions by any kind of user. Also works as a default implementation so other
6
6
  # components can inherit from it and get some convenience methods.
7
7
  class DefaultPermissions
8
+ include Decidim::UserRoleChecker
9
+
8
10
  def initialize(user, permission_action, context = {})
9
11
  @user = user
10
12
  @permission_action = permission_action
@@ -14,15 +14,19 @@ module Decidim
14
14
  delegate :url_helpers, to: "Decidim::Core::Engine.routes"
15
15
  delegate :resource_title, to: :event
16
16
  delegate :resource_url, to: :event
17
- delegate :email_intro, to: :event
18
17
  delegate :resource_path, to: :event
19
18
  delegate :safe_resource_text, to: :event
20
19
 
20
+ def email_intro
21
+ event.email_intro if event.respond_to?(:email_intro)
22
+ end
23
+
21
24
  def date_time
25
+ created_at_in_time_zone = created_at.in_time_zone(resource.organization.time_zone)
22
26
  if frequency == :daily
23
- created_at.strftime("%H:%M")
27
+ I18n.l(created_at_in_time_zone, format: :time_of_day)
24
28
  else
25
- I18n.l(created_at, format: :decidim_short)
29
+ I18n.l(created_at_in_time_zone, format: :decidim_short)
26
30
  end
27
31
  end
28
32
 
@@ -18,6 +18,7 @@ module Decidim
18
18
  query = filter_moderated(query)
19
19
  query = filter_spaces(query)
20
20
  query = filter_deleted(query)
21
+ query = filter_withdrawn(query)
21
22
  query.with_new_resource_type("all")
22
23
  end
23
24
  end
@@ -48,6 +49,30 @@ module Decidim
48
49
  ).where(decidim_moderations: { id: nil })
49
50
  end
50
51
 
52
+ def filter_withdrawn(query)
53
+ # Filter out the items that have been withdrawn.
54
+ conditions = []
55
+
56
+ ActionLog.public_resource_types.each do |resource_type|
57
+ klass = resource_type.constantize
58
+
59
+ condition = if klass.respond_to?(:not_withdrawn)
60
+ Arel.sql(
61
+ [
62
+ "decidim_action_logs.resource_type = '#{resource_type}'",
63
+ "decidim_action_logs.resource_id IN (#{Arel.sql(klass.not_withdrawn.select(:id).to_sql)})"
64
+ ].join(" AND ")
65
+ ).to_s
66
+ else
67
+ Arel.sql("decidim_action_logs.resource_type = '#{resource_type}'").to_s
68
+ end
69
+
70
+ conditions << "(#{condition})"
71
+ end
72
+
73
+ query.where(Arel.sql(conditions.join(" OR ")).to_s)
74
+ end
75
+
51
76
  def filter_spaces(query)
52
77
  conditions = []
53
78
 
@@ -1,8 +1,7 @@
1
1
  <div data-conversation-reply>
2
2
  <%= decidim_form_for form, url: decidim.conversation_path(conversation.id), method: :put, remote: true do |f| %>
3
3
  <div class="conversation__reply">
4
- <%= f.label :body, nil, class: "sr-only" %>
5
- <%= f.text_area :body, label: false, rows: 4, required: true, placeholder: t(".placeholder"), data: { "input-emoji": true } %>
4
+ <%= f.text_area :body, label: false, rows: 4, required: true, placeholder: t(".placeholder"), data: { "input-emoji": true }, aria: { label: t(".placeholder") } %>
6
5
  <%= f.submit "#{t(".send")} #{icon "arrow-right-line", class: "fill-current"}".html_safe, class: "button button__sm button__secondary self-end mt-4" %>
7
6
  </div>
8
7
  <% end %>
@@ -5,7 +5,7 @@
5
5
  <%= f.hidden_field :recipient_id, id: nil, name: "conversation[recipient_id][]", value: recipient.id %>
6
6
  <% end %>
7
7
  <%= f.label :body, nil, class: "sr-only" %>
8
- <%= f.text_area :body, label: false, rows: 4, required: true, placeholder: t(".placeholder"), data: { "input-emoji": true } %>
8
+ <%= f.text_area :body, label: false, rows: 4, required: true, placeholder: t(".placeholder"), data: { "input-emoji": true }, aria: { label: t(".placeholder") } %>
9
9
  <%= f.submit "#{t(".send")} #{icon "arrow-right-line", class: "fill-current"}".html_safe, class: "button button__sm button__secondary self-end mt-4" %>
10
10
  </div>
11
11
  <% end %>
@@ -0,0 +1,25 @@
1
+ <p class="email-greeting"><%= t(".hello", name: @user.name) %></p>
2
+
3
+ <p class="email-instructions">
4
+ <%= t(".report_html", url: reported_content_url, moderator: @moderator.name) %>
5
+ </p>
6
+
7
+ <p><b><%= t(".participatory_space") %></b></p>
8
+ <p><%= link_to translated_attribute(@participatory_space.title), resource_locator(@participatory_space).url %></p>
9
+
10
+ <p><b><%= t(".reason") %></b></p>
11
+ <p><%= t(@report.reason, organization_name: organization_name(@participatory_space.organization), scope: "decidim.shared.flag_modal") %></p>
12
+
13
+ <% if @report.details.present? %>
14
+ <p><b><%= t(".details") %></b></p>
15
+ <blockquote>
16
+ <%= @report.details %>
17
+ </blockquote>
18
+ <% end %>
19
+
20
+ <p><b><%= t(".content") %></b></p>
21
+ <%= reported_content_cell %>
22
+
23
+ <p class="email-button email-button__cta">
24
+ <%= link_to t(".manage_moderations"), manage_moderations_url %>
25
+ </p>
@@ -1,7 +1,7 @@
1
1
  <% menu_id = "#{SecureRandom.uuid}_results_per_page_menu" %>
2
2
  <div class="flex items-center gap-1">
3
3
  <%= icon "list-check-2", class: "w-4 h-4 text-gray fill-current" %>
4
- <span class="text-gray-2"><%= t("decidim.shared.results_per_page.label") %></span>
4
+ <p class="text-gray-2"><%= t("decidim.shared.results_per_page.label") %></p>
5
5
 
6
6
  <details class="relative">
7
7
  <summary id="<%= menu_id %>-control" class="flex items-center cursor-pointer text-secondary font-semibold" aria-controls="<%= menu_id %>" aria-haspopup="menu" title="<%= t("decidim.shared.results_per_page.title") %>">
@@ -6,6 +6,6 @@
6
6
  total_pages: total number of pages
7
7
  per_page: number of items to fetch per page
8
8
  remote: data-remote -%>
9
- <li class="w-6 h-6 rounded-full hover:bg-background-3 transition<%= "mx-2 bg-background-3 grid place-items-center" if page.current? %>" <%== 'aria-current="page"' if page.current? %> data-page>
9
+ <li class="w-6 h-6 px-2 rounded-full hover:bg-background-3 transition min-w-fit <%= "bg-background-3 grid place-items-center" if page.current? %>" <%== 'aria-current="page"' if page.current? %> data-page>
10
10
  <%= link_to_unless page.current?, page, url, { class: "w-full h-full grid place-items-center", remote:, rel: page.rel, title: t("views.pagination.title") << page.to_s } %>
11
11
  </li>
@@ -8,7 +8,7 @@ paginator: the paginator that renders the pagination tags inside -%>
8
8
 
9
9
  <% if total_pages > 1 %>
10
10
  <nav aria-label="<%= t("views.pagination.pagination") %>">
11
- <ul class="flex items-center text-sm text-secondary" data-pages>
11
+ <ul class="flex flex-wrap items-center text-sm text-secondary gap-x-1" data-pages>
12
12
  <%= paginator.prev_page_tag unless current_page.first? %>
13
13
 
14
14
  <% paginator.each_page do |page| -%>
@@ -1,7 +1,7 @@
1
1
  <% if organization %>
2
- <%= link_to decidim.root_url(host: organization.host), "aria-label": t("front_page_link", scope: "decidim.accessibility") do %>
2
+ <%= link_to decidim.root_url(host: organization.host) do %>
3
3
  <% if organization.logo.attached? %>
4
- <%= image_tag organization.attached_uploader(:logo).variant_url(:medium), alt: t("logo", scope: "decidim.accessibility", organization: current_organization_name) %>
4
+ <%= image_tag organization.attached_uploader(:logo).variant_url(:medium), alt: "#{current_organization_name} (#{t("decidim.errors.not_found.back_home")})" %>
5
5
  <% else %>
6
6
  <span><%= current_organization_name %></span>
7
7
  <% end %>
@@ -1,16 +1,10 @@
1
1
  <div id="<%= id %>" class="menu-bar__main-dropdown">
2
- <div class="menu-bar__main-dropdown__top">
3
- <div class="menu-bar__main-dropdown__top-left">
2
+ <div class="menu-bar__main-dropdown__left">
3
+ <div class="menu-bar__main-dropdown__left-top">
4
4
  <%= render partial: "layouts/decidim/header/menu_breadcrumb_main_dropdown_top_left" %>
5
5
  </div>
6
- <%= breadcrumb_root_menu.render %>
7
- </div>
8
- <div class="menu-bar__main-dropdown__bottom">
9
- <div class="menu-bar__main-dropdown__bottom-left">
10
- <%= cell("decidim/highlighted_participatory_process", menu_highlighted_participatory_process) %>
11
- </div>
12
- <div class="menu-bar__main-dropdown__bottom-right">
13
- <%= cell "decidim/content_blocks/menu_breadcrumb_last_activity", current_organization %>
14
- </div>
6
+ <%= cell("decidim/highlighted_participatory_process", menu_highlighted_participatory_process) %>
7
+ <%= cell "decidim/content_blocks/menu_breadcrumb_last_activity", current_organization %>
15
8
  </div>
9
+ <%= breadcrumb_root_menu.render %>
16
10
  </div>
@@ -1,12 +1,12 @@
1
1
  <% dropdown_item = breadcrumb_items.select { |item| item[:dropdown_cell].present? }.last %>
2
2
  <div class="menu-bar__breadcrumb-mobile__dropdown-trigger">
3
- <span>
4
- <% breadcrumb_items.last(2).each_with_index do |item, i| %>
5
- <% item_label = decidim_escape_translated(item[:label]).html_safe %>
6
- <% if i.positive? %>
3
+ <span class="inline-block w-full overflow-hidden text-ellipsis align-middle">
4
+ <% breadcrumb_items.last(2).each_with_index do |item, idx| %>
5
+ <% item_label = decidim_escape_translated(item[:label]) %>
6
+ <% if idx.positive? %>
7
7
  <span>/</span>
8
8
  <% end %>
9
- <span class="cursor-pointer <%= "truncate" if i.positive? %>" <%== 'aria-current="page"' if item[:active] %>>
9
+ <span class="cursor-pointer truncate" <%== 'aria-current="page"' if item[:active] %>>
10
10
  <% if item[:url].present? && !is_active_link?(item[:url], :exclusive) %>
11
11
  <%= link_to(item_label, item[:url]) %>
12
12
  <% else %>
@@ -576,7 +576,6 @@ ar:
576
576
  drag_and_drop_help: يمكن إضافة صور عن طريق سحبها وإسقاطها أو لصقها.
577
577
  endorsement_buttons_cell:
578
578
  already_endorsed: لا يعجبني
579
- endorse: يعجبني
580
579
  endorsements:
581
580
  identities:
582
581
  done: تم
@@ -1181,11 +1180,6 @@ ar:
1181
1180
  message: الرسالة
1182
1181
  resend_email_confirmation_instructions: إعادة إرسال تعليمات تأكيد البريد الإلكتروني
1183
1182
  reported_mailer:
1184
- hide:
1185
- hello: مرحبا %{name}،
1186
- manage_moderations: إدارة التعديلات
1187
- report_html: <p>بعد <a href="%{url}">محتوى</a> تم إخفاء تلقائيا.</p>
1188
- subject: تم إخفاء المورد تلقائيًا
1189
1183
  report:
1190
1184
  authors: المؤلفون
1191
1185
  content: محتوى تم الإبلاغ عنه