openaustralia/morph

View on GitHub
app/views/scrapers/_scraper.html.haml

Summary

Maintainability
Test Coverage
- highlight = {} unless defined?(highlight) && highlight

= link_to scraper, class: "list-group-item" do
  .scraper-block
    - if scraper.language.present?
      %small.scraper-lang.pull-right= scraper.language.human
    - if scraper.private?
      %i.fa.fa-lock.text-muted
    %strong.full_name= highlight[:"full_name.word_middle"] ? sanitize_highlight(highlight[:"full_name.word_middle"]) : scraper.full_name
    %div
      - if scraper.description.present?
        = highlight[:description] ? sanitize_highlight(highlight[:description]) : scraper.description
      - unless scraper.scraped_domains.empty?
        %p.scraper-domains-list.text-muted
          = highlight[:"scraped_domain_names.word_end"] ? sanitize_highlight(highlight[:"scraped_domain_names.word_end"]) : simplified_scraped_domains_list(scraper.scraped_domains.to_a)