oops_helper.rb revision 9a8554902266d182652efcc86912ec6f6620dd9a
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen return oops_request.responses.global if oops_request
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen url_for [@ontology.repository, @ontology, current_version, :oops_request]
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen url_for [@ontology.repository, @ontology] #, anchor: 'detail'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen "icon-#{icon}"
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen responses = response_scope.select('element_type, count(*) AS count').group(:element_type).order(:element_type)
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # support unknown element_types
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen (ICONS.keys + responses.map(&:element_type)).uniq.each do |type|
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen count = responses.find{|r| r.element_type == type }.try(:count) || 0
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen icon = ICONS[type] || 'question-sign'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen out << content_tag(:i, '', class: oops_icon(type))
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen out.html_safe
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen def oops_request
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen current_version.try(:request)
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen def show_oops?
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen @ontology.oops_supported? && !current_version.try(:request)