       title    : 'Create new Stack'
       cssClass : 'solid compact green action hidden'
       callback : (event) =>
-        console.log @_stackTemplatesLength
         if @_stackTemplatesLength >= 1 and not event?.shiftKey
           @showWarning "Multiple Stack Template support will be
                         provided soon. You still can modify your


    @stackTemplateList = new StackTemplateListView

    @stackTemplateList.listView.on 'ItemSelected', (stackTemplate) =>
      @emit 'EditStack', stackTemplate

    @stackTemplateList.listView.on 'ItemDeleted', =>
      @_stackTemplatesLength = @stackTemplateList.listView.items.length - 1

    @stackTemplateList.listController.on 'ItemsLoaded', (stackTemplates) =>
      @emit 'NoTemplatesFound'  if stackTemplates.length is 0


  reload: ->
    @stackTemplateList.listController.loadItems()


  setDefaultTemplate: (stackTemplate) ->

    { config } = stackTemplate

    unless config.verified
      return @showWarning "
        This stack template is not verified, please edit and save again
        to verify it. Only a verified stack template can be applied to a Team.
      "

    { groupsController } = kd.singletons

    groupsController.setDefaultTemplate stackTemplate, (err) =>
      if err
        @showWarning "An error occured:", err.message ? err
        console.warn err
      else
        @reload()


  showWarning: (content) ->
