Commit f887eb6b0536abb5ab760ab5ac33ad9f5f4226d4

Authored by Victor Costa
1 parent d9a171ce

Improve last points in dashboard

public/style.css
... ... @@ -91,10 +91,10 @@
91 91 text-align: center;
92 92 color: rgb(139, 139, 139);
93 93 }
94   -.gamification-dashboard .scores .negative {
  94 +.gamification-dashboard .scores .negative .value {
95 95 color: red;
96 96 }
97   -.gamification-dashboard .scores .positive {
  97 +.gamification-dashboard .scores .positive .value {
98 98 color: green;
99 99 }
100 100 .gamification-dashboard .scores .value {
... ...
test/functional/gamification_plugin_profile_controller_test.rb
... ... @@ -14,8 +14,8 @@ class GamificationPluginProfileControllerTest < ActionController::TestCase
14 14 person.add_points(20, :category => :comment_author)
15 15 person.add_points(30, :category => :article_author)
16 16 get :dashboard, :profile => person.identifier
17   - assert_tag :div, :attributes => {:class => 'score article_author'}, :child => {:tag => 'span', :attributes => {:class => 'value positive'}, :content => '30'}
18   - assert_tag :div, :attributes => {:class => 'score comment_author'}, :child => {:tag => 'span', :attributes => {:class => 'value positive'}, :content => '20'}
  17 + assert_tag :div, :attributes => {:class => 'score article_author positive'}, :child => {:tag => 'span', :attributes => {:class => 'value'}, :content => '30'}
  18 + assert_tag :div, :attributes => {:class => 'score comment_author positive'}, :child => {:tag => 'span', :attributes => {:class => 'value'}, :content => '20'}
19 19 assert_tag :div, :attributes => {:class => 'score total'}, :child => {:tag => 'span', :attributes => {:class => 'value'}, :content => '50'}
20 20 end
21 21  
... ...
views/gamification/dashboard.html.erb
... ... @@ -22,8 +22,9 @@
22 22 <div class="scores">
23 23 <h3><%= _('Last Score Points') %></h3>
24 24 <% @target.score_points.order('created_at desc').limit(5).each do |point| %>
25   - <div class="score <%= point.score.category %>">
26   - <span class="value <%= score_point_class(point) %>"><%= point.num_points %></span>
  25 + <div class="score <%= point.score.category %> <%= score_point_class(point) %>">
  26 + <span class="value"><%= point.num_points %></span>
  27 + <span class="category"><%= point.score.category %></span>
27 28 <span class="date timeago" title="<%= point.created_at %>"><%= point.created_at %></span>
28 29 </div>
29 30 <% end %>
... ...