Spaces:
Runtime error
Runtime error
Update templates/result.html
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Processed Data</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<style>
body {
background-color: #1d2329;
color: #e0e0e0;
font-family: 'Arial', sans-serif;
}
.container {
display: flex;
flex-direction: row;
height: 100vh;
margin-top: 20px;
}
.left-side {
flex: 1;
padding: 20px;
overflow-y: auto;
border: none;
border-radius: 10px;
}
.right-side {
flex: 1;
padding: 20px;
background-color: #1d2c38;
border-left: 1px solid #4e5d6c;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
}
.card {
background-color: #2a2f36;
border: none;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
margin-bottom: 20px;
}
.card-header {
background-color: #28a745;
color: white;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.list-group-item {
border: none;
background-color: #3a4149;
color: #e0e0e0;
padding: 10px;
}
iframe {
width: 100%;
height: 100%;
border: none;
border-radius: 12px;
}
.list-group-item strong {
color: #e0e0e0;
}
h2 {
margin-bottom: 20px;
color: #e0e0e0;
}
h3 {
margin-top: 10px;
margin-bottom: 10px;
font-size: 1.25rem;
color: #28a745;
}
pre {
background-color: #3a4149;
padding: 10px;
border-radius: 5px;
font-size: 1rem;
color: #e0e0e0;
overflow-x: auto;
}
.card-footer {
text-align: center;
border-top: 1px solid #4e5d6c;
padding: 15px;
}
.no-pdf-message {
text-align: center;
font-size: 1.25rem;
color: #6c757d;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.2);
}
100% {
transform: scale(1);
}
}
.emoji {
font-size: 2rem;
animation: pulse 1s infinite;
display: inline-block;
margin-right: 10px;
}
.emoji-high {
color: #28a745;
}
.emoji-medium {
color: #ffc107;
}
.emoji-low {
color: #dc3545;
}
a {
color: #007bff;
}
</style>
</head>
<body>
<div class="container">
<div class="left-side">
<div class="card">
<div class="card-header text-center">
<h3>Model</h3>
<h2>Extracted Details</h2>
</div>
<div class="card-body">
<ul class="list-group mb-3">
<li class="list-group-item">
<strong>Extracted Data:</strong>
{% for filename, text in data.extracted_text.items() %}
<h3>{{ filename }}:</h3>
<img src="{{ Img[filename] }}" alt="Processed Image" class="img-fluid mb-3"
style="max-width: 100%; height: auto;" />
<strong>Text:</strong>
<p>{{ text }}</p>
{% endfor %}
</li>
<li class="list-group-item">
<strong>Name:</strong>
{% if data.name is iterable and data.name is not string %}
<ul>
{% for value in data.name %}
<li>{{ value }}<br></li>
{% endfor %}
</ul>
{% else %}
<p>{{ data.name }}</p>
{% endif %}
</li>
<li class="list-group-item">
<strong>Designation:</strong>
{% if data.Designation is iterable and data.Designation is not string %}
<ul>
{% for value in data.Designation %}
<li>{{ value }}<br></li>
{% endfor %}
</ul>
{% else %}
<p>{{ data.Designation }}</p>
{% endif %}
</li>
<li class="list-group-item">
<strong>Contact Number:</strong>
{% if data.contact_number is iterable and data.contact_number is not string %}
<ul>
{% for value in data.contact_number %}
<li>{{ value }}<br></li>
{% endfor %}
</ul>
{% else %}
<p>{{ data.contact_number }}</p>
{% endif %}
</li>
<li class="list-group-item">
<strong>Email:</strong>
{% if data.email is iterable and data.email is not string %}
<ul>
{% for value in data.email %}
<li>{{ value }}<br></li>
{% endfor %}
</ul>
{% else %}
<p>{{ data.email }}</p>
{% endif %}
</li>
<li class="list-group-item">
<strong>Address:</strong>
{% if data.Location is iterable and data.Location is not string %}
<ul>
{% for value in data.Location %}
<li>{{ value }}<br></li>
{% endfor %}
</ul>
{% else %}
<p>{{ data.Location }}</p>
{% endif %}
</li>
<li class="list-group-item">
<strong>Links:</strong>
{% if data.Link is iterable and data.Link is not string %}
<ul>
{% for value in data.Link %}
<li>{{ value }}<br></li>
{% endfor %}
</ul>
{% else %}
<p>{{ data.Link }}</p>
{% endif %}
</li>
<li class="list-group-item">
<strong>Organisation:</strong>
{% if data.Company is iterable and data.Company is not string %}
<ul>
{% for value in data.Company %}
<li>{{ value }}<br></li>
{% endfor %}
</ul>
{% else %}
<p>{{ data.Company }}</p>
{% endif %}
</li>
</ul>
<a href="{{ url_for('index') }}">
<button type="button" class="btn btn-primary">Back to Upload</button>
</a>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html><!DOCTYPE html><html lang="en">
<head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Processed Results</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" /> <style> body { background-color: #1c1c1e; font-family: "Poppins", sans-serif; color: #f5f5f7; }
h1 { color: #e5e5e7; text-align: center; /* margin-bottom: 20px; */ }
.cont { background-color: #2c2c2e; padding: 30px; border-radius: 15px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); transition: 1s ease; }
.section-title { color: #ee4410; font-size: 1.5rem; font-weight: bold; margin-top: 20px; border-bottom: 2px solid #ee4410; padding-bottom: 10px; }
.card { background-color: #3a3a3c; color: #f5f5f7; border-radius: 10px; margin-bottom: 15px; padding: 15px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); transition: background-color 0.3s ease; }
.card:hover { background-color: #3a3a3c98; }
.card-title { color: #ee4410; font-size: 1.2rem; font-weight: bold; }
.card-text { color: #d1d1d6; font-size: 1rem; }
ul { list-style-type: none; padding-left: 0; }
li::before { content: "• "; color: #ee4410; }
.btn-reset { background-color: #ff9f0a; color: white; border: none; padding: 10px 20px; border-radius: 5px; transition: background-color 0.3s ease; margin-bottom: 20px; }
.btn-reset:hover { background-color: #e03a2f; }
.alert { text-align: center; position: absolute; top: 0; right: 15%; /* right: 50%; transform: translateX(-50%); */ } </style></head>
<body> <div class="container"> {% with messages = get_flashed_messages() %} {% if messages %} <div class="alert alert-success mt-4 " id="flash-message"> {{ messages[0] }} </div> {% endif %} {% endwith %}
<!-- <div class="alert alert-success mt-4 " id="flash-message"> sfdsdaa asfcsd sdgsfr sdfgfd jhijunb hun hjujbuy hgbuuuu jjf </div> --> </div> <div class="container cont mt-5"> <div class="d-flex align-items-center justify-content-between"> <h1>Extracted Details From Image</h1> <!-- Reset Button --> <div class="text-center mt-4"> <a href="{{ url_for('reset_upload') }}" class="btn btn-reset">Reset & Upload New File</a> </div> </div> {% if data %} <!-- Personal Information Section --> <section> <h3 class="section-title">Extracted Information</h3> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-body"> <div class="card"> <div class="card-body"> <h5 class="card-title">Extracted Data:</h5> {% if data.extracted_text.items() %} <ul> {% for filename, text in data.extracted_text.items() %} <li>{{ filename }}:</li> <img src="{{ Img[filename] }}" alt="Processed Image" class="img-fluid" /> <strong>Text:</strong> <p>{{ text }}</p> {% endfor %} </ul> {% else %} <p>No tools found</p> {% endif %} </div> </div> <div class="card-body"> <h5 class="card-title">Name:</h5> {% if data.name is iterable and data.name is not string %} <ul> {% for value in data.name %} <li>{{ value }}</li> {% endfor %} </ul> {% else %} <p>No tools found</p> {% endif %} </div> <div class="card-body"> <h5 class="card-title">Name:</h5> {% if data.name is iterable and data.name is not string %} <ul> {% for value in data.name %} <li>{{ value }}</li> {% endfor %} </ul> {% else %} <p>No tools found</p> {% endif %} </div> <div class="card-body"> <h5 class="card-title">Designation:</h5> {% if data.Designation is iterable and data.Designation is not string %} <ul> {% for value in data.Designation %} <li>{{ value }}</li> {% endfor %} </ul> {% else %} <p>No tools found</p> {% endif %} </div> <div class="card-body"> <h5 class="card-title">Contact number:</h5> {% if data.contact_number is iterable and data.contact_number is not string %} <ul> {% for value in data.contact_number %} <li>{{ value }}</li> {% endfor %} </ul> {% else %} <p>No tools found</p> {% endif %} </div> <div class="card-body"> <h5 class="card-title">Email:</h5> {% if data.email is iterable and data.email is not string %} <ul> {% for value in data.email %} <li>{{ value }}</li> {% endfor %} </ul> {% else %} <p>No tools found</p> {% endif %} </div> <div class="card-body"> <h5 class="card-title">Location:</h5> {% if data.Location is iterable and data.Location is not string %} <ul> {% for value in data.Location %} <li>{{ value }}</li> {% endfor %} </ul> {% else %} <p>No tools found</p> {% endif %} </div> <div class="card-body"> <h5 class="card-title">Link:</h5> {% if data.Link is iterable and data.Link is not string %} <ul> {% for value in data.Link %} <li>{{ value }}</li> {% endfor %} </ul> {% else %} <p>No tools found</p> {% endif %} </div> <div class="card-body"> <h5 class="card-title">Organisation:</h5> {% if data.Company is iterable and data.Company is not string %} <ul> {% for value in data.Company %} <li>{{ value }}</li> {% endfor %} </ul> {% else %} <p>No tools found</p> {% endif %} </div> </div> </div> </div> </div> </section>
{% else %} <p>No data available. Please process a file.</p> {% endif %} </div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> <script> setTimeout(function () { let flashMessage = document.getElementById("flash-message"); if (flashMessage) { flashMessage.style.transition = "opacity 1s ease"; flashMessage.style.opacity = 0; setTimeout(() => flashMessage.remove(), 1000); } }, 3000); </script></body>
</html>templates/result.html+267-264