mirror of
https://github.com/documize/community.git
synced 2025-08-09 15:35:27 +02:00
delete document from document view
This commit is contained in:
parent
e268256a86
commit
f57f24e633
4 changed files with 41 additions and 11 deletions
|
@ -87,6 +87,10 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
deleteDocument() {
|
||||||
|
this.attrs.onDocumentDelete();
|
||||||
|
},
|
||||||
|
|
||||||
saveTemplate() {
|
saveTemplate() {
|
||||||
var templateName = this.get('saveTemplate.name');
|
var templateName = this.get('saveTemplate.name');
|
||||||
var templateDescription = this.get('saveTemplate.description');
|
var templateDescription = this.get('saveTemplate.description');
|
||||||
|
|
|
@ -188,6 +188,17 @@ export default Ember.Controller.extend(NotifierMixin, {
|
||||||
self.get('model.slug'),
|
self.get('model.slug'),
|
||||||
newPage.id);
|
newPage.id);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onDocumentDelete() {
|
||||||
|
console.log("deleting " + this.get('model.id'));
|
||||||
|
let self = this;
|
||||||
|
|
||||||
|
this.get('documentService').deleteDocument(this.get('model.id')).then(function() {
|
||||||
|
self.audit.record("deleted-page");
|
||||||
|
self.send("showNotification", "Deleted");
|
||||||
|
self.transitionToRoute('folders.folder', self.get('folder.id'), self.get('folder.slug'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -3,7 +3,7 @@
|
||||||
{{/header/page-navigation}}
|
{{/header/page-navigation}}
|
||||||
|
|
||||||
{{document/document-toolbar document=model pages=pages meta=meta folder=folder isEditor=isEditor users=users owner=owner onSaveTemplate=(action 'onDocumentChange') onDocumentChange=(action 'onDocumentChange') onAttachmentUpload=(action
|
{{document/document-toolbar document=model pages=pages meta=meta folder=folder isEditor=isEditor users=users owner=owner onSaveTemplate=(action 'onDocumentChange') onDocumentChange=(action 'onDocumentChange') onAttachmentUpload=(action
|
||||||
'onAttachmentUpload')}}
|
'onAttachmentUpload') onDocumentDelete=(action 'onDocumentDelete')}}
|
||||||
|
|
||||||
<div class="container-fluid background-color-white">
|
<div class="container-fluid background-color-white">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -47,6 +47,10 @@
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
|
|
||||||
{{#if isEditor}}
|
{{#if isEditor}}
|
||||||
|
<div class="button-gap"></div>
|
||||||
|
<div class="square-button button-gray" id="set-meta-button" data-tooltip="Set owner, title, excerpt" data-tooltip-position="top center">
|
||||||
|
<i class="material-icons">settings</i>
|
||||||
|
</div>
|
||||||
<div class="button-gap"></div>
|
<div class="button-gap"></div>
|
||||||
<div class="square-button button-gray" id="attachment-button" data-tooltip="Attach file" data-tooltip-position="top center">
|
<div class="square-button button-gray" id="attachment-button" data-tooltip="Attach file" data-tooltip-position="top center">
|
||||||
<i class="material-icons">attach_file</i>
|
<i class="material-icons">attach_file</i>
|
||||||
|
@ -55,14 +59,25 @@
|
||||||
<div class="square-button button-gray" id="save-template-button" data-tooltip="Save as template" data-tooltip-position="top center">
|
<div class="square-button button-gray" id="save-template-button" data-tooltip="Save as template" data-tooltip-position="top center">
|
||||||
<i class="material-icons">content_copy</i>
|
<i class="material-icons">content_copy</i>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="button-gap"></div>
|
<div class="button-gap"></div>
|
||||||
<div class="square-button button-gray" id="set-meta-button" data-tooltip="Set owner, title, excerpt" data-tooltip-position="top center">
|
<div class="square-button button-gray" id="print-document-button" data-tooltip="Print this document" data-tooltip-position="top center">
|
||||||
<i class="material-icons">person</i>
|
<i class="material-icons">print</i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{#if isEditor}}
|
||||||
<div class="button-gap"></div>
|
<div class="button-gap"></div>
|
||||||
|
<div class="square-button button-red" id="delete-document-button" data-tooltip="Delete this document" data-tooltip-position="top center">
|
||||||
|
<i class="material-icons">delete</i>
|
||||||
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if isEditor}}
|
{{#if isEditor}}
|
||||||
|
{{#dropdown-dialog target="delete-document-button" position="bottom right" button="Delete" color="flat-red" onAction=(action 'deleteDocument')}}
|
||||||
|
<p>Are you sure you want to delete this document?</p>
|
||||||
|
<p>There is no undo!</p>
|
||||||
|
{{/dropdown-dialog}}
|
||||||
{{#dropdown-dialog target="save-template-button" position="bottom right" button="Save" color="flat-green" onAction=(action 'saveTemplate') focusOn="new-template-name"}}
|
{{#dropdown-dialog target="save-template-button" position="bottom right" button="Save" color="flat-green" onAction=(action 'saveTemplate') focusOn="new-template-name"}}
|
||||||
<div>
|
<div>
|
||||||
<div class="input-control">
|
<div class="input-control">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue