Skip to content
Snippets Groups Projects
Commit ca4bcb86 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

submap column in publication list

parent 29c7042a
No related branches found
No related tags found
1 merge request!214Resolve "Additional column: submap reference in publication list"
Pipeline #
......@@ -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"
}];
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment