mobilizon/lib/web/templates/email/activity/_resource_activity_item.html.heex
Thomas Citharel b315e1d7ff
refactor: use Phoenix verified routes
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-12-01 11:29:53 +01:00

89 lines
4 KiB
Plaintext

<%= case @activity.subject do %>
<% :resource_created -> %>
<%= if @activity.subject_params["is_folder"] do %>
<%= dgettext("activity", "%{profile} created the folder %{resource}.", %{
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
resource:
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
#{escape_html(@activity.subject_params["resource_title"])}
</a>"
})
|> raw %>
<% else %>
<%= dgettext("activity", "%{profile} created the resource %{resource}.", %{
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
resource:
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
#{escape_html(@activity.subject_params["resource_title"])}
</a>"
})
|> raw %>
<% end %>
<% :resource_renamed -> %>
<%= if @activity.subject_params["is_folder"] do %>
<%= dgettext(
"activity",
"%{profile} renamed the folder from %{old_resource_title} to %{resource}.",
%{
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
resource:
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
#{escape_html(@activity.subject_params["resource_title"])}
</a>",
old_resource_title:
"<b>#{escape_html(@activity.subject_params["old_resource_title"])}</b>"
}
)
|> raw %>
<% else %>
<%= dgettext(
"activity",
"%{profile} renamed the resource from %{old_resource_title} to %{resource}.",
%{
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
resource:
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
#{escape_html(@activity.subject_params["resource_title"])}
</a>",
old_resource_title:
"<b>#{escape_html(@activity.subject_params["old_resource_title"])}</b>"
}
)
|> raw %>
<% end %>
<% :resource_moved -> %>
<%= if @activity.subject_params["is_folder"] do %>
<%= dgettext("activity", "%{profile} moved the folder %{resource}.", %{
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
resource:
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
#{escape_html(@activity.subject_params["resource_title"])}
</a>"
})
|> raw %>
<% else %>
<%= dgettext("activity", "%{profile} moved the resource %{resource}.", %{
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
resource:
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
#{escape_html(@activity.subject_params["resource_title"])}
</a>"
})
|> raw %>
<% end %>
<% :resource_deleted -> %>
<%= if @activity.subject_params["is_folder"] do %>
<%= dgettext("activity", "%{profile} deleted the folder %{resource}.", %{
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
resource: "<b>#{escape_html(@activity.subject_params["resource_title"])}</b>"
})
|> raw %>
<% else %>
<%= dgettext("activity", "%{profile} deleted the resource %{resource}.", %{
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
resource: "<b>#{escape_html(@activity.subject_params["resource_title"])}</b>"
})
|> raw %>
<% end %>
<% end %>