happy little changes

This commit is contained in:
Luna D 2022-03-24 17:52:57 +01:00
parent 26deaaf588
commit 962af4d29b
No known key found for this signature in database
GPG key ID: 4B1C63448394F688
3 changed files with 20 additions and 6 deletions

View file

@ -12,7 +12,7 @@ defmodule PhilomenaWeb.Admin.ApprovalController do
Image
|> where(hidden_from_users: false)
|> where(approved: false)
|> order_by(desc: :id)
|> order_by(asc: :id)
|> preload([:user, tags: [:aliases, :aliased_tag]])
|> Repo.paginate(conn.assigns.scrivener)

View file

@ -118,9 +118,14 @@
td.danger Different rating tags
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
- else
- true ->
td.success Target older
.flex.flex--column.grid--dupe-report-list__cell.border-vertical id="report_options_#{report.id}"

View file

@ -104,7 +104,16 @@ defmodule PhilomenaWeb.DuplicateReportView do
def mergeable?(%{image: image, duplicate_of_image: duplicate_of_image} = report) do
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
defp artist_tags(%{tags: tags}) do