From b28f65ad5016ba3c3c9f973bd2a64ea3c8a3f84c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 18 Feb 2019 13:28:06 +0100 Subject: get institutions from spreadsheet --- scraper/client/paper/paper.address.js | 46 +++++++++++++++++++++-------------- scraper/client/paper/paper.css | 4 +++ 2 files changed, 32 insertions(+), 18 deletions(-) (limited to 'scraper/client/paper') diff --git a/scraper/client/paper/paper.address.js b/scraper/client/paper/paper.address.js index c571d8e2..267fe16b 100644 --- a/scraper/client/paper/paper.address.js +++ b/scraper/client/paper/paper.address.js @@ -146,7 +146,22 @@ class PaperAddress extends Component { return (

{citation.title}

-
{citation.id}
+
+ {citation.id} + {' | PDFs: '} + {citation.pdf.map((pdf,i) => { + const domain = pdf.replace('www.','').split('/').slice(2,3)[0] || 'unknown' + return ( + this.setState({ pdf_index: i })} + className={i === this.state.pdf_index ? 'selected pdfLink' : 'pdfLink'} + > + {'[' + domain + '] '} + + ) + })} +
{ + this.setState({ institution_1: '' }) + }} ref={ref => this.institution_1 = ref} />
@@ -187,6 +205,9 @@ class PaperAddress extends Component { onSelect={value => { this.setState({ institution_2: value }) }} + onCancel={value => { + this.setState({ institution_2: '' }) + }} ref={ref => this.institution_2 = ref} />
@@ -208,6 +229,9 @@ class PaperAddress extends Component { this.setState({ institution_3: value }) // this.institution_4._el.focus() }} + onCancel={value => { + this.setState({ institution_3: '' }) + }} ref={ref => this.institution_3 = ref} /> @@ -227,7 +251,9 @@ class PaperAddress extends Component { value={this.state.institution_4} onSelect={value => { this.setState({ institution_4: value }) - this.button.focus() + }} + onCancel={value => { + this.setState({ institution_4: '' }) }} ref={ref => this.institution_4 = ref} /> @@ -256,22 +282,6 @@ class PaperAddress extends Component { >{'Next >'} -
- {citation.pdf.map((pdf,i) => { - const pdf_partz = pdf.replace('www.','').split('/').slice(2,3)[0] || 'unknown' - let domain = '' - return ( - this.setState({ pdf_index: i })} - className={i === this.state.pdf_index ? 'selected' : ''} - > - {'[' + domain + ']'} - - ) - })} -
-