From 1f2171520eb4719fefc5a32f26ef2a002cd61f0d Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Thu, 11 Jun 2015 16:45:54 -0300 Subject: [PATCH] Display last score point on dashboard --- public/style.css | 9 +++++++++ views/gamification/dashboard.html.erb | 33 ++++++++++++++++++--------------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/public/style.css b/public/style.css index 8eca46e..3cb39db 100644 --- a/public/style.css +++ b/public/style.css @@ -71,3 +71,12 @@ position: absolute; left: 0; } + +.gamification .points .level { + display: inline-block; + margin: 0 30px; + vertical-align: top; +} +.gamification .points .scores { + display: inline-block; +} diff --git a/views/gamification/dashboard.html.erb b/views/gamification/dashboard.html.erb index 117e3e5..49a655f 100644 --- a/views/gamification/dashboard.html.erb +++ b/views/gamification/dashboard.html.erb @@ -7,24 +7,27 @@

<%= _('Gamification Dashboard for %s' % @target.identifier) %>

-
-

<%= _('Level') %>

- <%= level_chart(@target) %> -
- -
-

<%= _('Score') %>

- <% Merit::PointRules::AVAILABLE_RULES.each do |category, setting| %> -
- <%= _('%s: ' % category) %> - <%= @target.points(:category => category) %> +
+
+

<%= _('Level') %>

+ <%= level_chart(@target) %> +
+ <%= _('Total: ') %> + <%= @target.points %>
- <% end %> -
- <%= _('Total: ') %> - <%= @target.points %> +
+ +
+

<%= _('Last Score Points') %>

+ <% @target.score_points.order('created_at desc').limit(5).each do |point| %> +
+ <%= _('%s: ' % point.num_points ) %> + <%= point.created_at %> +
+ <% end %>
+

<%= _('Badges') %>

    -- libgit2 0.21.2