From f887eb6b0536abb5ab760ab5ac33ad9f5f4226d4 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Tue, 11 Aug 2015 11:44:40 -0300 Subject: [PATCH] Improve last points in dashboard --- public/style.css | 4 ++-- test/functional/gamification_plugin_profile_controller_test.rb | 4 ++-- views/gamification/dashboard.html.erb | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/public/style.css b/public/style.css index 9bb2d27..4490baa 100644 --- a/public/style.css +++ b/public/style.css @@ -91,10 +91,10 @@ text-align: center; color: rgb(139, 139, 139); } -.gamification-dashboard .scores .negative { +.gamification-dashboard .scores .negative .value { color: red; } -.gamification-dashboard .scores .positive { +.gamification-dashboard .scores .positive .value { color: green; } .gamification-dashboard .scores .value { diff --git a/test/functional/gamification_plugin_profile_controller_test.rb b/test/functional/gamification_plugin_profile_controller_test.rb index eb324ce..8b8938c 100644 --- a/test/functional/gamification_plugin_profile_controller_test.rb +++ b/test/functional/gamification_plugin_profile_controller_test.rb @@ -14,8 +14,8 @@ class GamificationPluginProfileControllerTest < ActionController::TestCase person.add_points(20, :category => :comment_author) person.add_points(30, :category => :article_author) get :dashboard, :profile => person.identifier - assert_tag :div, :attributes => {:class => 'score article_author'}, :child => {:tag => 'span', :attributes => {:class => 'value positive'}, :content => '30'} - assert_tag :div, :attributes => {:class => 'score comment_author'}, :child => {:tag => 'span', :attributes => {:class => 'value positive'}, :content => '20'} + assert_tag :div, :attributes => {:class => 'score article_author positive'}, :child => {:tag => 'span', :attributes => {:class => 'value'}, :content => '30'} + assert_tag :div, :attributes => {:class => 'score comment_author positive'}, :child => {:tag => 'span', :attributes => {:class => 'value'}, :content => '20'} assert_tag :div, :attributes => {:class => 'score total'}, :child => {:tag => 'span', :attributes => {:class => 'value'}, :content => '50'} end diff --git a/views/gamification/dashboard.html.erb b/views/gamification/dashboard.html.erb index 6496065..2cbfba3 100644 --- a/views/gamification/dashboard.html.erb +++ b/views/gamification/dashboard.html.erb @@ -22,8 +22,9 @@

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

<% @target.score_points.order('created_at desc').limit(5).each do |point| %> -
- <%= point.num_points %> +
+ <%= point.num_points %> + <%= point.score.category %> <%= point.created_at %>
<% end %> -- libgit2 0.21.2