1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 15:19:42 +02:00

Allow inline doc title/desc editing

This commit is contained in:
sauls8t 2018-10-23 13:47:00 +01:00
parent f950075593
commit 313ed7f90a
2 changed files with 9 additions and 2 deletions

View file

@ -21,8 +21,9 @@ export default Controller.extend(Tooltips, Notifier, {
templateService: service('template'), templateService: service('template'),
sectionService: service('section'), sectionService: service('section'),
linkService: service('link'), linkService: service('link'),
router: service(),
tab: 'content', tab: 'content',
queryParams: ['currentPageId'], queryParams: ['currentPageId', 'source'],
showRevisions: computed('permissions', 'document.protection', function() { showRevisions: computed('permissions', 'document.protection', function() {
if (!this.get('session.viewUsers')) return false; if (!this.get('session.viewUsers')) return false;
if (this.get('document.protection') === this.get('constants').ProtectionType.None) return true; if (this.get('document.protection') === this.get('constants').ProtectionType.None) return true;
@ -237,6 +238,12 @@ export default Controller.extend(Tooltips, Notifier, {
}); });
}, },
onEditMeta() {
if (!this.get('permissions.documentEdit')) return;
this.get('router').transitionTo('document.settings', {queryParams: {tab: 'general'}});
},
refresh(reloadPage) { refresh(reloadPage) {
return new EmberPromise((resolve) => { return new EmberPromise((resolve) => {
this.get('documentService').fetchDocumentData(this.get('document.id')).then((data) => { this.get('documentService').fetchDocumentData(this.get('document.id')).then((data) => {

View file

@ -40,7 +40,7 @@
</div> </div>
<div class="view-document"> <div class="view-document">
<div class="document-heading"> <div class="document-heading {{if permissions.documentEdit 'cursor-pointer' ''}}" {{action 'onEditMeta'}}>
<h1 class="doc-title"> <h1 class="doc-title">
{{#if document.template}} {{#if document.template}}
<span class="bg-warning p-1 pr-2 pl-2">Template</span>&nbsp;&nbsp; <span class="bg-warning p-1 pr-2 pl-2">Template</span>&nbsp;&nbsp;