diff --git a/frontend-js/src/main/js/gui/leftPanel/PublicationListDialog.js b/frontend-js/src/main/js/gui/leftPanel/PublicationListDialog.js index 7018ef0c9e1a1494235865839c993fa467b4a880..1ff214195907236a9a830b04f52a3cc4cb391300 100644 --- a/frontend-js/src/main/js/gui/leftPanel/PublicationListDialog.js +++ b/frontend-js/src/main/js/gui/leftPanel/PublicationListDialog.js @@ -32,15 +32,16 @@ PublicationListDialog.prototype.createPublicationListDialogGui = function () { "<th>Journal</th>" + // "<th>Year</th>" + // "<th>Elements on map</th>" + // + "<th>Submaps</th>" + // "</tr>"// }); var body = Functions.createElement({ - type: "tbody", + type: "tbody" }); var tableElement = Functions.createElement({ type: "table", className: "minerva-publication-table", - style: "width: 100%", + style: "width: 100%" }); tableElement.appendChild(head); @@ -57,7 +58,7 @@ PublicationListDialog.prototype._dataTableAjaxCall = function (data, callback) { length: data.length, sortColumn: self.getColumnsDefinition()[data.order[0].column].name, sortOrder: data.order[0].dir, - search: data.search.value, + search: data.search.value }).then(function (publicationList) { var out = []; var allElements = []; @@ -66,24 +67,33 @@ PublicationListDialog.prototype._dataTableAjaxCall = function (data, callback) { var elements = publicationList.data[i].elements; var row = []; + var submaps = {}; + submaps[self.getMap().getId()] = true; row[0] = "<a href='" + publication.link + "'>" + publication.id + "</a>"; row[1] = publication.title; row[2] = publication.authors.join(); row[3] = publication.journal; row[4] = publication.year; row[5] = "<div>"; + row[6] = "<div>"; for (var j = 0; j < elements.length; j++) { row[5] += "<a name='" + elements[j].id + "' href='#'>" + elements[j].type + ":" + elements[j].id + "</a>, "; allElements.push(new IdentifiedElement(elements[j])); + var modelId = elements[j].modelId; + if (submaps[modelId] === undefined) { + row[6] += self.getMap().getSubmapById(modelId).getModel().getName() + ", "; + submaps[elements[j].modelId] = true; + } } row[5] += "</div>"; + row[6] += "</div>"; out.push(row); } callback({ draw: data.draw, recordsTotal: publicationList.totalSize, recordsFiltered: publicationList.filteredSize, - data: out, + data: out }); var promises = []; allElements.forEach(function (element) { @@ -139,7 +149,7 @@ PublicationListDialog.prototype.show = function () { ajax: function (data, callback, settings) { resolve(self._dataTableAjaxCall(data, callback, settings)); }, - columns: self.getColumnsDefinition(), + columns: self.getColumnsDefinition() }); }); } else { @@ -163,6 +173,10 @@ PublicationListDialog.prototype.getColumnsDefinition = function () { orderable: false, searchable: false, name: "elements" + }, { + orderable: false, + searchable: false, + name: "submaps" }]; };