Commit f887eb6b0536abb5ab760ab5ac33ad9f5f4226d4
1 parent
d9a171ce
Exists in
master
and in
1 other branch
Improve last points in dashboard
Showing
3 changed files
with
7 additions
and
6 deletions
Show diff stats
public/style.css
@@ -91,10 +91,10 @@ | @@ -91,10 +91,10 @@ | ||
91 | text-align: center; | 91 | text-align: center; |
92 | color: rgb(139, 139, 139); | 92 | color: rgb(139, 139, 139); |
93 | } | 93 | } |
94 | -.gamification-dashboard .scores .negative { | 94 | +.gamification-dashboard .scores .negative .value { |
95 | color: red; | 95 | color: red; |
96 | } | 96 | } |
97 | -.gamification-dashboard .scores .positive { | 97 | +.gamification-dashboard .scores .positive .value { |
98 | color: green; | 98 | color: green; |
99 | } | 99 | } |
100 | .gamification-dashboard .scores .value { | 100 | .gamification-dashboard .scores .value { |
test/functional/gamification_plugin_profile_controller_test.rb
@@ -14,8 +14,8 @@ class GamificationPluginProfileControllerTest < ActionController::TestCase | @@ -14,8 +14,8 @@ class GamificationPluginProfileControllerTest < ActionController::TestCase | ||
14 | person.add_points(20, :category => :comment_author) | 14 | person.add_points(20, :category => :comment_author) |
15 | person.add_points(30, :category => :article_author) | 15 | person.add_points(30, :category => :article_author) |
16 | get :dashboard, :profile => person.identifier | 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 | assert_tag :div, :attributes => {:class => 'score total'}, :child => {:tag => 'span', :attributes => {:class => 'value'}, :content => '50'} | 19 | assert_tag :div, :attributes => {:class => 'score total'}, :child => {:tag => 'span', :attributes => {:class => 'value'}, :content => '50'} |
20 | end | 20 | end |
21 | 21 |
views/gamification/dashboard.html.erb
@@ -22,8 +22,9 @@ | @@ -22,8 +22,9 @@ | ||
22 | <div class="scores"> | 22 | <div class="scores"> |
23 | <h3><%= _('Last Score Points') %></h3> | 23 | <h3><%= _('Last Score Points') %></h3> |
24 | <% @target.score_points.order('created_at desc').limit(5).each do |point| %> | 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 | <span class="date timeago" title="<%= point.created_at %>"><%= point.created_at %></span> | 28 | <span class="date timeago" title="<%= point.created_at %>"><%= point.created_at %></span> |
28 | </div> | 29 | </div> |
29 | <% end %> | 30 | <% end %> |