diff --git a/lib/cannery_web/templates/user_confirmation/new.html.heex b/lib/cannery_web/templates/user_confirmation/new.html.heex index f438f90..42b8ff6 100644 --- a/lib/cannery_web/templates/user_confirmation/new.html.heex +++ b/lib/cannery_web/templates/user_confirmation/new.html.heex @@ -17,10 +17,12 @@
- <%= link(dgettext("actions", "Register"), - to: Routes.user_registration_path(@conn, :new), - class: "btn btn-primary" - ) %> + <%= if Accounts.allow_registration?() do %> + <%= link(dgettext("actions", "Register"), + to: Routes.user_registration_path(@conn, :new), + class: "btn btn-primary" + ) %> + <% end %> <%= link(dgettext("actions", "Log in"), to: Routes.user_session_path(@conn, :new), class: "btn btn-primary" diff --git a/lib/cannery_web/templates/user_reset_password/edit.html.heex b/lib/cannery_web/templates/user_reset_password/edit.html.heex index c6c2fdd..6adebaf 100644 --- a/lib/cannery_web/templates/user_reset_password/edit.html.heex +++ b/lib/cannery_web/templates/user_reset_password/edit.html.heex @@ -32,10 +32,12 @@
- <%= link(dgettext("actions", "Register"), - to: Routes.user_registration_path(@conn, :new), - class: "btn btn-primary" - ) %> + <%= if Accounts.allow_registration?() do %> + <%= link(dgettext("actions", "Register"), + to: Routes.user_registration_path(@conn, :new), + class: "btn btn-primary" + ) %> + <% end %> <%= link(dgettext("actions", "Log in"), to: Routes.user_session_path(@conn, :new), class: "btn btn-primary" diff --git a/lib/cannery_web/templates/user_reset_password/new.html.heex b/lib/cannery_web/templates/user_reset_password/new.html.heex index 35e7d43..580525f 100644 --- a/lib/cannery_web/templates/user_reset_password/new.html.heex +++ b/lib/cannery_web/templates/user_reset_password/new.html.heex @@ -18,10 +18,12 @@
- <%= link(dgettext("actions", "Register"), - to: Routes.user_registration_path(@conn, :new), - class: "btn btn-primary" - ) %> + <%= if Accounts.allow_registration?() do %> + <%= link(dgettext("actions", "Register"), + to: Routes.user_registration_path(@conn, :new), + class: "btn btn-primary" + ) %> + <% end %> <%= link(dgettext("actions", "Log in"), to: Routes.user_session_path(@conn, :new), class: "btn btn-primary" diff --git a/lib/cannery_web/templates/user_session/new.html.heex b/lib/cannery_web/templates/user_session/new.html.heex index c63baa9..f0c2b81 100644 --- a/lib/cannery_web/templates/user_session/new.html.heex +++ b/lib/cannery_web/templates/user_session/new.html.heex @@ -37,10 +37,12 @@
- <%= link(dgettext("actions", "Register"), - to: Routes.user_registration_path(@conn, :new), - class: "btn btn-primary" - ) %> + <%= if Accounts.allow_registration?() do %> + <%= link(dgettext("actions", "Register"), + to: Routes.user_registration_path(@conn, :new), + class: "btn btn-primary" + ) %> + <% end %> <%= link(dgettext("actions", "Forgot your password?"), to: Routes.user_reset_password_path(@conn, :new), class: "btn btn-primary" diff --git a/lib/cannery_web/views/user_confirmation_view.ex b/lib/cannery_web/views/user_confirmation_view.ex index cca8441..08bc492 100644 --- a/lib/cannery_web/views/user_confirmation_view.ex +++ b/lib/cannery_web/views/user_confirmation_view.ex @@ -1,3 +1,4 @@ defmodule CanneryWeb.UserConfirmationView do use CanneryWeb, :view + alias Cannery.Accounts end diff --git a/lib/cannery_web/views/user_reset_password_view.ex b/lib/cannery_web/views/user_reset_password_view.ex index cc5e137..aa16a36 100644 --- a/lib/cannery_web/views/user_reset_password_view.ex +++ b/lib/cannery_web/views/user_reset_password_view.ex @@ -1,3 +1,4 @@ defmodule CanneryWeb.UserResetPasswordView do use CanneryWeb, :view + alias Cannery.Accounts end diff --git a/lib/cannery_web/views/user_session_view.ex b/lib/cannery_web/views/user_session_view.ex index 2cb6390..ef414f7 100644 --- a/lib/cannery_web/views/user_session_view.ex +++ b/lib/cannery_web/views/user_session_view.ex @@ -1,3 +1,4 @@ defmodule CanneryWeb.UserSessionView do use CanneryWeb, :view + alias Cannery.Accounts end