2023-03-19 12:35:26 -04:00
|
|
|
<nav role="navigation" class="mb-8 px-8 py-4 w-full bg-primary-500">
|
2023-03-17 21:06:08 -04:00
|
|
|
<div class="flex flex-col sm:flex-row justify-between items-center">
|
|
|
|
<div class="mb-4 sm:mb-0 sm:mr-8 flex flex-row justify-start items-center space-x-2">
|
2023-04-14 23:34:11 -04:00
|
|
|
<.link navigate={~p"/"} class="inline mx-2 my-1 leading-5 text-xl text-white">
|
2023-03-17 21:06:08 -04:00
|
|
|
<img
|
2023-04-14 23:34:11 -04:00
|
|
|
src={~p"/images/cannery.svg"}
|
2023-03-17 21:06:08 -04:00
|
|
|
alt={gettext("Cannery logo")}
|
|
|
|
class="inline-block h-8 mx-1"
|
|
|
|
/>
|
|
|
|
<h1 class="inline hover:underline">Cannery</h1>
|
|
|
|
</.link>
|
|
|
|
|
|
|
|
<%= if @title_content do %>
|
|
|
|
<span class="mx-2 my-1">
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
<%= @title_content %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr class="mb-2 sm:hidden hr-light" />
|
|
|
|
|
|
|
|
<ul class="flex flex-row flex-wrap justify-center items-center
|
|
|
|
text-lg text-white text-ellipsis">
|
|
|
|
<%= if @current_user do %>
|
|
|
|
<li class="mx-2 my-1">
|
2023-04-14 23:34:11 -04:00
|
|
|
<.link navigate={~p"/tags"} class="text-white hover:underline">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= gettext("Tags") %>
|
|
|
|
</.link>
|
|
|
|
</li>
|
|
|
|
<li class="mx-2 my-1">
|
2023-04-14 23:34:11 -04:00
|
|
|
<.link navigate={~p"/containers"} class="text-white hover:underline">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= gettext("Containers") %>
|
|
|
|
</.link>
|
|
|
|
</li>
|
|
|
|
<li class="mx-2 my-1">
|
2023-04-14 23:34:11 -04:00
|
|
|
<.link navigate={~p"/catalog"} class="text-white hover:underline">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= gettext("Catalog") %>
|
|
|
|
</.link>
|
|
|
|
</li>
|
|
|
|
<li class="mx-2 my-1">
|
2023-04-14 23:34:11 -04:00
|
|
|
<.link navigate={~p"/ammo"} class="text-white hover:underline">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= gettext("Ammo") %>
|
|
|
|
</.link>
|
|
|
|
</li>
|
|
|
|
<li class="mx-2 my-1">
|
2023-04-14 23:34:11 -04:00
|
|
|
<.link navigate={~p"/range"} class="text-white hover:underline">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= gettext("Range") %>
|
|
|
|
</.link>
|
|
|
|
</li>
|
2024-02-23 21:12:25 -05:00
|
|
|
<li :if={@current_user |> Accounts.already_admin?()} class="mx-2 my-1">
|
2023-04-14 23:34:11 -04:00
|
|
|
<.link navigate={~p"/invites"} class="text-white hover:underline">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= gettext("Invites") %>
|
|
|
|
</.link>
|
|
|
|
</li>
|
|
|
|
<li class="mx-2 my-1">
|
2023-04-14 23:34:11 -04:00
|
|
|
<.link href={~p"/users/settings"} class="text-white hover:underline truncate">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= @current_user.email %>
|
|
|
|
</.link>
|
|
|
|
</li>
|
|
|
|
<li class="mx-2 my-1">
|
|
|
|
<.link
|
2023-04-14 23:34:11 -04:00
|
|
|
href={~p"/users/log_out"}
|
2023-03-17 21:06:08 -04:00
|
|
|
method="delete"
|
|
|
|
data-confirm={dgettext("prompts", "Are you sure you want to log out?")}
|
2023-03-19 12:35:26 -04:00
|
|
|
aria-label={gettext("Log out")}
|
2023-03-17 21:06:08 -04:00
|
|
|
>
|
|
|
|
<i class="fas fa-sign-out-alt"></i>
|
|
|
|
</.link>
|
|
|
|
</li>
|
|
|
|
<li
|
|
|
|
:if={
|
2024-02-23 21:12:25 -05:00
|
|
|
@current_user |> Accounts.already_admin?() and
|
2023-03-17 21:06:08 -04:00
|
|
|
function_exported?(Routes, :live_dashboard_path, 2)
|
|
|
|
}
|
|
|
|
class="mx-2 my-1"
|
|
|
|
>
|
|
|
|
<.link
|
2023-04-14 23:34:11 -04:00
|
|
|
navigate={~p"/dashboard"}
|
2023-03-17 21:06:08 -04:00
|
|
|
class="text-white hover:underline"
|
2023-03-19 12:35:26 -04:00
|
|
|
aria-label={gettext("Live Dashboard")}
|
2023-03-17 21:06:08 -04:00
|
|
|
>
|
|
|
|
<i class="fas fa-gauge"></i>
|
|
|
|
</.link>
|
|
|
|
</li>
|
|
|
|
<% else %>
|
|
|
|
<li :if={Accounts.allow_registration?()} class="mx-2 my-1">
|
2023-04-14 23:34:11 -04:00
|
|
|
<.link href={~p"/users/register"} class="text-white hover:underline truncate">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= dgettext("actions", "Register") %>
|
|
|
|
</.link>
|
|
|
|
</li>
|
|
|
|
<li class="mx-2 my-1">
|
2023-04-14 23:34:11 -04:00
|
|
|
<.link href={~p"/users/log_in"} class="text-white hover:underline truncate">
|
2023-03-17 21:06:08 -04:00
|
|
|
<%= dgettext("actions", "Log in") %>
|
|
|
|
</.link>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</nav>
|