<commit_before>.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
  .card-header
    - if content_for? :title
      %h1.h2-responsive.text-center
        = planting_icon
        %strong=yield :title
  = bootstrap_form_for(@planting) do |f|
    .card-body
      = required_field_help_text
      - if @planting.errors.any?
        #error_explanation
          %h2
            = pluralize(@planting.errors.size, "error")
            prohibited this planting from being saved:
          %ul
            - @planting.errors.full_messages.each do |msg|
              %li= msg

      = f.label :crop, 'What did you plant?', class: 'required'
      - if @seed.present?
        = link_to @seed, seed_path(@seed)
        = f.hidden_field :parent_seed_id, value: @seed.id
      - else
        = auto_suggest @planting, :crop, class: 'form-control', default: @crop
        %span.help-inline
          Can't find what you're looking for?
          = link_to "Request new crops.", new_crop_path

      .row
        .col-md-8
          = f.collection_radio_buttons(:garden_id, @planting.owner.gardens,
            :id, :name, required: true,
            label: 'Where did you plant it?')
          = link_to "Add a garden.", new_garden_path
        .col-md-4
          = f.text_field :planted_at,
                     value: @planting.planted_at ? @planting.planted_at.to_s(:ymd) : '',
                     class: 'add-datepicker', label: 'When?'

      .row
        .col-md-4
          = f.select(:planted_from, Planting::PLANTED_FROM_VALUES, { include_blank: '', label: 'Planted from' } )
        .col-md-4
          = f.select(:sunniness, Planting::SUNNINESS_VALUES, { include_blank: '', label: 'Sun or shade?' } )
        .col-md-4
          = f.number_field :quantity, label: 'How many?'
      = f.text_area :description, rows: 6, label: 'Tell us more about it'

      .row
        .col-md-6
          = f.check_box :finished, label: 'Mark as finished'
          %span.help-block= t('.finish_helper')
        .col-md-6
          = f.text_field :finished_at,
                     value: @planting.finished_at ? @planting.finished_at.to_s(:ymd) : '',
                     class: 'add-datepicker',
                     label: 'Finished date',
                     placeholder: 'optional'

    .card-footer
      .text-right= f.submit 'Save'
<commit_msg>only show active gardens on planting form<commit_after>.card.col-md-8.col-lg-7.mx-auto.float-none.white.z-depth-1.py-2.px-2
  .card-header
    - if content_for? :title
      %h1.h2-responsive.text-center
        = planting_icon
        %strong=yield :title
  = bootstrap_form_for(@planting) do |f|
    .card-body
      = required_field_help_text
      - if @planting.errors.any?
        #error_explanation
          %h2
            = pluralize(@planting.errors.size, "error")
            prohibited this planting from being saved:
          %ul
            - @planting.errors.full_messages.each do |msg|
              %li= msg

      = f.label :crop, 'What did you plant?', class: 'required'
      - if @seed.present?
        = link_to @seed, seed_path(@seed)
        = f.hidden_field :parent_seed_id, value: @seed.id
      - else
        = auto_suggest @planting, :crop, class: 'form-control', default: @crop
        %span.help-inline
          Can't find what you're looking for?
          = link_to "Request new crops.", new_crop_path

      .row
        .col-md-8
          = f.collection_radio_buttons(:garden_id, @planting.owner.gardens.active,
            :id, :name, required: true,
            label: 'Where did you plant it?')
          = link_to "Add a garden.", new_garden_path
        .col-md-4
          = f.text_field :planted_at,
                     value: @planting.planted_at ? @planting.planted_at.to_s(:ymd) : '',
                     class: 'add-datepicker', label: 'When?'

      .row
        .col-md-4
          = f.select(:planted_from, Planting::PLANTED_FROM_VALUES, { include_blank: '', label: 'Planted from' } )
        .col-md-4
          = f.select(:sunniness, Planting::SUNNINESS_VALUES, { include_blank: '', label: 'Sun or shade?' } )
        .col-md-4
          = f.number_field :quantity, label: 'How many?'
      = f.text_area :description, rows: 6, label: 'Tell us more about it'

      .row
        .col-md-6
          = f.check_box :finished, label: 'Mark as finished'
          %span.help-block= t('.finish_helper')
        .col-md-6
          = f.text_field :finished_at,
                     value: @planting.finished_at ? @planting.finished_at.to_s(:ymd) : '',
                     class: 'add-datepicker',
                     label: 'Finished date',
                     placeholder: 'optional'

    .card-footer
      .text-right= f.submit 'Save'

{'fraction_non_alphanumeric': 0.1299220888608128, 'fraction_numerical': 0.006738260686460307, 'mean_word_length': 1.878787878787879, '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': '2996740', 'n_tokens_mistral': 1586, 'n_tokens_neox': 1534, 'n_words': 320}