Skip to content

Commit

Permalink
Resolve #677
Browse files Browse the repository at this point in the history
  • Loading branch information
suninthesky committed Jul 12, 2018
1 parent 0b4c812 commit 4ac151b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ GEM
mixpanel-ruby (2.2.0)
money (6.9.0)
i18n (>= 0.6.4, < 0.9)
multi_json (1.12.1)
multi_json (1.13.1)
multi_xml (0.6.0)
netrc (0.11.0)
nio4r (2.1.0)
Expand Down Expand Up @@ -291,7 +291,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rollbar (2.15.0)
rollbar (2.16.3)
multi_json
rspec-cells (0.3.4)
cells (>= 4.0.0, < 6.0.0)
Expand Down
18 changes: 0 additions & 18 deletions app/cells/proposal_indicators_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ def eligibility_progress_bar
render view: :progress_bar, locals: {bg_color: bg_color, names: names, states: states}
end

def suitability_progress_bar
@counts = suitability_counts
@pcs = count_percentages(@counts)
bg_color = { 0 => 'bg-red', 1 => 'bg-yellow', 2 => 'bg-green', -1 => 'bg-blue' }
names = { 0 => 'unsuitable', 1 => 'fair suitability', 2 => 'suitable', -1 => 'to check' }
states = [-1, 0, 1, 2]
render view: :progress_bar, locals: {bg_color: bg_color, names: names, states: states}
end

def funds_checked
model.assessments.where("eligibility_status != #{INCOMPLETE}").size
end
Expand All @@ -37,13 +28,4 @@ def eligibility_counts
model.assessments.group(:eligibility_status).size
)
end

def suitability_counts
{
-1 => model.suitability.count{ |k, s| s.fetch('total') == nil },
0 => model.suitability.count{ |k, s| s.fetch('total') < 0.2 },
1 => model.suitability.count{ |k, s| s.fetch('total').between?(0.2, 0.5) },
2 => model.suitability.count{ |k, s| s.fetch('total') > 0.5 },
}
end
end
5 changes: 0 additions & 5 deletions app/views/proposals/_card.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
Eligibility
.col-two-thirds.fs12
= cell(:proposal_indicators, proposal).call(:eligibility_progress_bar)
.flex.mt3
.col-one-third.fs12
Suitability
.col-two-thirds.fs12
= cell(:proposal_indicators, proposal).call(:suitability_progress_bar)

.fs14.center.py15.border-top.border-silver
= link_to 'Funds', funds_path(proposal), class: 'px15'
Expand Down

0 comments on commit 4ac151b

Please sign in to comment.