fix post navigation

This commit is contained in:
byte[] 2019-12-08 00:12:23 -05:00
parent 2c8a5fd43d
commit 5f9fe0cb98
2 changed files with 6 additions and 1 deletions

View file

@ -15,7 +15,7 @@ h2 Search Results
= cond do = cond do
- Enum.any?(@posts) -> - Enum.any?(@posts) ->
- route = fn p -> Routes.post_path(@conn, :index, p) end - route = fn p -> Routes.post_path(@conn, :index, p) end
- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @posts, route: route, params: [cq: @conn.params["pq"]], conn: @conn - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @posts, route: route, params: [pq: @conn.params["pq"]], conn: @conn
= for {body, post} <- @posts, post.topic.hidden_from_users == false do = for {body, post} <- @posts, post.topic.hidden_from_users == false do
= render PhilomenaWeb.PostView, "_post.html", body: body, post: post, conn: @conn = render PhilomenaWeb.PostView, "_post.html", body: body, post: post, conn: @conn

View file

@ -1,10 +1,15 @@
= cond do = cond do
- Enum.any?(@images) -> - Enum.any?(@images) ->
= 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) = 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] -> - assigns[:error] ->
p p
' Oops, there was an error evaluating your query: ' Oops, there was an error evaluating your query:
pre = assigns[:error] pre = assigns[:error]
- blank?(@conn.params["q"]) ->
/ Don't render anything.
- true -> - true ->
p p
' No images found! ' No images found!