mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
find lib/ -name '*.ex' -exec sed -i 's|defp log_details(conn, |defp log_details(_conn, |g' {} \;
This commit is contained in:
parent
ae985927bd
commit
42da2725a4
39 changed files with 39 additions and 39 deletions
|
@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Admin.ArtistLink.ContactController do
|
||||||
|> redirect(to: ~p"/admin/artist_links")
|
|> redirect(to: ~p"/admin/artist_links")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, artist_link) do
|
defp log_details(_conn, _action, artist_link) do
|
||||||
%{
|
%{
|
||||||
body: "Contacted artist #{artist_link.user.name} at #{artist_link.uri}",
|
body: "Contacted artist #{artist_link.user.name} at #{artist_link.uri}",
|
||||||
subject_path: ~p"/profiles/#{artist_link.user}/artist_links/#{artist_link}"
|
subject_path: ~p"/profiles/#{artist_link.user}/artist_links/#{artist_link}"
|
||||||
|
|
|
@ -21,7 +21,7 @@ defmodule PhilomenaWeb.Admin.ArtistLink.RejectController do
|
||||||
|> redirect(to: ~p"/admin/artist_links")
|
|> redirect(to: ~p"/admin/artist_links")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, artist_link) do
|
defp log_details(_conn, _action, artist_link) do
|
||||||
%{
|
%{
|
||||||
body: "Rejected artist link #{artist_link.uri} created by #{artist_link.user.name}",
|
body: "Rejected artist link #{artist_link.uri} created by #{artist_link.user.name}",
|
||||||
subject_path: ~p"/profiles/#{artist_link.user}/artist_links/#{artist_link}"
|
subject_path: ~p"/profiles/#{artist_link.user}/artist_links/#{artist_link}"
|
||||||
|
|
|
@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Admin.ArtistLink.VerificationController do
|
||||||
|> redirect(to: ~p"/admin/artist_links")
|
|> redirect(to: ~p"/admin/artist_links")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, artist_link) do
|
defp log_details(_conn, _action, artist_link) do
|
||||||
%{
|
%{
|
||||||
body: "Verified artist link #{artist_link.uri} created by #{artist_link.user.name}",
|
body: "Verified artist link #{artist_link.uri} created by #{artist_link.user.name}",
|
||||||
subject_path: ~p"/profiles/#{artist_link.user}/artist_links/#{artist_link}"
|
subject_path: ~p"/profiles/#{artist_link.user}/artist_links/#{artist_link}"
|
||||||
|
|
|
@ -68,7 +68,7 @@ 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/#{conn.assigns.current_user}"
|
||||||
|
|
|
@ -110,7 +110,7 @@ defmodule PhilomenaWeb.Admin.FingerprintBanController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, ban) do
|
defp log_details(_conn, action, ban) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Created a fingerprint ban #{ban.generated_ban_id}"
|
:create -> "Created a fingerprint ban #{ban.generated_ban_id}"
|
||||||
|
|
|
@ -112,7 +112,7 @@ defmodule PhilomenaWeb.Admin.SubnetBanController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, ban) do
|
defp log_details(_conn, action, ban) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Created a subnet ban #{ban.generated_ban_id}"
|
:create -> "Created a subnet ban #{ban.generated_ban_id}"
|
||||||
|
|
|
@ -32,7 +32,7 @@ defmodule PhilomenaWeb.Admin.User.VerificationController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, user) do
|
defp log_details(_conn, action, user) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Granted verification to #{user.name}"
|
:create -> "Granted verification to #{user.name}"
|
||||||
|
|
|
@ -116,7 +116,7 @@ defmodule PhilomenaWeb.Admin.UserBanController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, ban) do
|
defp log_details(_conn, action, ban) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Created a user ban #{ban.generated_ban_id}"
|
:create -> "Created a user ban #{ban.generated_ban_id}"
|
||||||
|
|
|
@ -81,7 +81,7 @@ defmodule PhilomenaWeb.Admin.UserController do
|
||||||
assign(conn, :roles, Repo.all(Role))
|
assign(conn, :roles, Repo.all(Role))
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, user) do
|
defp log_details(_conn, _action, user) do
|
||||||
%{
|
%{
|
||||||
body: "Updated user details for #{user.name}",
|
body: "Updated user details for #{user.name}",
|
||||||
subject_path: ~p"/profiles/#{user}"
|
subject_path: ~p"/profiles/#{user}"
|
||||||
|
|
|
@ -30,7 +30,7 @@ defmodule PhilomenaWeb.DuplicateReport.AcceptController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, report) do
|
defp log_details(_conn, _action, report) do
|
||||||
%{
|
%{
|
||||||
body:
|
body:
|
||||||
"Accepted duplicate report, merged #{report.image.id} into #{report.duplicate_of_image.id}",
|
"Accepted duplicate report, merged #{report.image.id} into #{report.duplicate_of_image.id}",
|
||||||
|
|
|
@ -30,7 +30,7 @@ defmodule PhilomenaWeb.DuplicateReport.AcceptReverseController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, report) do
|
defp log_details(_conn, _action, report) do
|
||||||
%{
|
%{
|
||||||
body:
|
body:
|
||||||
"Reverse-accepted duplicate report, merged #{report.image.id} into #{report.duplicate_of_image.id}",
|
"Reverse-accepted duplicate report, merged #{report.image.id} into #{report.duplicate_of_image.id}",
|
||||||
|
|
|
@ -33,7 +33,7 @@ defmodule PhilomenaWeb.DuplicateReport.ClaimController do
|
||||||
|> redirect(to: ~p"/duplicate_reports")
|
|> redirect(to: ~p"/duplicate_reports")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, _) do
|
defp log_details(_conn, action, _) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Claimed a duplicate report"
|
:create -> "Claimed a duplicate report"
|
||||||
|
|
|
@ -25,7 +25,7 @@ defmodule PhilomenaWeb.DuplicateReport.RejectController do
|
||||||
|> redirect(to: ~p"/duplicate_reports")
|
|> redirect(to: ~p"/duplicate_reports")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, report) do
|
defp log_details(_conn, _action, report) do
|
||||||
%{
|
%{
|
||||||
body: "Rejected duplicate report (#{report.image.id} -> #{report.duplicate_of_image.id})",
|
body: "Rejected duplicate report (#{report.image.id} -> #{report.duplicate_of_image.id})",
|
||||||
subject_path: ~p"/duplicate_reports"
|
subject_path: ~p"/duplicate_reports"
|
||||||
|
|
|
@ -33,7 +33,7 @@ defmodule PhilomenaWeb.Image.AnonymousController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, image) do
|
defp log_details(_conn, _action, image) do
|
||||||
%{
|
%{
|
||||||
body: "Updated anonymity of image >>#{image.id}",
|
body: "Updated anonymity of image >>#{image.id}",
|
||||||
subject_path: ~p"/images/#{image}"
|
subject_path: ~p"/images/#{image}"
|
||||||
|
|
|
@ -18,7 +18,7 @@ defmodule PhilomenaWeb.Image.ApproveController do
|
||||||
|> redirect(to: ~p"/admin/approvals")
|
|> redirect(to: ~p"/admin/approvals")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, image) do
|
defp log_details(_conn, _action, image) do
|
||||||
%{body: "Approved image #{image.id}", subject_path: ~p"/images/#{image}"}
|
%{body: "Approved image #{image.id}", subject_path: ~p"/images/#{image}"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,7 +26,7 @@ defmodule PhilomenaWeb.Image.Comment.ApproveController do
|
||||||
|> redirect(to: ~p"/images/#{comment.image_id}" <> "#comment_#{comment.id}")
|
|> redirect(to: ~p"/images/#{comment.image_id}" <> "#comment_#{comment.id}")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, comment) do
|
defp log_details(_conn, _action, comment) do
|
||||||
%{
|
%{
|
||||||
body: "Approved comment on image >>#{comment.image_id}",
|
body: "Approved comment on image >>#{comment.image_id}",
|
||||||
subject_path: ~p"/images/#{comment.image_id}" <> "#comment_#{comment.id}"
|
subject_path: ~p"/images/#{comment.image_id}" <> "#comment_#{comment.id}"
|
||||||
|
|
|
@ -26,7 +26,7 @@ defmodule PhilomenaWeb.Image.Comment.DeleteController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, comment) do
|
defp log_details(_conn, _action, comment) do
|
||||||
%{
|
%{
|
||||||
body: "Destroyed comment on image >>#{comment.image_id}",
|
body: "Destroyed comment on image >>#{comment.image_id}",
|
||||||
subject_path: ~p"/images/#{comment.image_id}" <> "#comment_#{comment.id}"
|
subject_path: ~p"/images/#{comment.image_id}" <> "#comment_#{comment.id}"
|
||||||
|
|
|
@ -42,7 +42,7 @@ defmodule PhilomenaWeb.Image.Comment.HideController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, comment) do
|
defp log_details(_conn, action, comment) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Hidden comment on image >>#{comment.image_id} (#{comment.deletion_reason})"
|
:create -> "Hidden comment on image >>#{comment.image_id} (#{comment.deletion_reason})"
|
||||||
|
|
|
@ -25,7 +25,7 @@ defmodule PhilomenaWeb.Image.CommentLockController do
|
||||||
|> redirect(to: ~p"/images/#{image}")
|
|> redirect(to: ~p"/images/#{image}")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, image) do
|
defp log_details(_conn, action, image) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Locked comments on image >>#{image.id}"
|
:create -> "Locked comments on image >>#{image.id}"
|
||||||
|
|
|
@ -70,7 +70,7 @@ defmodule PhilomenaWeb.Image.DeleteController do
|
||||||
|> redirect(to: ~p"/images/#{image}")
|
|> redirect(to: ~p"/images/#{image}")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, image) do
|
defp log_details(_conn, action, image) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Hidden image >>#{image.id} (#{image.deletion_reason})"
|
:create -> "Hidden image >>#{image.id} (#{image.deletion_reason})"
|
||||||
|
|
|
@ -25,7 +25,7 @@ defmodule PhilomenaWeb.Image.DescriptionLockController do
|
||||||
|> redirect(to: ~p"/images/#{image}")
|
|> redirect(to: ~p"/images/#{image}")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, image) do
|
defp log_details(_conn, action, image) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Locked description editing on image >>#{image.id}"
|
:create -> "Locked description editing on image >>#{image.id}"
|
||||||
|
|
|
@ -38,7 +38,7 @@ defmodule PhilomenaWeb.Image.DestroyController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, image) do
|
defp log_details(_conn, _action, image) do
|
||||||
%{
|
%{
|
||||||
body: "Hard-deleted image >>#{image.id}",
|
body: "Hard-deleted image >>#{image.id}",
|
||||||
subject_path: ~p"/images/#{image}"
|
subject_path: ~p"/images/#{image}"
|
||||||
|
|
|
@ -33,7 +33,7 @@ defmodule PhilomenaWeb.Image.FeatureController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, image) do
|
defp log_details(_conn, _action, image) do
|
||||||
%{
|
%{
|
||||||
body: "Featured image >>#{image.id}",
|
body: "Featured image >>#{image.id}",
|
||||||
subject_path: ~p"/images/#{image}"
|
subject_path: ~p"/images/#{image}"
|
||||||
|
|
|
@ -16,7 +16,7 @@ defmodule PhilomenaWeb.Image.HashController do
|
||||||
|> redirect(to: ~p"/images/#{image}")
|
|> redirect(to: ~p"/images/#{image}")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, image) do
|
defp log_details(_conn, _action, image) do
|
||||||
%{
|
%{
|
||||||
body: "Cleared hash of image >>#{image.id}",
|
body: "Cleared hash of image >>#{image.id}",
|
||||||
subject_path: ~p"/images/#{image}"
|
subject_path: ~p"/images/#{image}"
|
||||||
|
|
|
@ -17,7 +17,7 @@ defmodule PhilomenaWeb.Image.RepairController do
|
||||||
|> redirect(to: ~p"/images/#{conn.assigns.image}")
|
|> redirect(to: ~p"/images/#{conn.assigns.image}")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, image) do
|
defp log_details(_conn, _action, image) do
|
||||||
%{
|
%{
|
||||||
body: "Repaired image >>#{image.id}",
|
body: "Repaired image >>#{image.id}",
|
||||||
subject_path: ~p"/images/#{image}"
|
subject_path: ~p"/images/#{image}"
|
||||||
|
|
|
@ -21,7 +21,7 @@ defmodule PhilomenaWeb.Image.ScratchpadController do
|
||||||
|> redirect(to: ~p"/images/#{image}")
|
|> redirect(to: ~p"/images/#{image}")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, image) do
|
defp log_details(_conn, _action, image) do
|
||||||
%{
|
%{
|
||||||
body: "Updated mod notes on image >>#{image.id} (#{image.scratchpad})",
|
body: "Updated mod notes on image >>#{image.id} (#{image.scratchpad})",
|
||||||
subject_path: ~p"/images/#{image}"
|
subject_path: ~p"/images/#{image}"
|
||||||
|
|
|
@ -18,7 +18,7 @@ defmodule PhilomenaWeb.Image.SourceHistoryController do
|
||||||
|> redirect(to: ~p"/images/#{image}")
|
|> redirect(to: ~p"/images/#{image}")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, image) do
|
defp log_details(_conn, _action, image) do
|
||||||
%{
|
%{
|
||||||
body: "Deleted source history for image >>#{image.id}",
|
body: "Deleted source history for image >>#{image.id}",
|
||||||
subject_path: ~p"/images/#{image}"
|
subject_path: ~p"/images/#{image}"
|
||||||
|
|
|
@ -58,7 +58,7 @@ defmodule PhilomenaWeb.Image.TagChangeController do
|
||||||
defp added_filter(query, _params),
|
defp added_filter(query, _params),
|
||||||
do: query
|
do: query
|
||||||
|
|
||||||
defp log_details(conn, _action, %{image: image, details: details}) do
|
defp log_details(_conn, _action, %{image: image, details: details}) do
|
||||||
%{
|
%{
|
||||||
body: "Deleted tag change #{details} on >>#{image.id} from history",
|
body: "Deleted tag change #{details} on >>#{image.id} from history",
|
||||||
subject_path: ~p"/images/#{image}"
|
subject_path: ~p"/images/#{image}"
|
||||||
|
|
|
@ -45,7 +45,7 @@ defmodule PhilomenaWeb.Image.TagLockController do
|
||||||
|> redirect(to: ~p"/images/#{image}")
|
|> redirect(to: ~p"/images/#{image}")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, image) do
|
defp log_details(_conn, action, image) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Locked tags on image >>#{image.id}"
|
:create -> "Locked tags on image >>#{image.id}"
|
||||||
|
|
|
@ -31,7 +31,7 @@ defmodule PhilomenaWeb.Image.TamperController do
|
||||||
|> 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 =
|
||||||
|
|
|
@ -40,7 +40,7 @@ defmodule PhilomenaWeb.Tag.ImageController do
|
||||||
|> redirect(to: ~p"/tags/#{conn.assigns.tag}")
|
|> redirect(to: ~p"/tags/#{conn.assigns.tag}")
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, tag) do
|
defp log_details(_conn, action, tag) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:update -> "Updated image on tag '#{tag.name}'"
|
:update -> "Updated image on tag '#{tag.name}'"
|
||||||
|
|
|
@ -172,7 +172,7 @@ defmodule PhilomenaWeb.TagController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, tag) do
|
defp log_details(_conn, action, tag) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:update -> "Updated details on tag '#{tag.name}'"
|
:update -> "Updated details on tag '#{tag.name}'"
|
||||||
|
|
|
@ -54,7 +54,7 @@ defmodule PhilomenaWeb.Topic.HideController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, topic) do
|
defp log_details(_conn, action, topic) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create ->
|
:create ->
|
||||||
|
|
|
@ -53,7 +53,7 @@ defmodule PhilomenaWeb.Topic.LockController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, topic) do
|
defp log_details(_conn, action, topic) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Locked topic '#{topic.title}' (#{topic.lock_reason}) in #{topic.forum.name}"
|
:create -> "Locked topic '#{topic.title}' (#{topic.lock_reason}) in #{topic.forum.name}"
|
||||||
|
|
|
@ -39,7 +39,7 @@ defmodule PhilomenaWeb.Topic.MoveController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, topic) do
|
defp log_details(_conn, _action, topic) do
|
||||||
%{
|
%{
|
||||||
body: "Topic '#{topic.title}' moved to #{topic.forum.name}",
|
body: "Topic '#{topic.title}' moved to #{topic.forum.name}",
|
||||||
subject_path: ~p"/forums/#{topic.forum}/topics/#{topic}"
|
subject_path: ~p"/forums/#{topic.forum}/topics/#{topic}"
|
||||||
|
|
|
@ -38,7 +38,7 @@ defmodule PhilomenaWeb.Topic.Post.ApproveController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, post) do
|
defp log_details(_conn, _action, post) do
|
||||||
%{
|
%{
|
||||||
body: "Approved forum post ##{post.id} in topic '#{post.topic.title}'",
|
body: "Approved forum post ##{post.id} in topic '#{post.topic.title}'",
|
||||||
subject_path:
|
subject_path:
|
||||||
|
|
|
@ -37,7 +37,7 @@ defmodule PhilomenaWeb.Topic.Post.DeleteController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, _action, post) do
|
defp log_details(_conn, _action, post) do
|
||||||
%{
|
%{
|
||||||
body: "Destroyed forum post ##{post.id} in topic '#{post.topic.title}'",
|
body: "Destroyed forum post ##{post.id} in topic '#{post.topic.title}'",
|
||||||
subject_path:
|
subject_path:
|
||||||
|
|
|
@ -63,7 +63,7 @@ defmodule PhilomenaWeb.Topic.Post.HideController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, post) do
|
defp log_details(_conn, action, post) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create ->
|
:create ->
|
||||||
|
|
|
@ -52,7 +52,7 @@ defmodule PhilomenaWeb.Topic.StickController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp log_details(conn, action, topic) do
|
defp log_details(_conn, action, topic) do
|
||||||
body =
|
body =
|
||||||
case action do
|
case action do
|
||||||
:create -> "Stickied topic '#{topic.title}' in #{topic.forum.name}"
|
:create -> "Stickied topic '#{topic.title}' in #{topic.forum.name}"
|
||||||
|
|
Loading…
Reference in a new issue