diff --git a/lib/chess_web/templates/game/form.html.eex b/lib/chess_web/templates/game/form.html.eex index 149bc87..7a3dd11 100644 --- a/lib/chess_web/templates/game/form.html.eex +++ b/lib/chess_web/templates/game/form.html.eex @@ -14,6 +14,6 @@
<%= link("Log in", to: session_path(@conn, :new)) %> or <%= link("Register", to: registration_path(@conn, :new)) %> to get started.
++ <%= gettext("%{login_link} or %{register_link} to get started", + login_link: login_link(@conn), + register_link: register_link(@conn)) |> raw %> +
diff --git a/lib/chess_web/views/page_view.ex b/lib/chess_web/views/page_view.ex index d2b928b..e08edcc 100644 --- a/lib/chess_web/views/page_view.ex +++ b/lib/chess_web/views/page_view.ex @@ -1,3 +1,15 @@ defmodule ChessWeb.PageView do use ChessWeb, :view + + def login_link(conn) do + gettext("Log in") + |> link(to: session_path(conn, :new)) + |> safe_to_string + end + + def register_link(conn) do + gettext("Register") + |> link(to: registration_path(conn, :new)) + |> safe_to_string + end end