Permalink
Browse files

Merge pull request #1908 from javiyu/fix_model_bars

Fix percentage calculation formula
  • Loading branch information...
2 parents fddcce1 + 508584c commit 2728870ae32c3a1fb903ed736a83e684f6841979 @mshibuya mshibuya committed Feb 17, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/views/rails_admin/main/dashboard.html.haml
@@ -22,7 +22,7 @@
= t "admin.misc.ago"
%td
- count = @count[abstract_model.pretty_name]
- - percent = count > 0 ? (@max <= 1 ? count : ((Math.log(count) * 100.0) / Math.log(@max)).to_i + 1) : -1
+ - percent = count > 0 ? (@max <= 1 ? count : ((Math.log(count+1) * 100.0) / Math.log(@max+1)).to_i) : -1
.progress{:style => "margin-bottom:0px", :class => "progress-#{get_indicator(percent)} #{active && 'active progress-striped'}" }
.bar.animate-width-to{:'data-animate-length' => ([1.0, percent].max.to_i * 20), :'data-animate-width-to' => "#{[2.0, percent].max.to_i}%", :style => "width:2%"}
= @count[abstract_model.pretty_name]

0 comments on commit 2728870

Please sign in to comment.