Show log-in link in header when logged out

Except on the login page itself
This commit is contained in:
2026-08-09 14:10:00 -06:00
parent b93ddd9dbd
commit 6a32dd5ee9
+9
View File
@@ -41,6 +41,10 @@
<%= link_to "Log out", destroy_user_session_path, class: 'underline hover:text-white' %> <%= link_to "Log out", destroy_user_session_path, class: 'underline hover:text-white' %>
</span> </span>
</div> </div>
<% elsif !user_signed_in? && controller_name != 'sessions' %>
<div class="flex items-baseline text-gray-200/80 text-sm font-medium">
<%= link_to "Log in", new_user_session_path, class: 'underline hover:text-white' %>
</div>
<% end %> <% end %>
</div> </div>
<div class="-mr-2 flex md:hidden"> <div class="-mr-2 flex md:hidden">
@@ -60,6 +64,11 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg> </svg>
</button> </button>
<% elsif !user_signed_in? && controller_name != 'sessions' %>
<div class="mt-3 px-2 space-y-1">
<%= link_to "Log in", new_user_session_path,
class: 'block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-900/30 active:text-white active:bg-gray-900/30' %>
</div>
<% end %> <% end %>
</div> </div>
</div> </div>