diff --git a/app/cells/decidim/author/avatar_image.erb b/app/cells/decidim/author/avatar_image.erb
new file mode 100644
index 0000000..bbdfdd5
--- /dev/null
+++ b/app/cells/decidim/author/avatar_image.erb
@@ -0,0 +1,9 @@
+<% if model.is_a?(Decidim::User) %>
+ <% if mode.public? %>
+ <%= image_tag model.avatar_url, alt: t("decidim.author.avatar", name: display_name), class: "author__avatar" %>
+ <% else %>
+ <%= image_tag model.default_avatar_url, alt: t("decidim.author.avatar", name: display_name), class: "author__avatar" %>
+ <% end %>
+<% else %>
+ <%= image_tag model.avatar_url, alt: t("decidim.author.avatar", name: display_name), class: "author__avatar" %>
+<% end %>
diff --git a/app/cells/decidim/author/profile_minicard.erb b/app/cells/decidim/author/profile_minicard.erb
new file mode 100644
index 0000000..d4790a7
--- /dev/null
+++ b/app/cells/decidim/author/profile_minicard.erb
@@ -0,0 +1,32 @@
+
-
+<% end %>
diff --git a/app/packs/src/decidim/privacy/decidim_privacy_settings.js b/app/packs/src/decidim/privacy/decidim_privacy_settings.js
index 693cbf3..6895d7f 100644
--- a/app/packs/src/decidim/privacy/decidim_privacy_settings.js
+++ b/app/packs/src/decidim/privacy/decidim_privacy_settings.js
@@ -5,17 +5,14 @@ $(() => {
if (accountPublicity && accountPublicity.dataset.publicity === "true") {
privacyMessagingText.style.display = "block";
} else {
- console.log(accountPublicity.dataset)
privacyMessagingText.style.display = "none";
}
const toggleVisibility = () => {
if (privacyMessagingText.style.display === "none"){
privacyMessagingText.style.display = "block";
- console.log("NÄYTÄ")
} else {
privacyMessagingText.style.display = "none";
- console.log("PIILOTA")
}
};
diff --git a/app/presenters/concerns/decidim/privacy/user_presenter_extensions.rb b/app/presenters/concerns/decidim/privacy/user_presenter_extensions.rb
index 9e862f3..1d4f2ee 100644
--- a/app/presenters/concerns/decidim/privacy/user_presenter_extensions.rb
+++ b/app/presenters/concerns/decidim/privacy/user_presenter_extensions.rb
@@ -24,14 +24,6 @@ def profile_url
decidim.profile_url(__getobj__.nickname)
end
- def avatar_url(variant = nil)
- return default_avatar_url if __getobj__.blocked?
- return default_avatar_url unless avatar.attached?
- return default_avatar_url unless public_user?
-
- avatar.url(variant: variant)
- end
-
def profile_path
return "" unless public_user?
return "" if respond_to?(:deleted?) && deleted?
diff --git a/app/views/decidim/messaging/conversations/_conversation.html.erb b/app/views/decidim/messaging/conversations/_conversation.html.erb
deleted file mode 100644
index abd553a..0000000
--- a/app/views/decidim/messaging/conversations/_conversation.html.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-<% nickname ||= false %>
-<% conversation_path = nickname ? decidim.profile_conversation_path(conversation, nickname:) : decidim.conversation_path(conversation) %>
-
-<%= link_to conversation_path, id: "conversation-#{conversation.id}", class: "conversation__item" do %>
-
- <% if conversation.interlocutors(current_user).count == 1 %>
- <% if !conversation.interlocutors(current_user).first.public? %>
- <%= image_tag present(conversation.interlocutors(current_user).first).default_avatar_url, alt: t("decidim.profile.private"), name: t("decidim.profile.private") %>
- <% else %>
- <%= cell "decidim/author", present(conversation.interlocutors(current_user).first), layout: :avatar, skip_profile_link: true %>
- <% end %>
- <% else %>
- <%= icon "group-line", class: "w-4 h-4 text-gray fill-current" %>
- <% end %>
-
-
-
-
-
- <%= conversation.interlocutors(current_user).last.name %>
-
-
- <% if conversation.interlocutors(current_user).count > 1 %>
-
- <% conversation.interlocutors(current_user).each do |interlocutor| %>
-
- <%= cell "decidim/author", present(interlocutor), layout: :avatar, skip_profile_link: true %>
-
- <% end %>
-
- <% end %>
-
-
-
<%= truncate conversation.last_message.body, length: 150 %>
-
-
- <%= t("decidim.user_conversations.index.time_ago", time: time_ago_in_words(Time.zone.parse(conversation.last_message.created_at.to_s))) %>
-
-
-
-
- <% if conversation.unread_count(current_user).positive? %>
- <%= conversation.unread_count(current_user) %>
- <% end %>
-
-<% end %>
diff --git a/app/views/decidim/messaging/conversations/_messages.html.erb b/app/views/decidim/messaging/conversations/_messages.html.erb
deleted file mode 100644
index d2dde0e..0000000
--- a/app/views/decidim/messaging/conversations/_messages.html.erb
+++ /dev/null
@@ -1,23 +0,0 @@
-
">
- <% if sender.deleted? %>
-
- <%= t("deleted", scope: "decidim.profile") %>
-
- <% elsif !sender.public? %>
- <%= image_tag present(sender).default_avatar_url, alt: t("decidim.profile.private"), name: t("decidim.profile.private") %>
- <% else %>
- <%= link_to profile_path(sender.nickname) do %>
- <%= image_tag present(sender).avatar_url, alt: t("decidim.author.avatar", name: decidim_sanitize(sender.name)) %>
- <% end %>
- <% end %>
-
- <% messages.each do |message| %>
-
-
- <%= simple_format(message.body_with_links) %>
-
-
- <% end %>
-
" title="<%= messages.last.created_at.strftime("%d-%m-%Y %H:%M:%S%z") %>"><%= messages.last.friendly_created_at %>
-
-
diff --git a/app/views/decidim/messaging/conversations/_show.html.erb b/app/views/decidim/messaging/conversations/_show.html.erb
deleted file mode 100644
index 4269332..0000000
--- a/app/views/decidim/messaging/conversations/_show.html.erb
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
- <%= yield %>
-
-
-
-
-
diff --git a/app/views/decidim/messaging/conversations/new.html.erb b/app/views/decidim/messaging/conversations/new.html.erb
deleted file mode 100644
index 40d3714..0000000
--- a/app/views/decidim/messaging/conversations/new.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-<%= render layout: "show", locals: { participants: @form.recipient.to_a } do %>
-
- <% if @form.recipient.to_a.select { |recipient| recipient.instance_of?(Decidim::User) }.any?(&:private_messaging_disabled?) %>
- <% if @form.recipient.count > 1 %>
-
<%= t(".private_messaging_disabled_new_multiple") %>
- <% else %>
-
<%= t(".private_messaging_disabled_new") %>
- <% end %>
- <% else %>
- <%= render "start", form: @form %>
- <% end %>
-<% end %>
diff --git a/app/views/decidim/messaging/conversations/show.html.erb b/app/views/decidim/messaging/conversations/show.html.erb
deleted file mode 100644
index dbe5d28..0000000
--- a/app/views/decidim/messaging/conversations/show.html.erb
+++ /dev/null
@@ -1,24 +0,0 @@
-<%= render layout: "show", locals: { participants: conversation.interlocutors(current_user) } do %>
-
- <% user_grouped_messages.each do |sender, messages| %>
- <%= render "messages", sender: sender, messages: messages %>
- <% end %>
-
- <% if conversation.with_deleted_users?(current_user) %>
-
<%= t ".deleted_accounts" %>
- <% elsif conversation.interlocutors(current_user).count == 1 &&
- conversation.interlocutors(current_user).first.instance_of?(Decidim::User) &&
- !conversation.interlocutors(current_user).first.public?
- %>
-
<%= t(".private_account") %>
- <% elsif conversation.interlocutors(current_user).count == 1 &&
- conversation.interlocutors(current_user).first.instance_of?(Decidim::User) &&
- conversation.interlocutors(current_user).first.private_messaging_disabled?
- %>
-
<%= t(".private_messaging_disabled") %>
- <% elsif conversation.accept_user?(current_user) %>
- <%= render "reply", form: @form, conversation: conversation %>
- <% else %>
-
<%= t ".not_allowed" %>
- <% end %>
-<% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 74f7974..cdb730b 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -13,6 +13,8 @@ en:
profile: My public profile
message: "Your profile is set as public on this platform and other people can see details about you, such as your name, nickname, profile picture and your public activity on this platform. You can change the visibility of your profile through the privacy settings page. Your profile is available at:"
shared:
+ layout_two_col:
+ private_account: Private account
layout_center:
save_privacy_settings: Save privacy settings
decidim:
diff --git a/lib/decidim/privacy/engine.rb b/lib/decidim/privacy/engine.rb
index f12f61e..de95064 100644
--- a/lib/decidim/privacy/engine.rb
+++ b/lib/decidim/privacy/engine.rb
@@ -52,7 +52,7 @@ class Engine < ::Rails::Engine
end
end
- initializer "decidim_privacy.add_cells_view_paths", before: "decidim_comments.add_cells_view_paths" do
+ initializer "decidim_privacy.add_cells_view_paths", before: "decidim_core.add_cells_view_paths" do
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Privacy::Engine.root}/app/cells")
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Privacy::Engine.root}/app/views")
end