moved over to new ENTRY based data structures for loading from DB and viewing content

This commit is contained in:
2021-01-19 17:33:10 +11:00
parent 2bd25c3e18
commit 31d45e80b6
4 changed files with 63 additions and 23 deletions

View File

@@ -4,25 +4,25 @@
<div class="row">
<table class="table table-striped table-sm col-xl-12">
<thead><tr class="thead-light"><th>Name</th><th>Size (MB)</th><th>Path Prefix</th><th>Hash</th></tr></thead><tbody>
{% for obj in file_data %}
{% for obj in entry_data %}
<tr><td>
{% if obj.type == "Directory" %}
{% if obj.type.name == "Directory" %}
<i style="font-size:48;" class="fas fa-folder"></i><br><span class="figure-caption">{{obj.name}}</span>
{% else %}
<figure class="figure" font-size: 24px;>
<div style="position:relative; width:100%">
{% if obj.type=="Image" %}
{% if obj.type.name=="Image" %}
{% set icon="fa-file-image" %}
<a href="{{obj.path_prefix}}/{{obj.name}}">
{% elif obj.type == "Video" %}
<a href="{{obj.in_dir[0].path_prefix}}/{{obj.name}}">
{% elif obj.type.name == "Video" %}
{% set icon="fa-film" %}
{% elif obj.type == "Directory" %}
{% elif obj.type.name == "Directory" %}
{% set icon="fa-folder" %}
{% else %}
{% set icon="fa-question-circle" %}
{% endif %}
<img class="thumb" style="display:block" height="48" src="data:image/jpeg;base64,{{obj.thumbnail}}"></img>
{% if obj.type=="Image" %}
<img class="thumb" style="display:block" height="48" src="data:image/jpeg;base64,{{obj.file_details[0].thumbnail}}"></img>
{% if obj.type.name=="Image" %}
</a>
{% endif %}
<div style="position:absolute; top: 2; left: 2;">
@@ -32,7 +32,13 @@
<figcaption class="figure-caption">{{obj.name}}</figcaption>
</figure>
{% endif %}
</td></td><td>{{obj.size_mb}}</td><td>{{obj.path_prefix}}</td><td>{{obj.hash}}</tr>
</td>
{% if obj.type.name != "Directory" %}
<td>{{obj.file_details[0].size_mb}}</td><td>{{obj.in_dir[0].path_prefix}}</td><td>{{obj.file_details[0].hash}}</td>
{% else %}
<td></td><td></td><td></td>
{% endif %}
</tr>
{% endfor %}
</tbody></table>
</div class="row">