var express = require('express');
var router = express.Router();

var models = require('../models');
var User = models.User;
var Registration = models.Registration;
var RegistrationPayment = models.RegistrationPayment;

var config = require('../configuration');

var utils = require('../utils');


/* GET home page. */
router.get('/', function(req, res, next) {
  if(req.session.currentUser)
  {
    if(req.user) {
      req.user.getRegistration({include: [RegistrationPayment]})
      .then(function(reg) {
        res.render('index/index', { name: req.user.name, registration: reg });
      });
    } else {
      res.render('index/index', { name: req.session.currentUser });
    }
  } else {
    res.render('index/index', { });
  }
});

function shuffle(array) {
  var currentIndex = array.length, temporaryValue, randomIndex ;

  // While there remain elements to shuffle...
  while (0 !== currentIndex) {

    // Pick a remaining element...
    randomIndex = Math.floor(Math.random() * currentIndex);
    currentIndex -= 1;

    // And swap it with the current element.
    temporaryValue = array[currentIndex];
    array[currentIndex] = array[randomIndex];
    array[randomIndex] = temporaryValue;
  }

  return array;
}

module.exports = router;

@@ -737,496 +737,8 @@
 );%0A%0A
-function shuffle(array) %7B%0A  var currentIndex = array.length, temporaryValue, randomIndex ;%0A%0A  // While there remain elements to shuffle...%0A  while (0 !== currentIndex) %7B%0A%0A    // Pick a remaining element...%0A    randomIndex = Math.floor(Math.random() * currentIndex);%0A    currentIndex -= 1;%0A%0A    // And swap it with the current element.%0A    temporaryValue = array%5BcurrentIndex%5D;%0A    array%5BcurrentIndex%5D = array%5BrandomIndex%5D;%0A    array%5BrandomIndex%5D = temporaryValue;%0A  %7D%0A%0A  return array;%0A%7D%0A%0A
 modu

Drop unused code