Don't show search link if logged out
This commit is contained in:
parent
1a1a58cb82
commit
803fc4c36e
|
@ -13,12 +13,14 @@
|
||||||
<nav role="navigation">
|
<nav role="navigation">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/"><%= instance_name() %></a></li>
|
<li><a href="/"><%= instance_name() %></a></li>
|
||||||
|
<%= if @conn.assigns[:user] do %>
|
||||||
<li><a href="<%= Routes.frontend_path(@conn, :search) %>">Search</a></li>
|
<li><a href="<%= Routes.frontend_path(@conn, :search) %>">Search</a></li>
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<%= if @conn.assigns[:user] do %>
|
<%= if @conn.assigns[:user] do %>
|
||||||
<li>
|
<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>
|
||||||
<li>
|
<li>
|
||||||
<%= form_for @conn, Routes.login_path(@conn, :logout), [method: :post], fn f -> %>
|
<%= form_for @conn, Routes.login_path(@conn, :logout), [method: :post], fn f -> %>
|
||||||
|
|
Loading…
Reference in New Issue