hide register/login links if registration is not open
This commit is contained in:
parent
5962f9eaee
commit
5b97348fb7
|
@ -9,7 +9,8 @@ import Config
|
||||||
|
|
||||||
config :poex,
|
config :poex,
|
||||||
ecto_repos: [Poex.Repo],
|
ecto_repos: [Poex.Repo],
|
||||||
generators: [timestamp_type: :utc_datetime]
|
generators: [timestamp_type: :utc_datetime],
|
||||||
|
open_registration: false
|
||||||
|
|
||||||
# Configures the endpoint
|
# Configures the endpoint
|
||||||
config :poex, PoexWeb.Endpoint,
|
config :poex, PoexWeb.Endpoint,
|
||||||
|
|
|
@ -13,47 +13,50 @@
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-white antialiased">
|
<body class="bg-white antialiased">
|
||||||
<ul class="relative z-10 flex items-center gap-4 px-4 sm:px-6 lg:px-8 justify-end">
|
<%= if Application.get_env(:poex, :open_registration, false) do %>
|
||||||
<%= if @current_user do %>
|
<ul class="relative z-10 flex items-center gap-4 px-4 sm:px-6 lg:px-8 justify-end">
|
||||||
<li class="text-[0.8125rem] leading-6 text-zinc-900">
|
|
||||||
<%= @current_user.email %>
|
<%= if @current_user do %>
|
||||||
</li>
|
<li class="text-[0.8125rem] leading-6 text-zinc-900">
|
||||||
<li>
|
<%= @current_user.email %>
|
||||||
<.link
|
</li>
|
||||||
href={~p"/users/settings"}
|
<li>
|
||||||
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
<.link
|
||||||
>
|
href={~p"/users/settings"}
|
||||||
Settings
|
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
||||||
</.link>
|
>
|
||||||
</li>
|
Settings
|
||||||
<li>
|
</.link>
|
||||||
<.link
|
</li>
|
||||||
href={~p"/users/log_out"}
|
<li>
|
||||||
method="delete"
|
<.link
|
||||||
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
href={~p"/users/log_out"}
|
||||||
>
|
method="delete"
|
||||||
Log out
|
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
||||||
</.link>
|
>
|
||||||
</li>
|
Log out
|
||||||
<% else %>
|
</.link>
|
||||||
<li>
|
</li>
|
||||||
<.link
|
<% else %>
|
||||||
href={~p"/users/register"}
|
<li>
|
||||||
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
<.link
|
||||||
>
|
href={~p"/users/register"}
|
||||||
Register
|
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
||||||
</.link>
|
>
|
||||||
</li>
|
Register
|
||||||
<li>
|
</.link>
|
||||||
<.link
|
</li>
|
||||||
href={~p"/users/log_in"}
|
<li>
|
||||||
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
<.link
|
||||||
>
|
href={~p"/users/log_in"}
|
||||||
Log in
|
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
||||||
</.link>
|
>
|
||||||
</li>
|
Log in
|
||||||
<% end %>
|
</.link>
|
||||||
</ul>
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
<%= @inner_content %>
|
<%= @inner_content %>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue