2017-12-11 11:40:12 +00:00
|
|
|
{{#if canShow}}
|
2017-12-11 12:04:48 +00:00
|
|
|
<div class="view-attachment mt-5">
|
2017-12-11 11:40:12 +00:00
|
|
|
{{#if hasAttachments}}
|
|
|
|
<ul class="list">
|
|
|
|
{{#each files key="id" as |a index|}}
|
|
|
|
<li class="item">
|
|
|
|
<img class="icon" src="/assets/img/attachments/{{document/file-icon a.extension}}" />
|
2017-12-19 16:52:40 +00:00
|
|
|
<a href="{{appMeta.endpoint}}/public/attachments/{{appMeta.orgId}}/{{a.id}}">
|
2017-12-11 11:40:12 +00:00
|
|
|
<span class="file">{{ a.filename }}</span>
|
|
|
|
</a>
|
2018-01-22 10:31:03 +00:00
|
|
|
{{#if canEdit}}
|
2017-12-11 11:40:12 +00:00
|
|
|
<div class="button-icon-danger align-middle action" {{action 'onShowDialog' a.id a.filename}}>
|
|
|
|
<i class="material-icons">delete</i>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</li>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
|
|
|
{{/if}}
|
2018-01-22 10:31:03 +00:00
|
|
|
{{#if canEdit}}
|
2017-12-11 11:40:12 +00:00
|
|
|
<div class="upload-document-files">
|
|
|
|
<div id="upload-document-files" class="btn btn-secondary">Upload</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{#ui/ui-dialog title="Delete Attachment" confirmCaption="Delete" buttonType="btn-danger" show=showDialog onAction=(action 'onDelete')}}
|
|
|
|
<p>Are you sure you want to delete {{deleteAttachment.name}}?</p>
|
|
|
|
{{/ui/ui-dialog}}
|
|
|
|
{{/if}}
|