Use twigs builtin filter to inline data urls, instead of a custom one.

This commit is contained in:
Jan Böhmer 2020-05-07 23:35:20 +02:00
parent f64910374f
commit d8adc26b03
8 changed files with 83 additions and 66 deletions

View file

@ -58,7 +58,7 @@
{% block additional_content %}
{% if pdf_data %}
<div class="card mt-2 p-1 border-secondary" style="resize: vertical; overflow: scroll; height: 250px">
<object id="pdf_preview" data="{{ inlineData(pdf_data, 'application/pdf') | escape('html_attr') }}"style="height: inherit">
<object id="pdf_preview" data="{{ pdf_data | data_uri(mime='application/pdf') }}"style="height: inherit">
</object>
</div>
{% endif %}

View file

@ -3,7 +3,7 @@
{{ element.lines | raw }}
</div>
<div class="C39-container" style="">
<img class="C39" src="{{ inlineData(element.barcode, 'image/svg+xml') }}" height="30px">
<img class="C39" src="{{ element.barcode | data_uri(mime='image/svg+xml') }}" height="30px">
<span class="C39-text">{{ element.barcode_content }}</span>
</div>
</div>

View file

@ -3,7 +3,7 @@
<div class="col-5">
<div class="qr-container">
<a href="{{ element.barcode_content }}">
<img class="qr" src="{{ inlineData(element.barcode, 'image/svg+xml') }}" width="100%" style="">
<img class="qr" src="{{ element.barcode | data_uri(mime='image/svg+xml') }}" width="100%" style="">
</a>
</div>
{#{{ element.barcode | raw }} #}