Brain-MRI-Analysis / templates /history.html
MohammedAH's picture
Upload 55 files
5fd1a86 verified
<!-- templates/history.html -->
{% extends "base.html" %}
{% block title %}Analysis History{% endblock %}
{% block content %}
<div class="max-w-6xl mx-auto">
<div class="bg-white rounded-lg shadow-lg p-6 mb-6">
<h1 class="text-3xl font-bold text-blue-600 mb-6">Analysis History</h1>
{% if analyses %}
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Image</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Classification</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Confidence</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
{% for item in analyses %}
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ item.created_at }}
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="h-16 w-16 flex-shrink-0">
<img class="h-16 w-16 object-cover rounded-md" src="{{ '/' + item.original_path }}" alt="MRI scan">
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full
{% if item.classification == 'no_tumor' %}
bg-green-100 text-green-800
{% else %}
bg-red-100 text-red-800
{% endif %}">
{{ item.classification.replace('_', ' ').title() }}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ (item.confidence * 100) | round(1) }}%
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
<a href="{{ url_for('result', analysis_id=item.id) }}" class="text-blue-600 hover:text-blue-900">View Details</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center py-10">
<p class="text-gray-500">No analysis history found.</p>
<a href="/" class="mt-4 inline-block bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg">
Perform an Analysis
</a>
</div>
{% endif %}
</div>
</div>
{% endblock %}