Skip to content

Commit 48e56d8

Browse files
committed
Improve archived_image page
1 parent b3e7da7 commit 48e56d8

2 files changed

Lines changed: 45 additions & 34 deletions

File tree

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,48 @@
11

2-
<html>
3-
<head>
4-
<title>IDR: Archived Image</title>
5-
</head>
6-
<style>
7-
body {
8-
font-family: Arial, sans-serif;
9-
margin: 20px;
10-
}
11-
</style>
12-
<body>
13-
<h1>Image Archived</h1>
14-
<h2>Study: {{ idr_study }}</h2>
15-
<h2>Image Name: {{ image.name }}</h2>
16-
<h3>ID: {{ image.id }}</h3>
17-
<p>This image is archived and cannot be viewed.</p>
2+
{% extends "idr_gallery/base.html" %}
183

4+
{% block content %}
5+
6+
<style>
7+
article {
8+
max-width: 800px;
9+
margin: 0 auto;
10+
padding: 20px;
11+
}
12+
</style>
13+
14+
<article>
15+
<h1>Image Archived</h1>
16+
<h2>Study: {{ idr_study }}</h2>
17+
<h2>Image Name: {{ image.name }}</h2>
18+
<h3>ID: {{ image.id }}</h3>
19+
<p>This image is archived and cannot be viewed.</p>
20+
21+
{% if fileset %}
22+
<h3>Image Files</h3>
23+
<p>The following files are associated with this image:</p>
1924
<ul>
20-
<li>Image Path: {{ img_path }}</li>
21-
<li>Data Location: {{ data_location }}</li>
22-
<li>Is Zarr?: {{ is_zarr }}</li>
23-
<li>Download URL: <a href="{{ download_url }}">{{ download_url }}</a></li>
24-
<li>BIA NGFF ID: {{ bia_ngff_id }}</li>
25+
{% for file in fileset.file_urls %}
26+
<li>
27+
{% if file.url %}
28+
<a href="{{ file.url }}">{{ file.path }}</a>
29+
{% else %}
30+
{{ file.path }}
31+
{% endif %}
32+
</li>
33+
{% endfor %}
2534
</ul>
35+
{% else %}
36+
<p>No associated fileset.</p>
37+
{% endif %}
2638

27-
<h3>Image Files</h3>
28-
{% if fileset %}
29-
<h2>Fileset ID: {{ fileset.id }}</h2>
30-
<ul>
31-
{% for file in fileset.file_urls %}
32-
<li><a href="{{ file.url }}">{{ file.path }}</a></li>
33-
{% endfor %}
34-
</ul>
35-
{% else %}
36-
<p>No associated fileset.</p>
37-
{% endif %}
38-
</body>
39-
</html>
39+
<ul style="background: white;">
40+
<li>Image Path: {{ img_path }}</li>
41+
<li>Data Location: {{ data_location }}</li>
42+
<li>Is Zarr?: {{ is_zarr }}</li>
43+
<li>Download URL: <a href="{{ download_url }}">{{ download_url }}</a></li>
44+
<li>BIA NGFF ID: {{ bia_ngff_id }}</li>
45+
</ul>
46+
</article>
47+
48+
{% endblock %}

idr_gallery/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,8 @@ def image_viewer(request, iid, conn=None, **kwargs):
531531
if idrid_name in path:
532532
file_path = path.split(idrid_name, 1)[-1]
533533
file_urls.append({"url": f"{download_url}{file_path}", "path": file_path})
534+
else:
535+
file_urls.append({"url": None, "path": path})
534536
fileset_id = image.fileset.id.val
535537
rsp_json["fileset"] = {
536538
"id": fileset_id,

0 commit comments

Comments
 (0)