fix search view

This commit is contained in:
byte[] 2019-10-08 19:50:28 -04:00
parent 0fac15353e
commit abb6d148a3
4 changed files with 7 additions and 5 deletions

View file

@ -22,15 +22,12 @@ defmodule PhilomenaWeb.SearchController do
)
conn
|> put_view(PhilomenaWeb.ImageView)
|> render("index.html", images: images, search_query: params["q"])
else
{:error, msg} ->
{:error, _msg} ->
conn
|> put_view(PhilomenaWeb.ImageView)
|> render("index.html",
images: [],
error: msg,
search_query: params["q"]
)
end

View file

@ -1,6 +1,7 @@
- header = assigns[:header] || ""
- route = assigns[:route] || fn p -> Routes.image_path(@conn, :index, p) end
- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @images, route: route
- params = assigns[:params] || []
- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @images, route: route, params: params
- info = render PhilomenaWeb.PaginationView, "_pagination_info.html", page: @images
.block#imagelist-container

View file

@ -0,0 +1 @@
= render PhilomenaWeb.ImageView, "index.html", images: @images, route: fn p -> Routes.search_path(@conn, :index, p) end, params: [q: @search_query]

View file

@ -0,0 +1,3 @@
defmodule PhilomenaWeb.SearchView do
use PhilomenaWeb, :view
end