QutBioacoustics/baw-server

View on GitHub
app/views/errors/generic.html.haml

Summary

Maintainability
Test Coverage
- content_for :meta_title, @details.blank? ? 'Error' : "#{@details[:status_code]} #{@details[:phrase]}"
- content_for :page_title, @details.blank? ? 'Error' : @details[:phrase]

.col-sm-7
  - if @details.blank?
    %p Sorry, something is not right
    %p There's been an issue - don't worry, it is our fault.
    %p You could go back and try again.
  - else
    %p= @details[:message]
    - @details[:links].each do |key, value|
      %p
        - if @details[:redirect_to_url]
          %a{href: "#{value}?redirect_to=#{ERB::Util.url_encode(@details[:redirect_to_url])}"}= key
        - else
          %a{href: value}= key
    - if @details[:supported_media]
      %ul
      - @details[:supported_media].each do |category, items|
        %li= category
        %ul
          - if category == :text
            %li= '.html (text/html)'
          - items.each do |item|
            %li=".#{item.to_sym} (#{item})"

.col-sm-5
  = image_tag('bird_watcher.jpg', size: '300x300', alt: 'Birder with binoculars')