shift73k/lib/shift73k_web/views/layout_view.ex

25 lines
575 B
Elixir
Raw Normal View History

2021-03-05 19:23:32 -05:00
defmodule Shift73kWeb.LayoutView do
use Shift73kWeb, :view
2021-03-05 19:23:32 -05:00
alias Shift73k.Accounts.User
alias Shift73kWeb.Roles
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
[
2021-03-03 16:52:26 -05:00
success: "alert-success",
info: "alert-info",
error: "alert-danger",
warning: "alert-warning",
primary: "alert-primary",
secondary: "alert-secondary"
]
end
2021-02-24 07:49:39 -05:00
end