clacks/lib/clacks_web/views/layout_view.ex

22 lines
432 B
Elixir

defmodule ClacksWeb.LayoutView do
use ClacksWeb, :view
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
end