Response:
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if admin_user_exists()
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, afterLogin
      Houston._call('make_admin', Meteor.userId())

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if admin_user_exists()
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, afterLogin
      Houston._call('make_admin', Meteor.userId())

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')
```

Response:
var admin_user_exists;

admin_user_exists = function() {
  return Houston._admins.find().count() > 0;
};

Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return admin_user_exists();
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Houston._go('home');
      }
    };
    if (admin_user_exists()) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val()
      }, afterLogin);
      return Houston._call('make_admin', Meteor.userId());
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Houston._call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var admin_user_exists;

admin_user_exists = function() {
  return Houston._admins.find().count() > 0;
};

Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return admin_user_exists();
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Houston._go('home');
      }
    };
    if (admin_user_exists()) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val()
      }, afterLogin);
      return Houston._call('make_admin', Meteor.userId());
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Houston._call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};
```

Response:
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if admin_user_exists()
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, afterLogin
      Houston._call('make_admin', Meteor.userId())

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

Response:
if admin_user_exists()
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, afterLogin
      Houston._call('make_admin', Meteor.userId())

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Response:
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if admin_user_exists()
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, (error) ->
        return afterLogin(error) if error
        # else - make me an admin, then send me on my way.
        Houston._call 'make_admin', Meteor.userId(), afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if admin_user_exists()
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, (error) ->
        return afterLogin(error) if error
        # else - make me an admin, then send me on my way.
        Houston._call 'make_admin', Meteor.userId(), afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')
```

Response:
var admin_user_exists;

admin_user_exists = function() {
  return Houston._admins.find().count() > 0;
};

Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return admin_user_exists();
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Houston._go('home');
      }
    };
    if (admin_user_exists()) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val()
      }, function(error) {
        if (error) {
          return afterLogin(error);
        }
        // else - make me an admin, then send me on my way.
        return Houston._call('make_admin', Meteor.userId(), afterLogin);
      });
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Houston._call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var admin_user_exists;

admin_user_exists = function() {
  return Houston._admins.find().count() > 0;
};

Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return admin_user_exists();
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Houston._go('home');
      }
    };
    if (admin_user_exists()) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val()
      }, function(error) {
        if (error) {
          return afterLogin(error);
        }
        // else - make me an admin, then send me on my way.
        return Houston._call('make_admin', Meteor.userId(), afterLogin);
      });
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Houston._call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};
```

Response:
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if admin_user_exists()
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, (error) ->
        return afterLogin(error) if error
        # else - make me an admin, then send me on my way.
        Houston._call 'make_admin', Meteor.userId(), afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if admin_user_exists()

Response:
Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, (error) ->
        return afterLogin(error) if error
        # else - make me an admin, then send me on my way.
        Houston._call 'make_admin', Meteor.userId(), afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Response:
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if admin_user_exists()
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, afterLogin
      Houston._call('make_admin', Meteor.userId())

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    e.preventDefault()
    Houston._call('make_admin', Meteor.userId())
    Houston._go 'home'
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if admin_user_exists()
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, afterLogin
      Houston._call('make_admin', Meteor.userId())

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    e.preventDefault()
    Houston._call('make_admin', Meteor.userId())
    Houston._go 'home'
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')
```

Response:
var admin_user_exists;

admin_user_exists = function() {
  return Houston._admins.find().count() > 0;
};

Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return admin_user_exists();
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Houston._go('home');
      }
    };
    if (admin_user_exists()) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val()
      }, afterLogin);
      return Houston._call('make_admin', Meteor.userId());
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    e.preventDefault();
    Houston._call('make_admin', Meteor.userId());
    return Houston._go('home');
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var admin_user_exists;

admin_user_exists = function() {
  return Houston._admins.find().count() > 0;
};

Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return admin_user_exists();
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Houston._go('home');
      }
    };
    if (admin_user_exists()) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val()
      }, afterLogin);
      return Houston._call('make_admin', Meteor.userId());
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    e.preventDefault();
    Houston._call('make_admin', Meteor.userId());
    return Houston._go('home');
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};
```

Response:
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if admin_user_exists()
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, afterLogin
      Houston._call('make_admin', Meteor.userId())

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    e.preventDefault()
    Houston._call('make_admin', Meteor.userId())
    Houston._go 'home'
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
admin_user_exists = () -> Houston._admins.find().count() > 0

Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> admin_user_exists()
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

Response:
if admin_user_exists()
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
      }, afterLogin
      Houston._call('make_admin', Meteor.userId())

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    e.preventDefault()
    Houston._call('make_admin', Meteor.userId())
    Houston._go 'home'
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Response:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')
```

Response:
Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Houston._go('home');
      }
    };
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      }, afterLogin);
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Houston._call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Houston._go('home');
      }
    };
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      }, afterLogin);
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Houston._call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};
```

Response:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if Meteor.users.findOne('profile.admin': true)

Response:
Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Houston._call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Response:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')
```

Response:
Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Houston._go('home');
      }
    };
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      }, afterLogin);
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Meteor.call('_houston_make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Houston._go('home');
      }
    };
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      }, afterLogin);
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Meteor.call('_houston_make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};
```

Response:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Houston._go 'home'

    if Meteor.users.findOne('profile.admin': true)

Response:
Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Response:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        houston_go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        houston_go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')
```

Response:
Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return houston_go('home');
      }
    };
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      }, afterLogin);
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Meteor.call('_houston_make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return houston_go('home');
      }
    };
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      }, afterLogin);
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Meteor.call('_houston_make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};
```

Response:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        houston_go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        houston_go 'home'

    if Meteor.users.findOne('profile.admin': true)

Response:
Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Response:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')
```

Response:
Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password);
    } else {
      // TODO: unbreak if this fails
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      });
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Meteor.call('_houston_make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Template._houston_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template._houston_login.events({
  'submit #houston-sign-in-form': function(e) {
    var email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password);
    } else {
      // TODO: unbreak if this fails
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      });
    }
  },
  'click .houston-logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-houston-admin': function(e) {
    Meteor.call('_houston_make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template._houston_login.rendered = function() {
  return $(window).unbind('scroll');
};
```

Response:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Template._houston_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template._houston_login.events(
  'submit #houston-sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser

Response:
email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .houston-logout': (e) ->
    e.preventDefault()
    Meteor.logout()

  'click .become-houston-admin': (e) ->
    Meteor.call('_houston_make_admin', Meteor.userId())
    e.preventDefault()
)

Template._houston_login.rendered = ->
  $(window).unbind('scroll')


Response:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        houston_go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        houston_go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')
```

Response:
Template.admin_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template.admin_login.events({
  'submit #sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return houston_go('home');
      }
    };
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      }, afterLogin);
    }
  },
  'click .logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-admin': function(e) {
    Meteor.call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template.admin_login.rendered = function() {
  return $(window).unbind('scroll');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Template.admin_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template.admin_login.events({
  'submit #sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return houston_go('home');
      }
    };
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      }, afterLogin);
    }
  },
  'click .logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-admin': function(e) {
    Meteor.call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template.admin_login.rendered = function() {
  return $(window).unbind('scroll');
};
```

Response:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        houston_go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        houston_go 'home'

    if Meteor.users.findOne('profile.admin': true)

Response:
Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')


Response:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Router.go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Router.go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')
```

Response:
Template.admin_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template.admin_login.events({
  'submit #sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Router.go('home');
      }
    };
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      }, afterLogin);
    }
  },
  'click .logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-admin': function(e) {
    Meteor.call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template.admin_login.rendered = function() {
  return $(window).unbind('scroll');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Template.admin_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template.admin_login.events({
  'submit #sign-in-form': function(e) {
    var afterLogin, email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    afterLogin = function(error) {
      // TODO error case that properly displays
      if (error) {
        return alert(error);
      } else {
        return Router.go('home');
      }
    };
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password, afterLogin);
    } else {
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      }, afterLogin);
    }
  },
  'click .logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-admin': function(e) {
    Meteor.call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template.admin_login.rendered = function() {
  return $(window).unbind('scroll');
};
```

Response:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Router.go 'home'

    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()

    afterLogin = (error) ->
      # TODO error case that properly displays
      if error
        alert error
      else
        Router.go 'home'

    if Meteor.users.findOne('profile.admin': true)

Response:
Meteor.loginWithPassword email, password, afterLogin
    else
      Accounts.createUser {
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true
      }, afterLogin

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')


Response:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')
```

Response:
Template.admin_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template.admin_login.events({
  'submit #sign-in-form': function(e) {
    var email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password);
    } else {
      // TODO: unbreak if this fails
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      });
    }
  },
  'click .logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-admin': function(e) {
    Meteor.call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template.admin_login.rendered = function() {
  return $(window).unbind('scroll');
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Template.admin_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template.admin_login.events({
  'submit #sign-in-form': function(e) {
    var email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password);
    } else {
      // TODO: unbreak if this fails
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      });
    }
  },
  'click .logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-admin': function(e) {
    Meteor.call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});

Template.admin_login.rendered = function() {
  return $(window).unbind('scroll');
};
```

Response:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')


Prompt:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser

Response:
email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)

Template.admin_login.rendered = ->
  $(window).unbind('scroll')


Response:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)
```

Response:
Template.admin_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template.admin_login.events({
  'submit #sign-in-form': function(e) {
    var email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password);
    } else {
      // TODO: unbreak if this fails
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      });
    }
  },
  'click .logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-admin': function(e) {
    Meteor.call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Template.admin_login.helpers({
  logged_in: function() {
    return Meteor.user();
  },
  admin_user_exists: function() {
    return Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template.admin_login.events({
  'submit #sign-in-form': function(e) {
    var email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password);
    } else {
      // TODO: unbreak if this fails
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      });
    }
  },
  'click .logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  },
  'click .become-admin': function(e) {
    Meteor.call('make_admin', Meteor.userId());
    return e.preventDefault();
  }
});
```

Response:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)


Prompt:
Template.admin_login.helpers(
  logged_in: -> Meteor.user()
  admin_user_exists: -> Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else

Response:
# TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
  'click .become-admin': (e) ->
    Meteor.call('make_admin', Meteor.userId())
    e.preventDefault()
)


Response:
Template.admin_login.helpers(
  notLoggedIn: -> not Meteor.user()
  adminAccountNotExist: -> !Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Template.admin_login.helpers(
  notLoggedIn: -> not Meteor.user()
  adminAccountNotExist: -> !Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
)
```

Response:
Template.admin_login.helpers({
  notLoggedIn: function() {
    return !Meteor.user();
  },
  adminAccountNotExist: function() {
    return !Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template.admin_login.events({
  'submit #sign-in-form': function(e) {
    var email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password);
    } else {
      // TODO: unbreak if this fails
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      });
    }
  },
  'click .logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
Template.admin_login.helpers({
  notLoggedIn: function() {
    return !Meteor.user();
  },
  adminAccountNotExist: function() {
    return !Meteor.users.findOne({
      'profile.admin': true
    });
  }
});

Template.admin_login.events({
  'submit #sign-in-form': function(e) {
    var email, password;
    e.preventDefault();
    email = $('input[name="email"]').val();
    password = $('input[name="password"]').val();
    if (Meteor.users.findOne({
      'profile.admin': true
    })) {
      return Meteor.loginWithPassword(email, password);
    } else {
      // TODO: unbreak if this fails
      return Accounts.createUser({
        email: $('input[name="email"]').val(),
        password: $('input[name="password"]').val(),
        profile: {
          admin: true
        }
      });
    }
  },
  'click .logout': function(e) {
    e.preventDefault();
    return Meteor.logout();
  }
});
```

Response:
Template.admin_login.helpers(
  notLoggedIn: -> not Meteor.user()
  adminAccountNotExist: -> !Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)
    else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
)


Prompt:
Template.admin_login.helpers(
  notLoggedIn: -> not Meteor.user()
  adminAccountNotExist: -> !Meteor.users.findOne 'profile.admin': true
)

Template.admin_login.events(
  'submit #sign-in-form': (e) ->
    e.preventDefault()
    email = $('input[name="email"]').val()
    password = $('input[name="password"]').val()
    if Meteor.users.findOne('profile.admin': true)
      Meteor.loginWithPassword(email, password)

Response:
else
      # TODO: unbreak if this fails
      Accounts.createUser
        email: $('input[name="email"]').val()
        password: $('input[name="password"]').val()
        profile:
          admin: true

  'click .logout': (e) ->
    e.preventDefault()
    Meteor.logout()
)


Response:
Immutable = require 'immutable'

schema = require '../schema'

teamRelatesFields = [
  'archivedTopics', 'contactPrefs', 'contacts', 'favorites'
  'intes', 'invitations', 'leftContacts', 'members', 'messages'
  'tags', 'topicPrefs', 'topics', 'stories', 'notifications',
  'groups'
]

# called on every network break and page close
exports.outdateStore = (store) ->
  router = store.get 'router'
  _teamId = router.getIn ['data', '_teamId']
  _roomId = router.getIn ['data', '_roomId']
  _toId = router.getIn ['data', '_toId']
  _storyId = router.getIn ['data', '_storyId']

  # clear data from store step by step, newStore is mutable reference
  newStore = store
  .set 'notices', Immutable.Map()
  .set 'bannerNotices', Immutable.Map()
  .set 'inteSettings', Immutable.List()
  .set 'device', schema.device
  # suppose there is a current team, clear data of other teams
  if _teamId?
    newStore = teamRelatesFields.reduce (acc, field) ->
      if newStore.hasIn([field, _teamId])
        acc.set(field, Immutable.Map())
        .setIn [field, _teamId], newStore.getIn([field, _teamId])
      else
        acc.set(field, Immutable.Map())
    , newStore
    # suppose a channel is focused, clear data of other channels
    _channelId = _roomId or _toId or _storyId
    if _channelId?
      currentMessages = newStore.getIn ['messages', _teamId, _channelId]
      newStore = newStore
      .setIn ['messages', _teamId], Immutable.Map()
      .setIn ['messages', _teamId, _channelId], currentMessages
    # otherwise, all messages can be cleared
    else
      newStore = newStore
      .setIn ['messages', _teamId], Immutable.Map()
  # otherwise, all fields can be cleared
  else
    teamRelatesFields.forEach (field) ->
      newStore = newStore.set field, Immutable.Map()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
Immutable = require 'immutable'

schema = require '../schema'

teamRelatesFields = [
  'archivedTopics', 'contactPrefs', 'contacts', 'favorites'
  'intes', 'invitations', 'leftContacts', 'members', 'messages'
  'tags', 'topicPrefs', 'topics', 'stories', 'notifications',
  'groups'
]

# called on every network break and page close
exports.outdateStore = (store) ->
  router = store.get 'router'
  _teamId = router.getIn ['data', '_teamId']
  _roomId = router.getIn ['data', '_roomId']
  _toId = router.getIn ['data', '_toId']
  _storyId = router.getIn ['data', '_storyId']

  # clear data from store step by step, newStore is mutable reference
  newStore = store
  .set 'notices', Immutable.Map()
  .set 'bannerNotices', Immutable.Map()
  .set 'inteSettings', Immutable.List()
  .set 'device', schema.device
  # suppose there is a current team, clear data of other teams
  if _teamId?
    newStore = teamRelatesFields.reduce (acc, field) ->
      if newStore.hasIn([field, _teamId])
        acc.set(field, Immutable.Map())
        .setIn [field, _teamId], newStore.getIn([field, _teamId])
      else
        acc.set(field, Immutable.Map())
    , newStore
    # suppose a channel is focused, clear data of other channels
    _channelId = _roomId or _toId or _storyId
    if _channelId?
      currentMessages = newStore.getIn ['messages', _teamId, _channelId]
      newStore = newStore
      .setIn ['messages', _teamId], Immutable.Map()
      .setIn ['messages', _teamId, _channelId], currentMessages
    # otherwise, all messages can be cleared
    else
      newStore = newStore
      .setIn ['messages', _teamId], Immutable.Map()
  # otherwise, all fields can be cleared
  else
    teamRelatesFields.forEach (field) ->
      newStore = newStore.set field, Immutable.Map()
```

Response:
var Immutable, schema, teamRelatesFields;

Immutable = require('immutable');

schema = require('../schema');

teamRelatesFields = ['archivedTopics', 'contactPrefs', 'contacts', 'favorites', 'intes', 'invitations', 'leftContacts', 'members', 'messages', 'tags', 'topicPrefs', 'topics', 'stories', 'notifications', 'groups'];

// called on every network break and page close
exports.outdateStore = function(store) {
  var _channelId, _roomId, _storyId, _teamId, _toId, currentMessages, newStore, router;
  router = store.get('router');
  _teamId = router.getIn(['data', '_teamId']);
  _roomId = router.getIn(['data', '_roomId']);
  _toId = router.getIn(['data', '_toId']);
  _storyId = router.getIn(['data', '_storyId']);
  // clear data from store step by step, newStore is mutable reference
  newStore = store.set('notices', Immutable.Map()).set('bannerNotices', Immutable.Map()).set('inteSettings', Immutable.List()).set('device', schema.device);
  // suppose there is a current team, clear data of other teams
  if (_teamId != null) {
    newStore = teamRelatesFields.reduce(function(acc, field) {
      if (newStore.hasIn([field, _teamId])) {
        return acc.set(field, Immutable.Map()).setIn([field, _teamId], newStore.getIn([field, _teamId]));
      } else {
        return acc.set(field, Immutable.Map());
      }
    }, newStore);
    // suppose a channel is focused, clear data of other channels
    _channelId = _roomId || _toId || _storyId;
    if (_channelId != null) {
      currentMessages = newStore.getIn(['messages', _teamId, _channelId]);
      return newStore = newStore.setIn(['messages', _teamId], Immutable.Map()).setIn(['messages', _teamId, _channelId], currentMessages);
    } else {
      // otherwise, all messages can be cleared
      return newStore = newStore.setIn(['messages', _teamId], Immutable.Map());
    }
  } else {
    // otherwise, all fields can be cleared
    return teamRelatesFields.forEach(function(field) {
      return newStore = newStore.set(field, Immutable.Map());
    });
  }
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var Immutable, schema, teamRelatesFields;

Immutable = require('immutable');

schema = require('../schema');

teamRelatesFields = ['archivedTopics', 'contactPrefs', 'contacts', 'favorites', 'intes', 'invitations', 'leftContacts', 'members', 'messages', 'tags', 'topicPrefs', 'topics', 'stories', 'notifications', 'groups'];

// called on every network break and page close
exports.outdateStore = function(store) {
  var _channelId, _roomId, _storyId, _teamId, _toId, currentMessages, newStore, router;
  router = store.get('router');
  _teamId = router.getIn(['data', '_teamId']);
  _roomId = router.getIn(['data', '_roomId']);
  _toId = router.getIn(['data', '_toId']);
  _storyId = router.getIn(['data', '_storyId']);
  // clear data from store step by step, newStore is mutable reference
  newStore = store.set('notices', Immutable.Map()).set('bannerNotices', Immutable.Map()).set('inteSettings', Immutable.List()).set('device', schema.device);
  // suppose there is a current team, clear data of other teams
  if (_teamId != null) {
    newStore = teamRelatesFields.reduce(function(acc, field) {
      if (newStore.hasIn([field, _teamId])) {
        return acc.set(field, Immutable.Map()).setIn([field, _teamId], newStore.getIn([field, _teamId]));
      } else {
        return acc.set(field, Immutable.Map());
      }
    }, newStore);
    // suppose a channel is focused, clear data of other channels
    _channelId = _roomId || _toId || _storyId;
    if (_channelId != null) {
      currentMessages = newStore.getIn(['messages', _teamId, _channelId]);
      return newStore = newStore.setIn(['messages', _teamId], Immutable.Map()).setIn(['messages', _teamId, _channelId], currentMessages);
    } else {
      // otherwise, all messages can be cleared
      return newStore = newStore.setIn(['messages', _teamId], Immutable.Map());
    }
  } else {
    // otherwise, all fields can be cleared
    return teamRelatesFields.forEach(function(field) {
      return newStore = newStore.set(field, Immutable.Map());
    });
  }
};
```

Response:
Immutable = require 'immutable'

schema = require '../schema'

teamRelatesFields = [
  'archivedTopics', 'contactPrefs', 'contacts', 'favorites'
  'intes', 'invitations', 'leftContacts', 'members', 'messages'
  'tags', 'topicPrefs', 'topics', 'stories', 'notifications',
  'groups'
]

# called on every network break and page close
exports.outdateStore = (store) ->
  router = store.get 'router'
  _teamId = router.getIn ['data', '_teamId']
  _roomId = router.getIn ['data', '_roomId']
  _toId = router.getIn ['data', '_toId']
  _storyId = router.getIn ['data', '_storyId']

  # clear data from store step by step, newStore is mutable reference
  newStore = store
  .set 'notices', Immutable.Map()
  .set 'bannerNotices', Immutable.Map()
  .set 'inteSettings', Immutable.List()
  .set 'device', schema.device
  # suppose there is a current team, clear data of other teams
  if _teamId?
    newStore = teamRelatesFields.reduce (acc, field) ->
      if newStore.hasIn([field, _teamId])
        acc.set(field, Immutable.Map())
        .setIn [field, _teamId], newStore.getIn([field, _teamId])
      else
        acc.set(field, Immutable.Map())
    , newStore
    # suppose a channel is focused, clear data of other channels
    _channelId = _roomId or _toId or _storyId
    if _channelId?
      currentMessages = newStore.getIn ['messages', _teamId, _channelId]
      newStore = newStore
      .setIn ['messages', _teamId], Immutable.Map()
      .setIn ['messages', _teamId, _channelId], currentMessages
    # otherwise, all messages can be cleared
    else
      newStore = newStore
      .setIn ['messages', _teamId], Immutable.Map()
  # otherwise, all fields can be cleared
  else
    teamRelatesFields.forEach (field) ->
      newStore = newStore.set field, Immutable.Map()


Prompt:
Immutable = require 'immutable'

schema = require '../schema'

teamRelatesFields = [
  'archivedTopics', 'contactPrefs', 'contacts', 'favorites'
  'intes', 'invitations', 'leftContacts', 'members', 'messages'
  'tags', 'topicPrefs', 'topics', 'stories', 'notifications',
  'groups'
]

# called on every network break and page close
exports.outdateStore = (store) ->
  router = store.get 'router'
  _teamId = router.getIn ['data', '_teamId']
  _roomId = router.getIn ['data', '_roomId']
  _toId = router.getIn ['data', '_toId']
  _storyId = router.getIn ['data', '_storyId']

  # clear data from store step by step, newStore is mutable reference
  newStore = store
  .set 'notices', Immutable.Map()
  .set 'bannerNotices', Immutable.Map()
  .set 'inteSettings', Immutable.List()

Response:
.set 'device', schema.device
  # suppose there is a current team, clear data of other teams
  if _teamId?
    newStore = teamRelatesFields.reduce (acc, field) ->
      if newStore.hasIn([field, _teamId])
        acc.set(field, Immutable.Map())
        .setIn [field, _teamId], newStore.getIn([field, _teamId])
      else
        acc.set(field, Immutable.Map())
    , newStore
    # suppose a channel is focused, clear data of other channels
    _channelId = _roomId or _toId or _storyId
    if _channelId?
      currentMessages = newStore.getIn ['messages', _teamId, _channelId]
      newStore = newStore
      .setIn ['messages', _teamId], Immutable.Map()
      .setIn ['messages', _teamId, _channelId], currentMessages
    # otherwise, all messages can be cleared
    else
      newStore = newStore
      .setIn ['messages', _teamId], Immutable.Map()
  # otherwise, all fields can be cleared
  else
    teamRelatesFields.forEach (field) ->
      newStore = newStore.set field, Immutable.Map()


Response:
launch() if ignition is on

volume: 10 if band isnt spinal_tap

let_the_wild_rumpus_begin() unless answer is no

if car.speed < speed_limit then accelerate()

print "My name is " + @name


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
launch() if ignition is on

volume: 10 if band isnt spinal_tap

let_the_wild_rumpus_begin() unless answer is no

if car.speed < speed_limit then accelerate()

print "My name is " + @name
```

Response:
if (ignition === true) {
  launch();
}

if (band !== spinal_tap) {
  ({
    volume: 10
  });
}

if (answer !== false) {
  let_the_wild_rumpus_begin();
}

if (car.speed < speed_limit) {
  accelerate();
}

print("My name is " + this.name);


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
if (ignition === true) {
  launch();
}

if (band !== spinal_tap) {
  ({
    volume: 10
  });
}

if (answer !== false) {
  let_the_wild_rumpus_begin();
}

if (car.speed < speed_limit) {
  accelerate();
}

print("My name is " + this.name);
```

Response:
launch() if ignition is on

volume: 10 if band isnt spinal_tap

let_the_wild_rumpus_begin() unless answer is no

if car.speed < speed_limit then accelerate()

print "My name is " + @name


Prompt:
launch() if ignition is on

volume: 10 if band isnt spinal_tap

Response:
let_the_wild_rumpus_begin() unless answer is no

if car.speed < speed_limit then accelerate()

print "My name is " + @name


Response:
class Linear extends Domain
  displayName: 'Linear'

  priority: 0

  Engine:  c

  construct: () ->
    @paths    ?= {}
    @instance = new c.SimplexSolver()
    @instance.autoSolve = false
    #@instance._store = []
    if @console.level > 2
      c.debug = true
      c.trace = true

  perform: ->
    if @constrained
      @constrained = @suggested = undefined
      if @instance._needsSolving
        @instance.solve()
        return @instance._changed
    else if @suggested
      @suggested = undefined
      @instance.resolve()
      return @instance._changed

  unedit: (variable) ->
    if constraint = @editing?['%' + (variable.name || variable)]
      #@instance.removeConstraint(constraint)
      cei = @instance._editVarMap.get(constraint.variable)
      @instance.removeColumn(cei.editMinus)
      @instance._editVarMap.delete(constraint.variable)
      delete @editing[(variable.name || variable)]

      #@removeConstraint(constraint)

  edit: (variable, strength, weight, continuation) ->
    unless @editing?[variable.name]
      constraint = new c.EditConstraint(variable, @strength(strength, 'strong'), @weight(weight))
      constraint.variable = variable
      @Constraint::inject @, constraint
      (@editing ||= {})[variable.name] = constraint

    return constraint

  nullify: (variable, full) ->
    @instance._externalParametricVars.delete(variable)
    variable.value = 0
    #if full


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
class Linear extends Domain
  displayName: 'Linear'

  priority: 0

  Engine:  c

  construct: () ->
    @paths    ?= {}
    @instance = new c.SimplexSolver()
    @instance.autoSolve = false
    #@instance._store = []
    if @console.level > 2
      c.debug = true
      c.trace = true

  perform: ->
    if @constrained
      @constrained = @suggested = undefined
      if @instance._needsSolving
        @instance.solve()
        return @instance._changed
    else if @suggested
      @suggested = undefined
      @instance.resolve()
      return @instance._changed

  unedit: (variable) ->
    if constraint = @editing?['%' + (variable.name || variable)]
      #@instance.removeConstraint(constraint)
      cei = @instance._editVarMap.get(constraint.variable)
      @instance.removeColumn(cei.editMinus)
      @instance._editVarMap.delete(constraint.variable)
      delete @editing[(variable.name || variable)]

      #@removeConstraint(constraint)

  edit: (variable, strength, weight, continuation) ->
    unless @editing?[variable.name]
      constraint = new c.EditConstraint(variable, @strength(strength, 'strong'), @weight(weight))
      constraint.variable = variable
      @Constraint::inject @, constraint
      (@editing ||= {})[variable.name] = constraint

    return constraint

  nullify: (variable, full) ->
    @instance._externalParametricVars.delete(variable)
    variable.value = 0
    #if full
```

Response:
var Linear;

Linear = (function() {
  class Linear extends Domain {
    construct() {
      if (this.paths == null) {
        this.paths = {};
      }
      this.instance = new c.SimplexSolver();
      this.instance.autoSolve = false;
      //@instance._store = []
      if (this.console.level > 2) {
        c.debug = true;
        return c.trace = true;
      }
    }

    perform() {
      if (this.constrained) {
        this.constrained = this.suggested = void 0;
        if (this.instance._needsSolving) {
          this.instance.solve();
          return this.instance._changed;
        }
      } else if (this.suggested) {
        this.suggested = void 0;
        this.instance.resolve();
        return this.instance._changed;
      }
    }

    unedit(variable) {
      var cei, constraint, ref;
      if (constraint = (ref = this.editing) != null ? ref['%' + (variable.name || variable)] : void 0) {
        //@instance.removeConstraint(constraint)
        cei = this.instance._editVarMap.get(constraint.variable);
        this.instance.removeColumn(cei.editMinus);
        this.instance._editVarMap.delete(constraint.variable);
        return delete this.editing[variable.name || variable];
      }
    }

    //@removeConstraint(constraint)
    edit(variable, strength, weight, continuation) {
      var constraint, ref;
      if (!((ref = this.editing) != null ? ref[variable.name] : void 0)) {
        constraint = new c.EditConstraint(variable, this.strength(strength, 'strong'), this.weight(weight));
        constraint.variable = variable;
        this.Constraint.prototype.inject(this, constraint);
        (this.editing || (this.editing = {}))[variable.name] = constraint;
      }
      return constraint;
    }

    nullify(variable, full) {
      this.instance._externalParametricVars.delete(variable);
      return variable.value = 0;
    }

  };

  Linear.prototype.displayName = 'Linear';

  Linear.prototype.priority = 0;

  Linear.prototype.Engine = c;

  return Linear;

}).call(this);

//if full