2021-03-11 21:12:55 -05:00
|
|
|
<nav role="navigation">
|
|
|
|
<div class="flex flex-row justify-between items-center space-x-4">
|
2021-09-10 00:28:53 -04:00
|
|
|
<%= link to: Routes.home_path(CanneryWeb.Endpoint, :index) do %>
|
2021-03-11 21:12:55 -05:00
|
|
|
<h1 class="leading-5 text-xl text-white hover:underline">Cannery</h1>
|
|
|
|
<% end %>
|
2021-09-10 00:28:53 -04:00
|
|
|
|
2021-03-11 21:12:55 -05: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>
|
2021-09-02 23:31:15 -04:00
|
|
|
<%= link @current_user.email, class: "hover:underline",
|
2021-03-11 21:12:55 -05:00
|
|
|
to: Routes.user_settings_path(CanneryWeb.Endpoint, :edit) %>
|
|
|
|
</li>
|
|
|
|
<li>
|
2021-09-10 00:18:15 -04:00
|
|
|
<%= link to: Routes.user_session_path(CanneryWeb.Endpoint, :delete), method: :delete,
|
|
|
|
data: [confirm: "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>
|
|
|
|
<% else %>
|
2021-09-10 00:18:15 -04:00
|
|
|
<%= if Accounts.allow_registration?() do %>
|
2021-09-10 00:28:53 -04:00
|
|
|
<li>
|
|
|
|
<%= link "Register", class: "hover:underline",
|
|
|
|
to: Routes.user_registration_path(CanneryWeb.Endpoint, :new) %>
|
|
|
|
</li>
|
2021-09-10 00:18:15 -04:00
|
|
|
<% end %>
|
|
|
|
|
2021-03-11 21:12:55 -05:00
|
|
|
<li>
|
|
|
|
<%= link "Log in", class: "hover:underline",
|
|
|
|
to: Routes.user_session_path(CanneryWeb.Endpoint, :new) %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2021-09-10 00:18:15 -04:00
|
|
|
</nav>
|