Example #1
0
        getObjects(HTTPOptions, function(searchUserObjects){
          var friendAvatarList = [];
          for(i = 0; i< friendObjects.length; i++){
            friendAvatarList.push(gravatar.get(friendObjects[i].local.email))
          }

          var searchUserAvatarsList = [];
          for(i = 0; i< searchUserObjects.length; i++){
            searchUserAvatarsList.push(gravatar.get(searchUserObjects[i].local.email))
          }
          //console.log(searchUserObjects)

          // Only Send non-friends to profile find friends
          var non_friends = [];
          for(i = 0; i< searchUserObjects.length; i++){
            if (friendObjects.indexOf(searchUserObjects[i].local._id)){
              non_friends.push(searchUserObjects[i]);
            }
          }

          res.render('profile.ejs', {
            // get the user out of session and pass to template
            searchUsers : non_friends,
            searchUserAvatars : searchUserAvatarsList,
            user : req.user,
            avatar : gravatar.get(req.user.local.email),
            friends : friendObjects,
            friendAvatars : friendAvatarList
          });
        });
Example #2
0
        getObjects(HTTPOptions, function(friendObjects){

          friendAvatarList = [];
          for(i = 0; i< friendObjects.length; i++){
            friendAvatarList.push(gravatar.get(friendObjects[i].local.email))
          }
          res.render('userProfile.ejs', {
            // get the userObject
            user : userObject,
            avatar : gravatar.get(userObject.local.email),
            friends : friendObjects,
            friendAvatars : friendAvatarList
          });
        });
Example #3
0
 .get('/lobby', isLoggedIn, function(req, res) {
   res.render('lobby.ejs', {
     user : req.user,
     avatar : gravatar.get(req.user.local.email),
     pageName : 'lobby',
     usingBlaze : true
   });
 })
Example #4
0
 .get('/game/:game_id', isLoggedIn, function(req, res) {
   res.render('game.ejs', {
     user : req.user,
     avatar : gravatar.get(req.user.local.email),
     game_id : req.params.game_id,
     pageName : 'game',
     usingBlaze : true
   });
 })
 this.gravatarUrl = function(options){
   return gravatar.get(this.email, options);
 };
Example #6
0
 .get('/czar', isLoggedIn, function(req, res) {
   res.render('game_czar_view.ejs', {
     user : req.user,
     avatar : gravatar.get(req.user.local.email)
   });
 })