               k.div {className: 'col-md-4'}, ->
                 k.h1 'Login'
                 k.form ->
-                  k.div {className: 'form-group'}, ->
+                  k.div {
+                    className: classNames(
+                      'form-group'
+                      {'has-success': that.hasSuccess('identifier')}
+                      {'has-error': that.hasError('identifier')}
+                      {'has-feedback': that.hasFeedback('identifier')}
+                    )
+                  }, ->
                     k.label {htmlFor: 'inputIdentifier'}, 'Email or username'
                     k.input {
                       type: 'text',

                      id: 'inputIdentifier'
                      placeholder: 'Email or username'
                      name: 'identifier'
                      value: that.state.page.data.identifier
                      onChange: that.handleChange
                    }
                  k.div {className: 'form-group'}, ->
                    k.label {htmlFor: 'inputPassword'}, 'Password'
                    k.input {
                      type: 'password',

      updated = React.addons.update this.state, command
      errors = validateLogin updated.page.data
      console.log 'errors', errors
      this.update
        page:
          data: {$merge: delta}
          errors: {$set: errors}

    handleClick: (event) ->
      event.preventDefault()
      that = this
      console.log 'ComponentLogin', 'handleClick', this.state.page
      if that.hasErrors()
        this.update
          page:
            hasBeenClicked: {$set: true}
        return
      login(that.state.page.data)
        .then (response) ->
          console.log 'success', response
        .fail (error) ->
          console.log 'error', error
    componentWillMount: ->
      console.log 'ComponentLogin', 'componentWillMount'
      this.update
        page:
          data: {$set: {}}
          errors: {$set: validateLogin {}}
    componentWillReceiveProps: (nextProps) ->
      # after calling `this.update()` in `handleChange` there is no guarantee
      # that `this.state` already reflects our changes.
