Improve list view and add cookie

This commit is contained in:
2023-11-27 16:49:59 +00:00
committed by Daniel Patterson
parent e31db2f5e8
commit cb7c15c345
5 changed files with 129 additions and 59 deletions

16
lib/wish_web/layout.ex Normal file
View File

@@ -0,0 +1,16 @@
defmodule WishWeb.Plug.GetLayoutFromCookie do
import Plug.Conn
def init(_) do
%{}
end
def call(conn, _opts) do
conn = fetch_cookies(conn)
case conn.cookies["user_display"] do
nil -> conn
other -> conn |> put_session(:user_display, other)
end
end
end