put file list inside details tag

This commit is contained in:
xenofem 2022-05-24 17:35:49 -04:00
parent 62e6d64253
commit 52158d25e9
2 changed files with 17 additions and 14 deletions

View file

@ -175,8 +175,9 @@ tr.unavailable td.file_download {
margin-right: auto; margin-right: auto;
} }
#download_contents h3 { #download_contents summary {
margin-bottom: 0; font-size: 24px;
font-weight: bold;
} }
#download_contents table { #download_contents table {

View file

@ -26,18 +26,20 @@
{% match file.contents %} {% match file.contents %}
{% when Some with (files) %} {% when Some with (files) %}
<div id="download_contents" class="section"> <div id="download_contents" class="section">
<h3>Contents</h3> <details>
<table><tbody> <summary>Show file list</summary>
{% let offsets = offsets.as_ref().unwrap() %} <table><tbody>
{% for f in files %} {% let offsets = offsets.as_ref().unwrap() %}
<tr class="{% if offsets.get(loop.index0.clone()).unwrap().clone() > available %}unavailable{% endif %}"> {% for f in files %}
<td class="file_size">{{ bytesize::to_string(f.size.clone(), false).replace(" ", "") }}</td> <tr class="{% if offsets.get(loop.index0.clone()).unwrap().clone() > available %}unavailable{% endif %}">
<td class="file_name">{{ f.name }}</td> <td class="file_size">{{ bytesize::to_string(f.size.clone(), false).replace(" ", "") }}</td>
<td class="file_download"><a class="download_button" href="download?code={{ code }}&download={{ loop.index0 }}"></a></td> <td class="file_name">{{ f.name }}</td>
<td class="file_unavailable"></td> <td class="file_download"><a class="download_button" href="download?code={{ code }}&download={{ loop.index0 }}"></a></td>
</tr> <td class="file_unavailable"></td>
{% endfor %} </tr>
</tbody></table> {% endfor %}
</tbody></table>
</details>
</div> </div>
{% else %} {% else %}
{% endmatch %} {% endmatch %}