joegattnet/joegattnet_v3

View on GitHub
app/views/shared/_note_blurb.atom.slim

Summary

Maintainability
Test Coverage
- blurb_length = blurb_length || NB.blurb_length.to_i
- headline, blurb = blurb(note.main_title, note.subtitle, note.clean_body, note.introduction, blurb_length)
- image = note.resources.attached_images.first unless note.has_instruction?('hide_image')

= link_to note_or_feature_path(note), lang: lang_attr(note.lang), dir: dir_attr(note.lang) do

  - if image
    = image_tag(cut_image_binary_path(image, type: :thumbnail), alt: strip_tags(image.description))

  - elsif note.is_embeddable_source_url
    = render 'shared/media', url: note.source_url

  h2 = simple_blurbify(headline)
  = blurbify(blurb, note.books)