Files
eoy-pdf-sortandmerge/templates/results.html
T
nmemmert f4611c5aa4 Fix client-side issues: logo loading and JS errors
- Replace base64 logo with static file reference to avoid ERR_INVALID_URL
- Add missing status element to index.html to fix TypeError in XMLHttpRequest
- Reduce MAX_CONTENT_LENGTH from 1000TB to 100GB for practicality
- Update all templates to use logo_url instead of logo_b64
- Update Waitress max_request_body_size to match Flask limit
2025-11-06 08:15:49 -05:00

219 lines
7.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Processing Results - End of Year Statements</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 1000px;
margin: 0 auto;
padding: 20px;
background-color: #f5f5f5;
}
.header {
text-align: center;
margin-bottom: 30px;
}
.logo {
max-width: 200px;
height: auto;
}
.results-section {
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
margin-bottom: 20px;
}
.job-item {
border: 1px solid #ddd;
border-radius: 4px;
padding: 15px;
margin-bottom: 10px;
background: #fafafa;
}
.job-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.job-info {
flex-grow: 1;
}
.job-actions {
display: flex;
gap: 10px;
}
button {
background-color: #007bff;
color: white;
padding: 8px 16px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
}
.delete-btn {
background-color: #dc3545;
}
.download-btn {
background-color: #28a745;
}
button:disabled {
background-color: #ccc;
cursor: not-allowed;
}
.no-jobs {
text-align: center;
color: #666;
font-style: italic;
}
.back-link {
display: inline-block;
margin-bottom: 20px;
color: #007bff;
text-decoration: none;
}
.back-link:hover {
text-decoration: underline;
}
.nav-links {
display: flex;
justify-content: center;
gap: 20px;
margin-bottom: 20px;
}
.nav-link {
color: #007bff;
text-decoration: none;
font-weight: bold;
padding: 8px 16px;
border: 2px solid #007bff;
border-radius: 4px;
transition: all 0.3s ease;
}
.nav-link:hover {
background-color: #007bff;
color: white;
}
.status-completed {
color: #28a745;
font-weight: bold;
}
.status-failed {
color: #dc3545;
font-weight: bold;
}
.auth-section {
margin-top: 20px;
text-align: center;
}
.user-info {
display: inline-block;
background: white;
padding: 10px 20px;
border-radius: 6px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.user-info span {
margin-right: 15px;
font-weight: bold;
}
.logout-btn, .login-btn {
background-color: #dc3545;
color: white;
padding: 6px 12px;
border: none;
border-radius: 4px;
text-decoration: none;
font-size: 14px;
display: inline-block;
}
.login-btn {
background-color: #28a745;
}
.logout-btn:hover, .login-btn:hover {
opacity: 0.8;
}
</style>
</head>
<body>
<div class="header">
<img src="{{ logo_url }}" alt="Logo" class="logo">
<h1>Processing Results</h1>
<p>View and download your completed PDF processing jobs</p>
<!-- Authentication section -->
<div class="auth-section">
{% if session.oauth_token %}
<div class="user-info">
<span>Welcome, {{ user_info.displayName or user_info.givenName or 'User' }}!</span>
<a href="{{ url_for('logout') }}" class="logout-btn">Logout</a>
</div>
{% else %}
<div class="login-prompt">
<a href="{{ url_for('login') }}" class="login-btn">Login with Microsoft</a>
</div>
{% endif %}
</div>
</div>
<div class="nav-links">
<a href="{{ url_for('index') }}" class="nav-link">📤 Upload Files</a>
<a href="{{ url_for('results') }}" class="nav-link">📋 View Results</a>
<a href="{{ url_for('jobs') }}" class="nav-link">📊 View All Jobs</a>
</div>
<a href="{{ url_for('index') }}" class="back-link">← Back to Upload</a>
<a href="{{ url_for('clear_and_upload') }}" class="back-link" style="margin-left: 20px;">🔄 Reprocess Files</a>
<div class="results-section">
<h2>Completed Jobs</h2>
{% if jobs %}
{% for job in jobs %}
<div class="job-item">
<div class="job-header">
<div class="job-info">
<strong>Job Name:</strong> {{ job['id'] }}<br>
<strong>Processed:</strong> {{ job['timestamp'].strftime('%Y-%m-%d %H:%M:%S') if job['timestamp'] else 'Unknown' }}<br>
<strong>Files:</strong> {{ job['file_count'] }}<br>
<strong>Status:</strong>
{% if job['status'] == 'completed' %}
<span class="status-completed">Completed</span>
{% else %}
<span class="status-failed">Failed</span>
{% endif %}
{% if job.get('error') %}
<br><strong>Error:</strong> {{ job['error'] }}
{% endif %}
</div>
<div class="job-actions">
{% if job['status'] == 'completed' %}
<form action="{{ url_for('download_job', job_id=job['id']) }}" method="get" style="display: inline;">
<button type="submit" class="download-btn">Download ZIP</button>
</form>
{% endif %}
<form action="{{ url_for('delete_job', job_id=job['id']) }}" method="post" style="display: inline;" onsubmit="return confirm('Are you sure you want to delete this job?')">
<button type="submit" class="delete-btn">Delete</button>
</form>
</div>
</div>
</div>
{% endfor %}
{% else %}
<p class="no-jobs">No completed jobs yet. <a href="{{ url_for('index') }}">Upload some files</a> to get started.</p>
{% endif %}
</div>
{% with messages = get_flashed_messages() %}
{% if messages %}
<div style="background: white; padding: 15px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-top: 20px;">
{% for message in messages %}
<p style="margin: 0; color: #28a745;">{{ message }}</p>
{% endfor %}
</div>
{% endif %}
{% endwith %}
</body>
</html>