- content_for :title, @photo.title
- content_for :opengraph do
  = tag("meta", property: "og:title", content: @photo.title)
  = tag("meta", property: "og:image", content: @photo.fullsize_url)
  = tag("meta", property: "og:image:user_generated", content: "true")
  = tag("meta", property: "og:type", content: "website")
  = tag("meta", property: "og:url", content: request.original_url)
  = tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])

- content_for :breadcrumbs do
  %li.breadcrumb-item= link_to 'Photos', photos_path
  %li.breadcrumb-item.active= link_to @photo, @photo

.row{id: "photo-#{@photo.id}"}
  .col-md-9
    %section.photo
      %h2.text-center.ellipsis
        = photo_icon
        = @photo.title

      %p.text-center
        = image_tag(@photo.fullsize_url, alt: @photo.title, class: 'rounded img-responsive shadow-sm')


    - if @crops.size.positive?
      .index-cards
        - @crops.each do |crop|
          = render 'crops/thumbnail', crop: crop
  .col-md-3
    %p
      %span.btn= render 'photos/likes', photo: @photo
      = render 'photos/actions', photo: @photo
      = link_to @photo.link_url, class: 'btn btn-info' do
        - if @photo.source == 'flickr'
          = icon 'fab', 'flickr'
        View on #{@photo.source.titleize}
      - if @photo.date_taken.present?
        %h3 Taken on #{I18n.l @photo.date_taken.to_date}

    = render @photo.owner

    %p
      %strong License:
      - if @photo.license_url
        = link_to @photo.license_name, @photo.license_url
      - else
        = @photo.license_name

    = render "associations", photo: @photo