style registration pages
This commit is contained in:
@ -1,11 +1,19 @@
|
||||
<main role="main" class="container min-h-full min-w-full">
|
||||
<p class="alert alert-info" role="alert">
|
||||
<%= get_flash(@conn, :info) %>
|
||||
</p>
|
||||
<header class="mb-4 px-8 py-4 w-full bg-primary-400">
|
||||
<%= render "topbar.html", assigns %>
|
||||
|
||||
<p class="alert alert-danger" role="alert">
|
||||
<%= get_flash(@conn, :error) %>
|
||||
</p>
|
||||
<%= 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>
|
||||
|
40
lib/lokal_web/templates/layout/topbar.html.eex
Normal file
40
lib/lokal_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(LokalWeb.Endpoint, :index) do %>
|
||||
<h1 class="leading-5 text-xl text-white hover:underline">Lokal</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(LokalWeb.Endpoint, :edit) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link "Log out", class: "hover:underline",
|
||||
to: Routes.user_session_path(LokalWeb.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(LokalWeb.Endpoint, :home) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<li>
|
||||
<%= link "Register", class: "hover:underline",
|
||||
to: Routes.user_registration_path(LokalWeb.Endpoint, :new) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link "Log in", class: "hover:underline",
|
||||
to: Routes.user_session_path(LokalWeb.Endpoint, :new) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
Reference in New Issue
Block a user