Skip to content

Commit

Permalink
fix: show custom links to unauthenticated users (#82)
Browse files Browse the repository at this point in the history
* fix: show custom links to unauthenticated users

* fix: avoid custom links to move to the left
  • Loading branch information
darccio authored May 1, 2023
1 parent 60b0d2a commit 42f0ef9
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions app/views/application/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse mb-2 mb-md-0" id="navbarCollapse">
<% if @current_user %>
<ul class="navbar-nav me-auto">
<ul class="navbar-nav me-auto">
<% if @current_user %>
<li class="nav-item">
<span class="badge bg-info"><%= @current_user.translated_role %></span>
</li>
<% end %>
</ul>
<ul class="navbar-nav">
<% Link.all.each do |link| %>
<li class="nav-item">
<span class="badge bg-info"><%= @current_user.translated_role %></span>
<%= link_to link.name, link.url, class: 'nav-link' %>
</li>
</ul>
<ul class="navbar-nav">
<% Link.all.each do |link| %>
<li class="nav-item">
<%= link_to link.name, link.url, class: 'nav-link' %>
</li>
<% end %>
<li class="nav-item">
<%= link_to t('application.log_out'), session_path('current'), method: :delete, class: 'nav-link' %>
</li>
</ul>
<% end %>
<% end %>
<% if @current_user %>
<li class="nav-item">
<%= link_to t('application.log_out'), session_path('current'), method: :delete, class: 'nav-link' %>
</li>
<% end %>
</ul>
</div>

0 comments on commit 42f0ef9

Please sign in to comment.