<commit_before>class ResourcesContainer extends KDView
  constructor: (options = {}, data) ->
    options.tagName  = 'section'
    options.cssClass = KD.utils.curry 'resources-container', options.cssClass
    super options, data

  addSubscriptions: ->
    tag = if KD.getGroup().slug is "koding" then "vm" else "custom-plan"
    payment = KD.singleton "paymentController"
    payment.fetchSubscriptionsWithPlans tags: [tag], (err, [subscription]) =>
      return new KDNotificationView title: err  if err
      @subscriptions.addSubView new SubscriptionUsageView null, subscription

  viewAppended: ->
    @addSubView @titleBar = new KDCustomHTMLView
      tagName  : 'header'
      partial  : '<h3>Resource Packs</h3><h4>Need some more power</h4>'

    @titleBar.addSubView new KDButtonView
      cssClass : 'solid green small'
      title    : 'UPGRADE'
      callback : (event)->
        KD.utils.stopDOMEvent event
        KD.singleton('router').handleRoute '/Pricing/Developer'

    @addSubView @subscriptions = new KDCustomHTMLView tagName: 'section'

    @addSubscriptions()<commit_msg>environments: add subscription to `ResourcesContainer` if it exists<commit_after>class ResourcesContainer extends KDView
  constructor: (options = {}, data) ->
    options.tagName  = 'section'
    options.cssClass = KD.utils.curry 'resources-container', options.cssClass
    super options, data

  addSubscriptions: ->
    tag = if KD.getGroup().slug is "koding" then "vm" else "custom-plan"
    payment = KD.singleton "paymentController"
    payment.fetchSubscriptionsWithPlans tags: [tag], (err, [subscription]) =>
      return new KDNotificationView title: err  if err
      @subscriptions.addSubView new SubscriptionUsageView null, subscription  if subscription

  viewAppended: ->
    @addSubView @titleBar = new KDCustomHTMLView
      tagName  : 'header'
      partial  : '<h3>Resource Packs</h3><h4>Need some more power</h4>'

    @titleBar.addSubView new KDButtonView
      cssClass : 'solid green small'
      title    : 'UPGRADE'
      callback : (event)->
        KD.utils.stopDOMEvent event
        KD.singleton('router').handleRoute '/Pricing/Developer'

    @addSubView @subscriptions = new KDCustomHTMLView tagName: 'section'

    @addSubscriptions()
{'fraction_non_alphanumeric': 0.1049136786188579, 'fraction_numerical': 0.0035413899955732625, 'mean_word_length': 3.640657084188912, 'pattern_counts': {'":': 0, '<': 11, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7481616', 'n_tokens_mistral': 684, 'n_tokens_neox': 653, 'n_words': 170}