Allow to select the master picture attachment.

This commit is contained in:
Jan Böhmer 2019-09-02 23:09:58 +02:00
parent fe9526e0eb
commit e2b643c52b
5 changed files with 47 additions and 6 deletions

View file

@ -5,6 +5,7 @@
</button>
{% endset %}
{{ form_row(form.master_picture_attachment) }}
<table class="table table-striped table-sm" id="attachments_table" data-prototype="{{ form_widget(form.attachments.vars.prototype)|e('html_attr') }}">
<tbody>

View file

@ -1,7 +1,7 @@
<div class="row">
<div class="col-md-3">
{% if part.masterPictureAttachement %}
<img src="{{ part.masterPictureAttachement | entityURL('file_view') }}" class="img-fluid img-thumbnail bg-light" alt="Part main image" height="300" width="300">
{% if part.masterPictureAttachment and part.masterPictureAttachment.picture %}
<img src="{{ part.masterPictureAttachment | entityURL('file_view') }}" class="img-fluid img-thumbnail bg-light" alt="Part main image" height="300" width="300">
{% else %}
<img src="{{ asset('img/part_placeholder.svg') }}" class="img-fluid img-thumbnail bg-light" alt="Part main image" height="300" width="300">
{% endif %}