diff options
| author | jules@lens <julescarbon@gmail.com> | 2019-03-30 15:15:12 +0100 |
|---|---|---|
| committer | jules@lens <julescarbon@gmail.com> | 2019-03-30 15:15:12 +0100 |
| commit | 90579a6ef41c4920034e73ef39365acc27cd8022 (patch) | |
| tree | 743239148b1aa8ae2dc50d71a8f279309869c4d5 /client | |
| parent | d982ad1d50a6c7ff749d2508df5f1e7f6576a5b1 (diff) | |
| parent | b9944ee1a4b07edda741cdfc89abf0715f65a164 (diff) | |
Merge branch 'master' of asdf.us:megapixels_dev
Diffstat (limited to 'client')
| -rw-r--r-- | client/map/index.js | 3 | ||||
| -rw-r--r-- | client/tables.js | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/client/map/index.js b/client/map/index.js index 7c205268..4e6db2de 100644 --- a/client/map/index.js +++ b/client/map/index.js @@ -102,7 +102,8 @@ export default function append(el, payload) { const citationAddress = citation.addresses[0] const latlng = [citationAddress.lat, citationAddress.lng].map(n => parseFloat(n)) if (Number.isNaN(latlng[0]) || Number.isNaN(latlng[1])) return - addMarker(map, latlng, citation.title, citationAddress.name, citation.year, citation.pdf) + const addressString = citation.addresses.map(addr => addr.name).join('<br/>') + addMarker(map, latlng, citation.title, addressString, citation.year, citation.pdf) addArc(map, source, latlng, arcStyles[citationAddress.type]) }) diff --git a/client/tables.js b/client/tables.js index 1077289f..9eedbe18 100644 --- a/client/tables.js +++ b/client/tables.js @@ -15,7 +15,9 @@ const citationsColumns = [ { title: 'Institution', field: 'institution', sorter: 'string' }, { title: 'Country', field: 'country', sorter: 'string', width: 140 }, { title: 'Year', field: 'year', sorter: 'number', width: 70 }, - { title: 'PDF', field: 'pdf', formatter: 'link', sorter: 'string', width: 100 }, + { title: 'PDF', field: 'pdf', formatter: 'link', + formatterParams: { target: "_blank", urlField: 'pdf', }, + sorter: 'string', width: 100 }, ] function getColumns(payload) { @@ -36,12 +38,17 @@ function getColumns(payload) { function getCitations(dataset) { // console.log(dataset.citations) + console.log(dataset.citations.map(d => [d.pdf, d.doi])) return dataset.citations.map(citation => ({ title: citation.title, institution: citation.addresses[0].name, country: citation.addresses[0].country, year: citation.year, - pdf: (citation.pdf && citation.pdf.length) ? citation.pdf[0] : "", + pdf: (citation.pdf && citation.pdf.length) + ? citation.pdf[0] + : (citation.doi && citation.doi.length) + ? citation.doi[0] + : "", })) } |
