2019-05-29 16:57:22 +01:00
|
|
|
{{#if (or hasAttachments canEdit)}}
|
|
|
|
<Ui::UiSpacer @size="200" />
|
2022-03-09 15:20:16 -05:00
|
|
|
<div class="title">{{localize 'attachments'}}</div>
|
2018-12-18 19:03:34 +00:00
|
|
|
<div class="document-sidebar-attachment">
|
|
|
|
<ul class="files">
|
|
|
|
{{#each files key="id" as |file|}}
|
2019-05-16 12:49:27 +01:00
|
|
|
{{#if (eq file.pageId "")}}
|
2019-04-18 13:31:48 +01:00
|
|
|
<li class="file">
|
|
|
|
<a href="{{appMeta.endpoint}}/public/attachment/{{appMeta.orgId}}/{{file.id}}{{downloadQuery}}">
|
|
|
|
{{file.filename}}
|
|
|
|
</a>
|
|
|
|
{{#if canEdit}}
|
|
|
|
<div class="menu">
|
2022-01-11 12:40:52 -05:00
|
|
|
<i class="dicon {{constants.Icon.Cross}}" role="button" tabindex="0" aria-haspopup="menu">
|
2019-05-29 16:57:22 +01:00
|
|
|
{{#attach-popover class="ember-attacher-popper" hideOn="escapekey, clickout" showOn="click" isShown=false}}
|
|
|
|
<div class="form">
|
2022-03-09 15:20:16 -05:00
|
|
|
<p>{{localize 'attachment_delete_confirm'}}</p>
|
2019-05-29 16:57:22 +01:00
|
|
|
<Ui::UiSpacer @size="100" />
|
|
|
|
{{ui/ui-button
|
|
|
|
light=false
|
2022-03-01 22:40:51 -05:00
|
|
|
label=(localize 'delete')
|
2019-05-29 16:57:22 +01:00
|
|
|
color=constants.Color.Red
|
|
|
|
onClick=(action "onDelete" file)}}
|
|
|
|
</div>
|
|
|
|
{{/attach-popover}}
|
|
|
|
</i>
|
2019-04-18 13:31:48 +01:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</li>
|
|
|
|
{{/if}}
|
2018-12-18 19:03:34 +00:00
|
|
|
{{/each}}
|
2019-05-30 10:41:09 +01:00
|
|
|
{{#if canEdit}}
|
|
|
|
<li id="upload-document-files">
|
2022-03-09 15:20:16 -05:00
|
|
|
<i class="dicon {{constants.Icon.Plus}}" role="button" tabindex="0" title={{localize 'upload_attachment'}} />
|
2019-05-30 10:41:09 +01:00
|
|
|
</li>
|
|
|
|
{{/if}}
|
2018-12-18 19:03:34 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
2019-05-29 16:57:22 +01:00
|
|
|
{{#if canEdit}}
|
|
|
|
{{#unless hasAttachments}}
|
|
|
|
<Ui::UiSpacer @size="100" />
|
|
|
|
{{/unless}}
|
|
|
|
{{/if}}
|
2018-12-18 19:03:34 +00:00
|
|
|
{{/if}}
|