// Generated by CoffeeScript 1.6.3
/*
  GET home page.
*/


(function() {
  exports.index = {};

  exports.index.index = function(req, res) {
    return res.render('index', {
      room: ''
    });
  };

  exports.index.login = function(req, res) {
    var identify, name, room;
    room = req.body.room;
    name = req.body.name;
    if (((room != null) && room !== "") && ((name != null) && name !== "")) {
      identify = JSON.stringify({
        room: room,
        name: name
      });
      return res.render('space', {
        identify: identify
      });
    } else {
      return res.render('index', {
        room: room,
        msg: 'IDと名前(ローマ字)を入力します'
      });
    }
  };

}).call(this);
