add routes to non liveview topbar

This commit is contained in:
shibao 2022-02-13 21:17:44 -05:00
parent df40f03589
commit 57e71fb3ac

View File

@ -9,6 +9,38 @@
<ul class="flex flex-col sm:flex-row flex-wrap justify-center items-center <ul class="flex flex-col sm:flex-row flex-wrap justify-center items-center
space-x-4 text-lg text-white text-ellipsis"> space-x-4 text-lg text-white text-ellipsis">
<%= if assigns |> Map.has_key?(:current_user) && @current_user do %> <%= if assigns |> Map.has_key?(:current_user) && @current_user do %>
<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 %>
<li> <li>
<%= link(@current_user.email, <%= link(@current_user.email,
class: "hover:underline", class: "hover:underline",
@ -22,6 +54,13 @@
<i class="fas fa-sign-out-alt"></i> <i class="fas fa-sign-out-alt"></i>
<% end %> <% end %>
</li> </li>
<%= 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 %>
<% else %> <% else %>
<%= if Accounts.allow_registration?() do %> <%= if Accounts.allow_registration?() do %>
<li> <li>