mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
Fix dynamic typing mistake
This commit is contained in:
parent
cc32f5d3b9
commit
3ffebd1533
2 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
= cond do
|
||||
- Enum.any?(@images) or Enum.any?(@tags, &Enum.any?(elem(&1, 0).dnp_entries)) ->
|
||||
- Enum.any?(@images) or override_display(@tags) ->
|
||||
= render PhilomenaWeb.ImageView, "index.html", conn: @conn, tags: @tags, images: @images, header: "Searching for #{@conn.params["q"]}", route: fn p -> Routes.search_path(@conn, :index, p) end, scope: scope(@conn)
|
||||
|
||||
- assigns[:error] ->
|
||||
|
|
|
@ -3,4 +3,10 @@ defmodule PhilomenaWeb.SearchView do
|
|||
|
||||
def scope(conn), do: PhilomenaWeb.ImageScope.scope(conn)
|
||||
def hides_images?(conn), do: can?(conn, :hide, %Philomena.Images.Image{})
|
||||
|
||||
def override_display([{_tag, _description, dnp_entries}]) do
|
||||
Enum.any?(dnp_entries)
|
||||
end
|
||||
|
||||
def override_display(_), do: false
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue