Don't show search link if logged out

This commit is contained in:
Shadowfacts 2020-04-26 16:52:03 -04:00
parent 1a1a58cb82
commit 803fc4c36e
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 4 additions and 2 deletions

View File

@ -13,12 +13,14 @@
<nav role="navigation">
<ul>
<li><a href="/"><%= instance_name() %></a></li>
<li><a href="<%= Routes.frontend_path(@conn, :search) %>">Search</a></li>
<%= if @conn.assigns[:user] do %>
<li><a href="<%= Routes.frontend_path(@conn, :search) %>">Search</a></li>
<% end %>
</ul>
<ul>
<%= if @conn.assigns[:user] do %>
<li>
Logged in as <a href="<%= Routes.actor_path(@conn, :get, @conn.assigns[:user].username) %>"><%= @conn.assigns[:user].username %></a>.
Logged in as <a href="<%= Routes.actor_path(@conn, :get, @user.username) %>"><%= @user.username %></a>.
</li>
<li>
<%= form_for @conn, Routes.login_path(@conn, :logout), [method: :post], fn f -> %>