<commit_before>class DomainProductForm extends JView

  viewAppended: ->
    locationController = KD.getSingleton 'locationController'
    locationForm = locationController.createLocationForm
      callback    : => @emit 'DataCollected', @locationForm.getData()
      buttons     : no
      phone       :
        required  : yes

    @locationForm = locationForm

    @privacyProtection = new KDFormViewWithFields
      fields         :
        enabled      :
          label      : 'Use privacy protection?'
          itemClass  : KDOnOffSwitch
          callback   : -> 
            do locationForm[if @getValue() is on then 'hide' else 'show']

    privacyExplanation = new KDView
      partial: "We'll mask your address information.  Blah blah blah."

    @privacyExplanation = privacyExplanation

    @privacyExplanation.hide()

    @buttons = new KDView

    @saveBtn = new KDButtonView
      title     : "Next"
      style     : 'modal-clean-green fr'
      callback  : @bound 'processForm'

    @buttons.addSubView @saveBtn

    super()

  processForm: ->
    privacyEnabled = @privacyProtection.inputs.enabled.getValue()
    if privacyEnabled is on
      @emit 'DataCollected', privacyProtection: on
    else
      @locationForm.submit()

  pistachio: ->
    """
    <p>Please enter the address information that will be associated with this
       domain name registration.  Alternatively, you can choose to register
       this domain privately for an additional fee.</p>
    {{> @privacyProtection}}
    {{> @privacyExplanation}}
    {{> @locationForm}}
    {{> @buttons}}
    """<commit_msg>domain: we will collect address information in any case<commit_after>class DomainProductForm extends JView

  viewAppended: ->
    locationController = KD.getSingleton 'locationController'
    
    @locationForm = locationController.createLocationForm
      callback    : =>
        @emit 'DataCollected', @locationForm.getData()
      fields      :
        privacyProtection:
          label   : "Use privacy protection?"
          itemClass: KDOnOffSwitch
      phone       :
        required  : yes


    # @buttons = new KDView

    # @saveBtn = new KDButtonView
    #   title     : "Next"
    #   style     : 'modal-clean-green fr'
    #   callback  : @bound 'processForm'

    # @buttons.addSubView @saveBtn

    super()

  processForm: ->
    @locationForm.submit()

  pistachio: ->
    """
    <p>Please enter the address information that will be associated with this
       domain name registration.  Alternatively, you can choose to register
       this domain privately for an additional fee.</p>
    {{> @locationForm}}
    """
{'fraction_non_alphanumeric': 0.08856926570779712, 'fraction_numerical': 0.0, 'mean_word_length': 2.5053050397877983, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, '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': '7155121', 'n_tokens_mistral': 737, 'n_tokens_neox': 698, 'n_words': 200}