stevegrossi/stevegrossi

View on GitHub
app/views/posts/show.html.slim

Summary

Maintainability
Test Coverage
- provide :title, @post.title
- provide :description, @post.idea
- provide :main_class, "MainContent--reader"

header.FullPost-header
  - if @post.book_post?
    a.Cover href="#book"
      = image_tag(@post.book.cover_url, alt: '', width: 100)
  div
    h1.FullPost-title = @post.title
    - if @post.subtitle.present?
      h2.FullPost-subtitle = @post.subtitle
  p.FullPost-date
    = @post.pretty_published_at
  p.FullPost-summary = @post.idea

article = markdown(@post.content)

- if @post.book_post?
  footer#book.MediaElement.Article
    = image_tag(@post.book.cover_url, alt: '', class: "MediaElement-media Cover")
    div.MediaElement-content
      div.Article-title = @post.book.title
      div = linked_author_list(@post.book)
      div.Article-meta
        = "#{ @post.book.publisher }, #{ @post.book.pub_year }"
        - if @post.book.asin.present?
          |  • 
          = link_to('Purchase', "http://www.amazon.com/gp/product/#{ @post.book.asin }?ie=UTF8&tag=stevgros-20")

= render 'shared/disqus', commentable: @post