2021-03-23 15:18:03 +01:00
|
|
|
<%= case @activity.subject do %>
|
2022-04-07 10:33:11 +02:00
|
|
|
<% :resource_created -> %>
|
|
|
|
<%= if @activity.subject_params["is_folder"] do %>
|
|
|
|
<%= dgettext("activity", "%{profile} created the folder %{resource}.", %{
|
2022-10-31 13:00:45 +01:00
|
|
|
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
|
2022-09-20 16:53:26 +02:00
|
|
|
resource:
|
2023-12-01 09:49:54 +01:00
|
|
|
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
|
2022-10-31 13:00:45 +01:00
|
|
|
#{escape_html(@activity.subject_params["resource_title"])}
|
2021-03-23 15:18:03 +01:00
|
|
|
</a>"
|
2022-04-07 10:33:11 +02:00
|
|
|
})
|
|
|
|
|> raw %>
|
|
|
|
<% else %>
|
|
|
|
<%= dgettext("activity", "%{profile} created the resource %{resource}.", %{
|
2022-10-31 13:00:45 +01:00
|
|
|
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
|
2022-09-20 16:53:26 +02:00
|
|
|
resource:
|
2023-12-01 09:49:54 +01:00
|
|
|
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
|
2022-10-31 13:00:45 +01:00
|
|
|
#{escape_html(@activity.subject_params["resource_title"])}
|
2021-03-23 15:18:03 +01:00
|
|
|
</a>"
|
2022-04-07 10:33:11 +02:00
|
|
|
})
|
|
|
|
|> raw %>
|
|
|
|
<% end %>
|
|
|
|
<% :resource_renamed -> %>
|
|
|
|
<%= if @activity.subject_params["is_folder"] do %>
|
|
|
|
<%= dgettext(
|
|
|
|
"activity",
|
|
|
|
"%{profile} renamed the folder from %{old_resource_title} to %{resource}.",
|
|
|
|
%{
|
2022-10-31 13:00:45 +01:00
|
|
|
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
|
2022-09-20 16:53:26 +02:00
|
|
|
resource:
|
2023-12-01 09:49:54 +01:00
|
|
|
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
|
2022-10-31 13:00:45 +01:00
|
|
|
#{escape_html(@activity.subject_params["resource_title"])}
|
2021-03-23 15:18:03 +01:00
|
|
|
</a>",
|
2022-10-31 13:00:45 +01:00
|
|
|
old_resource_title:
|
|
|
|
"<b>#{escape_html(@activity.subject_params["old_resource_title"])}</b>"
|
2022-04-07 10:33:11 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|> raw %>
|
|
|
|
<% else %>
|
|
|
|
<%= dgettext(
|
|
|
|
"activity",
|
|
|
|
"%{profile} renamed the resource from %{old_resource_title} to %{resource}.",
|
|
|
|
%{
|
2022-10-31 13:00:45 +01:00
|
|
|
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
|
2022-09-20 16:53:26 +02:00
|
|
|
resource:
|
2023-12-01 09:49:54 +01:00
|
|
|
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
|
2022-10-31 13:00:45 +01:00
|
|
|
#{escape_html(@activity.subject_params["resource_title"])}
|
2021-03-23 15:18:03 +01:00
|
|
|
</a>",
|
2022-10-31 13:00:45 +01:00
|
|
|
old_resource_title:
|
|
|
|
"<b>#{escape_html(@activity.subject_params["old_resource_title"])}</b>"
|
2022-04-07 10:33:11 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|> raw %>
|
|
|
|
<% end %>
|
|
|
|
<% :resource_moved -> %>
|
|
|
|
<%= if @activity.subject_params["is_folder"] do %>
|
|
|
|
<%= dgettext("activity", "%{profile} moved the folder %{resource}.", %{
|
2022-10-31 13:00:45 +01:00
|
|
|
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
|
2022-09-20 16:53:26 +02:00
|
|
|
resource:
|
2023-12-01 09:49:54 +01:00
|
|
|
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
|
2022-10-31 13:00:45 +01:00
|
|
|
#{escape_html(@activity.subject_params["resource_title"])}
|
2021-03-23 15:18:03 +01:00
|
|
|
</a>"
|
2022-04-07 10:33:11 +02:00
|
|
|
})
|
|
|
|
|> raw %>
|
|
|
|
<% else %>
|
|
|
|
<%= dgettext("activity", "%{profile} moved the resource %{resource}.", %{
|
2022-10-31 13:00:45 +01:00
|
|
|
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
|
2022-09-20 16:53:26 +02:00
|
|
|
resource:
|
2023-12-01 09:49:54 +01:00
|
|
|
"<a href=\"#{~p"/resource/#{@activity.subject_params["resource_uuid"]}" |> url() |> URI.decode()}\">
|
2022-10-31 13:00:45 +01:00
|
|
|
#{escape_html(@activity.subject_params["resource_title"])}
|
2021-03-23 15:18:03 +01:00
|
|
|
</a>"
|
2022-04-07 10:33:11 +02:00
|
|
|
})
|
|
|
|
|> raw %>
|
|
|
|
<% end %>
|
|
|
|
<% :resource_deleted -> %>
|
|
|
|
<%= if @activity.subject_params["is_folder"] do %>
|
|
|
|
<%= dgettext("activity", "%{profile} deleted the folder %{resource}.", %{
|
2022-10-31 13:00:45 +01:00
|
|
|
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
|
|
|
|
resource: "<b>#{escape_html(@activity.subject_params["resource_title"])}</b>"
|
2022-04-07 10:33:11 +02:00
|
|
|
})
|
|
|
|
|> raw %>
|
|
|
|
<% else %>
|
|
|
|
<%= dgettext("activity", "%{profile} deleted the resource %{resource}.", %{
|
2022-10-31 13:00:45 +01:00
|
|
|
profile: "<b>#{escaped_display_name_and_username(@activity.author)}</b>",
|
|
|
|
resource: "<b>#{escape_html(@activity.subject_params["resource_title"])}</b>"
|
2022-04-07 10:33:11 +02:00
|
|
|
})
|
|
|
|
|> raw %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|