<commit_before>.invoices

  =form_for @invoice do |f|

    =error_messages_for @invoice.credit_card||@cc
    =error_messages_for @invoice

    -@credit_card = (@invoice.credit_card||current_group.credit_card||@cc||CreditCard.new)
    -if @credit_card.remember
      Using credit card ending in
      = @credit_card.ending_in
      = link_to "change", "#", :id => "show_credit_card_info"

    .invoice_info
      .brand
        =image_tag "logo.png"

      .references
        %p.reference
          %strong Invoice reference:
          =@invoice.order_number
        %p
          %strong Date:
          =@invoice.created_at
        %p
          %strong Valid until:
          =@invoice.created_at+1.month
      .clear

    -if @invoice.items.first["item_class"] == "ShapadoVersion"
      -version = ShapadoVersion.find(@invoice.items.first["item_id"])
      .thanks
        %p.action
          You're upgrading your
          %em
            = current_group.name
          Shapado account
          %br located at
          %em
            ==#{current_group.domain}.

        %p
          == Once you click the checkout button below you'll be upgraded to the #{version.name} plan. You'll be charged the new rate of $#{version.in_dollars}/month starting on your next bill as shows.
          %br
          =link_to "I want to change this plan", plans_path

    .credit_card_form{:style => "display: #{@credit_card.remember ? 'none' : 'inline'}"}
      %h2 Contact Details

      =fields_for "credit_card", @credit_card do |ff|

        .contact-details
          .field
            .name
              %label First Name
              =ff.text_field :first_name
            .lastname
              %label Last Name
              =ff.text_field :last_name

        .field
          %label
            Email
          =ff.text_field :email

        %h2
          Credit Card Details


        .half
          .field.credit-cards
            %label
              Credit card type
            .visa
              =ff.radio_button :credit_card_type, "visa"
            .master
              =ff.radio_button :credit_card_type, "master"
            .amex
              =ff.radio_button :credit_card_type, "amax"

          .field
            %label
              Credit Card Number
            =ff.text_field :number
            %small Exactly as it appears on the card

        .half.cc-info
          .field
            %label
              Verification Code
            =ff.text_field :verification_code
            %small The CVV code is a 3 or 4 digit number on the front or back of the card.

          .field.date
            %label
              Expiration Date
            -index = -1
            =ff.select :year, (Time.now.year..Time.now.year+15).to_a
            =ff.select :month, I18n.t("date.month_names").map{|e| [e, index+=1]}

        .half
          .field
            %label
              Billing Address
            =ff.text_field :address1

          .field
            %label
              Billing Address line 2(optional)
            =ff.text_field :address2

        .half
          .field
            %label
              Country
            =ff.text_field :country

          .field
            .checkbox
              %label
                Please remember this card later
              =ff.check_box :remember

    =render "invoices/invoice", :invoice => @invoice
<commit_msg>swap year and month fields<commit_after>.invoices

  =form_for @invoice do |f|

    =error_messages_for @invoice.credit_card||@cc
    =error_messages_for @invoice

    -@credit_card = (@invoice.credit_card||current_group.credit_card||@cc||CreditCard.new)
    -if @credit_card.remember
      Using credit card ending in
      = @credit_card.ending_in
      = link_to "change", "#", :id => "show_credit_card_info"

    .invoice_info
      .brand
        =image_tag "logo.png"

      .references
        %p.reference
          %strong Invoice reference:
          =@invoice.order_number
        %p
          %strong Date:
          =@invoice.created_at
        %p
          %strong Valid until:
          =@invoice.created_at+1.month
      .clear

    -if @invoice.items.first["item_class"] == "ShapadoVersion"
      -version = ShapadoVersion.find(@invoice.items.first["item_id"])
      .thanks
        %p.action
          You're upgrading your
          %em
            = current_group.name
          Shapado account
          %br located at
          %em
            ==#{current_group.domain}.

        %p
          == Once you click the checkout button below you'll be upgraded to the #{version.name} plan. You'll be charged the new rate of $#{version.in_dollars}/month starting on your next bill as shows.
          %br
          =link_to "I want to change this plan", plans_path

    .credit_card_form{:style => "display: #{@credit_card.remember ? 'none' : 'inline'}"}
      %h2 Contact Details

      =fields_for "credit_card", @credit_card do |ff|

        .contact-details
          .field
            .name
              %label First Name
              =ff.text_field :first_name
            .lastname
              %label Last Name
              =ff.text_field :last_name

        .field
          %label
            Email
          =ff.text_field :email

        %h2
          Credit Card Details


        .half
          .field.credit-cards
            %label
              Credit card type
            .visa
              =ff.radio_button :credit_card_type, "visa"
            .master
              =ff.radio_button :credit_card_type, "master"
            .amex
              =ff.radio_button :credit_card_type, "amax"

          .field
            %label
              Credit Card Number
            =ff.text_field :number
            %small Exactly as it appears on the card

        .half.cc-info
          .field
            %label
              Verification Code
            =ff.text_field :verification_code
            %small The CVV code is a 3 or 4 digit number on the front or back of the card.

          .field.date
            %label
              Expiration Date
            -index = -1
            =ff.select :month, I18n.t("date.month_names").map{|e| [e, index+=1]}
            =ff.select :year, (Time.now.year..Time.now.year+15).to_a

        .half
          .field
            %label
              Billing Address
            =ff.text_field :address1

          .field
            %label
              Billing Address line 2(optional)
            =ff.text_field :address2

        .half
          .field
            %label
              Country
            =ff.text_field :country

          .field
            .checkbox
              %label
                Please remember this card later
              =ff.check_box :remember

    =render "invoices/invoice", :invoice => @invoice

{'fraction_non_alphanumeric': 0.08958731091202819, 'fraction_numerical': 0.0041122044353062125, 'mean_word_length': 1.4558240173097727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3378446', 'n_tokens_mistral': 2019, 'n_tokens_neox': 1904, 'n_words': 494}