|
|
|
@ -26,6 +26,25 @@ router.get('/cv', function(req, res, next) {
|
|
|
|
|
var pubs = bibtexParse.toJSON(pubdata);
|
|
|
|
|
var dict = items[0]
|
|
|
|
|
dict.publications = pubs;
|
|
|
|
|
db.collection('talks').aggregate(
|
|
|
|
|
[
|
|
|
|
|
{'$sort' : {'date' : -1}},
|
|
|
|
|
{'$group': {_id: { $substr: ['$date',0,4] }, talks: { $push: "$$ROOT" }}},
|
|
|
|
|
{'$sort' : {'_id' : -1}}]).toArray(function (err, talks) {
|
|
|
|
|
dict.talks = talks;
|
|
|
|
|
res.render('cv.template', {resume: dict, css: css});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/* GET works_list. */
|
|
|
|
|
router.get('/works_list', function(req, res, next) {
|
|
|
|
|
|
|
|
|
|
var css = fs.readFileSync( path.join(__dirname, '../public/stylesheets/resume_style.css'), 'utf8');
|
|
|
|
|
var db = req.db;
|
|
|
|
|
|
|
|
|
|
db.collection('resume').find().toArray(function (err, items) {
|
|
|
|
|
var dict = items[0];
|
|
|
|
|
|
|
|
|
|
db.collection('works').find({}, function(err, works) {
|
|
|
|
|
|
|
|
|
@ -81,19 +100,10 @@ router.get('/cv', function(req, res, next) {
|
|
|
|
|
{'$sort' : {'date' : -1}},
|
|
|
|
|
{'$group': {_id: { $year: "$date" }, works: { $push: "$$ROOT" }}},
|
|
|
|
|
{'$sort' : {'_id' : -1}}]).toArray(function (err, worksCV) {
|
|
|
|
|
db.collection('talks').aggregate(
|
|
|
|
|
[
|
|
|
|
|
{'$sort' : {'date' : -1}},
|
|
|
|
|
{'$group': {_id: { $substr: ['$date',0,4] }, talks: { $push: "$$ROOT" }}},
|
|
|
|
|
{'$sort' : {'_id' : -1}}]).toArray(function (err, talks) {
|
|
|
|
|
dict.works = worksCV;
|
|
|
|
|
dict.talks = talks;
|
|
|
|
|
console.log('talks: ' + talks);
|
|
|
|
|
console.log('works: ' + worksCV);
|
|
|
|
|
res.render('cv.template', {resume: dict, css: css});
|
|
|
|
|
res.render('workslist.template', {resume: dict, css: css});
|
|
|
|
|
db.collection('works').update({}, {$unset: {'events':1}}, {multi: true});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
return; // All done!
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|