2021-03-28 21:12:55 -04:00
|
|
|
defmodule Home73kWeb.LayoutView do
|
|
|
|
use Home73kWeb, :view
|
2021-03-29 11:27:44 -04:00
|
|
|
|
2021-04-03 23:22:35 -04:00
|
|
|
def navbar_fixed?(conn) do
|
2021-04-06 19:17:24 -04:00
|
|
|
[:index, :folio]
|
|
|
|
|> Enum.map(&Routes.home_path(conn, &1))
|
|
|
|
|> Enum.member?(Phoenix.Controller.current_path(conn))
|
|
|
|
end
|
|
|
|
|
|
|
|
def footer_absolute?(conn) do
|
|
|
|
[:index, :folio, :resume]
|
|
|
|
|> Enum.map(&Routes.home_path(conn, &1))
|
2021-04-03 23:22:35 -04:00
|
|
|
|> Enum.member?(Phoenix.Controller.current_path(conn))
|
|
|
|
end
|
|
|
|
|
2021-03-29 11:27:44 -04:00
|
|
|
def nav_link_opts(conn, opts) do
|
|
|
|
case Keyword.get(opts, :to) == Phoenix.Controller.current_path(conn) do
|
|
|
|
false -> opts
|
|
|
|
true -> Keyword.update(opts, :class, "active", fn c -> "#{c} active" end)
|
|
|
|
end
|
|
|
|
end
|
2021-03-28 21:12:55 -04:00
|
|
|
end
|