Skip to content

Instantly share code, notes, and snippets.

@ondrejbartas
Created April 22, 2013 13:19
Show Gist options
  • Save ondrejbartas/5434821 to your computer and use it in GitHub Desktop.
Save ondrejbartas/5434821 to your computer and use it in GitHub Desktop.
pocitani NFI
def show_nfi_tfl percent
if percent.nil?
""
elsif percent < 0
tfl = "tfl_3critical"
elsif percent < 10
tfl = "tfl_3red"
elsif percent < 20
tfl = "tfl_2yellow"
else
tfl = "tfl_1green"
end
"<span class='traffic_lights #{tfl} nfi_tfl'></span>".html_safe
end
def show_plan_real_nfi_tfl percent
if percent.nil?
""
elsif percent < 50
tfl = "tfl_3critical"
elsif percent < 80
tfl = "tfl_3red"
elsif percent < 90
tfl = "tfl_2yellow"
else
tfl = "tfl_1green"
end
"<span class='traffic_lights #{tfl} nfi_tfl'></span>".html_safe
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment