mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
Merge pull request #337 from mdashlw/reverse-fix
Some reverse search fixes
This commit is contained in:
commit
08d74b9be6
2 changed files with 13 additions and 3 deletions
|
@ -37,6 +37,16 @@ defmodule Philomena.DuplicateReports.SearchQuery do
|
||||||
:image_aspect_ratio,
|
:image_aspect_ratio,
|
||||||
:uploaded_image
|
:uploaded_image
|
||||||
])
|
])
|
||||||
|
|> validate_required([
|
||||||
|
:image_width,
|
||||||
|
:image_height,
|
||||||
|
:image_format,
|
||||||
|
:image_duration,
|
||||||
|
:image_mime_type,
|
||||||
|
:image_is_animated,
|
||||||
|
:image_aspect_ratio,
|
||||||
|
:uploaded_image
|
||||||
|
])
|
||||||
|> validate_number(:image_width, greater_than: 0)
|
|> validate_number(:image_width, greater_than: 0)
|
||||||
|> validate_number(:image_height, greater_than: 0)
|
|> validate_number(:image_height, greater_than: 0)
|
||||||
|> validate_inclusion(
|
|> validate_inclusion(
|
||||||
|
|
|
@ -13,7 +13,7 @@ h1 Reverse Search
|
||||||
p Upload a file from your computer, or provide a link to the page containing the image and click Fetch.
|
p Upload a file from your computer, or provide a link to the page containing the image and click Fetch.
|
||||||
.field
|
.field
|
||||||
= file_input f, :image, class: "input js-scraper"
|
= file_input f, :image, class: "input js-scraper"
|
||||||
= error_tag f, :image
|
= error_tag f, :uploaded_image
|
||||||
= error_tag f, :image_width
|
= error_tag f, :image_width
|
||||||
= error_tag f, :image_height
|
= error_tag f, :image_height
|
||||||
= error_tag f, :image_mime_type
|
= error_tag f, :image_mime_type
|
||||||
|
@ -40,7 +40,7 @@ h1 Reverse Search
|
||||||
|
|
||||||
= cond do
|
= cond do
|
||||||
- is_nil(@images) ->
|
- is_nil(@images) ->
|
||||||
|
|
||||||
- Enum.any?(@images) ->
|
- Enum.any?(@images) ->
|
||||||
h2 Results
|
h2 Results
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ h1 Reverse Search
|
||||||
th
|
th
|
||||||
th Image
|
th Image
|
||||||
th
|
th
|
||||||
|
|
||||||
= for match <- @images do
|
= for match <- @images do
|
||||||
tr
|
tr
|
||||||
th
|
th
|
||||||
|
|
Loading…
Reference in a new issue