clacks/lib/clacks_web/views/layout_view.ex

22 lines
432 B
Elixir
Raw Normal View History

2019-09-28 22:30:55 +00:00
defmodule ClacksWeb.LayoutView do
use ClacksWeb, :view
2020-01-16 02:24:35 +00:00
alias ClacksWeb.Router.Helpers, as: Routes
def instance_name do
Application.get_env(:clacks, :instance, %{}) |> Keyword.get(:name)
end
def login_path(conn) do
params =
case Phoenix.Controller.current_path(conn) do
"/" ->
[]
path ->
[continue: path]
end
Routes.login_path(conn, :login, params)
end
2019-09-28 22:30:55 +00:00
end