     @addSubView tabView = @tabView = new KDTabView
       hideHandleCloseIcons : yes
       maxHandleWidth       : 210
+      tabHandleClass       : AdminSubTabHandleView
 
-    tabView.addPane pending  = new KDTabPaneView name: 'Pending Invitations'
-    tabView.addPane accepted = new KDTabPaneView name: 'Accepted Invitations'
-    tabView.addPane invite   = new KDTabPaneView name: 'Invite', hiddenHandle: yes
+    tabView.addPane invite   = new KDTabPaneView
+      name         : PANE_NAMES_BY_ROUTE.Invite
+      route        : '/Admin/Invitations/Invite'
+    tabView.addPane pending  = new KDTabPaneView
+      name         : PANE_NAMES_BY_ROUTE.Pending
+      route        : '/Admin/Invitations/Pending'
+    tabView.addPane accepted = new KDTabPaneView
+      name         : PANE_NAMES_BY_ROUTE.Accepted
+      route        : '/Admin/Invitations/Accepted'
 
     pending.addSubView  pendingView  = new PendingInvitationsView  {}, data
     accepted.addSubView acceptedView = new AcceptedInvitationsView {}, data
-    invite.addSubView   inviteView   = new InviteSomeoneView {}, data
+    invite.addSubView   inviteView   = new InviteSomeoneView       {}, data
 
     tabView.showPaneByIndex 0
 
-    inviteView.on 'InvitationViewCancelled', =>
-      tabView.showPaneByIndex tabView.lastOpenPaneIndex
-      @inviteButton.show()
-
-    tabView.on 'PaneDidShow', => @inviteButton.show()
     inviteView.on 'NewInvitationsAdded', -> pendingView.refresh()
 
-
-  createInviteButton: ->
-
-    @addSubView @inviteButton = new KDButtonView
-      title    : 'INVITE SOMEONE'
-      cssClass : 'solid compact green invite'
-      callback : =>
-        @tabView.showPaneByName 'Invite'
-        @inviteButton.hide()
+    @on 'SubTabRequested', (action, identifier) -> tabView.showPaneByName PANE_NAMES_BY_ROUTE[action]

    super options, data

    @createTabView()
    @createInviteButton()


  createTabView: ->

KDButtonView            = kd.ButtonView
KDTabPaneView           = kd.TabPaneView
InviteSomeoneView       = require './invitesomeoneview'
AdminSubTabHandleView   = require './../adminsubtabhandleview'
PendingInvitationsView  = require './pendinginvitationsview'
AcceptedInvitationsView = require './acceptedinvitationsview'

module.exports = class AdminInvitationsView extends KDView

  PANE_NAMES_BY_ROUTE =
    'Invite'   : 'Invite Teammates'
    'Pending'  : 'Pending Invitations'
    'Accepted' : 'Accepted Invitations'

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

