<commit_before>= content_for :title, "#{@garden.owner}'s #{@garden}"

- content_for :opengraph do
  - @garden.photos.each do |photo|
    = tag("meta", property: "og:image", content: photo.fullsize_url)
  - if @garden.description
    = tag("meta", property: "og:description", content: og_description(@garden.description))
  = tag("meta", property: "og:title", content: "#{@garden.owner}'s #{@garden}")
  = 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'])
.row
  .col-md-9
    - if can?(:edit, @garden) || can?(:delete, @garden)
      %p.btn-group
        - if can? :edit, @garden
          - if @garden.active
            = link_to new_planting_path(garden_id: @garden.id), class: 'btn btn-primary' do
              %span.glyphicon.glyphicon-grain{ title: "Plant" }
              Plant something
            = link_to "Mark as inactive", garden_path(@garden, garden: { active: 0 }),
              method: :put, class: 'btn btn-default',
              data: { confirm: 'All plantings associated with this garden will be marked as finished. Are you sure?' }
          - else
            = link_to "Mark as active", garden_path(@garden, garden: { active: 1 }),
                      method: :put,
                      class: 'btn btn-default'
          = link_to edit_garden_path(@garden), class: 'btn btn-default', id: 'edit_garden_link' do
            %span.glyphicon.glyphicon-pencil{ title: "Edit garden" }
        - if can?(:destroy, @garden)
          = link_to @garden,
                    method: :delete,
                    data: { confirm: 'All plantings associated with this garden will also be deleted. Are you sure?' },
                    class: 'btn btn-default', id: 'delete_garden_link' do
            %span.glyphicon.glyphicon-trash{ title: "Delete" }

    - unless @garden.active
      .alert.alert-warning
        This garden is inactive.
        - if can? :edit, @garden
          = link_to 'Set it to active', edit_garden_path(@garden)
          to plant something in this garden.

    %div
      :growstuff_markdown
        #{strip_tags @garden.description}
      - unless @garden.description
        .row-fluid
          %p No description available yet.

          - if can? :edit, @garden
            %p
              Why not
              = link_to 'tell us more.', edit_garden_path(@garden)

    - if @garden.photos.size.positive?
      %h3= localize_plural(@garden.photos, Photo)
      .row
        - @garden.photos.includes(:owner).each do |photo|
          .col-xs-4.col-md-2
            = render partial: 'photos/thumbnail', locals: { photo: photo }

    - if can?(:edit, @garden) && can?(:create, Photo)
      .row
        .col-md-12
          %p
            = link_to new_photo_path(type: "garden", id: @garden.id),
            class: 'btn btn-primary' do
              %span.glyphicon.glyphicon-camera{ title: "Add Photo" }
              Add Photo
    %h3 What's planted here?
    .row
      - if @garden.plantings.size.positive?
        - @garden.plantings.current.includes(:crop, :owner, :harvests, :garden).each do |planting|
          .col-xs-12.col-md-6
            = render partial: "plantings/thumbnail", locals: { planting: planting }
      - else
        .col-md-12
          %p Nothing is currently planted here.
    %h3 Previously planted in this garden
    .row
      - if @garden.plantings.finished.size.positive?
        - @garden.plantings.finished.includes(:crop, :owner, :harvests, :garden).each do |planting|
          .col-xs-12.col-md-6
            = render partial: "plantings/thumbnail", locals: { planting: planting }
      - else
        .col-md-12
          %p Nothing has been planted here.
  .col-md-3
    %h4 About this garden
    %p
      %strong Owner:
      = link_to @garden.owner, @garden.owner
    - unless @garden.location.blank?
      %p
        %strong Location:
        = @garden.location
    - unless @garden.area.blank?
      %p
        %strong Area:
        = pluralize(@garden.area, @garden.area_unit)

    %h4 "#{@garden.owner}'s gardens"
    %ul<commit_msg>Removed unnecesary div wrap<commit_after>= content_for :title, "#{@garden.owner}'s #{@garden}"

- content_for :opengraph do
  - @garden.photos.each do |photo|
    = tag("meta", property: "og:image", content: photo.fullsize_url)
  - if @garden.description
    = tag("meta", property: "og:description", content: og_description(@garden.description))
  = tag("meta", property: "og:title", content: "#{@garden.owner}'s #{@garden}")
  = 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'])
.row
  .col-md-9
    - if can?(:edit, @garden) || can?(:delete, @garden)
      %p.btn-group
        - if can? :edit, @garden
          - if @garden.active
            = link_to new_planting_path(garden_id: @garden.id), class: 'btn btn-primary' do
              %span.glyphicon.glyphicon-grain{ title: "Plant" }
              Plant something
            = link_to "Mark as inactive", garden_path(@garden, garden: { active: 0 }),
              method: :put, class: 'btn btn-default',
              data: { confirm: 'All plantings associated with this garden will be marked as finished. Are you sure?' }
          - else
            = link_to "Mark as active", garden_path(@garden, garden: { active: 1 }),
                      method: :put,
                      class: 'btn btn-default'
          = link_to edit_garden_path(@garden), class: 'btn btn-default', id: 'edit_garden_link' do
            %span.glyphicon.glyphicon-pencil{ title: "Edit garden" }
        - if can?(:destroy, @garden)
          = link_to @garden,
                    method: :delete,
                    data: { confirm: 'All plantings associated with this garden will also be deleted. Are you sure?' },
                    class: 'btn btn-default', id: 'delete_garden_link' do
            %span.glyphicon.glyphicon-trash{ title: "Delete" }

    - unless @garden.active
      .alert.alert-warning
        This garden is inactive.
        - if can? :edit, @garden
          = link_to 'Set it to active', edit_garden_path(@garden)
          to plant something in this garden.

    %div
      :growstuff_markdown
        #{strip_tags @garden.description}
      - unless @garden.description
        .row-fluid
          %p No description available yet.

          - if can? :edit, @garden
            %p
              Why not
              = link_to 'tell us more.', edit_garden_path(@garden)

    - if @garden.photos.size.positive?
      %h3= localize_plural(@garden.photos, Photo)
      .row
        - @garden.photos.includes(:owner).each do |photo|
          .col-xs-4.col-md-2
            = render partial: 'photos/thumbnail', locals: { photo: photo }

    - if can?(:edit, @garden) && can?(:create, Photo)
      .row
        .col-md-12
          %p
            = link_to new_photo_path(type: "garden", id: @garden.id),
            class: 'btn btn-primary' do
              %span.glyphicon.glyphicon-camera{ title: "Add Photo" }
              Add Photo
    %h3 What's planted here?
    .row
      - if @garden.plantings.size.positive?
        - @garden.plantings.current.includes(:crop, :owner, :harvests, :garden).each do |planting|
          .col-xs-12.col-md-6
            = render partial: "plantings/thumbnail", locals: { planting: planting }
      - else
        .col-md-12
          %p Nothing is currently planted here.
    %h3 Previously planted in this garden
    - if @garden.plantings.finished.size.positive?
      .row
        - @garden.plantings.finished.includes(:crop, :owner, :harvests, :garden).each do |planting|
          .col-xs-12.col-md-6
            = render partial: "plantings/thumbnail", locals: { planting: planting }
    - else
      %p Nothing has been planted here.
  .col-md-3
    %h4 About this garden
    %p
      %strong Owner:
      = link_to @garden.owner, @garden.owner
    - unless @garden.location.blank?
      %p
        %strong Location:
        = @garden.location
    - unless @garden.area.blank?
      %p
        %strong Area:
        = pluralize(@garden.area, @garden.area_unit)

    %h4 "#{@garden.owner}'s gardens"
    %ul
{'fraction_non_alphanumeric': 0.13464991023339318, 'fraction_numerical': 0.005266307600239378, 'mean_word_length': 2.1579743008314436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '223607', 'n_tokens_mistral': 2723, 'n_tokens_neox': 2639, 'n_words': 657}