decidim-core 0.28.5 → 0.28.6

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 (88) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/participatory_space_dropdown_metadata/show.erb +5 -3
  3. data/app/cells/decidim/resource_types_filter/show.erb +1 -1
  4. data/app/cells/decidim/resource_types_filter_cell.rb +6 -6
  5. data/app/cells/decidim/user_activity/show.erb +1 -1
  6. data/app/commands/decidim/create_omniauth_registration.rb +14 -8
  7. data/app/commands/decidim/search.rb +14 -0
  8. data/app/controllers/decidim/profiles_controller.rb +2 -2
  9. data/app/controllers/decidim/reports_controller.rb +1 -1
  10. data/app/controllers/decidim/user_activities_controller.rb +1 -1
  11. data/app/forms/decidim/account_form.rb +5 -2
  12. data/app/helpers/decidim/orders_helper.rb +2 -1
  13. data/app/helpers/decidim/participatory_space_helpers.rb +1 -1
  14. data/app/models/decidim/user.rb +0 -4
  15. data/app/models/decidim/user_base_entity.rb +4 -0
  16. data/app/packs/src/decidim/index.js +4 -2
  17. data/app/packs/src/decidim/map/provider/here.js +1 -1
  18. data/app/packs/stylesheets/decidim/_hashtags.scss +5 -0
  19. data/app/packs/stylesheets/decidim/_header.scss +20 -2
  20. data/app/packs/stylesheets/decidim/application.scss +1 -0
  21. data/app/presenters/decidim/log/user_presenter.rb +1 -0
  22. data/app/services/decidim/base_diff_renderer.rb +2 -0
  23. data/app/services/decidim/static_map_generator.rb +1 -1
  24. data/app/views/decidim/last_activities/index.html.erb +1 -1
  25. data/app/views/decidim/reported_mailer/hide.html.erb +1 -1
  26. data/app/views/decidim/reported_mailer/report.html.erb +1 -1
  27. data/app/views/decidim/searches/_count.html.erb +1 -1
  28. data/app/views/decidim/searches/_filters.html.erb +40 -38
  29. data/app/views/decidim/shared/_orders.html.erb +2 -2
  30. data/config/locales/ar.yml +44 -13
  31. data/config/locales/bg.yml +17 -8
  32. data/config/locales/bs-BA.yml +2 -0
  33. data/config/locales/ca-IT.yml +2115 -0
  34. data/config/locales/ca.yml +56 -13
  35. data/config/locales/cs.yml +57 -15
  36. data/config/locales/de.yml +51 -8
  37. data/config/locales/el.yml +14 -2
  38. data/config/locales/en.yml +43 -0
  39. data/config/locales/eo.yml +2 -0
  40. data/config/locales/es-MX.yml +56 -13
  41. data/config/locales/es-PY.yml +60 -17
  42. data/config/locales/es.yml +61 -18
  43. data/config/locales/eu.yml +114 -73
  44. data/config/locales/fi-plain.yml +46 -11
  45. data/config/locales/fi.yml +48 -13
  46. data/config/locales/fr-CA.yml +52 -9
  47. data/config/locales/fr.yml +51 -8
  48. data/config/locales/ga-IE.yml +6 -0
  49. data/config/locales/gl.yml +29 -2
  50. data/config/locales/hu.yml +16 -9
  51. data/config/locales/id-ID.yml +28 -3
  52. data/config/locales/is-IS.yml +14 -1
  53. data/config/locales/it.yml +44 -14
  54. data/config/locales/ja.yml +55 -10
  55. data/config/locales/lb.yml +27 -7
  56. data/config/locales/lt.yml +8 -2
  57. data/config/locales/lv.yml +22 -2
  58. data/config/locales/nl.yml +27 -5
  59. data/config/locales/no.yml +20 -0
  60. data/config/locales/pl.yml +14 -5
  61. data/config/locales/pt-BR.yml +17 -7
  62. data/config/locales/pt.yml +20 -0
  63. data/config/locales/ro-RO.yml +232 -73
  64. data/config/locales/ru.yml +29 -1
  65. data/config/locales/sk.yml +34 -6
  66. data/config/locales/sl.yml +4 -0
  67. data/config/locales/sr-CS.yml +2 -0
  68. data/config/locales/sv.yml +28 -9
  69. data/config/locales/tr-TR.yml +26 -7
  70. data/config/locales/uk.yml +16 -1
  71. data/config/locales/zh-CN.yml +22 -2
  72. data/config/locales/zh-TW.yml +10 -0
  73. data/lib/decidim/attributes/time_with_zone.rb +5 -1
  74. data/lib/decidim/content_parsers/blob_parser.rb +10 -8
  75. data/lib/decidim/content_parsers/user_parser.rb +1 -1
  76. data/lib/decidim/core/test/shared_examples/reports_examples.rb +48 -6
  77. data/lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb +26 -0
  78. data/lib/decidim/core/test/shared_examples/versions_controller_examples.rb +26 -0
  79. data/lib/decidim/core/version.rb +1 -1
  80. data/lib/decidim/map/provider/dynamic_map/here.rb +1 -40
  81. data/lib/decidim/map/provider/static_map/here.rb +34 -0
  82. data/lib/decidim/nicknamizable.rb +1 -1
  83. data/lib/decidim/reportable.rb +6 -2
  84. data/lib/decidim/translatable_attributes.rb +5 -1
  85. data/lib/decidim/view_model.rb +1 -0
  86. data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +23 -20
  87. metadata +8 -7
  88. data/app/packs/src/decidim/vendor/leaflet-tilelayer-here.js +0 -212
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30504edbc5451f226b04213804ae8b02392132d8f66f9d5ebe9ea58ad264031e
4
- data.tar.gz: 0ff217364122ef3812f7aa950e4908364126ceca46f135d0d5dc049b1ee19537
3
+ metadata.gz: 88c7b06f4bb2ad092e2e306434bd645d1f27f8e467bc34ab341093f1213ef70b
4
+ data.tar.gz: 45be0ca0bc0b4f11581b1e12c931cbc1c9a80a321ed9c7e1822bc79ff7d9d59f
5
5
  SHA512:
6
- metadata.gz: 897aec8c06d1dd2110a5bd880e07061cab5e12495b707ed175afa81468c5ac162cf3d7a6643879eab83a82a9ca76232ff82dcb0d9b29ccf277d328fec6539a35
7
- data.tar.gz: 88e9607861160a270e3604733a323fc2b1d359779c335ff8ccce97c9e587062c9c916d07682ad0ddda2b50abe2f718d3ce4baeb5bf77cbf3aab77ea231160014
6
+ metadata.gz: 79b66628f6569dd4f570d3388bf185583b5d9fe1edee9545da9948cb8371e9b7722edd651db0805a73aeeb272e8b8c2df4c55b07b9237da062761992e43e8c13
7
+ data.tar.gz: 969da677904a158b3b7744f58a834162dbc10c6b8d94a609aac305744a6c061b439117793d52d964edcbbfe656476239651ac0d6dc34d32c22fc3da79f0b32b6
@@ -3,7 +3,9 @@
3
3
  <%= render :metadata %>
4
4
  <%= cell "decidim/content_blocks/menu_breadcrumb_last_activity", model, hide_participatory_space: true %>
5
5
  </div>
6
- <ul class="menu-bar__secondary-dropdown__menu">
7
- <%= render :links %>
8
- </ul>
6
+ <nav role="navigation" aria-label="<%= t("decidim.accessibility.secondary_menu") %>">
7
+ <ul class="menu-bar__secondary-dropdown__menu">
8
+ <%= render :links %>
9
+ </ul>
10
+ </nav>
9
11
  </div>
@@ -11,7 +11,7 @@
11
11
  <ul id="dropdown-menu-resource">
12
12
  <% resource_types.each do |resource_type| %>
13
13
  <li role="menuitem">
14
- <%= link_to decidim.last_activities_path(filter: { with_resource_type: resource_type[0] } ), class: "filter#{" is-active" if filter_param == resource_type[0]}" do %>
14
+ <%= link_to filter_url(resource_type[0]), class: "filter#{" is-active" if filter_param == resource_type[0]}" do %>
15
15
  <span class="sr-only"><%= resource_type[1] %></span>
16
16
  <%= text_with_resource_icon(*resource_type) %>
17
17
  <% end %>
@@ -29,8 +29,12 @@ module Decidim
29
29
  options[:id] || "filters"
30
30
  end
31
31
 
32
- def form_path
33
- options[:form_path]
32
+ def filter_url(resource_type)
33
+ if options[:source] == :last_activities
34
+ last_activities_path(filter: { with_resource_type: resource_type })
35
+ else
36
+ profile_activity_path(nickname: params[:nickname], filter: { resource_type: })
37
+ end
34
38
  end
35
39
 
36
40
  def filter_param_key
@@ -41,10 +45,6 @@ module Decidim
41
45
  @filter_param ||= params.dig(:filter, filter_param_key) || all_types_key
42
46
  end
43
47
 
44
- def filter
45
- options[:filter]
46
- end
47
-
48
48
  def all_resource_types_option
49
49
  [all_types_key, I18n.t("all", scope: "decidim.last_activities")]
50
50
  end
@@ -1,5 +1,5 @@
1
1
  <div class="profile__activity">
2
- <%= cell "decidim/resource_types_filter", resource_types, form_path: url_for, filter: %>
2
+ <%= cell "decidim/resource_types_filter", resource_types, source: :profile_activity %>
3
3
  <div class="profile__activity__container" id="activities-container">
4
4
  <% if activities.length == 0 %>
5
5
  <%= cell "decidim/announcement", t("decidim.user_activity.index.no_activities_warning") %>
@@ -45,6 +45,8 @@ module Decidim
45
45
 
46
46
  attr_reader :form, :verified_email
47
47
 
48
+ REGEXP_SANITIZER = /[<>?%&\^*#@()\[\]=+:;"{}\\|]/
49
+
48
50
  def create_or_find_user
49
51
  @user = User.find_or_initialize_by(
50
52
  email: verified_email,
@@ -63,16 +65,11 @@ module Decidim
63
65
  @user.save!
64
66
  else
65
67
  @user.email = (verified_email || form.email)
66
- @user.name = form.name
68
+ @user.name = form.name.gsub(REGEXP_SANITIZER, "")
67
69
  @user.nickname = form.normalized_nickname
68
70
  @user.newsletter_notifications_at = nil
69
71
  @user.password = SecureRandom.hex
70
- if form.avatar_url.present?
71
- url = URI.parse(form.avatar_url)
72
- filename = File.basename(url.path)
73
- file = url.open
74
- @user.avatar.attach(io: file, filename:)
75
- end
72
+ attach_avatar(form.avatar_url) if form.avatar_url.present?
76
73
  @user.skip_confirmation! if verified_email
77
74
  @user.tos_agreement = "1"
78
75
  @user.save!
@@ -81,6 +78,15 @@ module Decidim
81
78
  end
82
79
  end
83
80
 
81
+ def attach_avatar(avatar_url)
82
+ url = URI.parse(avatar_url)
83
+ filename = File.basename(url.path)
84
+ file = url.open
85
+ @user.avatar.attach(io: file, filename:)
86
+ rescue OpenURI::HTTPError, Errno::ECONNREFUSED
87
+ # Do not attach the avatar, as it fails to fetch it.
88
+ end
89
+
84
90
  def create_identity
85
91
  @user.identities.create!(
86
92
  provider: form.provider,
@@ -126,7 +132,7 @@ module Decidim
126
132
  provider: form.provider,
127
133
  uid: form.uid,
128
134
  email: form.email,
129
- name: form.name,
135
+ name: form.name.gsub(REGEXP_SANITIZER, ""),
130
136
  nickname: form.normalized_nickname,
131
137
  avatar_url: form.avatar_url,
132
138
  raw_data: form.raw_data
@@ -37,6 +37,12 @@ module Decidim
37
37
  klass.order_by_id_list(result_ids.take(HIGHLIGHTED_RESULTS_COUNT))
38
38
  end
39
39
 
40
+ uncommentable_resources = uncommentable_resources(results) if results.present?
41
+ if uncommentable_resources.present?
42
+ results -= uncommentable_resources
43
+ results_count -= uncommentable_resources.count
44
+ end
45
+
40
46
  results_by_type.update(class_name => {
41
47
  count: results_count,
42
48
  results:
@@ -89,5 +95,13 @@ module Decidim
89
95
  query = query.global_search(I18n.transliterate(term)) if term.present?
90
96
  query
91
97
  end
98
+
99
+ def uncommentable_resources(results)
100
+ results.where(id: results.select { |obj| related_uncommentable_resources?(obj) }.map(&:id))
101
+ end
102
+
103
+ def related_uncommentable_resources?(object)
104
+ object.respond_to?(:commentable) && !object.commentable.commentable?
105
+ end
92
106
  end
93
107
  end
@@ -24,7 +24,7 @@ module Decidim
24
24
  def show
25
25
  return redirect_to profile_members_path if profile_holder.is_a?(Decidim::UserGroup)
26
26
 
27
- redirect_to profile_activity_path(nickname: params[:nickname])
27
+ redirect_to profile_activity_path(nickname: params[:nickname].downcase)
28
28
  end
29
29
 
30
30
  def tooltip
@@ -116,7 +116,7 @@ module Decidim
116
116
  def profile_holder
117
117
  return if params[:nickname].blank?
118
118
 
119
- @profile_holder ||= Decidim::UserBaseEntity.find_by("LOWER(nickname) = ? AND decidim_organization_id = ?", params[:nickname].downcase, current_organization.id)
119
+ @profile_holder ||= Decidim::UserBaseEntity.find_by("nickname = ? AND decidim_organization_id = ?", params[:nickname].downcase, current_organization.id)
120
120
  end
121
121
  end
122
122
  end
@@ -16,7 +16,7 @@ module Decidim
16
16
  CreateReport.call(@form, reportable, current_user) do
17
17
  on(:ok) do
18
18
  flash[:notice] = I18n.t("decidim.reports.create.success")
19
- redirect_back fallback_location: root_path
19
+ redirect_to reportable.reload.reported_content_url
20
20
  end
21
21
 
22
22
  on(:invalid) do
@@ -22,7 +22,7 @@ module Decidim
22
22
  def user
23
23
  return unless params[:nickname]
24
24
 
25
- @user ||= current_organization.users.find_by("LOWER(nickname) = ?", params[:nickname].downcase)
25
+ @user ||= current_organization.users.find_by("nickname = ?", params[:nickname].downcase)
26
26
  end
27
27
 
28
28
  def activities
@@ -21,7 +21,10 @@ module Decidim
21
21
 
22
22
  validates :name, presence: true, format: { with: Decidim::User::REGEXP_NAME }
23
23
  validates :email, presence: true, "valid_email_2/email": { disposable: true }
24
- validates :nickname, presence: true, format: { with: Decidim::User::REGEXP_NICKNAME }
24
+ validates :nickname,
25
+ presence: true,
26
+ format: { with: Decidim::User::REGEXP_NICKNAME, message: :format },
27
+ length: { maximum: Decidim::User.nickname_max_length }
25
28
 
26
29
  validates :nickname, length: { maximum: Decidim::User.nickname_max_length, allow_blank: true }
27
30
  validates :password, password: { name: :name, email: :email, username: :nickname }, if: -> { password.present? }
@@ -66,7 +69,7 @@ module Decidim
66
69
 
67
70
  def unique_nickname
68
71
  return true if Decidim::UserBaseEntity.where(
69
- "decidim_organization_id = ? AND LOWER(nickname) = ? ",
72
+ "decidim_organization_id = ? AND nickname = ? ",
70
73
  context.current_organization.id,
71
74
  nickname.downcase
72
75
  ).where.not(id: context.current_user.id).empty?
@@ -13,7 +13,8 @@ module Decidim
13
13
  def order_selector(orders, options = {})
14
14
  render partial: "decidim/shared/orders", locals: {
15
15
  orders:,
16
- i18n_scope: options[:i18n_scope]
16
+ i18n_scope: options[:i18n_scope],
17
+ css_class: options[:css_class]
17
18
  }
18
19
  end
19
20
 
@@ -28,7 +28,7 @@ module Decidim
28
28
  end
29
29
 
30
30
  def participatory_space_floating_help
31
- return if help_section.blank?
31
+ return if help_section.blank? || strip_tags(translated_attribute(help_section).html_safe).blank?
32
32
 
33
33
  floating_help(help_id) { translated_attribute(help_section).html_safe }
34
34
  end
@@ -13,8 +13,6 @@ module Decidim
13
13
  include Decidim::UserReportable
14
14
  include Decidim::Traceable
15
15
 
16
- REGEXP_NICKNAME = /\A[\w-]+\z/
17
-
18
16
  class Roles
19
17
  def self.all
20
18
  Decidim.config.user_roles
@@ -51,8 +49,6 @@ module Decidim
51
49
 
52
50
  has_one_attached :download_your_data_file
53
51
 
54
- scope :not_deleted, -> { where(deleted_at: nil) }
55
-
56
52
  scope :managed, -> { where(managed: true) }
57
53
  scope :not_managed, -> { where(managed: false) }
58
54
 
@@ -21,11 +21,13 @@ module Decidim
21
21
 
22
22
  # Regex for name & nickname format validations
23
23
  REGEXP_NAME = /\A(?!.*[<>?%&\^*#@()\[\]=+:;"{}\\|])/
24
+ REGEXP_NICKNAME = /\A[a-z0-9_-]+\z/
24
25
 
25
26
  has_one_attached :avatar
26
27
  validates_avatar :avatar, uploader: Decidim::AvatarUploader
27
28
 
28
29
  validates :name, format: { with: REGEXP_NAME }
30
+ validates :nickname, format: { with: REGEXP_NICKNAME }, unless: -> { deleted? || managed? }
29
31
 
30
32
  scope :confirmed, -> { where.not(confirmed_at: nil) }
31
33
  scope :not_confirmed, -> { where(confirmed_at: nil) }
@@ -34,6 +36,8 @@ module Decidim
34
36
  scope :not_blocked, -> { where(blocked: false) }
35
37
  scope :available, -> { where(deleted_at: nil, blocked: false, managed: false) }
36
38
 
39
+ scope :not_deleted, -> { where(deleted_at: nil) }
40
+
37
41
  # Public: Returns a collection with all the public entities this user is following.
38
42
  #
39
43
  # This cannot be done as with a `has_many :following, through: :following_follows`
@@ -68,7 +68,8 @@ import markAsReadNotifications from "src/decidim/notifications"
68
68
  import RemoteModal from "src/decidim/remote_modal"
69
69
  import selectActiveIdentity from "src/decidim/identity_selector_dialog"
70
70
  import createTooltip from "src/decidim/tooltips"
71
- import fetchRemoteTooltip from "src/decidim/remote_tooltips"
71
+ // Temporary disabling this feature because we have a poor performance. See https://github.com/decidim/decidim/issues/14431
72
+ // import fetchRemoteTooltip from "src/decidim/remote_tooltips"
72
73
  import createToggle from "src/decidim/toggle"
73
74
  import {
74
75
  createAccordion,
@@ -190,7 +191,8 @@ const initializer = (element = document) => {
190
191
  // Initialize data-toggles
191
192
  element.querySelectorAll("[data-toggle]").forEach((elem) => createToggle(elem))
192
193
 
193
- element.querySelectorAll("[data-remote-tooltip]").forEach((elem) => fetchRemoteTooltip(elem))
194
+ // Temporary disabling this feature because we have a poor performance. See https://github.com/decidim/decidim/issues/14431
195
+ // element.querySelectorAll("[data-remote-tooltip]").forEach((elem) => fetchRemoteTooltip(elem))
194
196
 
195
197
  element.querySelectorAll(".new_report").forEach((elem) => changeReportFormBehavior(elem))
196
198
  }
@@ -1,5 +1,5 @@
1
1
  import "leaflet"
2
- import "src/decidim/vendor/leaflet-tilelayer-here"
2
+ import "leaflet-tilelayer-here"
3
3
 
4
4
  /**
5
5
  * NOTE:
@@ -0,0 +1,5 @@
1
+ .hashtags {
2
+ > label {
3
+ @apply ml-4;
4
+ }
5
+ }
@@ -81,7 +81,7 @@ header {
81
81
  @apply fixed bottom-0 left-0 z-40 bg-white w-full px-4 py-3 flex justify-between text-secondary shadow-[0_-4px_6px_rgba(198,198,198,0.25)];
82
82
 
83
83
  &__trigger {
84
- @apply flex flex-col items-center text-secondary cursor-pointer p-2;
84
+ @apply flex flex-col items-center text-secondary cursor-pointer md:pl-4 md:border-l border-gray-3;
85
85
 
86
86
  svg {
87
87
  @apply w-5 h-5 fill-current;
@@ -140,6 +140,20 @@ header {
140
140
  }
141
141
  }
142
142
 
143
+ &__login {
144
+ @apply w-auto h-full flex flex-row items-center relative text-secondary gap-1 pl-2 pr-2;
145
+
146
+ svg {
147
+ @apply w-8 h-8 fill-current;
148
+ }
149
+
150
+ svg + span {
151
+ @apply text-sm first-letter:uppercase w-auto;
152
+
153
+ flex-shrink: 0;
154
+ }
155
+ }
156
+
143
157
  &__item {
144
158
  @apply w-1/4 flex flex-col items-center relative;
145
159
 
@@ -412,8 +426,12 @@ header {
412
426
  @apply h4 md:h3;
413
427
  }
414
428
 
429
+ nav {
430
+ @apply w-full md:w-1/4;
431
+ }
432
+
415
433
  &__menu {
416
- @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;
434
+ @apply w-full bg-primary px-4 md:px-8 pt-0 pb-3 md:py-3 divide-y divide-gray-3 text-white;
417
435
 
418
436
  > * {
419
437
  @apply py-3 md:py-3.5;
@@ -57,6 +57,7 @@
57
57
  @import "stylesheets/decidim/_toggle_switch.scss";
58
58
  @import "stylesheets/decidim/_hero.scss";
59
59
  @import "stylesheets/decidim/_actions.scss";
60
+ @import "stylesheets/decidim/_hashtags.scss";
60
61
  }
61
62
 
62
63
  // On the other hand, the following styles match with specific routes
@@ -46,6 +46,7 @@ module Decidim
46
46
  # Returns an HTML-safe String.
47
47
  def present_user
48
48
  return h.content_tag(:span, present_user_name, class: "logs__log__author") if user.blank?
49
+ return I18n.t("decidim.profile.deleted") if user.respond_to?(:deleted?) && user.deleted?
49
50
 
50
51
  h.link_to(
51
52
  present_user_name,
@@ -41,6 +41,8 @@ module Decidim
41
41
  end
42
42
 
43
43
  def parse_i18n_changeset(attribute, values, type, diff)
44
+ return diff unless values.last.is_a?(Hash)
45
+
44
46
  (values.last.keys - ["machine_translations"]).each do |locale, _value|
45
47
  first_value = values.first.try(:[], locale)
46
48
  last_value = values.last.try(:[], locale)
@@ -15,7 +15,7 @@ module Decidim
15
15
  def data
16
16
  return if @resource.blank? || map_utility.nil?
17
17
 
18
- Rails.cache.fetch(@resource.cache_key) do
18
+ Rails.cache.fetch(@resource.cache_key_with_version) do
19
19
  map_utility.image_data(
20
20
  latitude: @resource.latitude,
21
21
  longitude: @resource.longitude,
@@ -5,7 +5,7 @@
5
5
  <h1 class="title-decorator my-12"><%= t("last_activity", scope: "decidim.last_activities.index") %></h1>
6
6
 
7
7
  <div class="profile__activity pb-16">
8
- <%= cell "decidim/resource_types_filter", resource_types, form_path: last_activities_path, filter_param_key: :with_resource_type, filter: %>
8
+ <%= cell "decidim/resource_types_filter", resource_types, source: :last_activities, filter_param_key: :with_resource_type %>
9
9
  <div id="activities">
10
10
  <%= render partial: "activities" %>
11
11
  </div>
@@ -1,7 +1,7 @@
1
1
  <p class="email-greeting"><%= t(".hello", name: @user.name) %></p>
2
2
 
3
3
  <p class="email-instructions">
4
- <%= t(".report_html", url: reported_content_url ) %>
4
+ <%= t(".report_html", url: report_url ) %>
5
5
  </p>
6
6
 
7
7
  <p class="email-button email-button__cta">
@@ -1,7 +1,7 @@
1
1
  <p class="email-greeting"><%= t(".hello", name: @user.name) %></p>
2
2
 
3
3
  <p class="email-instructions">
4
- <%= t(".report_html", url: reported_content_url) %>
4
+ <%= t(".report_html", url: report_url) %>
5
5
  </p>
6
6
 
7
7
  <br>
@@ -15,6 +15,6 @@
15
15
  <% end %>
16
16
  </div>
17
17
 
18
- <h1 class="h3 decorator mb-10 md:my-10">
18
+ <h1 id="search-results-title" class="h3 decorator mb-10 md:my-10">
19
19
  <%= t("decidim.search.results_found_for_term", count: @results_count, term:) %>
20
20
  </h1>
@@ -1,44 +1,46 @@
1
- <div class="filter-container search__filter">
2
- <button id="dropdown-trigger-search" data-component="dropdown" data-target="dropdown-menu-search" data-auto-close="true">
3
- <%= content_tag :span, t("decidim.searches.filters_small_view.filter_by"), class: "#{"is-active" if params.dig(:filter, :with_resource_type) == nil}" %>
4
- <% @blocks.each do |elements| %>
5
- <% elements.each do |type, results| %>
6
- <%= content_tag :span, class: "#{"is-active" if params.dig(:filter, :with_resource_type) == type}" do %>
7
- <span><%= searchable_resource_human_name(type) %></span>
1
+ <nav role="navigation" aria-labelledby="search-results-title">
2
+ <div class="filter-container search__filter">
3
+ <button id="dropdown-trigger-search" data-component="dropdown" data-target="dropdown-menu-search" data-auto-close="true">
4
+ <%= content_tag :span, t("decidim.searches.filters_small_view.filter_by"), class: "#{"is-active" if params.dig(:filter, :with_resource_type) == nil}" %>
5
+ <% @blocks.each do |elements| %>
6
+ <% elements.each do |type, results| %>
7
+ <%= content_tag :span, class: "#{"is-active" if params.dig(:filter, :with_resource_type) == type}" do %>
8
+ <span><%= searchable_resource_human_name(type) %></span>
9
+ <% end %>
8
10
  <% end %>
9
11
  <% end %>
10
- <% end %>
11
- <%= icon "arrow-down-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
12
- <%= icon "arrow-up-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
13
- </button>
14
- <div id="dropdown-menu-search" aria-hidden="true">
15
- <div>
16
- <%= link_to main_search_path, class: "filter#{" is-active" if params.dig(:filter, :with_resource_type) == nil}" do %>
17
- <%= resource_type_icon("all") %>
18
- <span><%= t("all", scope: "decidim.searches.filters.state") %></span>
19
- <span class="label ml-auto"><%= @results_count %></span>
20
- <% end %>
21
- </div>
22
- <% @blocks.each do |elements| %>
12
+ <%= icon "arrow-down-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
13
+ <%= icon "arrow-up-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
14
+ </button>
15
+ <div id="dropdown-menu-search" aria-hidden="true">
23
16
  <div>
24
- <% elements.each do |type, results| %>
25
- <div>
26
- <% if results[:count].positive? %>
27
- <%= link_to search_path_by_resource_type(type), class: "filter#{" is-active" if params.dig(:filter, :with_resource_type) == type}" do %>
28
- <%= resource_type_icon(type) %>
29
- <span><%= searchable_resource_human_name(type) %></span>
30
- <span class="label ml-auto"><%= results[:count] %></span>
31
- <% end %>
32
- <% else %>
33
- <%= content_tag :div, class: "filter#{" is-empty" if results[:count].zero?}" do %>
34
- <%= resource_type_icon(type) %>
35
- <span><%= searchable_resource_human_name(type) %></span>
36
- <span class="label ml-auto"><%= results[:count] %></span>
37
- <% end %>
38
- <% end %>
39
- </div>
17
+ <%= link_to main_search_path, class: "filter#{" is-active" if params.dig(:filter, :with_resource_type) == nil}" do %>
18
+ <%= resource_type_icon("all") %>
19
+ <span><%= t("all", scope: "decidim.searches.filters.state") %></span>
20
+ <span class="label ml-auto"><%= @results_count %></span>
40
21
  <% end %>
41
22
  </div>
42
- <% end %>
23
+ <% @blocks.each do |elements| %>
24
+ <div>
25
+ <% elements.each do |type, results| %>
26
+ <div>
27
+ <% if results[:count].positive? %>
28
+ <%= link_to search_path_by_resource_type(type), class: "filter#{" is-active" if params.dig(:filter, :with_resource_type) == type}" do %>
29
+ <%= resource_type_icon(type) %>
30
+ <span><%= searchable_resource_human_name(type) %></span>
31
+ <span class="label ml-auto"><%= results[:count] %></span>
32
+ <% end %>
33
+ <% else %>
34
+ <%= content_tag :div, class: "filter#{" is-empty" if results[:count].zero?}" do %>
35
+ <%= resource_type_icon(type) %>
36
+ <span><%= searchable_resource_human_name(type) %></span>
37
+ <span class="label ml-auto"><%= results[:count] %></span>
38
+ <% end %>
39
+ <% end %>
40
+ </div>
41
+ <% end %>
42
+ </div>
43
+ <% end %>
44
+ </div>
43
45
  </div>
44
- </div>
46
+ </nav>
@@ -1,9 +1,9 @@
1
- <button class="order-by__button" id="dropdown-trigger-order" data-component="dropdown" data-target="dropdown-menu-order" data-open-md="true">
1
+ <button class="order-by__button <%= b_css_class if defined?(b_css_class) %>" id="dropdown-trigger-order" data-component="dropdown" data-target="dropdown-menu-order" data-open-md="true">
2
2
  <%= icon "arrow-down-s-line" %>
3
3
  <%= icon "arrow-up-s-line" %>
4
4
  <span><%= t("#{i18n_scope}.label") %></span>
5
5
  </button>
6
- <div id="dropdown-menu-order" class="order-by">
6
+ <div id="dropdown-menu-order" class="order-by <%= css_class if defined?(css_class) %>">
7
7
  <% orders.each do |order_name| %>
8
8
  <%= order_link order_name,
9
9
  i18n_scope:,