Spaces:
Runtime error
Runtime error
Create templates/index.html
Browse files- app/templates/index.html +78 -0
app/templates/index.html
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- app/templates/index.html -->
|
2 |
+
<!DOCTYPE html>
|
3 |
+
<html lang="en">
|
4 |
+
<head>
|
5 |
+
<meta charset="UTF-8">
|
6 |
+
<title>PDF Language Issue Analyzer</title>
|
7 |
+
<style>
|
8 |
+
body {
|
9 |
+
font-family: Arial, sans-serif;
|
10 |
+
margin: 40px;
|
11 |
+
}
|
12 |
+
.container {
|
13 |
+
max-width: 800px;
|
14 |
+
margin: auto;
|
15 |
+
}
|
16 |
+
.upload-section {
|
17 |
+
border: 2px dashed #ccc;
|
18 |
+
padding: 20px;
|
19 |
+
text-align: center;
|
20 |
+
}
|
21 |
+
.upload-section:hover {
|
22 |
+
border-color: #333;
|
23 |
+
}
|
24 |
+
.results {
|
25 |
+
margin-top: 20px;
|
26 |
+
}
|
27 |
+
.issues {
|
28 |
+
margin-top: 10px;
|
29 |
+
}
|
30 |
+
.pdf-viewer {
|
31 |
+
margin-top: 20px;
|
32 |
+
}
|
33 |
+
</style>
|
34 |
+
</head>
|
35 |
+
<body>
|
36 |
+
<div class="container">
|
37 |
+
<h1>PDF Language Issue Analyzer</h1>
|
38 |
+
<div class="upload-section">
|
39 |
+
<form id="upload-form" enctype="multipart/form-data" method="post" action="/analyze">
|
40 |
+
<input type="file" name="file" accept="application/pdf" required>
|
41 |
+
<br><br>
|
42 |
+
<button type="submit">Analyze PDF</button>
|
43 |
+
</form>
|
44 |
+
</div>
|
45 |
+
|
46 |
+
{% if language_issues %}
|
47 |
+
<div class="results">
|
48 |
+
<h2>Language Issues Found: {{ language_issues.total_issues }}</h2>
|
49 |
+
<div class="issues">
|
50 |
+
<ul>
|
51 |
+
{% for issue in language_issues.issues %}
|
52 |
+
<li>
|
53 |
+
<strong>Message:</strong> {{ issue.message }}<br>
|
54 |
+
<strong>Context:</strong> {{ issue.context }}<br>
|
55 |
+
<strong>Suggestions:</strong>
|
56 |
+
{% if issue.suggestions %}
|
57 |
+
{{ issue.suggestions | join(", ") }}
|
58 |
+
{% else %}
|
59 |
+
None
|
60 |
+
{% endif %}
|
61 |
+
<hr>
|
62 |
+
</li>
|
63 |
+
{% endfor %}
|
64 |
+
</ul>
|
65 |
+
</div>
|
66 |
+
{% if annotated_pdf %}
|
67 |
+
<div class="pdf-viewer">
|
68 |
+
<h3>Annotated PDF:</h3>
|
69 |
+
<embed src="{{ annotated_pdf }}" type="application/pdf" width="100%" height="600px" />
|
70 |
+
<br>
|
71 |
+
<a href="{{ annotated_pdf }}" download="annotated_document.pdf">Download Annotated PDF</a>
|
72 |
+
</div>
|
73 |
+
{% endif %}
|
74 |
+
</div>
|
75 |
+
{% endif %}
|
76 |
+
</div>
|
77 |
+
</body>
|
78 |
+
</html>
|