From 68ba456f28e931c00683ab9ed6650f49ae2a7189 Mon Sep 17 00:00:00 2001 From: Traboulsi <salam.traboulsi@hft-stuttgart.de> Date: Mon, 23 Oct 2023 17:57:44 +0000 Subject: [PATCH] Update public/js/add_paper.js --- public/js/add_paper.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/js/add_paper.js b/public/js/add_paper.js index c9c1caa..c1681cb 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 +} -- GitLab