mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-17 11:04:22 +01:00
record initial source change on upload
This commit is contained in:
parent
6d105ffc53
commit
b423f8f201
2 changed files with 6 additions and 1 deletions
|
@ -67,6 +67,11 @@ defmodule Philomena.Images do
|
|||
|> Image.cache_changeset()
|
||||
|> repo.update()
|
||||
end)
|
||||
|> Multi.run(:source_change, fn repo, %{image: image} ->
|
||||
%SourceChange{image_id: image.id, initial: true}
|
||||
|> SourceChange.creation_changeset(attrs, attribution)
|
||||
|> repo.insert()
|
||||
end)
|
||||
|> Multi.run(:added_tag_count, fn repo, %{image: image} ->
|
||||
tag_ids = image.added_tags |> Enum.map(& &1.id)
|
||||
tags = Tag |> where([t], t.id in ^tag_ids)
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
- else
|
||||
em> not provided yet
|
||||
|
||||
= if @source_change_count > 0 do
|
||||
= if @source_change_count > 1 do
|
||||
a.button.button--link.button--separate-left href=Routes.image_source_change_path(@conn, :index, @image) title="Source history"
|
||||
i.fa.fa-history>
|
||||
| History (
|
||||
|
|
Loading…
Reference in a new issue