aboutsummaryrefslogtreecommitdiff
path: root/app/views/application/_user_info.html.erb
blob: 122ec191f4fe11923367bd15571a5d8cd228ffae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<section id="user_info" class="<%= current_user.present? ? 'authenticated' : 'anonymous' %>">
    <nav>
        <% if current_user.present? %>
        <a href="/my/dashboard"><%= image_tag current_user.avatar_url, alt: current_user.username %></a>
        <ul>
            <%= tag.li link_to("Ajouter un point", new_agent_resource_url(agent_id: current_agent)) %>
            <%= tag.li link_to("Terminer la session", logout_url) %>
        </ul>
        <% else %>
        <%= link_to image_tag('login.png', alt: 'Se connecter'), '/authenticate' %>
        <% end %>
    </nav>
</section>

<% content_for :debug do %>
<%= @current_user&.avatar_url %>
<% end %>