<commit_before>class AvatarArea extends KDCustomHTMLView

  JView.mixin @prototype

  constructor: (options = {}, data)->

    options.cssClass or= 'avatar-area'

    super options, data

    account = @getData()

    @avatar = new AvatarView
      tagName    : 'div'
      cssClass   : 'avatar-image-wrapper'
      attributes :
        title    : 'View your public profile'
      size       :
        width    : 35
        height   : 35
    , account

    @groupSwitcherPopup = new AvatarPopupGroupSwitcher
      cssClass : "group-switcher"

    @groupsSwitcherIcon = new AvatarAreaIconLink
      cssClass   : 'groups acc-dropdown-icon'
      attributes :
        title    : 'Your groups'
        testpath : 'AvatarAreaIconLink'
      delegate   : @groupSwitcherPopup

    @once 'viewAppended', =>
      mainView = KD.getSingleton 'mainView'
      mainView.addSubView @groupSwitcherPopup
      @groupSwitcherPopup.listControllerPending.on 'PendingGroupsCountDidChange', (count)=>
        if count > 0
        then @groupSwitcherPopup.invitesHeader.show()
        else @groupSwitcherPopup.invitesHeader.hide()
        @groupsSwitcherIcon.updateCount count

    KD.getSingleton('mainController').on 'accountChanged', =>
      @groupSwitcherPopup.listController.removeAllItems()

      # Commenting out these lines because of
      # removal of the groups links from avatar popup. ~Umut
      # @groupSwitcherPopup.populateGroups()
      # @groupSwitcherPopup.populatePendingGroups()


  pistachio: ->

    {profile} = @getData()

    """
    {{> @avatar}}
    <a class='profile' href='/#{profile.nickname}' title='Your profile'>#{profile.firstName}</a>
    {{> @groupsSwitcherIcon}}
    """
<commit_msg>Notification: Add notification popup to avatar area<commit_after>class AvatarArea extends KDCustomHTMLView

  JView.mixin @prototype

  constructor: (options = {}, data)->

    options.cssClass or= 'avatar-area'

    super options, data

    account = @getData()

    @avatar = new AvatarView
      tagName    : 'div'
      cssClass   : 'avatar-image-wrapper'
      attributes :
        title    : 'View your public profile'
      size       :
        width    : 35
        height   : 35
    , account

    @groupSwitcherPopup = new AvatarPopupGroupSwitcher
      cssClass : "group-switcher"

    @groupsSwitcherIcon = new AvatarAreaIconLink
      cssClass   : 'groups acc-dropdown-icon'
      attributes :
        title    : 'Your groups'
        testpath : 'AvatarAreaIconLink'
      delegate   : @groupSwitcherPopup

    @notificationsPopup = new PopupNotifications
      cssClass : "notification-lister"

    @notificationsIcon = new AvatarAreaIconLink
      cssClass   : 'notifications acc-dropdown-icon'
      attributes :
        title    : 'Notifications'
      delegate   : @notificationsPopup

    @once 'viewAppended', =>
      mainView = KD.getSingleton 'mainView'
      mainView.addSubView @groupSwitcherPopup
      mainView.addSubView @notificationsPopup
      @groupSwitcherPopup.listControllerPending.on 'PendingGroupsCountDidChange', (count)=>
        if count > 0
        then @groupSwitcherPopup.invitesHeader.show()
        else @groupSwitcherPopup.invitesHeader.hide()
        @groupsSwitcherIcon.updateCount count

      @attachListeners()

    KD.getSingleton('mainController').on 'accountChanged', =>
      @groupSwitcherPopup.listController.removeAllItems()


      # Commenting out these lines because of
      # removal of the groups links from avatar popup. ~Umut
      # @groupSwitcherPopup.populateGroups()
      # @groupSwitcherPopup.populatePendingGroups()

  attachListeners:->

    @notificationsPopup.on 'NotificationCountDidChange', (count)=>
      @utils.killWait @notificationsPopup.loaderTimeout
      @notificationsIcon.updateCount count

  pistachio: ->

    {profile} = @getData()

    """
    {{> @avatar}}
    <a class='profile' href='/#{profile.nickname}' title='Your profile'>#{profile.firstName}</a>
    {{> @groupsSwitcherIcon}}
    {{> @notificationsIcon}}
    """

{'fraction_non_alphanumeric': 0.10134462151394422, 'fraction_numerical': 0.00249003984063745, 'mean_word_length': 2.9228515625, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 26, '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': '6527118', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1194, 'n_words': 242}