add Accounts.registration_mode/0
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
daa50039a7
commit
aa5a1f30f9
@ -389,6 +389,17 @@ defmodule Memex.Accounts do
|
||||
list_users_by_role(:admin) |> Enum.empty?()
|
||||
end
|
||||
|
||||
@doc """
|
||||
Returns an atom representing the current configured registration mode
|
||||
"""
|
||||
@spec registration_mode() :: :public | :invite_only
|
||||
def registration_mode do
|
||||
case Application.get_env(:memex, Memex.Accounts)[:registration] do
|
||||
"public" -> :public
|
||||
_other -> :invite_only
|
||||
end
|
||||
end
|
||||
|
||||
@doc """
|
||||
Checks if user is an admin
|
||||
|
||||
|
@ -100,9 +100,9 @@
|
||||
<li class="flex flex-col justify-center items-center space-y-2">
|
||||
<b><%= gettext("registration:") %></b>
|
||||
<p>
|
||||
<%= case Application.get_env(:memex, Memex.Accounts)[:registration] do
|
||||
"public" -> gettext("public signups")
|
||||
_ -> gettext("invite only")
|
||||
<%= case Accounts.registration_mode() do
|
||||
:public -> gettext("public signups")
|
||||
:invite_only -> gettext("invite only")
|
||||
end %>
|
||||
</p>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user