diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/application/_user_info.html.erb | 4 | ||||
-rw-r--r-- | app/views/welcome/dashboard.html.erb | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/app/views/application/_user_info.html.erb b/app/views/application/_user_info.html.erb index 3220c89..be3b6c5 100644 --- a/app/views/application/_user_info.html.erb +++ b/app/views/application/_user_info.html.erb @@ -3,11 +3,11 @@ <% 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 + <%#= 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("Mon compte", account_url(current_user.id)) %> <%= tag.li link_to("Terminer la session", logout_url) %> </ul> <% else %> diff --git a/app/views/welcome/dashboard.html.erb b/app/views/welcome/dashboard.html.erb index 8880434..242fc58 100644 --- a/app/views/welcome/dashboard.html.erb +++ b/app/views/welcome/dashboard.html.erb @@ -1,6 +1,12 @@ <h1>Welcome <%= h current_user.name %>!</h1> -<p>Current Agent: <%= current_agent&.name %></p> +<h3>Mes Agents</h3> + +<p><%= form_for current_agent, url: '/my/current_agent', method: :patch do |f| %> + En cours : <%= f.submit('select') %> + <%= f.select(:id, options_for_select(current_user.agents.map { |a| [a.name, a.id] }), selected: current_agent.id) %> +<% end %></p> + <section id="global_stats"> <h2>Global Count</h2> |