aboutsummaryrefslogtreecommitdiff
path: root/app/views/welcome/dashboard.html.erb
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2020-10-09 10:29:34 +0200
committerhellekin <hellekin@cepheide.org>2020-10-09 10:29:34 +0200
commitd242fb5bbc423876f4c192b5f133619a2d4f0113 (patch)
tree5da6478cd67c49406d8678aa7e99f949419f905c /app/views/welcome/dashboard.html.erb
parentf48ce2f4c934fde3862cdad593eececc7a567d61 (diff)
downloadincommon-map-d242fb5bbc423876f4c192b5f133619a2d4f0113.tar.gz
Scope routes to Agent
Since an Agent is required for all records, we scope the routes and get it present for free ;) This commit also adds resource views.
Diffstat (limited to 'app/views/welcome/dashboard.html.erb')
-rw-r--r--app/views/welcome/dashboard.html.erb14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/views/welcome/dashboard.html.erb b/app/views/welcome/dashboard.html.erb
index 81264e2..8880434 100644
--- a/app/views/welcome/dashboard.html.erb
+++ b/app/views/welcome/dashboard.html.erb
@@ -1,5 +1,15 @@
<h1>Welcome <%= h current_user.name %>!</h1>
-<p>Current Agent: <%= current_user&.agencies&.first&.agent&.name %></p>
+<p>Current Agent: <%= current_agent&.name %></p>
-<p>Cool, what can we do now?</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>