Skip to content

Commit

Permalink
Merge pull request #4100 from skateman/policy-sim-quadrant
Browse files Browse the repository at this point in the history
Use fonticons and proper tooltips in policy simulation quadrants
  • Loading branch information
martinpovolny authored Jun 12, 2018
2 parents df52bf4 + 11c2132 commit 9c81b35
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions app/helpers/quadicon_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,14 @@ def self.settings_key(klass, layout)
# Change the bottom-right quadrant of the quadicon with the policy simulation result
def policy_sim(quad, result)
if quad.try(:[], :bottom_right)
img = case result
when true then '100/check.png'
when 'N/A' then '100/na.png'
else '100/x.png'
end

quad[:bottom_right] = {
:fileicon => img,
:tooltip => result
}
quad[:bottom_right] = case result
when true
{:fonticon => 'pficon pficon-ok', :tooltip => _('Policy simulation successful.')}
when 'N/A'
{:fonticon => 'fa fa-ban', :tooltip => _('Policy simulation not applicable.')}
else
{:fonticon => 'pficon-error-circle-o', :tooltip => _('Policy simulation failed with: %{error}') % {:error => result}}
end
end
quad
end
Expand Down

0 comments on commit 9c81b35

Please sign in to comment.