hide register button when registration disabled

This commit is contained in:
shibao 2022-02-11 22:24:16 -05:00
parent 8795e4a98b
commit d685ca5c74
7 changed files with 27 additions and 16 deletions

View File

@ -17,10 +17,12 @@
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= 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"

View File

@ -32,10 +32,12 @@
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= 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"

View File

@ -18,10 +18,12 @@
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= 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"

View File

@ -37,10 +37,12 @@
<hr class="hr">
<div class="flex flex-row justify-center items-center space-x-4">
<%= 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"

View File

@ -1,3 +1,4 @@
defmodule CanneryWeb.UserConfirmationView do
use CanneryWeb, :view
alias Cannery.Accounts
end

View File

@ -1,3 +1,4 @@
defmodule CanneryWeb.UserResetPasswordView do
use CanneryWeb, :view
alias Cannery.Accounts
end

View File

@ -1,3 +1,4 @@
defmodule CanneryWeb.UserSessionView do
use CanneryWeb, :view
alias Cannery.Accounts
end