<commit_before>class VmPaymentConfirmForm extends PlanUpgradeConfirmForm

  viewAppended: ->
    data = @getData()

    @pack = new KDView
      cssClass  : 'payment-confirm-pack'
      partial   : 
        """
        <h2>VM</h2>
        <p>#{ @getExplanation 'pack' }</p>
        """

    @subscription = new KDView
      cssClass  : 'payment-confirm-subscription'
      partial   :
        """
        <h3>Subscription</h3>
        <p>#{ @getExplanation 'subscription' }</p>
        """

    super()

  getExplanation: (key) -> switch key
    when 'pack'
      "You selected this VM:"
    when 'plan'
      "You'll need to upgrade your plan for this purchase:"
    when 'subscription'
      "Your existing subscription will cover this purchase."
    else
      super key

  setData: (data) ->    
    super data

    throw new Error 'Product data was not provided!'  unless data.productData?

    if data.productData.pack
      packView = new VmProductView { showControls: no }, data.productData.pack
      @pack.addSubView packView
    else
      @pack.hide()

    if data.productData.subscription
      @subscription.addSubView new VmPlanView {}, data.productData.subscription
    else
      @subscription.hide()


  pistachio: ->
    """
    {{> @pack}}
    {{> @plan}}
    {{> @subscription}}
    {{> @payment}}
    {{> @buttonBar}}
    """<commit_msg>payment: remove unnecessary payment method view from `VMPaymentConfirmForm`<commit_after>class VmPaymentConfirmForm extends PlanUpgradeConfirmForm

  viewAppended: ->
    data = @getData()

    @pack = new KDView
      cssClass  : 'payment-confirm-pack'
      partial   :
        """
        <h2>VM</h2>
        <p>#{ @getExplanation 'pack' }</p>
        """

    @subscription = new KDView
      cssClass  : 'payment-confirm-subscription'
      partial   :
        """
        <h3>Subscription</h3>
        <p>#{ @getExplanation 'subscription' }</p>
        """

    super()

  getExplanation: (key) -> switch key
    when 'pack'
      "You selected this VM:"
    when 'plan'
      "You'll need to upgrade your plan for this purchase:"
    when 'subscription'
      "Your existing subscription will cover this purchase."
    else
      super key

  setData: (data) ->
    super data

    throw new Error 'Product data was not provided!'  unless data.productData?

    if data.productData.pack
      packView = new VmProductView { showControls: no }, data.productData.pack
      @pack.addSubView packView
    else
      @pack.hide()

    if data.productData.subscription
      @subscription.addSubView new VmPlanView {}, data.productData.subscription
    else
      @subscription.hide()


  pistachio: ->
    """
    {{> @pack}}
    {{> @plan}}
    {{> @subscription}}
    {{> @buttonBar}}
    """
{'fraction_non_alphanumeric': 0.12227866473149492, 'fraction_numerical': 0.002902757619738752, 'mean_word_length': 2.3663003663003663, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 36, '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': '5322369', 'n_tokens_mistral': 843, 'n_tokens_neox': 835, 'n_words': 212}