     mc                   = KD.getSingleton 'mainController'
     mc.sidebarController = new SidebarController view : @sidebar
     @sidebarPanel.addSubView @sidebar
+
+
+
 
   createChatPanel:->
     @addSubView @chatPanel   = new MainChatPanel

        KD.utils.stopDOMEvent event
        KD.getSingleton('router').handleRoute "/Login"

    if entryPoint?.slug? and entryPoint.type is "group"
      KD.remote.cacheable entryPoint.slug, (err, models)=>
        if err then callback err
        else if models?
          [group] = models
          @logo.updatePartial "<span></span>#{group.title}"


  createMainTabView:->

    @mainTabHandleHolder = new MainTabHandleHolder
      domId    : "main-tab-handle-holder"
      cssClass : "kdtabhandlecontainer"
      delegate : this

    @appSettingsMenuButton = new AppSettingsMenuButton
    @appSettingsMenuButton.hide()

    @mainTabView = new MainTabView
      domId              : "main-tab-view"
      listenToFinder     : yes
      delegate           : this
      slidingPanes       : no
      tabHandleContainer : @mainTabHandleHolder
    ,null

    @mainTabView.on "PaneDidShow", =>
      appManager  = KD.getSingleton "appManager"
      appManifest = appManager.getFrontAppManifest()
      menu = appManifest?.menu or \
             KD.getAppOptions(appManager.getFrontApp().getOptions().name)?.menu
      if Array.isArray menu
        menu = items: menu
      if menu?.items?.length

      tagName : "header"
      domId   : "main-header"

    @header.clear()

    @header.addSubView wrapper = new KDView
    @header.wrapper = wrapper
    wrapper.addSubView @logo = new KDCustomHTMLView
      tagName   : "a"
      domId     : "koding-logo"
      cssClass  : if entryPoint?.type is 'group' then 'group' else ''
      partial   : '<cite></cite>'
      click     : (event)=>
        KD.utils.stopDOMEvent event
        if KD.isLoggedIn()
        then KD.getSingleton('router').handleRoute "/Activity", {entryPoint}
        else location.replace '/'

    @createMainNavigation()

    wrapper.addSubView loginLink = new CustomLinkView
      domId       : 'header-sign-in'
