From 5b97348fb7886c05eba901b8a6f2c5cf40a7b4b4 Mon Sep 17 00:00:00 2001 From: Silas Date: Sat, 25 Nov 2023 09:28:53 -0500 Subject: [PATCH] hide register/login links if registration is not open --- config/config.exs | 3 +- .../components/layouts/root.html.heex | 85 ++++++++++--------- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/config/config.exs b/config/config.exs index c375ef2..9f7ed6e 100644 --- a/config/config.exs +++ b/config/config.exs @@ -9,7 +9,8 @@ import Config config :poex, ecto_repos: [Poex.Repo], - generators: [timestamp_type: :utc_datetime] + generators: [timestamp_type: :utc_datetime], + open_registration: false # Configures the endpoint config :poex, PoexWeb.Endpoint, diff --git a/lib/poex_web/components/layouts/root.html.heex b/lib/poex_web/components/layouts/root.html.heex index 0ded62e..c57542a 100644 --- a/lib/poex_web/components/layouts/root.html.heex +++ b/lib/poex_web/components/layouts/root.html.heex @@ -13,47 +13,50 @@ - + <%= if Application.get_env(:poex, :open_registration, false) do %> + + <% end %> <%= @inner_content %>