fixup! WIP

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-05-04 19:12:26 +02:00
parent b57b9a0e43
commit 92eb64feae
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
3 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ defmodule Mobilizon.Web.Email.Activity do
Map.update(acc, group_id, [activity], fn activities -> activities ++ [activity] end)
end)
|> Enum.map(fn {key, value} ->
{key, Enum.sort(value, &(&1.inserted_at <= &2.inserted_at))}
{key, Enum.sort(value, &(&1.inserted_at >= &2.inserted_at))}
end)
|> Enum.map(fn {key, value} -> {key, filter_duplicates(value)} end)
|> Enum.into(%{})

View File

@ -51,9 +51,9 @@
<%= if hd(group_activities).group.avatar do %><div style="display: inline-block;width: 100%;max-width: 91px;vertical-align: top;text-align: left;font-family: Arial,sans-serif;font-size: 14px;">
<img src="<%= hd(group_activities).group.avatar.url %>" style="width: 80%;max-width: 100px;margin-bottom: 20px;" />
</div><% end %><div style="display: inline-block;width: 100%;max-width: 350px;vertical-align: top;padding-bottom: 20px;font-family: Arial,sans-serif;font-size: 16px;line-height: 22px;padding-top: 15px;">
<p style="margin: 0;font-weight: bold;"><%= hd(group_activities).group.name || Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group) %></p>
<p style="margin: 0;font-weight: bold;"><%= hd(group_activities).group.name || "@#{Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group)}" %></p>
<%= if hd(group_activities).group.name do %>
<span style="color: #7a7a7a"><%= Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group) %></span>
<span style="color: #7a7a7a">@<%= Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group) %></span>
<% end %>
</div>
</a>

View File

@ -6,7 +6,7 @@
<%= for {_, group_activities} <- @activities do %>
==
<%= hd(group_activities).group.name || Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group) %>
<%= hd(group_activities).group.name || "@#{Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group)}" %>
<%= for activity <- Enum.take(group_activities, 5) do %>
* <%= case activity.type do %><% :discussion -> %><%= render("activity/_discussion_activity_item.text", activity: activity) %><% :event -> %><%= render("activity/_event_activity_item.text", activity: activity) %><% :group -> %><%= render("activity/_group_activity_item.text", activity: activity) %>