').append([
'"',
reviewBodies[0],
'"',
$('').append([
' —',
(displayName || actualName),
location !== null ? ', ' + location : ''
].join(''))
])
];
review.html(reviewContent);
return review;
}
var staffPicksContent = $('#staff-picks-content');
$.ajax({
url: 'https://intranet.ocls.info/staff-picks/query',
method: 'GET',
data: {
random: true,
limit : 1
},
dataType: 'json'
})
.then(function (response) {
response = response || {};
var
solrResponse = response.response || {},
numFound = solrResponse.numFound || 0,
docs = solrResponse.docs || [];
if (numFound == 0 || !docs.length)
return;
// build and place content from data
staffPicksContent.append([
$('').text('Staff Picks'),
].concat(docs.map($staffPick).filter(function (row) {
return row !== null;
})));
})
.catch(function (e) {
console.error(e);
});
})(window.jQuery);