- <%= 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 35e7d432..580525f6 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 c63baa9f..f0c2b810 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 cca8441a..08bc492e 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 cc5e1378..aa16a365 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 2cb6390f..ef414f77 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