From 8d1c08bfb4d8bd7737f419609b1bdc9fe7fd9a3e Mon Sep 17 00:00:00 2001 From: Thelonius Kort Date: Thu, 19 Jan 2023 22:16:18 +0100 Subject: [PATCH] Add a layout for the public pages --- .../components/layouts/proot.html.heex | 17 +++++++++++++++++ lib/outlook_web/router.ex | 6 +++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 lib/outlook_web/components/layouts/proot.html.heex diff --git a/lib/outlook_web/components/layouts/proot.html.heex b/lib/outlook_web/components/layouts/proot.html.heex new file mode 100644 index 0000000..da67fea --- /dev/null +++ b/lib/outlook_web/components/layouts/proot.html.heex @@ -0,0 +1,17 @@ + + + + + + + <.live_title suffix=" ยท Ausblick"> + <%= assigns[:page_title] %> + + + + + + <%= @inner_content %> + + diff --git a/lib/outlook_web/router.ex b/lib/outlook_web/router.ex index c5a9424..aaf2dd0 100644 --- a/lib/outlook_web/router.ex +++ b/lib/outlook_web/router.ex @@ -13,6 +13,10 @@ defmodule OutlookWeb.Router do plug :fetch_current_user end + pipeline :public_root_layout do + plug :put_root_layout, "proot.html" + end + pipeline :api do plug :accepts, ["json"] end @@ -101,7 +105,7 @@ defmodule OutlookWeb.Router do end scope "/", OutlookWeb do - pipe_through [:browser] + pipe_through [:browser, :public_root_layout] delete "/users/log_out", UserSessionController, :delete