Show all choregraphie information

This page only show choregraphie when at least one holder exists.
<% def display_holder(holder, value) begin holder_date = Time.parse(value) status = 'success' diff = (@current_time - holder_date).round(0) status = 'warning' if diff > 3600 status = 'danger' if diff > 7200 diff_txt = "#{diff % 3600} seconds" diff_txt = "#{(diff % 86400) / 3600} hours, #{diff_txt}" if diff > 3600 diff_txt = "#{diff / 86400} days, #{diff_txt}" if diff > 86400 rescue StandardError => e status = 'info' holder_date = "Cannot parse date: #{e}" diff_txt = "Error Parsing date #{value}" end ["
  • #{holder}: #{holder_date} : #{diff_txt} ago", status] end %>
    <% kv('choregraphie', recurse:true).each do |tuple| %> <% key = tuple['Key'].gsub('/', '-') if tuple['Value'].nil? json = [] holders = [] %> <% else json = JSON.parse(Base64.decode64(tuple['Value'])) holders = json['holders'] end %> <% if holders.count > 0 %>
    <%= holders.count%>/<%= json['concurrency'] %>
    <% text_result = '' clazz = 'collapse' holders.each_pair do |key,value| if value.is_a?(Hash) text_result+= "
  • #{key}:
      " value.each_pair do |k, v| res, status = display_holder(k, v) clazz = 'collapse show' unless status == 'success' text_result += res end text_result += '
  • ' else res, status = display_holder(key, value) clazz = 'collapse show' unless status == 'success' text_result << res end end %>
    <%= JSON.pretty_generate(json) %>
      <%= text_result %>
    <% end %> <% end %> <%= render_file 'common/footer.html.erb' %>