       tagName  : 'cite'
       domId    : 'sidebar-toggle'
       click    : => @toggleClass 'collapsed'
-
-
-  createAccountArea:->
-
-    @aside.addSubView @accountArea = new KDCustomHTMLView
-      cssClass : 'account-area'
-
-    if KD.isLoggedIn()
-    then @createLoggedInAccountArea()
-    else
-      mc = KD.getSingleton "mainController"
-      mc.once "accountChanged.to.loggedIn", @bound 'createLoggedInAccountArea'
-
-
-  createLoggedInAccountArea:->
-
-    KDView.setElementClass document.body, 'add', 'logged-in'
-
-    @accountArea.destroySubViews()
-
-    # KD.utils.defer => @accountMenu.accountChanged KD.whoami()
-
-    @accountArea.addSubView @avatarArea  = new AvatarArea {}, KD.whoami()
-    # @accountArea.addSubView @searchIcon  = new KDCustomHTMLView
-    #   domId      : 'fatih-launcher'
-    #   cssClass   : 'search acc-dropdown-icon'
-    #   tagName    : 'a'
-    #   attributes :
-    #     title    : 'Search'
-    #     href     : '#'
-    #   click      : (event)=>
-    #     KD.utils.stopDOMEvent event
-    #     # log 'run fatih'
-
-    #     @accountArea.setClass "search-open"
-    #     @searchInput.setFocus()
-
-    #     KD.getSingleton("windowController").addLayer @searchInput
-
-    #     @searchInput.once "ReceivedClickElsewhere", =>
-    #       @accountArea.unsetClass "search-open"
-
-    #   partial    : "<span class='icon'></span>"
-
-    # @accountArea.addSubView @searchForm = new KDCustomHTMLView
-    #   cssClass   : "search-form-container"
-
-    # handleRoute = (searchRoute, text)->
-    #   if group = KD.getSingleton("groupsController").getCurrentGroup()
-    #     groupSlug = if group.slug is "koding" then "" else "/#{group.slug}"
-    #   else
-    #     groupSlug = ""
-
-    #   toBeReplaced =  if text is "" then "?q=:text:" else ":text:"
-
-    #   # inject search text
-    #   searchRoute = searchRoute.replace toBeReplaced, text
-    #   # add group slug
-    #   searchRoute = "#{groupSlug}#{searchRoute}"
-
-    #   KD.getSingleton("router").handleRoute searchRoute
-
-    # search = (text) ->
-    #   currentApp  = KD.getSingleton("appManager").getFrontApp()
-    #   if currentApp and searchRoute = currentApp.options.searchRoute
-    #     return handleRoute searchRoute, text
-    #   else
-    #     return handleRoute "/Activity?q=:text:", text
-
-    # @searchForm.addSubView @searchInput = new KDInputView
-    #   placeholder  : "Search here..."
-    #   keyup      : (event)=>
-    #     text = @searchInput.getValue()
-    #     # if user deleted everything in textbox
-    #     # clear the search result
-    #     if text is "" and @searchInput.searched
-    #       search("")
-    #       @searchInput.searched = false
-
-    #     # 13 is ENTER
-    #     if event.keyCode is 13
-    #       search text
-    #       @searchInput.searched = true
-
-    #     # 27 is ESC
-    #     if event.keyCode is 27
-    #       @accountArea.unsetClass "search-open"
-    #       @searchInput.setValue ""
-    #       @searchInput.searched = false
 
 
   createMainTabView:->


    {mainController} = KD.singletons

    @bindPulsingRemove()
    @bindTransitionEnd()
    @createHeader()

    if KD.isLoggedInOnLoad then @createSidebar()

    @createPanelWrapper()
    @createMainTabView()

    mainController.ready =>
      if KD.isLoggedInOnLoad then @createAccountArea()

      @setStickyNotification()
      @emit 'ready'


  createHeader:->

    {entryPoint} = KD.config

    @addSubView @header = new KDView
      tagName  : 'header'

    @header.addSubView new TopNavigation

    @header.addSubView @logo = new KDCustomHTMLView
      tagName   : 'a'
      domId     : 'koding-logo'
      partial   : '<cite></cite>'
      click     : (event) =>
        KD.utils.stopDOMEvent event
        KD.singletons.router.handleRoute '/'

    @header.addSubView @logotype = new CustomLinkView
      cssClass : 'logotype'
      title    : 'Koding'
      href     : '/Home'


  createPanelWrapper:->

