diff --git a/public/js/add_paper.js b/public/js/add_paper.js index c9c1caaf6b0e816a54beeb2d35adc27f54b3c362..c1681cbb18bb428e7b1e30d8a485706af1b420b6 100644 --- a/public/js/add_paper.js +++ b/public/js/add_paper.js @@ -3,6 +3,8 @@ var item_id = 0 function addpaper(item) { var new_row = document.getElementById("cont_paper") + + if (item === undefined) { } else { @@ -23,6 +25,10 @@ function addpaper(item) { authors = authors.substring(0, authors.length - 2); last_item = item + + // check if abstract is available in the item object + var abstract = item.item.abtract ? '<p>' + item.item.abstract + '</p>' : '' ; + var PDF_HTML = '' var PDF_HTML = item.links.pdf != "" ? `<a type="button" href="${item.links.pdf}" class="btn btn-outline-success btn-circle" target="_blank"> <i class="far fa-file-pdf"> </i></a> PDF ` : "" @@ -67,6 +73,7 @@ function addpaper(item) { keywords + '</small>' + '</h5>' + + abstract + // Include the abstract here doi + '<br>' + PDF_HTML + ' ' + @@ -84,4 +91,4 @@ function addpaper(item) { '</div>' } -} \ No newline at end of file +}