Skip to content

Commit

Permalink
fix: render image preview in ressources, bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Mar 14, 2024
1 parent 66cee1c commit 26f0919
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion website/web/templates/identifier_details.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% from "macros.html" import shorten_string %}

<script type="text/javascript">
new DataTable('#identifierDetailsTable_{{favicon_sha512}}', {
new DataTable('#identifierDetailsTable', {
order: [[ 0, "desc" ]],
columnDefs: [{ width: '30%',
targets: 0,
Expand Down
27 changes: 13 additions & 14 deletions website/web/templates/tree_body_hashes.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{% from "macros.html" import popup_icons_response %}

<script type="text/javascript">
new DataTable('#bodyHashesTable', {
var table = new DataTable('#bodyHashesTable', {
order: [[ 0, "desc" ]],
columnDefs: [{ width: '10%', targets: 0 },
{ width: '10%', targets: 1 },
{ width: '60%', targets: 2 },
{ width: '20%', targets: 3 }],
initComplete: function (settings, json) {
$('[data-bs-toggle="tooltip"]').tooltip({html: true});
}
}).on('draw', function() {
$('[data-bs-toggle="tooltip"]').tooltip({html: true});
});
</script>

Expand All @@ -23,20 +30,12 @@
<tr>
<td>{{ info['total_captures'] }}</td>
<td>
<a href="{{ url_for('get_ressource', tree_uuid=tree_uuid, node_uuid=info['node'].uuid) }}">
<img src="{{ url_for('static', filename=icon_info['icon']) }}" alt="{{ icon_info['tooltip'] }}"
width="21" height="21"
{% if info['node'].generic_type == "image" %}
data-bs-toggle="tooltip" data-bs-placement="left" data-bs-html="true" data-container="#bodyHashesTable"
title='<img class="ressource_preview" src="{{ url_for('get_ressource_preview', tree_uuid=tree_uuid, node_uuid=info['node'].uuid) }}"/> </br>Click to download.'
{% else %}
data-bs-toggle="tooltip" data-bs-placement="left" data-bs-html="true" data-container="#bodyHashesTable"
title="{{icon_info['tooltip']}} <br/>Click to download."
{% endif %}
/>
</a>
{{popup_icons_response(info['node'], tree_uuid)}}
</td>
<td>
<p class="text-break">{{ info['node'].name }}</p>
<a href="#/" onclick="openTreeInNewTab('{{ tree_uuid }}', '{{ info['node'].uuid }}')">Show on tree</a>
</td>
<td><p class="text-break">{{ info['node'].name }}</p></td>
<td>
<span class="d-inline-block text-truncate" style="max-width: 200px;">
<a href="#bodyHashDetailsModal" data-remote="{{ url_for('body_hash_details', body_hash=body_hash) }}"
Expand Down
7 changes: 3 additions & 4 deletions website/web/templates/tree_identifiers.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script type="text/javascript">
new DataTable('#faviconsTable', {
columnDefs: [{ width: '10%', targets: 0 },
new DataTable('#identifiersTable', {
columnDefs: [{ width: '20%', targets: 0 },
{ width: '40%', targets: 1 },
{ width: '40%', targets: 2 },
{ width: '10%', targets: 3 }],
{ width: '40%', targets: 2 }],
});
</script>

Expand Down

0 comments on commit 26f0919

Please sign in to comment.