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.
- checksums.yaml +4 -4
- data/app/cells/decidim/participatory_space_dropdown_metadata/show.erb +5 -3
- data/app/cells/decidim/resource_types_filter/show.erb +1 -1
- data/app/cells/decidim/resource_types_filter_cell.rb +6 -6
- data/app/cells/decidim/user_activity/show.erb +1 -1
- data/app/commands/decidim/create_omniauth_registration.rb +14 -8
- data/app/commands/decidim/search.rb +14 -0
- data/app/controllers/decidim/profiles_controller.rb +2 -2
- data/app/controllers/decidim/reports_controller.rb +1 -1
- data/app/controllers/decidim/user_activities_controller.rb +1 -1
- data/app/forms/decidim/account_form.rb +5 -2
- data/app/helpers/decidim/orders_helper.rb +2 -1
- data/app/helpers/decidim/participatory_space_helpers.rb +1 -1
- data/app/models/decidim/user.rb +0 -4
- data/app/models/decidim/user_base_entity.rb +4 -0
- data/app/packs/src/decidim/index.js +4 -2
- data/app/packs/src/decidim/map/provider/here.js +1 -1
- data/app/packs/stylesheets/decidim/_hashtags.scss +5 -0
- data/app/packs/stylesheets/decidim/_header.scss +20 -2
- data/app/packs/stylesheets/decidim/application.scss +1 -0
- data/app/presenters/decidim/log/user_presenter.rb +1 -0
- data/app/services/decidim/base_diff_renderer.rb +2 -0
- data/app/services/decidim/static_map_generator.rb +1 -1
- data/app/views/decidim/last_activities/index.html.erb +1 -1
- data/app/views/decidim/reported_mailer/hide.html.erb +1 -1
- data/app/views/decidim/reported_mailer/report.html.erb +1 -1
- data/app/views/decidim/searches/_count.html.erb +1 -1
- data/app/views/decidim/searches/_filters.html.erb +40 -38
- data/app/views/decidim/shared/_orders.html.erb +2 -2
- data/config/locales/ar.yml +44 -13
- data/config/locales/bg.yml +17 -8
- data/config/locales/bs-BA.yml +2 -0
- data/config/locales/ca-IT.yml +2115 -0
- data/config/locales/ca.yml +56 -13
- data/config/locales/cs.yml +57 -15
- data/config/locales/de.yml +51 -8
- data/config/locales/el.yml +14 -2
- data/config/locales/en.yml +43 -0
- data/config/locales/eo.yml +2 -0
- data/config/locales/es-MX.yml +56 -13
- data/config/locales/es-PY.yml +60 -17
- data/config/locales/es.yml +61 -18
- data/config/locales/eu.yml +114 -73
- data/config/locales/fi-plain.yml +46 -11
- data/config/locales/fi.yml +48 -13
- data/config/locales/fr-CA.yml +52 -9
- data/config/locales/fr.yml +51 -8
- data/config/locales/ga-IE.yml +6 -0
- data/config/locales/gl.yml +29 -2
- data/config/locales/hu.yml +16 -9
- data/config/locales/id-ID.yml +28 -3
- data/config/locales/is-IS.yml +14 -1
- data/config/locales/it.yml +44 -14
- data/config/locales/ja.yml +55 -10
- data/config/locales/lb.yml +27 -7
- data/config/locales/lt.yml +8 -2
- data/config/locales/lv.yml +22 -2
- data/config/locales/nl.yml +27 -5
- data/config/locales/no.yml +20 -0
- data/config/locales/pl.yml +14 -5
- data/config/locales/pt-BR.yml +17 -7
- data/config/locales/pt.yml +20 -0
- data/config/locales/ro-RO.yml +232 -73
- data/config/locales/ru.yml +29 -1
- data/config/locales/sk.yml +34 -6
- data/config/locales/sl.yml +4 -0
- data/config/locales/sr-CS.yml +2 -0
- data/config/locales/sv.yml +28 -9
- data/config/locales/tr-TR.yml +26 -7
- data/config/locales/uk.yml +16 -1
- data/config/locales/zh-CN.yml +22 -2
- data/config/locales/zh-TW.yml +10 -0
- data/lib/decidim/attributes/time_with_zone.rb +5 -1
- data/lib/decidim/content_parsers/blob_parser.rb +10 -8
- data/lib/decidim/content_parsers/user_parser.rb +1 -1
- data/lib/decidim/core/test/shared_examples/reports_examples.rb +48 -6
- data/lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb +26 -0
- data/lib/decidim/core/test/shared_examples/versions_controller_examples.rb +26 -0
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/map/provider/dynamic_map/here.rb +1 -40
- data/lib/decidim/map/provider/static_map/here.rb +34 -0
- data/lib/decidim/nicknamizable.rb +1 -1
- data/lib/decidim/reportable.rb +6 -2
- data/lib/decidim/translatable_attributes.rb +5 -1
- data/lib/decidim/view_model.rb +1 -0
- data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +23 -20
- metadata +8 -7
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88c7b06f4bb2ad092e2e306434bd645d1f27f8e467bc34ab341093f1213ef70b
|
4
|
+
data.tar.gz: 45be0ca0bc0b4f11581b1e12c931cbc1c9a80a321ed9c7e1822bc79ff7d9d59f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
<
|
7
|
-
|
8
|
-
|
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
|
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
|
33
|
-
options[:
|
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,
|
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("
|
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
|
-
|
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("
|
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,
|
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
|
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?
|
@@ -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
|
data/app/models/decidim/user.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
}
|
@@ -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
|
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
|
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.
|
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,
|
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,44 +1,46 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
<%
|
6
|
-
|
7
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
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
|
-
</
|
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:,
|