mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
happy little changes
This commit is contained in:
parent
26deaaf588
commit
962af4d29b
3 changed files with 20 additions and 6 deletions
|
@ -12,7 +12,7 @@ defmodule PhilomenaWeb.Admin.ApprovalController do
|
||||||
Image
|
Image
|
||||||
|> where(hidden_from_users: false)
|
|> where(hidden_from_users: false)
|
||||||
|> where(approved: false)
|
|> where(approved: false)
|
||||||
|> order_by(desc: :id)
|
|> order_by(asc: :id)
|
||||||
|> preload([:user, tags: [:aliases, :aliased_tag]])
|
|> preload([:user, tags: [:aliases, :aliased_tag]])
|
||||||
|> Repo.paginate(conn.assigns.scrivener)
|
|> Repo.paginate(conn.assigns.scrivener)
|
||||||
|
|
||||||
|
|
|
@ -118,9 +118,14 @@
|
||||||
td.danger Different rating tags
|
td.danger Different rating tags
|
||||||
|
|
||||||
tr
|
tr
|
||||||
= if forward_merge?(report) do
|
= cond do
|
||||||
|
- not source_approved?(report) ->
|
||||||
|
td.danger Source is not approved
|
||||||
|
- not target_approved?(report) ->
|
||||||
|
td.danger Target is not approved
|
||||||
|
- forward_merge?(report) ->
|
||||||
td.warning Target newer
|
td.warning Target newer
|
||||||
- else
|
- true ->
|
||||||
td.success Target older
|
td.success Target older
|
||||||
|
|
||||||
.flex.flex--column.grid--dupe-report-list__cell.border-vertical id="report_options_#{report.id}"
|
.flex.flex--column.grid--dupe-report-list__cell.border-vertical id="report_options_#{report.id}"
|
||||||
|
|
|
@ -104,7 +104,16 @@ defmodule PhilomenaWeb.DuplicateReportView do
|
||||||
|
|
||||||
def mergeable?(%{image: image, duplicate_of_image: duplicate_of_image} = report) do
|
def mergeable?(%{image: image, duplicate_of_image: duplicate_of_image} = report) do
|
||||||
same_rating_tags?(report) and not image.hidden_from_users and
|
same_rating_tags?(report) and not image.hidden_from_users and
|
||||||
not duplicate_of_image.hidden_from_users
|
not duplicate_of_image.hidden_from_users and image.approved and
|
||||||
|
duplicate_of_image.approved
|
||||||
|
end
|
||||||
|
|
||||||
|
def source_approved?(%{image: image}) do
|
||||||
|
image.approved
|
||||||
|
end
|
||||||
|
|
||||||
|
def target_approved?(%{duplicate_of_image: image}) do
|
||||||
|
image.approved
|
||||||
end
|
end
|
||||||
|
|
||||||
defp artist_tags(%{tags: tags}) do
|
defp artist_tags(%{tags: tags}) do
|
||||||
|
|
Loading…
Reference in a new issue