diff options
Diffstat (limited to 'app/views/application')
-rw-r--r-- | app/views/application/_user_info.html.erb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/views/application/_user_info.html.erb b/app/views/application/_user_info.html.erb new file mode 100644 index 0000000..4549684 --- /dev/null +++ b/app/views/application/_user_info.html.erb @@ -0,0 +1,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 link_to("Ajouter un point", new_resource_url) %> + <%= tag.li link_to("Mon compte", user_url(current_user.id)) %> + <%= tag.li link_to("Terminer la session", logout_url) %> + </ul> + <% else %> + <%= link_to image_tag('login.png', alt: 'Se connecter'), '/authenticate' %> + <% end %> + </nav> +</section> |