cannery/lib/cannery_web/templates/layout/topbar.html.heex

84 lines
2.8 KiB
Plaintext
Raw Normal View History

2021-03-11 21:12:55 -05:00
<nav role="navigation">
2022-01-31 22:40:07 -05:00
<div class="flex flex-row justify-between items-center space-x-4 overflow-x-hidden">
2022-01-21 20:36:25 -05:00
<%= link to: Routes.live_path(CanneryWeb.Endpoint, HomeLive) do %>
2022-02-08 23:38:20 -05:00
<h1 class="leading-5 text-xl text-white hover:underline">
Cannery
</h1>
2021-03-11 21:12:55 -05:00
<% end %>
2021-09-10 00:28:53 -04:00
2022-01-31 22:40:07 -05:00
<ul class="flex flex-col sm:flex-row flex-wrap justify-center items-center
space-x-4 text-lg text-white text-ellipsis">
2021-03-11 21:12:55 -05:00
<%= if assigns |> Map.has_key?(:current_user) && @current_user do %>
2022-02-13 21:17:44 -05:00
<li>
<%= link(gettext("Tags"),
class: "hover:underline",
to: Routes.tag_index_path(CanneryWeb.Endpoint, :index)
) %>
</li>
<li>
<%= link(gettext("Containers"),
class: "hover:underline",
to: Routes.container_index_path(CanneryWeb.Endpoint, :index)
) %>
</li>
<li>
<%= link(gettext("Ammo"),
class: "hover:underline",
to: Routes.ammo_type_index_path(CanneryWeb.Endpoint, :index)
) %>
</li>
<li>
<%= link(gettext("Manage"),
class: "hover:underline",
to: Routes.ammo_group_index_path(CanneryWeb.Endpoint, :index)
) %>
</li>
<%= if @current_user.role == :admin do %>
<li>
<%= link(gettext("Invites"),
class: "hover:underline",
to: Routes.invite_index_path(CanneryWeb.Endpoint, :index)
) %>
</li>
<% end %>
2021-03-11 21:12:55 -05:00
<li>
2022-02-08 23:38:20 -05:00
<%= link(@current_user.email,
class: "hover:underline",
to: Routes.user_settings_path(CanneryWeb.Endpoint, :edit)
) %>
2021-03-11 21:12:55 -05:00
</li>
<li>
2022-02-08 23:38:20 -05:00
<%= link to: Routes.user_session_path(CanneryWeb.Endpoint, :delete),
method: :delete,
data: [confirm: dgettext("prompts", "Are you sure you want to log out?")] do %>
2021-09-02 23:31:15 -04:00
<i class="fas fa-sign-out-alt"></i>
<% end %>
2021-03-11 21:12:55 -05:00
</li>
2022-02-13 21:17:44 -05:00
<%= if @current_user.role == :admin and function_exported?(Routes, :live_dashboard_path, 2) do %>
<li>
<%= link to: Routes.live_dashboard_path(CanneryWeb.Endpoint, :home) do %>
<i class="fas fa-tachometer-alt"></i>
<% end %>
</li>
<% end %>
2021-03-11 21:12:55 -05:00
<% else %>
<%= if Accounts.allow_registration?() do %>
2021-09-10 00:28:53 -04:00
<li>
2022-02-08 23:38:20 -05:00
<%= link(dgettext("actions", "Register"),
class: "hover:underline",
to: Routes.user_registration_path(CanneryWeb.Endpoint, :new)
) %>
2021-09-10 00:28:53 -04:00
</li>
<% end %>
2021-03-11 21:12:55 -05:00
<li>
2022-02-08 23:38:20 -05:00
<%= link(dgettext("actions", "Log in"),
class: "hover:underline",
to: Routes.user_session_path(CanneryWeb.Endpoint, :new)
) %>
2021-03-11 21:12:55 -05:00
</li>
<% end %>
</ul>
</div>
</nav>