home73k/lib/home73k_web/views/layout_view.ex

22 lines
515 B
Elixir
Raw Normal View History

2021-03-28 21:12:55 -04:00
defmodule Home73kWeb.LayoutView do
use Home73kWeb, :view
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
def alert_kinds do
[
success: "alert-success",
info: "alert-info",
error: "alert-danger",
warning: "alert-warning",
primary: "alert-primary",
secondary: "alert-secondary"
]
end
2021-03-28 21:12:55 -04:00
end