mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
18 lines
393 B
Elixir
18 lines
393 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, "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
|