cannery/lib/cannery_web/templates/layout/topbar.html.heex
2022-02-09 00:13:12 -05:00

45 lines
1.5 KiB
Plaintext

<nav role="navigation">
<div class="flex flex-row justify-between items-center space-x-4 overflow-x-hidden">
<%= link to: Routes.live_path(CanneryWeb.Endpoint, HomeLive) do %>
<h1 class="leading-5 text-xl text-white hover:underline">
Cannery
</h1>
<% end %>
<ul class="flex flex-col sm:flex-row flex-wrap justify-center items-center
space-x-4 text-lg text-white text-ellipsis">
<%= if assigns |> Map.has_key?(:current_user) && @current_user do %>
<li>
<%= link(@current_user.email,
class: "hover:underline",
to: Routes.user_settings_path(CanneryWeb.Endpoint, :edit)
) %>
</li>
<li>
<%= link to: Routes.user_session_path(CanneryWeb.Endpoint, :delete),
method: :delete,
data: [confirm: dgettext("prompts", "Are you sure you want to log out?")] do %>
<i class="fas fa-sign-out-alt"></i>
<% end %>
</li>
<% else %>
<%= if Accounts.allow_registration?() do %>
<li>
<%= link(dgettext("actions", "Register"),
class: "hover:underline",
to: Routes.user_registration_path(CanneryWeb.Endpoint, :new)
) %>
</li>
<% end %>
<li>
<%= link(dgettext("actions", "Log in"),
class: "hover:underline",
to: Routes.user_session_path(CanneryWeb.Endpoint, :new)
) %>
</li>
<% end %>
</ul>
</div>
</nav>