memEx/lib/lokal_web/templates/layout/topbar.html.heex

42 lines
1.4 KiB
Plaintext
Raw Normal View History

2021-09-02 23:32:52 -04:00
<nav role="navigation">
<div class="flex flex-row justify-between items-center space-x-4">
2022-01-22 13:01:36 -05:00
<%= link to: Routes.live_path(LokalWeb.Endpoint, PageLive) do %>
2021-09-02 23:32:52 -04:00
<h1 class="leading-5 text-xl text-white hover:underline">Lokal</h1>
<% end %>
2022-01-22 13:01:36 -05:00
2021-09-02 23:32:52 -04:00
<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>
2022-01-22 13:01:36 -05:00
<%= @current_user.email %>
</li>
2021-09-02 23:32:52 -04:00
<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>
2022-01-22 13:01:36 -05:00
</nav>