Fix template syntax errors - use dictionary access job['key'] instead of job.key

This commit is contained in:
nmemmert committed 2025-11-05 14:50:53 -05:00
1 parent 576ea9edec
commit 54cd87c0f4
3 files changed
+36 -36

No files matched your search

+13 -13
View File
@@ -148,39 +148,39 @@
<div class="job-section">
<h2>Job Information</h2>
<div class="job-info">
<div><strong>Job Name:</strong> {{ job.id }}</div>
<div><strong>Started:</strong> {{ job.timestamp.strftime('%Y-%m-%d %H:%M:%S') if job.timestamp else 'Unknown' }}</div>
<div><strong>Files:</strong> {{ job.file_count if job.file_count else 'Processing...' }}</div>
<div><strong>Job Name:</strong> {{ job['id'] }}</div>
<div><strong>Started:</strong> {{ job['timestamp'].strftime('%Y-%m-%d %H:%M:%S') if job['timestamp'] else 'Unknown' }}</div>
<div><strong>Files:</strong> {{ job['file_count'] if job['file_count'] else 'Processing...' }}</div>
<div><strong>Status:</strong>
<span class="status-{{ job.status }}">
{{ job.status.title() }}
<span class="status-{{ job['status'] }}">
{{ job['status'].title() }}
</span>
</div>
</div>
{% if job.status == 'processing' %}
{% if job['status'] == 'processing' %}
<div class="status-section">
<h3>Processing Progress</h3>
<p id="statusMessage">{{ job.message }}</p>
<progress id="progressBar" value="{{ job.progress }}" max="100"></progress>
<p id="statusMessage">{{ job['message'] }}</p>
<progress id="progressBar" value="{{ job['progress'] }}" max="100"></progress>
<div style="margin-top: 10px;">
<strong>{{ job.progress }}% Complete</strong>
</div>
</div>
{% endif %}
{% if job.status == 'completed' %}
{% if job['status'] == 'completed' %}
<div class="status-section">
<h3>Processing Complete!</h3>
<p>{{ job.message }}</p>
<progress value="100" max="100"></progress>
<div style="margin-top: 20px;">
<a href="{{ url_for('download_job', job_id=job.id) }}" class="download-btn" style="color: white; text-decoration: none; padding: 10px 20px; border-radius: 4px; display: inline-block;">Download Results</a>
<a href="{{ url_for('download_job', job_id=job['id']) }}" class="download-btn" style="color: white; text-decoration: none; padding: 10px 20px; border-radius: 4px; display: inline-block;">Download Results</a>
</div>
</div>
{% endif %}
{% if job.status == 'failed' %}
{% if job['status'] == 'failed' %}
<div class="status-section">
<h3>Processing Failed</h3>
<p>{{ job.message }}</p>
@@ -199,11 +199,11 @@
<a href="{{ url_for('results') }}">View All Jobs</a>
</div>
{% if job.status == 'processing' %}
{% if job['status'] == 'processing' %}
<script>
// Auto-refresh for processing jobs
function updateStatus() {
fetch('/api/job/{{ job.id }}/status')
fetch("/api/job/{{ job['id'] }}/status")
.then(response => response.json())
.then(data => {
document.getElementById('statusMessage').textContent = data.message;
+15 -15
View File
@@ -186,38 +186,38 @@
<div class="job-item">
<div class="job-header">
<div class="job-info">
<strong>Job Name:</strong> {{ job.id }}<br>
<strong>Started:</strong> {{ job.timestamp.strftime('%Y-%m-%d %H:%M:%S') if job.timestamp else 'Unknown' }}<br>
{% if job.file_count %}
<strong>Files:</strong> {{ job.file_count }}<br>
<strong>Job Name:</strong> {{ job['id'] }}<br>
<strong>Started:</strong> {{ job['timestamp'].strftime('%Y-%m-%d %H:%M:%S') if job['timestamp'] else 'Unknown' }}<br>
{% if job['file_count'] %}
<strong>Files:</strong> {{ job['file_count'] }}<br>
{% endif %}
<strong>Status:</strong>
{% if job.status == 'completed' %}
{% if job['status'] == 'completed' %}
<span class="status-completed">Completed</span>
{% elif job.status == 'processing' %}
{% elif job['status'] == 'processing' %}
<span class="status-processing">Processing</span>
{% elif job.status == 'failed' %}
{% elif job['status'] == 'failed' %}
<span class="status-failed">Failed</span>
{% elif job.status == 'queued' %}
{% elif job['status'] == 'queued' %}
<span class="status-queued">Queued</span>
{% else %}
<span>{{ job.status|title }}</span>
<span>{{ job['status']|title }}</span>
{% endif %}
{% if job.get('error') %}
<br><strong>Error:</strong> {{ job.error }}
<br><strong>Error:</strong> {{ job['error'] }}
{% endif %}
{% if job.get('message') %}
<br><strong>Message:</strong> {{ job.message }}
<br><strong>Message:</strong> {{ job['message'] }}
{% endif %}
</div>
<div class="job-actions">
<a href="{{ url_for('job_status', job_id=job.id) }}" class="view-btn" style="display: inline-block; padding: 8px 16px; text-decoration: none; color: white; background-color: #17a2b8; border-radius: 4px;">View Details</a>
{% if job.status == 'completed' %}
<form action="{{ url_for('download_job', job_id=job.id) }}" method="get" style="display: inline;">
<a href="{{ url_for('job_status', job_id=job['id']) }}" class="view-btn" style="display: inline-block; padding: 8px 16px; text-decoration: none; color: white; background-color: #17a2b8; border-radius: 4px;">View Details</a>
{% 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?')">
<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>
+8 -8
View File
@@ -175,26 +175,26 @@
<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>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' %}
{% 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 }}
<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;">
{% 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?')">
<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>