decidim-core 0.30.0.rc2 → 0.30.0.rc3
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/amendable/amendments/show.erb +1 -1
- 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/controllers/decidim/profiles_controller.rb +2 -2
- data/app/controllers/decidim/user_activities_controller.rb +1 -1
- data/app/forms/decidim/account_form.rb +2 -2
- data/app/jobs/decidim/hide_child_resources_job.rb +3 -3
- data/app/jobs/decidim/migrate/paper_trail_job.rb +33 -0
- data/app/models/decidim/user.rb +0 -4
- data/app/models/decidim/user_base_entity.rb +4 -0
- data/app/packs/src/decidim/sticky_footer.js +19 -0
- data/app/packs/stylesheets/decidim/_cards.scss +4 -0
- data/app/packs/stylesheets/decidim/_content_blocks.scss +1 -1
- data/app/packs/stylesheets/decidim/_login.scss +4 -0
- data/app/packs/stylesheets/decidim/_modal_authorization.scss +1 -1
- data/app/packs/stylesheets/decidim/_profile.scss +1 -1
- data/app/resolvers/decidim/meta_image_url_resolver.rb +1 -0
- data/app/services/decidim/static_map_generator.rb +1 -1
- data/app/views/decidim/devise/registrations/new.html.erb +1 -1
- data/app/views/decidim/devise/sessions/new.html.erb +1 -1
- data/app/views/decidim/devise/shared/_omniauth_buttons.html.erb +1 -1
- data/app/views/decidim/last_activities/index.html.erb +1 -1
- data/app/views/decidim/open_data/index.html.erb +1 -1
- data/config/locales/ar.yml +12 -25
- data/config/locales/bg.yml +8 -22
- data/config/locales/ca.yml +19 -33
- data/config/locales/cs.yml +16 -31
- data/config/locales/de.yml +6 -21
- data/config/locales/el.yml +8 -13
- data/config/locales/en.yml +2 -16
- data/config/locales/eo.yml +2 -0
- data/config/locales/es-MX.yml +14 -28
- data/config/locales/es-PY.yml +19 -33
- data/config/locales/es.yml +19 -33
- data/config/locales/eu.yml +52 -67
- data/config/locales/fi-plain.yml +11 -26
- data/config/locales/fi.yml +12 -27
- data/config/locales/fr-CA.yml +58 -20
- data/config/locales/fr.yml +58 -20
- data/config/locales/ga-IE.yml +2 -4
- data/config/locales/gl.yml +22 -13
- data/config/locales/hu.yml +7 -21
- data/config/locales/id-ID.yml +22 -13
- data/config/locales/is-IS.yml +10 -0
- data/config/locales/it.yml +22 -20
- data/config/locales/ja.yml +120 -21
- data/config/locales/lb.yml +19 -19
- data/config/locales/lt.yml +5 -17
- data/config/locales/lv.yml +16 -13
- data/config/locales/nl.yml +20 -17
- data/config/locales/no.yml +16 -16
- data/config/locales/pl.yml +4 -18
- data/config/locales/pt-BR.yml +8 -21
- data/config/locales/pt.yml +16 -16
- data/config/locales/ro-RO.yml +15 -20
- data/config/locales/ru.yml +23 -8
- data/config/locales/sk.yml +27 -16
- data/config/locales/sv.yml +11 -25
- data/config/locales/tr-TR.yml +21 -20
- data/config/locales/uk.yml +12 -1
- data/config/locales/zh-CN.yml +16 -13
- data/config/locales/zh-TW.yml +6 -16
- data/db/migrate/20240722215500_change_object_changes_on_versions.rb +4 -24
- data/lib/decidim/content_parsers/user_parser.rb +1 -1
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/map/provider/static_map/here.rb +34 -0
- data/lib/decidim/nicknamizable.rb +1 -1
- data/lib/tasks/upgrade/decidim_fix_nickname_uniqueness.rake +23 -20
- metadata +11 -13
- 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
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.30.0.
|
4
|
+
version: 0.30.0.rc3
|
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-03-
|
13
|
+
date: 2025-03-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: concurrent-ruby
|
@@ -780,28 +780,28 @@ dependencies:
|
|
780
780
|
requirements:
|
781
781
|
- - '='
|
782
782
|
- !ruby/object:Gem::Version
|
783
|
-
version: 0.30.0.
|
783
|
+
version: 0.30.0.rc3
|
784
784
|
type: :development
|
785
785
|
prerelease: false
|
786
786
|
version_requirements: !ruby/object:Gem::Requirement
|
787
787
|
requirements:
|
788
788
|
- - '='
|
789
789
|
- !ruby/object:Gem::Version
|
790
|
-
version: 0.30.0.
|
790
|
+
version: 0.30.0.rc3
|
791
791
|
- !ruby/object:Gem::Dependency
|
792
792
|
name: decidim-dev
|
793
793
|
requirement: !ruby/object:Gem::Requirement
|
794
794
|
requirements:
|
795
795
|
- - '='
|
796
796
|
- !ruby/object:Gem::Version
|
797
|
-
version: 0.30.0.
|
797
|
+
version: 0.30.0.rc3
|
798
798
|
type: :development
|
799
799
|
prerelease: false
|
800
800
|
version_requirements: !ruby/object:Gem::Requirement
|
801
801
|
requirements:
|
802
802
|
- - '='
|
803
803
|
- !ruby/object:Gem::Version
|
804
|
-
version: 0.30.0.
|
804
|
+
version: 0.30.0.rc3
|
805
805
|
description: Adds core features so other engines can hook into the framework.
|
806
806
|
email:
|
807
807
|
- josepjaume@gmail.com
|
@@ -843,8 +843,6 @@ files:
|
|
843
843
|
- app/cells/decidim/author/contact.erb
|
844
844
|
- app/cells/decidim/author/date.erb
|
845
845
|
- app/cells/decidim/author/endorsements.erb
|
846
|
-
- app/cells/decidim/author/flag.erb
|
847
|
-
- app/cells/decidim/author/flag_user.erb
|
848
846
|
- app/cells/decidim/author/name.erb
|
849
847
|
- app/cells/decidim/author/profile_minicard.erb
|
850
848
|
- app/cells/decidim/author/show.erb
|
@@ -996,9 +994,6 @@ files:
|
|
996
994
|
- app/cells/decidim/endorsers_list/full.erb
|
997
995
|
- app/cells/decidim/endorsers_list/show.erb
|
998
996
|
- app/cells/decidim/endorsers_list_cell.rb
|
999
|
-
- app/cells/decidim/flag_modal/flag_user.erb
|
1000
|
-
- app/cells/decidim/flag_modal/show.erb
|
1001
|
-
- app/cells/decidim/flag_modal_cell.rb
|
1002
997
|
- app/cells/decidim/follow_button/content.erb
|
1003
998
|
- app/cells/decidim/follow_button/show.erb
|
1004
999
|
- app/cells/decidim/follow_button_cell.rb
|
@@ -1074,8 +1069,6 @@ files:
|
|
1074
1069
|
- app/cells/decidim/profile_actions/show.erb
|
1075
1070
|
- app/cells/decidim/profile_actions_cell.rb
|
1076
1071
|
- app/cells/decidim/profile_cell.rb
|
1077
|
-
- app/cells/decidim/profile_sidebar/show.erb
|
1078
|
-
- app/cells/decidim/profile_sidebar_cell.rb
|
1079
1072
|
- app/cells/decidim/progress_bar/show.erb
|
1080
1073
|
- app/cells/decidim/progress_bar_cell.rb
|
1081
1074
|
- app/cells/decidim/public_participation/show.erb
|
@@ -1084,6 +1077,10 @@ files:
|
|
1084
1077
|
- app/cells/decidim/report_button/flag_modal.erb
|
1085
1078
|
- app/cells/decidim/report_button/show.erb
|
1086
1079
|
- app/cells/decidim/report_button_cell.rb
|
1080
|
+
- app/cells/decidim/report_user_button/already_reported_modal.erb
|
1081
|
+
- app/cells/decidim/report_user_button/flag_modal.erb
|
1082
|
+
- app/cells/decidim/report_user_button/show.erb
|
1083
|
+
- app/cells/decidim/report_user_button_cell.rb
|
1087
1084
|
- app/cells/decidim/reported_content/show.erb
|
1088
1085
|
- app/cells/decidim/reported_content_cell.rb
|
1089
1086
|
- app/cells/decidim/represent_user_group/show.erb
|
@@ -1421,6 +1418,7 @@ files:
|
|
1421
1418
|
- app/jobs/decidim/machine_translation_resource_job.rb
|
1422
1419
|
- app/jobs/decidim/machine_translation_save_job.rb
|
1423
1420
|
- app/jobs/decidim/metric_job.rb
|
1421
|
+
- app/jobs/decidim/migrate/paper_trail_job.rb
|
1424
1422
|
- app/jobs/decidim/newsletters_opt_in_job.rb
|
1425
1423
|
- app/jobs/decidim/notification_generator_for_recipient_job.rb
|
1426
1424
|
- app/jobs/decidim/notification_generator_job.rb
|
@@ -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
|