mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
Merge pull request #285 from mdashlw/bump-max-sources
Bump max source count to 15
This commit is contained in:
commit
36efbd9eb8
4 changed files with 5 additions and 3 deletions
|
@ -937,7 +937,7 @@ defmodule Philomena.Images do
|
||||||
(source.sources ++ target.sources)
|
(source.sources ++ target.sources)
|
||||||
|> Enum.map(fn s -> %Source{image_id: target.id, source: s.source} end)
|
|> Enum.map(fn s -> %Source{image_id: target.id, source: s.source} end)
|
||||||
|> Enum.uniq()
|
|> Enum.uniq()
|
||||||
|> Enum.take(10)
|
|> Enum.take(15)
|
||||||
|
|
||||||
target
|
target
|
||||||
|> Image.sources_changeset(sources)
|
|> Image.sources_changeset(sources)
|
||||||
|
|
|
@ -212,11 +212,13 @@ defmodule Philomena.Images.Image do
|
||||||
image
|
image
|
||||||
|> cast(attrs, [])
|
|> cast(attrs, [])
|
||||||
|> SourceDiffer.diff_input(old_sources, new_sources)
|
|> SourceDiffer.diff_input(old_sources, new_sources)
|
||||||
|
|> validate_length(:sources, max: 15)
|
||||||
end
|
end
|
||||||
|
|
||||||
def sources_changeset(image, new_sources) do
|
def sources_changeset(image, new_sources) do
|
||||||
change(image)
|
change(image)
|
||||||
|> put_assoc(:sources, new_sources)
|
|> put_assoc(:sources, new_sources)
|
||||||
|
|> validate_length(:sources, max: 15)
|
||||||
end
|
end
|
||||||
|
|
||||||
def tag_changeset(image, attrs, old_tags, new_tags, excluded_tags \\ []) do
|
def tag_changeset(image, attrs, old_tags, new_tags, excluded_tags \\ []) do
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
p
|
p
|
||||||
'The page(s) you found this image on. Images may have a maximum of
|
'The page(s) you found this image on. Images may have a maximum of
|
||||||
span.js-max-source-count> 10
|
span.js-max-source-count> 15
|
||||||
' source URLs. Leave any sources you don't want to use blank.
|
' source URLs. Leave any sources you don't want to use blank.
|
||||||
|
|
||||||
= inputs_for f, :sources, [as: "image[old_sources]", skip_hidden: true], fn fs ->
|
= inputs_for f, :sources, [as: "image[old_sources]", skip_hidden: true], fn fs ->
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
h4 About this image
|
h4 About this image
|
||||||
p
|
p
|
||||||
'The page(s) you found this image on. Images may have a maximum of
|
'The page(s) you found this image on. Images may have a maximum of
|
||||||
span.js-max-source-count> 10
|
span.js-max-source-count> 15
|
||||||
' source URLs. Leave any sources you don't want to use blank.
|
' source URLs. Leave any sources you don't want to use blank.
|
||||||
|
|
||||||
= inputs_for f, :sources, fn fs ->
|
= inputs_for f, :sources, fn fs ->
|
||||||
|
|
Loading…
Reference in a new issue