hide register button when registration disabled
This commit is contained in:
		| @@ -17,10 +17,12 @@ | |||||||
|     <hr class="hr"> |     <hr class="hr"> | ||||||
|  |  | ||||||
|     <div class="flex flex-row justify-center items-center space-x-4"> |     <div class="flex flex-row justify-center items-center space-x-4"> | ||||||
|       <%= link(dgettext("actions", "Register"), |       <%= if Accounts.allow_registration?() do %> | ||||||
|         to: Routes.user_registration_path(@conn, :new), |         <%= link(dgettext("actions", "Register"), | ||||||
|         class: "btn btn-primary" |           to: Routes.user_registration_path(@conn, :new), | ||||||
|       ) %> |           class: "btn btn-primary" | ||||||
|  |         ) %> | ||||||
|  |       <% end %> | ||||||
|       <%= link(dgettext("actions", "Log in"), |       <%= link(dgettext("actions", "Log in"), | ||||||
|         to: Routes.user_session_path(@conn, :new), |         to: Routes.user_session_path(@conn, :new), | ||||||
|         class: "btn btn-primary" |         class: "btn btn-primary" | ||||||
|   | |||||||
| @@ -32,10 +32,12 @@ | |||||||
|     <hr class="hr"> |     <hr class="hr"> | ||||||
|  |  | ||||||
|     <div class="flex flex-row justify-center items-center space-x-4"> |     <div class="flex flex-row justify-center items-center space-x-4"> | ||||||
|       <%= link(dgettext("actions", "Register"), |       <%= if Accounts.allow_registration?() do %> | ||||||
|         to: Routes.user_registration_path(@conn, :new), |         <%= link(dgettext("actions", "Register"), | ||||||
|         class: "btn btn-primary" |           to: Routes.user_registration_path(@conn, :new), | ||||||
|       ) %> |           class: "btn btn-primary" | ||||||
|  |         ) %> | ||||||
|  |       <% end %> | ||||||
|       <%= link(dgettext("actions", "Log in"), |       <%= link(dgettext("actions", "Log in"), | ||||||
|         to: Routes.user_session_path(@conn, :new), |         to: Routes.user_session_path(@conn, :new), | ||||||
|         class: "btn btn-primary" |         class: "btn btn-primary" | ||||||
|   | |||||||
| @@ -18,10 +18,12 @@ | |||||||
|     <hr class="hr"> |     <hr class="hr"> | ||||||
|  |  | ||||||
|     <div class="flex flex-row justify-center items-center space-x-4"> |     <div class="flex flex-row justify-center items-center space-x-4"> | ||||||
|       <%= link(dgettext("actions", "Register"), |       <%= if Accounts.allow_registration?() do %> | ||||||
|         to: Routes.user_registration_path(@conn, :new), |         <%= link(dgettext("actions", "Register"), | ||||||
|         class: "btn btn-primary" |           to: Routes.user_registration_path(@conn, :new), | ||||||
|       ) %> |           class: "btn btn-primary" | ||||||
|  |         ) %> | ||||||
|  |       <% end %> | ||||||
|       <%= link(dgettext("actions", "Log in"), |       <%= link(dgettext("actions", "Log in"), | ||||||
|         to: Routes.user_session_path(@conn, :new), |         to: Routes.user_session_path(@conn, :new), | ||||||
|         class: "btn btn-primary" |         class: "btn btn-primary" | ||||||
|   | |||||||
| @@ -37,10 +37,12 @@ | |||||||
|     <hr class="hr"> |     <hr class="hr"> | ||||||
|  |  | ||||||
|     <div class="flex flex-row justify-center items-center space-x-4"> |     <div class="flex flex-row justify-center items-center space-x-4"> | ||||||
|       <%= link(dgettext("actions", "Register"), |       <%= if Accounts.allow_registration?() do %> | ||||||
|         to: Routes.user_registration_path(@conn, :new), |         <%= link(dgettext("actions", "Register"), | ||||||
|         class: "btn btn-primary" |           to: Routes.user_registration_path(@conn, :new), | ||||||
|       ) %> |           class: "btn btn-primary" | ||||||
|  |         ) %> | ||||||
|  |       <% end %> | ||||||
|       <%= link(dgettext("actions", "Forgot your password?"), |       <%= link(dgettext("actions", "Forgot your password?"), | ||||||
|         to: Routes.user_reset_password_path(@conn, :new), |         to: Routes.user_reset_password_path(@conn, :new), | ||||||
|         class: "btn btn-primary" |         class: "btn btn-primary" | ||||||
|   | |||||||
| @@ -1,3 +1,4 @@ | |||||||
| defmodule CanneryWeb.UserConfirmationView do | defmodule CanneryWeb.UserConfirmationView do | ||||||
|   use CanneryWeb, :view |   use CanneryWeb, :view | ||||||
|  |   alias Cannery.Accounts | ||||||
| end | end | ||||||
|   | |||||||
| @@ -1,3 +1,4 @@ | |||||||
| defmodule CanneryWeb.UserResetPasswordView do | defmodule CanneryWeb.UserResetPasswordView do | ||||||
|   use CanneryWeb, :view |   use CanneryWeb, :view | ||||||
|  |   alias Cannery.Accounts | ||||||
| end | end | ||||||
|   | |||||||
| @@ -1,3 +1,4 @@ | |||||||
| defmodule CanneryWeb.UserSessionView do | defmodule CanneryWeb.UserSessionView do | ||||||
|   use CanneryWeb, :view |   use CanneryWeb, :view | ||||||
|  |   alias Cannery.Accounts | ||||||
| end | end | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user