hide register/login links if registration is not open

This commit is contained in:
Silas 2023-11-25 09:28:53 -05:00
parent 5962f9eaee
commit 5b97348fb7
Signed by: silentsilas
GPG Key ID: 4199EFB7DAA34349
2 changed files with 46 additions and 42 deletions

View File

@ -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,

View File

@ -13,7 +13,9 @@
</script> </script>
</head> </head>
<body class="bg-white antialiased"> <body class="bg-white antialiased">
<%= if Application.get_env(:poex, :open_registration, false) do %>
<ul class="relative z-10 flex items-center gap-4 px-4 sm:px-6 lg:px-8 justify-end"> <ul class="relative z-10 flex items-center gap-4 px-4 sm:px-6 lg:px-8 justify-end">
<%= if @current_user do %> <%= if @current_user do %>
<li class="text-[0.8125rem] leading-6 text-zinc-900"> <li class="text-[0.8125rem] leading-6 text-zinc-900">
<%= @current_user.email %> <%= @current_user.email %>
@ -54,6 +56,7 @@
</li> </li>
<% end %> <% end %>
</ul> </ul>
<% end %>
<%= @inner_content %> <%= @inner_content %>
</body> </body>
</html> </html>