fixup! WIP

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-05-05 18:28:42 +02:00
parent 000cb41589
commit 9799eed3b0
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
2 changed files with 10 additions and 10 deletions

View File

@ -27,13 +27,13 @@ defmodule Mobilizon.Web.Email.Activity do
instance: Config.instance_name()
)
activities = chunk_activities(activities)
chunked_activities = chunk_activities(activities)
Email.base_email(to: email, subject: subject)
|> assign(:locale, locale)
|> assign(:subject, subject)
|> assign(:activities, activities)
|> assign(:total_number_activities, map_size(activities))
|> assign(:activities, chunked_activities)
|> assign(:total_number_activities, length(activities))
|> render(:email_direct_activity)
end
@ -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

@ -33,7 +33,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width: 600px;" >
<!-- COPY -->
<tr>
<td bgcolor="#ffffff" align="left" style="padding: 20px 30px 0px 30px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;" >
<td bgcolor="#ffffff" align="left" style="padding: 20px 5% 0px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;" >
<p style="margin: 0;">
<%= dngettext("activity", "There has been an activity!", "There has been some activity!", @total_number_activities) %>
</p>
@ -43,17 +43,17 @@
<td bgcolor="#ffffff" align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" style="border-radius: 3px; text-align: left; padding: 10px 30px 0px 30px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400;line-height: 25px;" >
<td align="center" style="border-radius: 3px; text-align: left; padding: 10px 5% 0px 30px; color: #474467; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400;line-height: 25px;" >
<ul style="margin: 0 auto; padding-left: 15px;">
<%= for {_, group_activities} <- @activities do %>
<li style="list-style: none;border-bottom: solid 2px #d7d6de;padding: 10px 0;">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td align="left">
<table width="180" align="left">
<table align="left">
<tr>
<%= if hd(group_activities).group.avatar do %>
<td width="100">
<td width="85">
<a href="<%= page_url(Mobilizon.Web.Endpoint, :actor, Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group)) |> URI.decode() %>" target="_blank" style="text-decoration: none;">
<img width="80" src="<%= hd(group_activities).group.avatar.url %>" style="width: 80px;max-height: 100px;" style="margin:0; padding:0; border:none; display:block;" border="0" alt="" />
</a>
@ -63,7 +63,7 @@
<table width="" cellpadding="0" cellspacing="0" border="0" style="max-width: 400px;width: 100%;" align="left">
<tr>
<td align="left">
<a href="<%= page_url(Mobilizon.Web.Endpoint, :actor, Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group)) |> URI.decode() %>" target="_blank" style="text-decoration: none;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;display: block; color: #474467;font-family: 'Roboto', Helvetica, Arial, sans-serif;font-size: 18px;font-weight: bold;line-height: 25px;">
<a href="<%= page_url(Mobilizon.Web.Endpoint, :actor, Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group)) |> URI.decode() %>" target="_blank" style="text-decoration: none;color: #474467;font-family: 'Roboto', Helvetica, Arial, sans-serif;font-size: 18px;font-weight: bold;line-height: 25px;">
<%= hd(group_activities).group.name || "@#{Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group)}" %>
</a>
</td>
@ -71,7 +71,7 @@
<%= if hd(group_activities).group.name do %>
<tr>
<td align="left">
<a href="<%= page_url(Mobilizon.Web.Endpoint, :actor, Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group)) |> URI.decode() %>" target="_blank" style="text-decoration: none;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;display: block;color: #7a7a7a;font-family: 'Roboto', Helvetica, Arial, sans-serif;font-size: 16px;font-weight: 400;line-height: 25px;">
<a href="<%= page_url(Mobilizon.Web.Endpoint, :actor, Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group)) |> URI.decode() %>" target="_blank" style="text-decoration: none;display: block;color: #7a7a7a;font-family: 'Roboto', Helvetica, Arial, sans-serif;font-size: 16px;font-weight: 400;line-height: 25px;">
@<%= Mobilizon.Actors.Actor.preferred_username_and_domain(hd(group_activities).group) %>
</a>
</td>