mirror of
https://github.com/documize/community.git
synced 2025-08-08 23:15:29 +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
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
|
@ -87,6 +87,10 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
},
|
||||
|
||||
actions: {
|
||||
deleteDocument() {
|
||||
this.attrs.onDocumentDelete();
|
||||
},
|
||||
|
||||
saveTemplate() {
|
||||
var templateName = this.get('saveTemplate.name');
|
||||
var templateDescription = this.get('saveTemplate.description');
|
||||
|
@ -137,4 +141,4 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
|||
return true;
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -188,6 +188,17 @@ export default Ember.Controller.extend(NotifierMixin, {
|
|||
self.get('model.slug'),
|
||||
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}}
|
||||
|
||||
{{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="row">
|
||||
|
|
|
@ -47,6 +47,10 @@
|
|||
{{/link-to}}
|
||||
|
||||
{{#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="square-button button-gray" id="attachment-button" data-tooltip="Attach file" data-tooltip-position="top center">
|
||||
<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">
|
||||
<i class="material-icons">content_copy</i>
|
||||
</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">
|
||||
<i class="material-icons">person</i>
|
||||
</div>
|
||||
<div class="button-gap"></div>
|
||||
{{/if}}
|
||||
|
||||
<div class="button-gap"></div>
|
||||
<div class="square-button button-gray" id="print-document-button" data-tooltip="Print this document" data-tooltip-position="top center">
|
||||
<i class="material-icons">print</i>
|
||||
</div>
|
||||
|
||||
{{#if isEditor}}
|
||||
<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 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"}}
|
||||
<div>
|
||||
<div class="input-control">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue