mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +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)
|
||||
|> Enum.map(fn s -> %Source{image_id: target.id, source: s.source} end)
|
||||
|> Enum.uniq()
|
||||
|> Enum.take(10)
|
||||
|> Enum.take(15)
|
||||
|
||||
target
|
||||
|> Image.sources_changeset(sources)
|
||||
|
|
|
@ -212,11 +212,13 @@ defmodule Philomena.Images.Image do
|
|||
image
|
||||
|> cast(attrs, [])
|
||||
|> SourceDiffer.diff_input(old_sources, new_sources)
|
||||
|> validate_length(:sources, max: 15)
|
||||
end
|
||||
|
||||
def sources_changeset(image, new_sources) do
|
||||
change(image)
|
||||
|> put_assoc(:sources, new_sources)
|
||||
|> validate_length(:sources, max: 15)
|
||||
end
|
||||
|
||||
def tag_changeset(image, attrs, old_tags, new_tags, excluded_tags \\ []) do
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
p
|
||||
'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.
|
||||
|
||||
= inputs_for f, :sources, [as: "image[old_sources]", skip_hidden: true], fn fs ->
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
h4 About this image
|
||||
p
|
||||
'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.
|
||||
|
||||
= inputs_for f, :sources, fn fs ->
|
||||
|
|
Loading…
Reference in a new issue