% if p.state == 'Complete' %>
finished
<% elsif p.state == 'Failed' %>
failed
<% elsif p.state == 'RunningOnServer' || p.state == 'RunningOnClient' %>
running
<% else %>
<% if (p.components.select do |k,v| v[:job] end).length == 0 %>
not started
<% else %>
not running
<% end %>
<% end %>