mirror of
https://github.com/ilri/csv-metadata-quality-web.git
synced 2025-05-08 06:06:01 +02:00
Move csv_metadata_quality_web to a package
Eventually I will want to refactor so this will be necessary.
This commit is contained in:
5
csv_metadata_quality_web/templates/footer.html
Normal file
5
csv_metadata_quality_web/templates/footer.html
Normal file
@ -0,0 +1,5 @@
|
||||
<footer class="footer mt-auto py-3">
|
||||
<div class="container">
|
||||
<span><a href="https://github.com/ilri/csv-metadata-quality">csv-metadata-quality</a> v{{ cli_version }}</span>
|
||||
</div>
|
||||
</footer>
|
8
csv_metadata_quality_web/templates/head.html
Normal file
8
csv_metadata_quality_web/templates/head.html
Normal file
@ -0,0 +1,8 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="Simple web interface for the DSpace CSV Metadata Quality tool.">
|
||||
<meta name="author" content="Alan Orth">
|
||||
<title>DSpace CSV Metadata Quality Checker</title>
|
||||
<link href="{{ url_for('static', filename='css/style.min.css') }}" rel="stylesheet">
|
||||
</head>
|
7
csv_metadata_quality_web/templates/header.html
Normal file
7
csv_metadata_quality_web/templates/header.html
Normal file
@ -0,0 +1,7 @@
|
||||
<header>
|
||||
<div class="navbar navbar-dark bg-dark shadow-sm">
|
||||
<div class="container">
|
||||
<a href="/" class="navbar-brand text-white text-decoration-none">DSpace CSV Metadata Quality Checker</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
52
csv_metadata_quality_web/templates/index.html
Normal file
52
csv_metadata_quality_web/templates/index.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!doctype html>
|
||||
<html lang="en" class="h-100">
|
||||
{% include 'head.html' %}
|
||||
<body class="d-flex flex-column h-100">
|
||||
{% include 'header.html' %}
|
||||
<main class="flex-shrink-0">
|
||||
<div class="container py-3">
|
||||
<p class="lead">The DSpace CSV Metadata Quality Checker is a collection of sanity checks and automated fixes for a number of common issues in metadata files.</p>
|
||||
<form method="POST" action="" enctype="multipart/form-data">
|
||||
<div class="mb-3">
|
||||
<label for="formFile" class="form-label">Select a CSV file to process (or try <a href="https://raw.githubusercontent.com/ilri/csv-metadata-quality/master/data/test.csv">test.csv</a>)</label>
|
||||
<input class="form-control" type="file" id="formFile" name="file" accept=".csv">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-text">
|
||||
Skip fields(s)
|
||||
<input class="form-check-input" type="checkbox" id="excludeFieldsCheckbox" name="excludeCheckbox" aria-label="Checkbox for following text input">
|
||||
</div>
|
||||
<input type="text" class="form-control" placeholder="dcterms.subject" id="excludeFieldsText" name="excludeText" aria-label="Text input with checkbox">
|
||||
<div id="excludeHelp" class="form-text">Optionally indicate fields to skip during analysis. Separate multiple fields with a comma, for example: <code>dcterms.issued,dcterms.subject</code>.</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-text">
|
||||
Validate field(s) against AGROVOC
|
||||
<input class="form-check-input" type="checkbox" checked="true" id="agrovocFieldsCheckbox" name="agrovocCheckbox" aria-label="Checkbox for following text input">
|
||||
</div>
|
||||
<input type="text" class="form-control" value="dcterms.subject" id="agrovocFieldsText" name="agrovocText" aria-label="Text input with checkbox">
|
||||
<div id="agrovocHelp" class="form-text">Optionally indicate fields to validate against <a href="https://agrovoc.uniroma2.it/agrovoc/agrovoc/en/" title="AGROVOC Multilingual Thesaurus">AGROVOC</a>. Separate multiple fields with a comma, for example: <code>dcterms.subject,cg.coverage.country</code>. Note: this can take an extra minute or more depending on your data. If you have a problem please try again and it will generally be faster the second time.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" checked="true" id="unsafeCheckbox" name="unsafe">
|
||||
<label class="form-check-label" for="unsafeCheckbox" aria-describedby="unsafeHelp">Enable unsafe fixes</label>
|
||||
<div id="unsafeHelp" class="form-text">This will remove newlines and perform <a href="https://withblue.ink/2019/03/11/why-you-need-to-normalize-unicode-strings.html" title='When "Zoë" !== "Zoë". Or why you need to normalize Unicode strings'>normalization of Unicode characters</a>. Read more about these <a href="https://github.com/ilri/csv-metadata-quality#unsafe-fixes">unsafe fixes</a>.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" id="experimentalCheckbox" name="experimental">
|
||||
<label class="form-check-label" for="experimentalCheckbox" aria-describedby="experimentalHelp">Enable experimental checks</label>
|
||||
<div id="experimentalHelp" class="form-text">Attempt to validate whether the value of an item's <code>dc.language.iso</code> or <code>dcterms.language</code> field matches the <em>actual</em> language of text used in its title, abstract, and citation. Read more about these <a href="https://github.com/ilri/csv-metadata-quality#experimental-checks">experimental checks</a>.</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% include 'footer.html' %}
|
||||
</body>
|
||||
</html>
|
21
csv_metadata_quality_web/templates/result.html
Normal file
21
csv_metadata_quality_web/templates/result.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
<html lang="en" class="h-100">
|
||||
{% include 'head.html' %}
|
||||
<body class="d-flex flex-column h-100">
|
||||
{% include 'header.html' %}
|
||||
<main class="flex-shrink-0">
|
||||
<div class="container py-3">
|
||||
<p class="lead">The DSpace CSV Metadata Quality Checker is a collection of sanity checks and automated fixes for a number of common issues in metadata files.</p>
|
||||
<h3>Results</h3>
|
||||
<p>Results for <code>{{ filename }}</code>. Download <a href="/result/{{ base64name }}/download" title="{{ filename | replace('.csv', '-cleaned.csv') }}">cleaned file</a>.</p>
|
||||
<h3>Log</h3>
|
||||
<p>The detailed log of the analysis is below. <span style="color: #00aa00">Green</span> indicates a fix was applied, <span style="color: #aa0000">red</span> indicates an error, and <span style="color: #aa5500">orange</span> indicates a warning.</p>
|
||||
<blockquote>
|
||||
{{- stdout | safe -}}
|
||||
</blockquote>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% include 'footer.html' %}
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user