summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-03-31 17:40:44 +0200
committerJules Laplace <julescarbon@gmail.com>2019-03-31 17:40:44 +0200
commit438cde0ab82cf9fdbdcbb45e0ad8e43efc3525bb (patch)
tree5b655ddb574c5f7691354159196c8444ae93a37a
parent5eb849e37e0c902743a8b1178b652a14d9848e74 (diff)
hide pdf
-rw-r--r--client/chart/pie.charts.js5
-rw-r--r--client/index.js4
-rw-r--r--client/map/index.js8
-rw-r--r--scraper/client/paper/paper.verify.js14
-rw-r--r--site/assets/css/applets.css12
-rw-r--r--site/public/about/faq/index.html11
-rw-r--r--site/public/about/press/index.html7
-rw-r--r--site/public/about/privacy/index.html7
-rw-r--r--site/public/about/terms/index.html7
9 files changed, 45 insertions, 30 deletions
diff --git a/client/chart/pie.charts.js b/client/chart/pie.charts.js
index 6e579537..84e85c3a 100644
--- a/client/chart/pie.charts.js
+++ b/client/chart/pie.charts.js
@@ -17,6 +17,7 @@ class PieCharts extends Component {
render() {
const { payload } = this.props
const { paper, citations } = payload.data
+ console.log(this.props)
if (!citations.length) return null
const countries = {}
@@ -83,9 +84,10 @@ class PieCharts extends Component {
}
}}
size={{
- height: 336,
+ height: countryRows.length < 4 ? 316 : 336,
}}
/>
+ <span className='chartCaption'>{paper.name}{' dataset citations by country'}</span>
</div>
<div>
<C3Chart
@@ -105,6 +107,7 @@ class PieCharts extends Component {
height: 316,
}}
/>
+ <span className='chartCaption'>{paper.name}{' dataset citations by organization type'}</span>
</div>
</div>
)
diff --git a/client/index.js b/client/index.js
index 5c8bc880..5a7315b5 100644
--- a/client/index.js
+++ b/client/index.js
@@ -87,9 +87,9 @@ function runApplets() {
if (dataset === 'index.html') {
dataset = path.pop()
}
- console.log('dataset from path:', dataset)
+ // console.log('dataset from path:', dataset)
} else {
- console.log('not on a dataset page')
+ // console.log('not on a dataset page')
return [el, payload]
}
}
diff --git a/client/map/index.js b/client/map/index.js
index 9ca43867..475ba3c6 100644
--- a/client/map/index.js
+++ b/client/map/index.js
@@ -104,10 +104,10 @@ export default function append(el, payload) {
let citationsByAddress = {}
citations.forEach(citation => {
if (!citation.addresses) {
- console.log(citation)
+ // console.log(citation)
return
}
- console.log(citation)
+ // console.log(citation)
citation.addresses.forEach(address => {
if (!(address.name in citationsByAddress)) {
citationsByAddress[address.name] = { address, citations: []}
@@ -118,7 +118,7 @@ export default function append(el, payload) {
Object.keys(citationsByAddress).map(name => {
const { citations: citationList, address: citationAddress } = citationsByAddress[name]
- console.log(name, citationsByAddress[name])
+ // console.log(name, citationsByAddress[name])
// console.log(citation)
const latlng = [citationAddress.lat, citationAddress.lng].map(n => parseFloat(n))
if (Number.isNaN(latlng[0]) || Number.isNaN(latlng[1])) return
@@ -135,7 +135,7 @@ export default function append(el, payload) {
addArc(map, source, latlng, style)
})
- console.log(paper)
+ // console.log(paper)
const rootMarker = addMarker(map, source, [paper])
rootMarker.openPopup()
diff --git a/scraper/client/paper/paper.verify.js b/scraper/client/paper/paper.verify.js
index 83eb5b44..fcebac02 100644
--- a/scraper/client/paper/paper.verify.js
+++ b/scraper/client/paper/paper.verify.js
@@ -60,6 +60,7 @@ class PaperVerify extends Component {
...initialState,
...citationState,
...address.paper,
+ pdfIndex: citationState.citations.pdf.findIndex(el => el.pdf.match(/^http:/)),
}
this.setState(newState)
} else if (verify && !verify.loading && verify.paper && (!oldPaper || oldPaper !== verify.paper)) {
@@ -70,6 +71,7 @@ class PaperVerify extends Component {
...initialState,
...citationState,
...address.paper,
+ pdfIndex: citationState.citations.pdf.findIndex(el => el.pdf.match(/^http:/)),
}
this.setState(newState)
} else {
@@ -79,6 +81,7 @@ class PaperVerify extends Component {
newState = {
...citationState,
...address.paper,
+ pdfIndex: citationState.citations.pdf.findIndex(el => el.pdf.match(/^http:/)),
uses_dataset: paper.uses_dataset,
images_in_paper: paper.images_in_paper,
verified_by: paper.verified_by,
@@ -156,7 +159,7 @@ class PaperVerify extends Component {
if (citationIndex < 0) {
history.push('/paper/' + key + '/info/')
} else {
- let nextId = citations[citationIndex].id
+ let nextId = sortedCitations[citationIndex].id
history.push('/paper/' + key + '/verify/' + nextId)
}
}
@@ -172,10 +175,10 @@ class PaperVerify extends Component {
history.push('/paper/' + key + '/info/')
} else {
citationIndex += 1
- if (citationIndex >= citations.length) {
+ if (citationIndex >= sortedCitations.length) {
history.push('/paper/' + key + '/info/')
} else {
- let nextId = citations[citationIndex].id
+ let nextId = sortedCitations[citationIndex].id
history.push('/paper/' + key + '/verify/' + nextId)
}
}
@@ -414,7 +417,10 @@ class PaperVerify extends Component {
>{'Next >'}</button>
</div>
- <iframe className='pdfViewer' referrerPolicy='no-referrer' src={citation.pdf[this.state.pdf_index]} />
+ {citation.pdf.length
+ ? <iframe className='pdfViewer' referrerPolicy='no-referrer' src={citation.pdf[this.state.pdf_index] || "about:blank"} />
+ : ''
+ }
</div>
)
}
diff --git a/site/assets/css/applets.css b/site/assets/css/applets.css
index 10c0e786..41d04783 100644
--- a/site/assets/css/applets.css
+++ b/site/assets/css/applets.css
@@ -222,6 +222,10 @@
}
.piechart .chart > div {
width: 50%;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ align-items: center;
}
.piechart .chart .c3-chart-arc text {
fill: #fff;
@@ -231,4 +235,10 @@
}
.piechart .c3 path, .piechart .c3 line {
stroke: rgba(64,64,64,0.3);
-} \ No newline at end of file
+}
+.piechart .chartCaption {
+ color: #888;
+ font-size: 12px;
+ font-family: 'Roboto', sans-serif;
+ font-weight: 400;
+}
diff --git a/site/public/about/faq/index.html b/site/public/about/faq/index.html
index 738759ab..b86dac22 100644
--- a/site/public/about/faq/index.html
+++ b/site/public/about/faq/index.html
@@ -29,12 +29,11 @@
<section><h1>FAQs</h1>
<section class="about-menu">
<ul>
- <li><a href="/about/">About</a></li>
- <li><a href="/about/press/">Press</a></li>
- <li><a class="current" href="/about/credits/">Credits</a></li>
- <li><a href="/about/disclaimer/">Disclaimer</a></li>
- <li><a href="/about/terms/">Terms and Conditions</a></li>
- <li><a href="/about/privacy/">Privacy Policy</a></li>
+<li><a href="/about/">About</a></li>
+<li><a class="current" href="/about/faq/">FAQs</a></li>
+<li><a href="/about/press/">Press</a></li>
+<li><a href="/about/terms/">Terms</a></li>
+<li><a href="/about/privacy/">Privacy</a></li>
</ul>
</section><p>[ page under development ]</p>
</section>
diff --git a/site/public/about/press/index.html b/site/public/about/press/index.html
index e2e646da..3fc33969 100644
--- a/site/public/about/press/index.html
+++ b/site/public/about/press/index.html
@@ -30,11 +30,10 @@
<section class="about-menu">
<ul>
<li><a href="/about/">About</a></li>
+<li><a href="/about/faq/">FAQs</a></li>
<li><a class="current" href="/about/press/">Press</a></li>
-<li><a href="/about/credits/">Credits</a></li>
-<li><a href="/about/disclaimer/">Disclaimer</a></li>
-<li><a href="/about/terms/">Terms and Conditions</a></li>
-<li><a href="/about/privacy/">Privacy Policy</a></li>
+<li><a href="/about/terms/">Terms</a></li>
+<li><a href="/about/privacy/">Privacy</a></li>
</ul>
</section><p>(TEMPORARY PAGE)</p>
<ul>
diff --git a/site/public/about/privacy/index.html b/site/public/about/privacy/index.html
index f6915d66..2e1b3349 100644
--- a/site/public/about/privacy/index.html
+++ b/site/public/about/privacy/index.html
@@ -30,11 +30,10 @@
<section class="about-menu">
<ul>
<li><a href="/about/">About</a></li>
+<li><a href="/about/faq/">FAQs</a></li>
<li><a href="/about/press/">Press</a></li>
-<li><a href="/about/credits/">Credits</a></li>
-<li><a href="/about/disclaimer/">Disclaimer</a></li>
-<li><a href="/about/terms/">Terms and Conditions</a></li>
-<li><a class="current" href="/about/privacy/">Privacy Policy</a></li>
+<li><a href="/about/terms/">Terms</a></li>
+<li><a class="current" href="/about/privacy/">Privacy</a></li>
</ul>
</section><p>(TEMPORARY PAGE)</p>
<p>A summary of our privacy policy is as follows:</p>
diff --git a/site/public/about/terms/index.html b/site/public/about/terms/index.html
index b86eae88..58e49b78 100644
--- a/site/public/about/terms/index.html
+++ b/site/public/about/terms/index.html
@@ -30,11 +30,10 @@
<section class="about-menu">
<ul>
<li><a href="/about/">About</a></li>
+<li><a href="/about/faq/">FAQs</a></li>
<li><a href="/about/press/">Press</a></li>
-<li><a href="/about/credits/">Credits</a></li>
-<li><a href="/about/disclaimer/">Disclaimer</a></li>
-<li><a class="current" href="/about/terms/">Terms and Conditions</a></li>
-<li><a href="/about/privacy/">Privacy Policy</a></li>
+<li><a class="current" href="/about/terms/">Terms</a></li>
+<li><a href="/about/privacy/">Privacy</a></li>
</ul>
</section><p>(TEMPORARY PAGE)</p>
<p>(FPO: this is only example text)</p>