mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +01:00
Remove remaining conn usages from log_details
This commit is contained in:
parent
cc21b402a0
commit
bb7aa0a124
2 changed files with 7 additions and 6 deletions
|
@ -51,7 +51,8 @@ defmodule PhilomenaWeb.Admin.Batch.TagController do
|
||||||
details: &log_details/3,
|
details: &log_details/3,
|
||||||
data: %{
|
data: %{
|
||||||
tag_list: tag_list,
|
tag_list: tag_list,
|
||||||
image_count: Enum.count(image_ids)
|
image_count: Enum.count(image_ids),
|
||||||
|
user: conn.assigns.current_user
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|> json(%{succeeded: image_ids, failed: []})
|
|> json(%{succeeded: image_ids, failed: []})
|
||||||
|
@ -68,10 +69,10 @@ defmodule PhilomenaWeb.Admin.Batch.TagController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, data) do
|
defp log_details(_conn, _action, data) do
|
||||||
%{
|
%{
|
||||||
body: "Batch tagged '#{data.tag_list}' on #{data.image_count} images",
|
body: "Batch tagged '#{data.tag_list}' on #{data.image_count} images",
|
||||||
subject_path: ~p"/profiles/#{conn.assigns.current_user}"
|
subject_path: ~p"/profiles/#{data.user}"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,12 +26,12 @@ defmodule PhilomenaWeb.Image.TamperController do
|
||||||
|> put_flash(:info, "Vote removed.")
|
|> put_flash(:info, "Vote removed.")
|
||||||
|> moderation_log(
|
|> moderation_log(
|
||||||
details: &log_details/3,
|
details: &log_details/3,
|
||||||
data: %{vote: result, image: image}
|
data: %{vote: result, image: image, username: conn.assigns.user.name}
|
||||||
)
|
)
|
||||||
|> redirect(to: ~p"/images/#{conn.assigns.image}")
|
|> redirect(to: ~p"/images/#{conn.assigns.image}")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, data) do
|
defp log_details(_conn, _action, data) do
|
||||||
image = data.image
|
image = data.image
|
||||||
|
|
||||||
vote_type =
|
vote_type =
|
||||||
|
@ -42,7 +42,7 @@ defmodule PhilomenaWeb.Image.TamperController do
|
||||||
end
|
end
|
||||||
|
|
||||||
%{
|
%{
|
||||||
body: "Deleted #{vote_type} by #{conn.assigns.user.name} on image >>#{data.image.id}",
|
body: "Deleted #{vote_type} by #{data.username} on image >>#{data.image.id}",
|
||||||
subject_path: ~p"/images/#{image}"
|
subject_path: ~p"/images/#{image}"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue