initial commit
This commit is contained in:
19
lib/cannery_web/templates/layout/app.html.eex
Normal file
19
lib/cannery_web/templates/layout/app.html.eex
Normal file
@ -0,0 +1,19 @@
|
||||
<main role="main" class="container min-h-full min-w-full">
|
||||
<header class="mb-4 px-8 py-4 w-full bg-primary-400">
|
||||
<%= render "topbar.html", assigns %>
|
||||
|
||||
<%= if get_flash(@conn, :info) do %>
|
||||
<p class="alert alert-info" role="alert">
|
||||
<%= get_flash(@conn, :info) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= if get_flash(@conn, :error) do %>
|
||||
<p class="alert alert-danger" role="alert">
|
||||
<%= get_flash(@conn, :error) %>
|
||||
</p>
|
||||
<% end %>
|
||||
</header>
|
||||
|
||||
<%= @inner_content %>
|
||||
</main>
|
5
lib/cannery_web/templates/layout/live.html.leex
Normal file
5
lib/cannery_web/templates/layout/live.html.leex
Normal file
@ -0,0 +1,5 @@
|
||||
<main role="main" class="container min-w-full min-h-full">
|
||||
<%= live_component CanneryWeb.Live.Component.Topbar %>
|
||||
|
||||
<%= @inner_content %>
|
||||
</main>
|
15
lib/cannery_web/templates/layout/root.html.leex
Normal file
15
lib/cannery_web/templates/layout/root.html.leex
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<%= csrf_meta_tag() %>
|
||||
<%= live_title_tag assigns[:page_title] || "Cannery", suffix: "" %>
|
||||
<link phx-track-static rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
|
||||
<script defer phx-track-static type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
|
||||
</head>
|
||||
<body class="m-0 p-0 min-w-full min-h-full">
|
||||
<%= @inner_content %>
|
||||
</body>
|
||||
</html>
|
40
lib/cannery_web/templates/layout/topbar.html.eex
Normal file
40
lib/cannery_web/templates/layout/topbar.html.eex
Normal file
@ -0,0 +1,40 @@
|
||||
<nav role="navigation">
|
||||
<div class="flex flex-row justify-between items-center space-x-4">
|
||||
<%= link to: Routes.page_path(CanneryWeb.Endpoint, :index) do %>
|
||||
<h1 class="leading-5 text-xl text-white hover:underline">Cannery</h1>
|
||||
<% end %>
|
||||
|
||||
<ul class="flex flex-row flex-wrap justify-center items-center
|
||||
space-x-4 text-lg text-white">
|
||||
<%# user settings %>
|
||||
<%= if assigns |> Map.has_key?(:current_user) && @current_user do %>
|
||||
<li>
|
||||
<%= @current_user.email %></li>
|
||||
<li>
|
||||
<%= link "Settings", class: "hover:underline",
|
||||
to: Routes.user_settings_path(CanneryWeb.Endpoint, :edit) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link "Log out", class: "hover:underline",
|
||||
to: Routes.user_session_path(CanneryWeb.Endpoint, :delete), method: :delete %>
|
||||
</li>
|
||||
|
||||
<%= if function_exported?(Routes, :live_dashboard_path, 2) do %>
|
||||
<li>
|
||||
<%= link "LiveDashboard", class: "hover:underline",
|
||||
to: Routes.live_dashboard_path(CanneryWeb.Endpoint, :home) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<li>
|
||||
<%= link "Register", class: "hover:underline",
|
||||
to: Routes.user_registration_path(CanneryWeb.Endpoint, :new) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link "Log in", class: "hover:underline",
|
||||
to: Routes.user_session_path(CanneryWeb.Endpoint, :new) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
Reference in New Issue
Block a user