decidim-core 0.29.2 → 0.29.3
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/profile_actions/show.erb +1 -1
- data/app/cells/decidim/report_button/already_reported_modal.erb +2 -2
- data/app/cells/decidim/report_button/flag_modal.erb +13 -27
- data/app/cells/decidim/report_button_cell.rb +2 -8
- data/app/cells/decidim/report_user_button/already_reported_modal.erb +11 -0
- data/app/cells/decidim/report_user_button/flag_modal.erb +46 -0
- data/app/cells/decidim/report_user_button/show.erb +2 -0
- data/app/cells/decidim/report_user_button_cell.rb +59 -0
- 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/create_report.rb +1 -6
- 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/jobs/decidim/hide_child_resources_job.rb +24 -0
- data/app/mailers/decidim/reported_mailer.rb +1 -0
- data/app/models/decidim/action_log.rb +1 -9
- data/app/models/decidim/report.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/datepicker/datepicker_functions.js +3 -3
- 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/_content_blocks.scss +4 -0
- data/app/packs/stylesheets/decidim/_hashtags.scss +5 -0
- data/app/packs/stylesheets/decidim/_header.scss +11 -5
- data/app/packs/stylesheets/decidim/application.scss +1 -0
- data/app/presenters/decidim/log/user_presenter.rb +1 -0
- data/app/presenters/decidim/user_presenter.rb +1 -1
- 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 +17 -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/app/views/layouts/decidim/footer/_main_legal.html.erb +1 -1
- data/config/locales/ar.yml +41 -28
- data/config/locales/bg.yml +10 -24
- data/config/locales/bs-BA.yml +2 -0
- data/config/locales/ca-IT.yml +2111 -0
- data/config/locales/ca.yml +57 -29
- data/config/locales/cs.yml +55 -32
- data/config/locales/de.yml +48 -24
- data/config/locales/el.yml +10 -15
- data/config/locales/en.yml +44 -16
- data/config/locales/eo.yml +2 -0
- data/config/locales/es-MX.yml +56 -28
- data/config/locales/es-PY.yml +61 -33
- data/config/locales/es.yml +60 -32
- data/config/locales/eu.yml +112 -87
- data/config/locales/fi-plain.yml +44 -28
- data/config/locales/fi.yml +46 -30
- data/config/locales/fr-CA.yml +58 -25
- data/config/locales/fr.yml +57 -24
- data/config/locales/ga-IE.yml +4 -4
- data/config/locales/gl.yml +25 -15
- data/config/locales/hu.yml +9 -23
- data/config/locales/id-ID.yml +24 -16
- data/config/locales/is-IS.yml +10 -1
- data/config/locales/it.yml +35 -27
- data/config/locales/ja.yml +55 -25
- data/config/locales/lb.yml +24 -22
- data/config/locales/lt.yml +5 -17
- data/config/locales/lv.yml +18 -15
- data/config/locales/nl.yml +23 -18
- data/config/locales/no.yml +18 -16
- data/config/locales/pl.yml +7 -21
- data/config/locales/pt-BR.yml +11 -24
- data/config/locales/pt.yml +18 -16
- data/config/locales/ro-RO.yml +243 -86
- data/config/locales/ru.yml +23 -8
- data/config/locales/sk.yml +29 -18
- data/config/locales/sl.yml +4 -0
- data/config/locales/sr-CS.yml +2 -0
- data/config/locales/sv.yml +22 -26
- data/config/locales/tr-TR.yml +24 -23
- data/config/locales/uk.yml +12 -2
- data/config/locales/zh-CN.yml +18 -15
- data/config/locales/zh-TW.yml +8 -16
- data/lib/decidim/asset_router/storage.rb +7 -2
- 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/social_share_examples.rb +32 -0
- 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/moderation_tools.rb +16 -2
- data/lib/decidim/nicknamizable.rb +1 -1
- data/lib/decidim/reportable.rb +6 -2
- data/lib/decidim/translatable_attributes.rb +5 -1
- data/lib/tasks/upgrade/clean_hidden_resources.rake +33 -0
- data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +23 -20
- metadata +15 -14
- data/app/cells/decidim/author/flag.erb +0 -6
- data/app/cells/decidim/author/flag_user.erb +0 -14
- data/app/cells/decidim/flag_modal/flag_user.erb +0 -34
- data/app/cells/decidim/flag_modal/show.erb +0 -52
- data/app/cells/decidim/flag_modal_cell.rb +0 -56
- data/app/cells/decidim/profile_sidebar/show.erb +0 -167
- data/app/cells/decidim/profile_sidebar_cell.rb +0 -68
- data/app/packs/src/decidim/vendor/leaflet-tilelayer-here.js +0 -212
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.29.
|
4
|
+
version: 0.29.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-
|
13
|
+
date: 2025-04-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: concurrent-ruby
|
@@ -772,28 +772,28 @@ dependencies:
|
|
772
772
|
requirements:
|
773
773
|
- - '='
|
774
774
|
- !ruby/object:Gem::Version
|
775
|
-
version: 0.29.
|
775
|
+
version: 0.29.3
|
776
776
|
type: :development
|
777
777
|
prerelease: false
|
778
778
|
version_requirements: !ruby/object:Gem::Requirement
|
779
779
|
requirements:
|
780
780
|
- - '='
|
781
781
|
- !ruby/object:Gem::Version
|
782
|
-
version: 0.29.
|
782
|
+
version: 0.29.3
|
783
783
|
- !ruby/object:Gem::Dependency
|
784
784
|
name: decidim-dev
|
785
785
|
requirement: !ruby/object:Gem::Requirement
|
786
786
|
requirements:
|
787
787
|
- - '='
|
788
788
|
- !ruby/object:Gem::Version
|
789
|
-
version: 0.29.
|
789
|
+
version: 0.29.3
|
790
790
|
type: :development
|
791
791
|
prerelease: false
|
792
792
|
version_requirements: !ruby/object:Gem::Requirement
|
793
793
|
requirements:
|
794
794
|
- - '='
|
795
795
|
- !ruby/object:Gem::Version
|
796
|
-
version: 0.29.
|
796
|
+
version: 0.29.3
|
797
797
|
description: Adds core features so other engines can hook into the framework.
|
798
798
|
email:
|
799
799
|
- josepjaume@gmail.com
|
@@ -836,8 +836,6 @@ files:
|
|
836
836
|
- app/cells/decidim/author/contact.erb
|
837
837
|
- app/cells/decidim/author/date.erb
|
838
838
|
- app/cells/decidim/author/endorsements.erb
|
839
|
-
- app/cells/decidim/author/flag.erb
|
840
|
-
- app/cells/decidim/author/flag_user.erb
|
841
839
|
- app/cells/decidim/author/name.erb
|
842
840
|
- app/cells/decidim/author/profile_minicard.erb
|
843
841
|
- app/cells/decidim/author/show.erb
|
@@ -992,9 +990,6 @@ files:
|
|
992
990
|
- app/cells/decidim/endorsers_list_button/content.erb
|
993
991
|
- app/cells/decidim/endorsers_list_button_cell.rb
|
994
992
|
- app/cells/decidim/endorsers_list_cell.rb
|
995
|
-
- app/cells/decidim/flag_modal/flag_user.erb
|
996
|
-
- app/cells/decidim/flag_modal/show.erb
|
997
|
-
- app/cells/decidim/flag_modal_cell.rb
|
998
993
|
- app/cells/decidim/follow_button/content.erb
|
999
994
|
- app/cells/decidim/follow_button/show.erb
|
1000
995
|
- app/cells/decidim/follow_button_cell.rb
|
@@ -1063,8 +1058,6 @@ files:
|
|
1063
1058
|
- app/cells/decidim/profile_actions/show.erb
|
1064
1059
|
- app/cells/decidim/profile_actions_cell.rb
|
1065
1060
|
- app/cells/decidim/profile_cell.rb
|
1066
|
-
- app/cells/decidim/profile_sidebar/show.erb
|
1067
|
-
- app/cells/decidim/profile_sidebar_cell.rb
|
1068
1061
|
- app/cells/decidim/progress_bar/show.erb
|
1069
1062
|
- app/cells/decidim/progress_bar_cell.rb
|
1070
1063
|
- app/cells/decidim/public_participation/show.erb
|
@@ -1073,6 +1066,10 @@ files:
|
|
1073
1066
|
- app/cells/decidim/report_button/flag_modal.erb
|
1074
1067
|
- app/cells/decidim/report_button/show.erb
|
1075
1068
|
- app/cells/decidim/report_button_cell.rb
|
1069
|
+
- app/cells/decidim/report_user_button/already_reported_modal.erb
|
1070
|
+
- app/cells/decidim/report_user_button/flag_modal.erb
|
1071
|
+
- app/cells/decidim/report_user_button/show.erb
|
1072
|
+
- app/cells/decidim/report_user_button_cell.rb
|
1076
1073
|
- app/cells/decidim/reported_content/show.erb
|
1077
1074
|
- app/cells/decidim/reported_content_cell.rb
|
1078
1075
|
- app/cells/decidim/represent_user_group/show.erb
|
@@ -1398,6 +1395,7 @@ files:
|
|
1398
1395
|
- app/jobs/decidim/export_participatory_space_job.rb
|
1399
1396
|
- app/jobs/decidim/find_and_update_descendants_job.rb
|
1400
1397
|
- app/jobs/decidim/hide_all_created_by_author_job.rb
|
1398
|
+
- app/jobs/decidim/hide_child_resources_job.rb
|
1401
1399
|
- app/jobs/decidim/machine_translation_fields_job.rb
|
1402
1400
|
- app/jobs/decidim/machine_translation_resource_job.rb
|
1403
1401
|
- app/jobs/decidim/machine_translation_save_job.rb
|
@@ -1707,7 +1705,6 @@ files:
|
|
1707
1705
|
- app/packs/src/decidim/user_registrations.js
|
1708
1706
|
- app/packs/src/decidim/utilities/text.js
|
1709
1707
|
- app/packs/src/decidim/vendor/jquery-tmpl.js
|
1710
|
-
- app/packs/src/decidim/vendor/leaflet-tilelayer-here.js
|
1711
1708
|
- app/packs/src/decidim/vendor/tribute.js
|
1712
1709
|
- app/packs/src/decidim/vizzs/areachart.js
|
1713
1710
|
- app/packs/src/decidim/vizzs/index.js
|
@@ -1734,6 +1731,7 @@ files:
|
|
1734
1731
|
- app/packs/stylesheets/decidim/_fonts.scss
|
1735
1732
|
- app/packs/stylesheets/decidim/_footer.scss
|
1736
1733
|
- app/packs/stylesheets/decidim/_forms.scss
|
1734
|
+
- app/packs/stylesheets/decidim/_hashtags.scss
|
1737
1735
|
- app/packs/stylesheets/decidim/_header.scss
|
1738
1736
|
- app/packs/stylesheets/decidim/_hero.scss
|
1739
1737
|
- app/packs/stylesheets/decidim/_home.scss
|
@@ -2156,6 +2154,7 @@ files:
|
|
2156
2154
|
- config/locales/bg.yml
|
2157
2155
|
- config/locales/bn-BD.yml
|
2158
2156
|
- config/locales/bs-BA.yml
|
2157
|
+
- config/locales/ca-IT.yml
|
2159
2158
|
- config/locales/ca.yml
|
2160
2159
|
- config/locales/cs-CZ.yml
|
2161
2160
|
- config/locales/cs.yml
|
@@ -2798,6 +2797,7 @@ files:
|
|
2798
2797
|
- lib/decidim/core/test/shared_examples/searchable_results_examples.rb
|
2799
2798
|
- lib/decidim/core/test/shared_examples/share_link_examples.rb
|
2800
2799
|
- lib/decidim/core/test/shared_examples/simple_event.rb
|
2800
|
+
- lib/decidim/core/test/shared_examples/social_share_examples.rb
|
2801
2801
|
- lib/decidim/core/test/shared_examples/space_cell_changes_button_text_cta.rb
|
2802
2802
|
- lib/decidim/core/test/shared_examples/static_pages_examples.rb
|
2803
2803
|
- lib/decidim/core/test/shared_examples/statistics_cell_examples.rb
|
@@ -2987,6 +2987,7 @@ files:
|
|
2987
2987
|
- lib/tasks/decidim_robots.rake
|
2988
2988
|
- lib/tasks/decidim_tasks.rake
|
2989
2989
|
- lib/tasks/decidim_webpacker_tasks.rake
|
2990
|
+
- lib/tasks/upgrade/clean_hidden_resources.rake
|
2990
2991
|
- lib/tasks/upgrade/decidim_active_storage_migration_tasks.rake
|
2991
2992
|
- lib/tasks/upgrade/decidim_attachments.rake
|
2992
2993
|
- lib/tasks/upgrade/decidim_content_blocks_tasks.rake
|
@@ -1,6 +0,0 @@
|
|
1
|
-
<button type="button" data-open="<%= current_user.present? ? "flagModal" : "loginModal" %>" title="<%= t("report", scope: "decidim.shared.flag_modal" ) %>" aria-controls="<%= current_user.present? ? "flagModal" : "loginModal" %>" aria-haspopup="true" tabindex="0">
|
2
|
-
<%= icon "flag", aria_hidden: true, class: "icon--small", role: "img", "aria-hidden": true %>
|
3
|
-
<span>
|
4
|
-
<%= t("report", scope: "decidim.shared.flag_modal" ) %>
|
5
|
-
</span>
|
6
|
-
</button>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<% if user_flaggable? && model.try(:id) != current_user.try(:id) %>
|
2
|
-
<%= cell(
|
3
|
-
"decidim/button",
|
4
|
-
{ icon: "flag-line", text: t("decidim.shared.flag_modal.report") },
|
5
|
-
button_classes: "button button__sm button__text-secondary only:m-auto",
|
6
|
-
html_options: {
|
7
|
-
"data-open" => current_user.present? ? "flagUserModal" : "loginModal",
|
8
|
-
"aria-controls" => current_user.present? ? "flagUserModal" : "loginModal",
|
9
|
-
"aria-haspopup" => "dialog"
|
10
|
-
}
|
11
|
-
) %>
|
12
|
-
|
13
|
-
<%= cell("decidim/flag_modal", model).flag_user %>
|
14
|
-
<% end %>
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<div class="flag-modal hidden" id="flagUserModal" data-reveal role="dialog" aria-modal="true" aria-labelledby="flagUserModal-label">
|
2
|
-
<div>
|
3
|
-
<h3 id="flagUserModal-label"><%= t("decidim.shared.flag_user_modal.title") %></h3>
|
4
|
-
<button class="close-button" data-close aria-label="<%= t("decidim.shared.flag_user_modal.close") %>" type="button">
|
5
|
-
<span aria-hidden="true">×</span>
|
6
|
-
</button>
|
7
|
-
</div>
|
8
|
-
<% if model.reported_by? current_user %>
|
9
|
-
<p><%= t("decidim.shared.flag_user_modal.already_reported") %></p>
|
10
|
-
<% else %>
|
11
|
-
<p><%= t("decidim.shared.flag_user_modal.description") %></p>
|
12
|
-
<%= decidim_form_for report_form, url: decidim.report_user_path(sgid: model.to_sgid.to_s), method: :post do |f| %>
|
13
|
-
<%= f.collection_radio_buttons :reason, [
|
14
|
-
[:spam, t("decidim.shared.flag_user_modal.spam")],
|
15
|
-
[:offensive, t("decidim.shared.flag_user_modal.offensive")],
|
16
|
-
[:does_not_belong, t("decidim.shared.flag_user_modal.does_not_belong", organization_name: current_organization.name)]
|
17
|
-
], :first, :last do |builder| %>
|
18
|
-
<%= builder.label { builder.radio_button + builder.text } %>
|
19
|
-
<% end %>
|
20
|
-
<%= f.text_area :details, rows: 4 %>
|
21
|
-
<% if current_user&.admin? %>
|
22
|
-
<%= f.check_box :block, label: t("decidim.shared.flag_user_modal.block"),
|
23
|
-
include_hidden: false,
|
24
|
-
data: {
|
25
|
-
label_action: t("decidim.shared.flag_user_modal.block"),
|
26
|
-
label_report: t("decidim.shared.flag_user_modal.report"),
|
27
|
-
block: "true"
|
28
|
-
} %>
|
29
|
-
<%= f.check_box :hide, label: t("decidim.shared.flag_user_modal.hide"), label_options: { id: "block_and_hide" } %>
|
30
|
-
<% end %>
|
31
|
-
<%= f.submit t("decidim.shared.flag_user_modal.report") %>
|
32
|
-
<% end %>
|
33
|
-
<% end %>
|
34
|
-
</div>
|
@@ -1,52 +0,0 @@
|
|
1
|
-
<%= decidim_modal id: modal_id do %>
|
2
|
-
<%= decidim_form_for report_form, url: decidim.report_path(sgid: model.to_sgid.to_s), method: :post, html: { id: nil, class: "modal__report form-defaults" } do |f| %>
|
3
|
-
<div data-dialog-container>
|
4
|
-
<%= icon "flag-line", class: "inline-block align-middle" %>
|
5
|
-
<h3 data-dialog-title id="dialog-title-<%= modal_id %>">
|
6
|
-
<%= t("decidim.shared.flag_modal.title") %>
|
7
|
-
</h3>
|
8
|
-
|
9
|
-
<% if model.reported_by? current_user %>
|
10
|
-
<div>
|
11
|
-
<p class="modal__report-text">
|
12
|
-
<%= t("decidim.shared.flag_modal.already_reported") %>
|
13
|
-
</p>
|
14
|
-
</div>
|
15
|
-
<% else %>
|
16
|
-
<div>
|
17
|
-
<p class="modal__report-text">
|
18
|
-
<%= t("decidim.shared.flag_modal.description") %>
|
19
|
-
</p>
|
20
|
-
<fieldset>
|
21
|
-
<legend><%= t("decidim.shared.flag_modal.reason") %></legend>
|
22
|
-
<%= f.collection_radio_buttons :reason, [
|
23
|
-
[:spam, t("decidim.shared.flag_modal.spam")],
|
24
|
-
[:offensive, t("decidim.shared.flag_modal.offensive")],
|
25
|
-
[:does_not_belong, t("decidim.shared.flag_modal.does_not_belong", organization_name: current_organization.name)]
|
26
|
-
], :first, :last do |builder| %>
|
27
|
-
<div class="modal__report-container__radio">
|
28
|
-
<%= builder.radio_button(id: builder.value) %>
|
29
|
-
<label for="<%= builder.value %>">
|
30
|
-
<%= builder.text %>
|
31
|
-
</label>
|
32
|
-
</div>
|
33
|
-
<% end %>
|
34
|
-
</fieldset>
|
35
|
-
<% unless model.reported_by? current_user %>
|
36
|
-
<%= f.text_area :details, class: "w-full rounded border min-h-[160px] border-text-gray-2 mt-2", id: "#{modal_id}_details", label_options: { for: "#{modal_id}_details", class: "text-gray-2" } %>
|
37
|
-
<% end %>
|
38
|
-
</div>
|
39
|
-
<% end %>
|
40
|
-
</div>
|
41
|
-
<div data-dialog-actions>
|
42
|
-
<% unless model.reported_by? current_user %>
|
43
|
-
<button type="submit" class="button button__lg button__secondary">
|
44
|
-
<span>
|
45
|
-
<%= t("decidim.shared.flag_modal.report") %>
|
46
|
-
</span>
|
47
|
-
<%= icon "arrow-right-line" %>
|
48
|
-
</button>
|
49
|
-
<% end %>
|
50
|
-
</div>
|
51
|
-
<% end %>
|
52
|
-
<% end %>
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
class FlagModalCell < Decidim::ViewModel
|
5
|
-
include ActionView::Helpers::FormOptionsHelper
|
6
|
-
|
7
|
-
def flag_user
|
8
|
-
render
|
9
|
-
end
|
10
|
-
|
11
|
-
def cache_hash
|
12
|
-
hash = []
|
13
|
-
hash.push(I18n.locale)
|
14
|
-
hash.push(current_user.try(:id))
|
15
|
-
hash.push(model.reported_by?(current_user) ? 1 : 0)
|
16
|
-
hash.push(model.class.name.gsub("::", ":"))
|
17
|
-
hash.push(model.id)
|
18
|
-
hash.join(Decidim.cache_key_separator)
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
def frontend_administrable?
|
24
|
-
author.respond_to?(:nickname) &&
|
25
|
-
model.can_be_administered_by?(current_user) &&
|
26
|
-
(model.respond_to?(:official?) && !model.official?)
|
27
|
-
end
|
28
|
-
|
29
|
-
def link_to_profile
|
30
|
-
author.presenter.profile_url
|
31
|
-
end
|
32
|
-
|
33
|
-
def author
|
34
|
-
model.try(:creator_identity) || model.try(:normalized_author)
|
35
|
-
end
|
36
|
-
|
37
|
-
def user_report_form
|
38
|
-
Decidim::ReportForm.from_params(reason: "spam")
|
39
|
-
end
|
40
|
-
|
41
|
-
def modal_id
|
42
|
-
options[:modal_id] || "flagModal"
|
43
|
-
end
|
44
|
-
|
45
|
-
def hide_checkbox_id
|
46
|
-
@hide_checkbox_id ||= Digest::MD5.hexdigest("report_form_hide_#{model.class.name}_#{model.id}")
|
47
|
-
end
|
48
|
-
|
49
|
-
def report_form
|
50
|
-
@report_form ||= begin
|
51
|
-
context = { can_hide: model.try(:can_be_administered_by?, current_user) }
|
52
|
-
Decidim::ReportForm.new(reason: "spam").with_context(context)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
@@ -1,167 +0,0 @@
|
|
1
|
-
<div class="card profile--sidebar">
|
2
|
-
<%= image_tag profile_user.avatar_url(:profile), class: "card__image card__image--larger", alt: "avatar #{profile_user.name}" %>
|
3
|
-
<div>
|
4
|
-
<h1>
|
5
|
-
<strong><%= profile_user.name %></strong>
|
6
|
-
<br>
|
7
|
-
<span>
|
8
|
-
<%= profile_user.nickname %> <br>
|
9
|
-
</span>
|
10
|
-
<% if user_flaggable? %>
|
11
|
-
<span class="user-report_link">
|
12
|
-
<%== cell("decidim/author", profile_user, from:profile_user).flag_user %>
|
13
|
-
</span>
|
14
|
-
|
15
|
-
<% end %>
|
16
|
-
<% if can_contact_user? %>
|
17
|
-
<span>
|
18
|
-
<%= link_to_current_or_new_conversation_with(profile_holder) %>
|
19
|
-
</span>
|
20
|
-
<% end %>
|
21
|
-
</h1>
|
22
|
-
<div>
|
23
|
-
<small><%= decidim_html_escape(profile_user.about.to_s) %></small>
|
24
|
-
</div>
|
25
|
-
<% if profile_user.personal_url.present? %>
|
26
|
-
<%= link_to html_truncate(profile_user.personal_url.gsub(%r{https?\:\/\/}, ""), length: 30), profile_user.personal_url, rel: "nofollow noopener noreferrer ugc" %>
|
27
|
-
<% end %>
|
28
|
-
</div>
|
29
|
-
<% if profile_user.badge.present? %>
|
30
|
-
<div>
|
31
|
-
<span>
|
32
|
-
<%= icon profile_user.badge, class: "author__verified", aria_label: t("decidim.profiles.show.officialized"), role: "img" %>
|
33
|
-
</span>
|
34
|
-
<span>
|
35
|
-
<%= officialization_text %>
|
36
|
-
</span>
|
37
|
-
</div>
|
38
|
-
<% end %>
|
39
|
-
<%= render_hook(:user_profile_bottom) %>
|
40
|
-
<div>
|
41
|
-
<div class="text-center">
|
42
|
-
<% if profile_user_can_follow? %>
|
43
|
-
<div>
|
44
|
-
<%= link_to profile_followers_path(nickname: profile_holder.nickname) do %>
|
45
|
-
<%= t("decidim.profiles.show.followers") %>
|
46
|
-
<div><strong><%= profile_user.followers_count %></strong></div>
|
47
|
-
<% end %>
|
48
|
-
</div>
|
49
|
-
<div>
|
50
|
-
<%= link_to profile_following_path(nickname: profile_holder.nickname) do %>
|
51
|
-
<%= t("decidim.profiles.show.following") %>
|
52
|
-
<div><strong><%= profile_user.following_count %></strong></div>
|
53
|
-
<% end %>
|
54
|
-
</div>
|
55
|
-
<% else %>
|
56
|
-
<div>
|
57
|
-
<%= link_to profile_followers_path(nickname: profile_holder.nickname) do %>
|
58
|
-
<%= t("decidim.profiles.show.followers") %>
|
59
|
-
<div><%= profile_user.followers_count %></div>
|
60
|
-
<% end %>
|
61
|
-
</div>
|
62
|
-
<div>
|
63
|
-
<%= link_to profile_members_path(nickname: profile_holder.nickname) do %>
|
64
|
-
<%= t("decidim.profiles.show.members") %>
|
65
|
-
<div><%= profile_user.members_count %></div>
|
66
|
-
<% end %>
|
67
|
-
</div>
|
68
|
-
<% end %>
|
69
|
-
</div>
|
70
|
-
</div>
|
71
|
-
|
72
|
-
<% if current_organization.badges_enabled? && badge_statuses.any? %>
|
73
|
-
<div>
|
74
|
-
<div>
|
75
|
-
<div class="row column">
|
76
|
-
<strong><%= t("decidim.profiles.sidebar.badges.title") %></strong>
|
77
|
-
<div>
|
78
|
-
<div data-tooltip data-position="top" title="<%= t("decidim.profiles.sidebar.badges.info") %>" data-yeti-box="badges-tooltip" data-toggle="badges-tooltip" data-resize="badges-tooltip" data-events="resize">
|
79
|
-
<%= icon "info", class: "icon--small", role: "img", "aria-hidden": true %>
|
80
|
-
</div>
|
81
|
-
</div>
|
82
|
-
</div>
|
83
|
-
<div class="row collapse">
|
84
|
-
<% badge_statuses.each do |status| %>
|
85
|
-
<div class="column">
|
86
|
-
<div>
|
87
|
-
<%= cell("decidim/badge", profile_holder, badge: status.badge, status:).call(:small) %>
|
88
|
-
</div>
|
89
|
-
</div>
|
90
|
-
<% end %>
|
91
|
-
</div>
|
92
|
-
</div>
|
93
|
-
</div>
|
94
|
-
<% end %>
|
95
|
-
</div>
|
96
|
-
|
97
|
-
<div class="row">
|
98
|
-
<div class="column">
|
99
|
-
<% if own_profile? %>
|
100
|
-
<div class="text-center">
|
101
|
-
<%= link_to decidim.account_path, class: "button" do %>
|
102
|
-
<span>
|
103
|
-
<%= t("decidim.profiles.user.edit_profile") %>
|
104
|
-
</span>
|
105
|
-
<% end %>
|
106
|
-
</div>
|
107
|
-
<% if user_groups_enabled? %>
|
108
|
-
<div class="text-center">
|
109
|
-
<%= link_to decidim.new_group_path, class: "button hollow" do %>
|
110
|
-
<span>
|
111
|
-
<%= t("decidim.profiles.user.create_user_group") %>
|
112
|
-
</span>
|
113
|
-
<% end %>
|
114
|
-
</div>
|
115
|
-
<% end %>
|
116
|
-
<% elsif logged_in? %>
|
117
|
-
<%= cell "decidim/follow_button", profile_holder %>
|
118
|
-
<% end %>
|
119
|
-
|
120
|
-
<% if user_groups_enabled? %>
|
121
|
-
<% if can_edit_user_group_profile? %>
|
122
|
-
<% if user_group_email_to_be_confirmed? %>
|
123
|
-
<div class="text-center">
|
124
|
-
<%= link_to decidim.group_email_confirmation_path(model.nickname), method: :post, class: "button hollow expanded" do %>
|
125
|
-
<span>
|
126
|
-
<%= t("decidim.profiles.user.resend_email_confirmation_instructions") %>
|
127
|
-
</span>
|
128
|
-
<% end %>
|
129
|
-
</div>
|
130
|
-
<% end %>
|
131
|
-
|
132
|
-
<div class="text-center">
|
133
|
-
<%= link_to t("decidim.profiles.user.edit_user_group"), edit_group_path(profile_holder.nickname) %>
|
134
|
-
</div>
|
135
|
-
<div class="text-center">
|
136
|
-
<%= link_to t("decidim.profiles.user.manage_user_group_users"), profile_group_members_path(profile_holder.nickname) %>
|
137
|
-
</div>
|
138
|
-
<div class="text-center">
|
139
|
-
<%= link_to t("decidim.profiles.user.manage_user_group_admins"), profile_group_admins_path(profile_holder.nickname) %>
|
140
|
-
</div>
|
141
|
-
<div class="text-center">
|
142
|
-
<%= link_to t("decidim.profiles.user.invite_user"), group_invites_path(profile_holder.nickname) %>
|
143
|
-
</div>
|
144
|
-
<% end %>
|
145
|
-
|
146
|
-
<% if can_join_user_group? %>
|
147
|
-
<div class="text-center">
|
148
|
-
<%= link_to decidim.group_join_requests_path(model.nickname), method: :post, class: "button hollow expanded" do %>
|
149
|
-
<span>
|
150
|
-
<%= t("decidim.profiles.user.join_user_group") %>
|
151
|
-
</span>
|
152
|
-
<% end %>
|
153
|
-
</div>
|
154
|
-
<% end %>
|
155
|
-
|
156
|
-
<% if can_leave_group? %>
|
157
|
-
<div class="text-center">
|
158
|
-
<%= link_to decidim.leave_group_path(model.nickname), method: :delete, data: { confirm: t("decidim.groups.actions.are_you_sure") }, class: "button hollow expanded" do %>
|
159
|
-
<span>
|
160
|
-
<%= t("decidim.profiles.user.leave_user_group") %>
|
161
|
-
</span>
|
162
|
-
<% end %>
|
163
|
-
</div>
|
164
|
-
<% end %>
|
165
|
-
<% end %>
|
166
|
-
</div>
|
167
|
-
</div>
|
@@ -1,68 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
class ProfileSidebarCell < Decidim::ProfileCell
|
5
|
-
include Decidim::Messaging::ConversationHelper
|
6
|
-
include Decidim::ViewHooksHelper
|
7
|
-
include Decidim::CellsHelper
|
8
|
-
|
9
|
-
helper_method :profile_user
|
10
|
-
|
11
|
-
def show
|
12
|
-
render :show
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def profile_user
|
18
|
-
@profile_user ||= present(model)
|
19
|
-
end
|
20
|
-
|
21
|
-
def can_contact_user?
|
22
|
-
!current_user || (current_user && current_user != model && profile_user.can_be_contacted?)
|
23
|
-
end
|
24
|
-
|
25
|
-
def officialization_text
|
26
|
-
profile_user.officialization_text
|
27
|
-
end
|
28
|
-
|
29
|
-
def can_edit_user_group_profile?
|
30
|
-
return false unless current_user
|
31
|
-
return false if model.is_a?(Decidim::User)
|
32
|
-
|
33
|
-
Decidim::UserGroups::ManageableUserGroups.for(current_user).include?(model)
|
34
|
-
end
|
35
|
-
|
36
|
-
def profile_user_can_follow?
|
37
|
-
profile_user.can_follow?
|
38
|
-
end
|
39
|
-
|
40
|
-
def badge_statuses
|
41
|
-
Decidim::Gamification.badges.select { |badge| badge.valid_for?(profile_holder) }.map do |badge|
|
42
|
-
status = Decidim::Gamification.status_for(profile_holder, badge.name)
|
43
|
-
status.level.positive? ? status : nil
|
44
|
-
end.compact
|
45
|
-
end
|
46
|
-
|
47
|
-
def can_join_user_group?
|
48
|
-
return false unless current_user
|
49
|
-
return false if model.is_a?(Decidim::User)
|
50
|
-
|
51
|
-
Decidim::UserGroupMembership.where(user: current_user, user_group: model).empty?
|
52
|
-
end
|
53
|
-
|
54
|
-
def can_leave_group?
|
55
|
-
return false unless current_user
|
56
|
-
return false if model.is_a?(Decidim::User)
|
57
|
-
|
58
|
-
Decidim::UserGroupMembership.where(user: current_user, user_group: model).any?
|
59
|
-
end
|
60
|
-
|
61
|
-
def user_group_email_to_be_confirmed?
|
62
|
-
return false unless current_user
|
63
|
-
return false if model.is_a?(Decidim::User)
|
64
|
-
|
65
|
-
!model.confirmed?
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|