mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-25 04:47:59 +01:00
d1c893248d
* return hits from elasticsearch and add in sort param to templates * use returned hits from elasticsearch for navigation * mix format * fix gallery pagination * add missing fields to search help dropdown * unused variable
19 lines
427 B
Elixir
19 lines
427 B
Elixir
defmodule PhilomenaWeb.ImageScope do
|
|
def scope(conn) do
|
|
[]
|
|
|> scope(conn, "q", :q)
|
|
|> scope(conn, "sf", :sf)
|
|
|> scope(conn, "sd", :sd)
|
|
|> scope(conn, "del", :del)
|
|
|> scope(conn, "sort", :sort)
|
|
|> scope(conn, "hidden", :hidden)
|
|
end
|
|
|
|
defp scope(list, conn, key, key_atom) do
|
|
case conn.params[key] do
|
|
nil -> list
|
|
"" -> list
|
|
val -> [{key_atom, val} | list]
|
|
end
|
|
end
|
|
end
|