aboutsummaryrefslogtreecommitdiff
path: root/app/views/application/_user_info.html.erb
blob: be3b6c573b5b14ce81c1c9001fdbac3c9d91254f (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(new_agent_switch_url, method: :get, remote: true, title: "Changer d'Agent") do
                       "Agent: %s" % current_agent
            end, id: 'current_agent_name') %>
            <%= tag.li agent_selector_form %>
            <%= 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>