mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
fix search view
This commit is contained in:
parent
0fac15353e
commit
abb6d148a3
4 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
1
lib/philomena_web/templates/search/index.html.slime
Normal file
1
lib/philomena_web/templates/search/index.html.slime
Normal 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]
|
3
lib/philomena_web/views/search_view.ex
Normal file
3
lib/philomena_web/views/search_view.ex
Normal file
|
@ -0,0 +1,3 @@
|
|||
defmodule PhilomenaWeb.SearchView do
|
||||
use PhilomenaWeb, :view
|
||||
end
|
Loading…
Reference in a new issue