aboutsummaryrefslogtreecommitdiff
path: root/app/views/welcome/dashboard.html.erb
blob: 242fc58daf6cc53f2e5c046ed5032631cafa6eba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<h1>Welcome <%= h current_user.name %>!</h1>

<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>
    <p><%#= @stats[:counts].map { |k,v| pluralize(k.to_s.singularize, v) }.to_sentence %></p>
    <p><%= p @stats[:count] %>
</section>

<section id="current_agent_stats">
    <h2>Current Agent: <%= current_agent %></h2>
    <p><%#= @stats[:current_agent][:counts].map { |k,v| pluralize(k.to_s.singularize, v) }.to_sentence %></p>
    <%= render partial: current_agent %>
</section>