74 lines
2.9 KiB
HTML
74 lines
2.9 KiB
HTML
{% extends 'base.html' %}
|
||
{% block content %}
|
||
<h1>Welcome to SciPaperLoader</h1>
|
||
|
||
{% if success %}
|
||
<div class="alert alert-success mt-3">{{ success }}</div>
|
||
{% endif %}
|
||
|
||
{% if error_message %}
|
||
<div class="alert alert-warning mt-3">
|
||
<h4>{{ error_message }}</h4>
|
||
<table class="table table-sm table-bordered">
|
||
<thead>
|
||
<tr>
|
||
<th>Row</th>
|
||
<th>DOI</th>
|
||
<th>Error</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for error in error_samples %}
|
||
<tr>
|
||
<td>{{ error.row }}</td>
|
||
<td>{{ error.doi }}</td>
|
||
<td>{{ error.error }}</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
<a href="{{ url_for('upload.download_error_log') }}" class="btn btn-outline-secondary">Download Full Error Log</a>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<div class="alert alert-info">
|
||
<p><strong>Instructions:</strong> Please upload a CSV file containing academic paper metadata. The file must include the following columns:</p>
|
||
<ul>
|
||
<li><code>alternative_id</code> – an alternative title or abbreviation</li>
|
||
<li><code>journal</code> – the journal name</li>
|
||
<li><code>doi</code> – the digital object identifier</li>
|
||
<li><code>issn</code> – the ISSN of the journal</li>
|
||
<li><code>title</code> – the title of the paper</li>
|
||
</ul>
|
||
<p>The format of your CSV should resemble the response structure of the Crossref API's <code>/journals/{issn}/works</code> endpoint.</p>
|
||
</div>
|
||
|
||
<form method="POST" action="{{ url_for('upload.upload') }}" enctype="multipart/form-data">
|
||
<div class="mb-3">
|
||
<label class="form-label">How to handle duplicate DOIs:</label>
|
||
<div class="form-check">
|
||
<input class="form-check-input" type="radio" name="duplicate_strategy" value="skip" id="skip" checked>
|
||
<label class="form-check-label" for="skip">Skip duplicate entries</label>
|
||
</div>
|
||
<div class="form-check">
|
||
<input class="form-check-input" type="radio" name="duplicate_strategy" value="update" id="update">
|
||
<label class="form-check-label" for="update">Update existing entries</label>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="file">Upload CSV File</label>
|
||
<input type="file" name="file" id="file" class="form-control" required>
|
||
</div>
|
||
<div class="form-group mt-3">
|
||
<label for="delimiter">Choose CSV Delimiter</label>
|
||
<select name="delimiter" id="delimiter" class="form-control">
|
||
<option value=",">Comma (,)</option>
|
||
<option value=";">Semicolon (;)</option>
|
||
<option value="\t">Tab (\\t)</option>
|
||
<option value="|">Pipe (|)</option>
|
||
</select>
|
||
</div>
|
||
<button type="submit" class="btn btn-primary mt-3">Upload</button>
|
||
</form>
|
||
{% endblock %}
|