adding works list and plumbing

legacy_v1
mwinter 3 years ago
parent ff248d6a92
commit 9259436903

@ -855,23 +855,32 @@ function populatePublications() {
function populateAbout() { function populateAbout() {
var head = $('<h4>').append($('<div>').css('width', '50px').css('min-width', '50px').append('CV')); var cvHead = $('<h4>').append($('<div>').css('width', '50px').css('min-width', '50px').append('CV'));
//var documentButton = $("<button id=cv_button data-iframe='true' data-src='/cv'>").attr({title: "CV"}).addClass('score_icon'); //var documentButton = $("<button id=cv_button data-iframe='true' data-src='/cv'>").attr({title: "CV"}).addClass('score_icon');
var documentButton = $("<button id=cv_button>").attr({title: "CV"}).addClass('score_icon'); var cvButton = $("<button id=cv_button>").attr({title: "CV"}).addClass('score_icon');
documentButton.click(function() { var wlHead = $('<h4>').append($('<div>').css('width', '300px').css('min-width', '300px').append('Works List with Presentation History'));
var wlButton = $("<button id=cv_button>").attr({title: "Works List with Presentation History"}).addClass('score_icon');
cvButton.click(function() {
window.open('/cv'); window.open('/cv');
}); });
wlButton.click(function() {
window.open('/works_list');
});
/* /*
documentButton.lightGallery({ cvButton.lightGallery({
selector: 'this', selector: 'this',
width: '90%', width: '90%',
galleryId: 'cv' galleryId: 'cv'
}); });
*/ */
head.append(documentButton).insertBefore('#mc_embed_signup'); cvHead.append(cvButton).insertBefore('#mc_embed_signup');
wlHead.append(wlButton).insertBefore('#mc_embed_signup');
$('#my_image').html(""); $('#my_image').html("");
$('#my_image').append("<ul id='myimagegallerylist'>"); $('#my_image').append("<ul id='myimagegallerylist'>");

@ -107,6 +107,14 @@ a {
margin-bottom: 5px; margin-bottom: 5px;
} }
.work-info {
margin-left: -30px;
}
.venue-info {
margin-left: 15px;
}
.education-gpa { .education-gpa {
padding-left: 2px; padding-left: 2px;
} }

@ -26,6 +26,25 @@ router.get('/cv', function(req, res, next) {
var pubs = bibtexParse.toJSON(pubdata); var pubs = bibtexParse.toJSON(pubdata);
var dict = items[0] var dict = items[0]
dict.publications = pubs; 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) { db.collection('works').find({}, function(err, works) {
@ -81,19 +100,10 @@ router.get('/cv', function(req, res, next) {
{'$sort' : {'date' : -1}}, {'$sort' : {'date' : -1}},
{'$group': {_id: { $year: "$date" }, works: { $push: "$$ROOT" }}}, {'$group': {_id: { $year: "$date" }, works: { $push: "$$ROOT" }}},
{'$sort' : {'_id' : -1}}]).toArray(function (err, worksCV) { {'$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.works = worksCV;
dict.talks = talks; res.render('workslist.template', {resume: dict, css: css});
console.log('talks: ' + talks);
console.log('works: ' + worksCV);
res.render('cv.template', {resume: dict, css: css});
db.collection('works').update({}, {$unset: {'events':1}}, {multi: true}); db.collection('works').update({}, {$unset: {'events':1}}, {multi: true});
}); });
});
return; // All done! return; // All done!
} }

Loading…
Cancel
Save