class @UserRename
  @confirm_prompt = (old_login) ->
    $('#rename_button').click (e) ->
      if !confirm('Are you sure you want to rename ' + old_login + ' to ' + $('#new_login').val() +  '?')
        e.preventDefault()
        return false
      return true

  check_override = (new_login) ->
    if $('#rename_override_text').val() == new_login && $('#rename_override_reason').val()
      $('#rename_override_btn').removeClass 'disabled'
    else
      $('#rename_override_btn').addClass 'disabled'

  @override = (new_login) ->
    $('#rename_override_text').on 'input', -> check_override(new_login)
    $('#rename_override_reason').on 'input', -> check_override(new_login)
