something awful login data

all the stuff to add 2 fields to the user object and to access the
logged0in user in a liveview session
This commit is contained in:
2022-07-18 15:16:57 +02:00
parent 3e8f4ef042
commit 7035fe5b2d
12 changed files with 129 additions and 62 deletions

View File

@ -1,4 +1,4 @@
<div class="user-box flex flex-wrap">
<div class="user-box">
<%= if @current_user do %>
<h4 class="w-full"><%= @current_user.email %></h4>
<%= link "Settings", class: "link",

View File

@ -5,21 +5,27 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="csrf-token" content={csrf_token_value()}>
<%= live_title_tag assigns[:page_title] || "SomethingErlang", suffix: " · Phoenix Framework" %>
<link phx-track-static rel="stylesheet" href={Routes.static_path(@conn, "/assets/app.css")}/>
<script defer phx-track-static type="text/javascript" src={Routes.static_path(@conn, "/assets/app.js")}></script>
<%= live_title_tag assigns[:page_title] || "SomethingErlang",
suffix: " · Phoenix Framework" %>
<link phx-track-static rel="stylesheet"
href={Routes.static_path(@conn, "/assets/app.css")}/>
<script defer phx-track-static type="text/javascript"
src={Routes.static_path(@conn, "/assets/app.js")}></script>
</head>
<body>
<header>
<section class="container mx-auto">
<nav class="flex space-around">
<%= if function_exported?(Routes, :live_dashboard_path, 2) do %>
<%= link "LiveDashboard", to: Routes.live_dashboard_path(@conn, :home) %>
<nav>
<div class="navbar">
<div class="navbar-start"></div>
<div class="navbar-end">
<%= if function_exported?(Routes, :live_dashboard_path, 2) do %>
<%= link "LiveDashboard",
to: Routes.live_dashboard_path(@conn, :home) %>
<% end %>
<div class="grow"></div>
<%= render "_user_menu.html", assigns %>
<%= render "_user_menu.html", assigns %>
</div>
</div>
</nav>
</section>
</header>
<%= @inner_content %>
</body>