       attributes  : { testpath : 'goto-team-button' }
       type        : 'submit'
 
-    @input.on 'ValidationFeedbackCleared', =>
-      @inputView.unsetClass 'validation-error validation-passed'
+    @teamName.input.on 'ValidationFeedbackCleared', =>
+      @teamName.input.unsetClass 'validation-error validation-passed'
 
 
   pistachio: ->
 
     """
-    {{> @inputView}}
-    <div class='submit'>{{> @button}}</div>
+    {{> @teamName }}
+    {{> @suffix }}
+    <div class='submit'>{{> @button }}</div>
     """

kd      = require 'kd'
utils   = require './../core/utils'
JView   = require './../core/jview'


module.exports = class TeamsSelectorForm extends kd.FormView


    teams    = utils.getPreviousTeams()
    lastTeam = teams?.latest

    @teamName = new LoginInputView
      inputOptions   :
        label        : 'Team URL'
        placeholder  : 'your-team-name'
        name         : 'slug'
        defaultValue : lastTeam  if lastTeam

    @suffix = new kd.View
      tagName      : 'span'
      cssClass     : 'TeamDomainSuffix'
      partial      : ".#{kd.config.domains.main}"


