|
17 | 17 | </style> |
18 | 18 |
|
19 | 19 | <article> |
20 | | - <h1>This Image is not viewable</h1> |
21 | | - <h2>Image Name: {{ image.name }}</h2> |
22 | | - <strong>ID: {{ image.id }}</strong><br /> |
23 | | - <strong>Study: {{ idr_study }}</strong> |
24 | | - <p> |
25 | | - Due to infrastructure limitations, this image is not viewable. The IDR only |
26 | | - supports the viewing of OME-Zarr images. |
27 | | - </p> |
| 20 | + <div style="display: flex; gap: 20px; flex-direction: row;"> |
| 21 | + <div style="flex: 0 0 96px;"> |
| 22 | + <img src="{% url 'render_thumbnail' image.id %}" alt="Thumbnail for {{ image.name }}" border: 1px solid #ccc; border-radius: 5px;"> |
| 23 | + </div> |
| 24 | + <div style="flex: 1 1 auto"> |
| 25 | + |
| 26 | + <h2>Image Name: {{ image.name }}</h2> |
| 27 | + <strong>ID: {{ image.id }}</strong><br /> |
| 28 | + <strong>Study: {{ idr_study }}</strong> |
| 29 | + <p> |
| 30 | + This image is not viewable online. <br/> |
| 31 | + The IDR only supports the viewing of OME-Zarr images. |
| 32 | + </p> |
| 33 | + </div> |
| 34 | + </div> |
28 | 35 |
|
29 | 36 | {% if fileset %} |
30 | | - <h3>Image Files</h3> |
31 | | - {% if fileset.file_urls|length == 1 %} |
32 | | - <p>There is 1 file associated with this image:</p> |
| 37 | + <h3>Download Image Files</h3> |
| 38 | + {% if data_location == "Github" %} |
| 39 | + <p> |
| 40 | + This image is defined by a {% if is_pattern %}.pattern{% else %}companion.ome{% endif %} file |
| 41 | + and sibling .tiff files which are on GitHub (links below). |
| 42 | + Each .tiff file is a symbolic link to the actual image file in |
| 43 | + <!-- link is updated from download_urls.tsv info --> |
| 44 | + <a id="download_url_tsv" target="_blank" class="file_download" href="{{ download_url }}">{{ download_url }}</a>. |
| 45 | + </p> |
| 46 | + {% elif fileset.file_urls|length == 1 %} |
| 47 | + <p>There is 1 file associated with this image. Click to download:</p> |
| 48 | + {% else %} |
| 49 | + <p> |
| 50 | + There are {{ fileset.file_urls|length }} files associated with this image |
| 51 | + which can be downloaded from the links below. For more download options, |
| 52 | + including bulk download using Globus or FTP clients, see the |
| 53 | + <a href="/about/download.html">IDR Data download page</a>. |
| 54 | + </p> |
| 55 | + {% endif %} |
| 56 | + |
| 57 | + <ul> |
| 58 | + {% for file in fileset.file_urls %} |
| 59 | + <li> |
| 60 | + {% if file.url %} |
| 61 | + <a class="file_download" target="_blank" href="{{ file.url }}">{{ file.path }}</a> |
| 62 | + {% else %} {{ file.path }} {% endif %} |
| 63 | + </li> |
| 64 | + {% endfor %} |
| 65 | + </ul> |
33 | 66 | {% else %} |
34 | | - <p> |
35 | | - There are {{ fileset.file_urls|length }} files associated with this image |
36 | | - which can be downloaded from the links below. For more download options, |
37 | | - including bulk download using Globus or FTP clients, see the |
38 | | - <a href="/about/download.html">IDR Data download page</a>. |
39 | | - </p> |
| 67 | + <!-- Only expected for some OME-Zarr images (this page won't show for them) --> |
| 68 | + <p>No associated fileset.</p> |
40 | 69 | {% endif %} |
41 | | - <ul> |
42 | | - {% for file in fileset.file_urls %} |
43 | | - <li> |
44 | | - {% if file.url %} |
45 | | - <a class="file_download" href="{{ file.url }}">{{ file.path }}</a> |
46 | | - {% else %} {{ file.path }} {% endif %} |
47 | | - </li> |
48 | | - {% endfor %} |
49 | | - </ul> |
50 | | - {% else %} |
51 | | - <p>No associated fileset.</p> |
52 | | - {% endif %} Extra info (debug) |
53 | | - <ul style="background: white"> |
54 | | - <li>Image Path: {{ img_path }}</li> |
55 | | - <li>Data Location: {{ data_location }}</li> |
56 | | - <li>Is Zarr?: {{ is_zarr }}</li> |
57 | | - <li>Download URL: <a href="{{ download_url }}">{{ download_url }}</a></li> |
58 | | - <li>BIA NGFF ID: {{ bia_ngff_id }}</li> |
59 | | - </ul> |
| 70 | + |
| 71 | + <details><summary>Extra info (debug)</summary> |
| 72 | + <ul style="background: white"> |
| 73 | + <li>Image Path: {{ img_path }}</li> |
| 74 | + <li>Data Location: {{ data_location }}</li> |
| 75 | + <li>Is Zarr?: {{ is_zarr }}</li> |
| 76 | + <li>Download URL from IDR: <a href="{{ download_url }}">{{ download_url }}</a></li> |
| 77 | + <li>BIA NGFF ID: {{ bia_ngff_id }}</li> |
| 78 | + </ul> |
| 79 | + </details> |
60 | 80 | </article> |
61 | 81 |
|
62 | 82 | <script> |
@@ -122,6 +142,11 @@ <h3>Image Files</h3> |
122 | 142 | const downloadUrlIndex = headers.indexOf("download_url"); |
123 | 143 | // downloadUrl e.g. https://ftp.ebi.ac.uk/pub/databases/IDR/idr0047-neuert-yeastmrna/ |
124 | 144 | const downloadUrl = cells[downloadUrlIndex]; |
| 145 | + let link = document.getElementById("download_url_tsv"); |
| 146 | + if (link) { |
| 147 | + link.textContent = downloadUrl; |
| 148 | + link.href = downloadUrl; |
| 149 | + } |
125 | 150 | const baseUrl = downloadUrl.split(IDR_ID)[0]; // e.g. https://ftp.ebi.ac.uk/pub/databases/IDR/ |
126 | 151 | console.log(`Download URL for ${IDR_ID}:`, downloadUrl); |
127 | 152 | if (downloadUrl) { |
|
0 commit comments