calraijintaiko/caltaiko

View on GitHub
app/views/performances/_show.html.haml

Summary

Maintainability
Test Coverage
- banner = image_tag(performance.banner.url(:display), itemprop: 'image')

.banner-image
  = banner
  .text.row.show-for-large-up
    .column.large-12
      %p.subtitle
        %time{ itemprop: 'startDate',
        datetime: performance.date.iso8601.to_s }
          = performance.display_datetime
      %h1.title= performance.title

.row.performance-page.article
  .column.small-12.hide-for-large-up
    %h1.article-title= performance.title

  .column.small-12.article-text
    :markdown
      #{performance.description}

  .column.small-12.large-6.performance-details
    .row
      .column.small-12.medium-6.large-12
        %h3 Where
        %p.where{ itemprop: 'location' }= performance.location

      .column.small-12.medium-6.large-12
        %h3 When
        %p= performance.display_datetime

    .icons
      .row
        - unless performance.images_link.empty?
          = link_to performance.images_link,
            class: 'column small-12 medium-6 large-12' do
            %i.fi-photo
            %span.icon-text View images from this performance!

        - unless performance.link.empty?
          = link_to performance.link,
            class: 'column small-12 medium-6 large-12' do
            %i.fi-info
            %span.icon-text Check the event page for more information!

        - if user_signed_in?
          = link_to edit_performance_path(performance),
            class: 'column small-12 medium-6 large-12' do
            %i.fi-pencil
            %span.icon-text Edit this performance

          = link_to performance_path(performance), method: :delete,
            class: 'column small-12 medium-6 large-12',
            data: { confirm: "Delete performance '#{performance.title}'?" } do
            %i.fi-trash
            %span.icon-text Delete this performance

  .column.small-12.large-6
    .performance-map
      %iframe{ width: '600', height: '450', frameborder: '0',
        style: 'border: 0', allowfullscreen: '',
        src: performance.google_maps_embed_url }