diff --git a/lib/philomena_web/controllers/search_controller.ex b/lib/philomena_web/controllers/search_controller.ex index e01284b9..d31f25c5 100644 --- a/lib/philomena_web/controllers/search_controller.ex +++ b/lib/philomena_web/controllers/search_controller.ex @@ -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 diff --git a/lib/philomena_web/templates/image/index.html.slime b/lib/philomena_web/templates/image/index.html.slime index 75b6802e..cb2c75a5 100644 --- a/lib/philomena_web/templates/image/index.html.slime +++ b/lib/philomena_web/templates/image/index.html.slime @@ -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 diff --git a/lib/philomena_web/templates/search/index.html.slime b/lib/philomena_web/templates/search/index.html.slime new file mode 100644 index 00000000..47e27c3f --- /dev/null +++ b/lib/philomena_web/templates/search/index.html.slime @@ -0,0 +1 @@ += render PhilomenaWeb.ImageView, "index.html", images: @images, route: fn p -> Routes.search_path(@conn, :index, p) end, params: [q: @search_query] \ No newline at end of file diff --git a/lib/philomena_web/views/search_view.ex b/lib/philomena_web/views/search_view.ex new file mode 100644 index 00000000..c82d11e5 --- /dev/null +++ b/lib/philomena_web/views/search_view.ex @@ -0,0 +1,3 @@ +defmodule PhilomenaWeb.SearchView do + use PhilomenaWeb, :view +end