mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Change space settings management into tab views
This commit is contained in:
parent
738b3d94b6
commit
92f8fe550e
38 changed files with 683 additions and 411 deletions
|
@ -1,4 +1,4 @@
|
|||
> We provide frequent product releases to ensure self-host customers enjoy the same product as our Cloud/SaaS platform customers.
|
||||
> We're committed to providing frequent product releases to ensure self-host customers enjoy the same product as our cloud/SaaS customers.
|
||||
>
|
||||
> Harvey Kandola, CEO & Founder, Documize Inc.
|
||||
|
||||
|
|
|
@ -14,10 +14,11 @@ import { empty } from '@ember/object/computed';
|
|||
import { set } from '@ember/object';
|
||||
import { copy } from '@ember/object/internals';
|
||||
import { inject as service } from '@ember/service';
|
||||
import Component from '@ember/component';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import encoding from '../../utils/encoding';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({
|
||||
export default Component.extend(Notifier, {
|
||||
appMeta: service(),
|
||||
isDocumizeProvider: computed('authProvider', function() {
|
||||
return this.get('authProvider') === this.get('constants').AuthProvider.Documize;
|
||||
|
@ -139,6 +140,8 @@ export default Component.extend({
|
|||
break;
|
||||
}
|
||||
|
||||
this.showWait();
|
||||
|
||||
let data = { authProvider: provider, authConfig: JSON.stringify(config) };
|
||||
|
||||
this.get('onSave')(data).then(() => {
|
||||
|
@ -158,6 +161,7 @@ export default Component.extend({
|
|||
}
|
||||
});
|
||||
}
|
||||
this.showDone();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,11 +11,12 @@
|
|||
|
||||
import $ from 'jquery';
|
||||
import { empty, and } from '@ember/object/computed';
|
||||
import Component from '@ember/component';
|
||||
import { isEmpty } from '@ember/utils';
|
||||
import { set } from '@ember/object';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({
|
||||
export default Component.extend(Notifier, {
|
||||
titleEmpty: empty('model.general.title'),
|
||||
messageEmpty: empty('model.general.message'),
|
||||
conversionEndpointEmpty: empty('model.general.conversionEndpoint'),
|
||||
|
@ -47,7 +48,10 @@ export default Component.extend({
|
|||
|
||||
this.model.general.set('allowAnonymousAccess', $("#allowAnonymousAccess").prop('checked'));
|
||||
|
||||
this.showWait();
|
||||
|
||||
this.get('save')().then(() => {
|
||||
this.showDone();
|
||||
set(this, 'titleError', false);
|
||||
set(this, 'messageError', false);
|
||||
set(this, 'conversionEndpointError', false);
|
||||
|
|
|
@ -12,9 +12,10 @@
|
|||
import $ from 'jquery';
|
||||
import { empty } from '@ember/object/computed';
|
||||
import { inject as service } from '@ember/service';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({
|
||||
export default Component.extend(Notifier, {
|
||||
appMeta: service(),
|
||||
LicenseError: empty('model.license'),
|
||||
changelog: '',
|
||||
|
@ -36,7 +37,9 @@ export default Component.extend({
|
|||
|
||||
actions: {
|
||||
saveLicense() {
|
||||
this.showWait();
|
||||
this.get('saveLicense')().then(() => {
|
||||
this.showDone();
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -11,9 +11,10 @@
|
|||
|
||||
import $ from 'jquery';
|
||||
import { empty } from '@ember/object/computed';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({
|
||||
export default Component.extend(Notifier, {
|
||||
SMTPHostEmptyError: empty('model.smtp.host'),
|
||||
SMTPPortEmptyError: empty('model.smtp.port'),
|
||||
SMTPSenderEmptyError: empty('model.smtp.sender'),
|
||||
|
@ -47,9 +48,11 @@ export default Component.extend({
|
|||
},
|
||||
);
|
||||
|
||||
this.showWait();
|
||||
this.set('buttonText', 'Please wait...');
|
||||
|
||||
this.get('saveSMTP')().then((result) => {
|
||||
this.showDone();
|
||||
this.set('buttonText', 'Save & Test');
|
||||
this.set('testSMTP', result);
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ export default Component.extend({
|
|||
|
||||
p.set('id', this.get('block.id'));
|
||||
p.set('orgId', this.get('block.orgId'));
|
||||
p.set('documentId', this.get('document.id'));
|
||||
p.set('documentId', 'dummy');
|
||||
p.set('contentType', this.get('block.contentType'));
|
||||
p.set('pageType', this.get('block.pageType'));
|
||||
p.set('title', this.get('block.title'));
|
||||
|
@ -31,7 +31,7 @@ export default Component.extend({
|
|||
|
||||
m.set('pageId', this.get('block.id'));
|
||||
m.set('orgId', this.get('block.orgId'));
|
||||
m.set('documentId', this.get('document.id'));
|
||||
m.set('documentId', 'dummy');
|
||||
m.set('rawBody', this.get('block.rawBody'));
|
||||
m.set('config', this.get('block.config'));
|
||||
m.set('externalSource', this.get('block.externalSource'));
|
||||
|
|
|
@ -175,23 +175,6 @@ export default Component.extend(TooltipMixin, Notifier, {
|
|||
this.set('showDeleteBlockDialog', true);
|
||||
},
|
||||
|
||||
onDeleteBlock() {
|
||||
this.set('showDeleteBlockDialog', false);
|
||||
|
||||
let id = this.get('deleteBlockId');
|
||||
|
||||
let cb = this.get('onDeleteBlock');
|
||||
let promise = cb(id);
|
||||
|
||||
promise.then(() => {
|
||||
this.set('deleteBlockId', '');
|
||||
let refresh = this.get('refresh');
|
||||
refresh();
|
||||
});
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
onVote(vote) {
|
||||
this.get('documentService').vote(this.get('document.id'), vote);
|
||||
this.set('voteThanks', true);
|
||||
|
|
69
gui/app/components/folder/settings-blocks.js
Normal file
69
gui/app/components/folder/settings-blocks.js
Normal file
|
@ -0,0 +1,69 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// 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>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import { inject as service } from '@ember/service';
|
||||
import { computed } from '@ember/object';
|
||||
import AuthMixin from '../../mixins/auth';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(AuthMixin, Notifier, {
|
||||
router: service(),
|
||||
spaceSvc: service('folder'),
|
||||
sectionSvc: service('section'),
|
||||
|
||||
showDeleteDialog: false,
|
||||
deleteBlockId: '',
|
||||
|
||||
isSpaceAdmin: computed('permissions', function() {
|
||||
return this.get('permissions.spaceOwner') || this.get('permissions.spaceManage');
|
||||
}),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (!this.get('isSpaceAdmin')) return;
|
||||
|
||||
this.get('sectionSvc').getSpaceBlocks(this.get('space.id')).then((blocks) => {
|
||||
this.set('blocks', blocks);
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
onShowDeleteDialog(id) {
|
||||
this.set('showDeleteDialog', true);
|
||||
this.set('deleteBlockId', id);
|
||||
},
|
||||
|
||||
onEdit(id) {
|
||||
this.get('router').transitionTo('folder.block', this.get('space.id'), this.get('space.slug'), id);
|
||||
},
|
||||
|
||||
onDeleteBlock() {
|
||||
this.set('showDeleteDialog', false);
|
||||
|
||||
let id = this.get('deleteBlockId');
|
||||
|
||||
this.showWait();
|
||||
|
||||
this.get('sectionSvc').deleteBlock(id).then(() => {
|
||||
this.set('deleteBlockId', '');
|
||||
this.showDone();
|
||||
|
||||
this.get('sectionSvc').getSpaceBlocks(this.get('space.id')).then((blocks) => {
|
||||
this.set('blocks', blocks);
|
||||
});
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
84
gui/app/components/folder/settings-general.js
Normal file
84
gui/app/components/folder/settings-general.js
Normal file
|
@ -0,0 +1,84 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// 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>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import { A } from '@ember/array';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { schedule } from '@ember/runloop';
|
||||
import { computed } from '@ember/object';
|
||||
import AuthMixin from '../../mixins/auth';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(AuthMixin, Notifier, {
|
||||
router: service(),
|
||||
spaceSvc: service('folder'),
|
||||
localStorage: service('localStorage'),
|
||||
|
||||
isSpaceAdmin: computed('permissions', function() {
|
||||
return this.get('permissions.spaceOwner') || this.get('permissions.spaceManage');
|
||||
}),
|
||||
|
||||
spaceTypeOptions: A([]),
|
||||
spaceType: 0,
|
||||
likes: 'Did this help you?',
|
||||
allowLikes: false,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
let constants = this.get('constants');
|
||||
let folder = this.get('space');
|
||||
|
||||
let spaceTypeOptions = A([]);
|
||||
spaceTypeOptions.pushObject({id: constants.FolderType.Private, label: 'Private - viewable only by me'});
|
||||
spaceTypeOptions.pushObject({id: constants.FolderType.Protected, label: 'Protected - access is restricted to selected users'});
|
||||
spaceTypeOptions.pushObject({id: constants.FolderType.Public, label: 'Public - can be seen by everyone'});
|
||||
this.set('spaceTypeOptions', spaceTypeOptions);
|
||||
this.set('spaceType', spaceTypeOptions.findBy('id', folder.get('folderType')));
|
||||
|
||||
this.set('likes', folder.get('likes'));
|
||||
this.set('allowLikes', folder.get('allowLikes'));
|
||||
},
|
||||
|
||||
actions: {
|
||||
onSetSpaceType(t) {
|
||||
this.set('spaceType', t);
|
||||
},
|
||||
|
||||
onSetLikes(l) {
|
||||
this.set('allowLikes', l);
|
||||
|
||||
schedule('afterRender', () => {
|
||||
if (l) this.$('#space-likes-prompt').focus();
|
||||
});
|
||||
},
|
||||
|
||||
onSave() {
|
||||
if (!this.get('isSpaceAdmin')) return;
|
||||
|
||||
let space = this.get('space');
|
||||
space.set('folderType', this.get('spaceType.id'));
|
||||
|
||||
let allowLikes = this.get('allowLikes');
|
||||
space.set('likes', allowLikes ? this.get('likes') : '');
|
||||
|
||||
this.showWait();
|
||||
|
||||
this.get('spaceSvc').save(space).then(() => {
|
||||
this.showDone();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
89
gui/app/components/folder/settings-invitations.js
Normal file
89
gui/app/components/folder/settings-invitations.js
Normal file
|
@ -0,0 +1,89 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// 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>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import { inject as service } from '@ember/service';
|
||||
import { computed } from '@ember/object';
|
||||
import AuthMixin from '../../mixins/auth';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(AuthMixin, Notifier, {
|
||||
spaceSvc: service('folder'),
|
||||
|
||||
isSpaceAdmin: computed('permissions', function() {
|
||||
return this.get('permissions.spaceOwner') || this.get('permissions.spaceManage');
|
||||
}),
|
||||
|
||||
inviteEmail: '',
|
||||
inviteMessage: '',
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (this.get('inviteMessage').length === 0) {
|
||||
this.set('inviteMessage', this.getDefaultInvitationMessage());
|
||||
}
|
||||
},
|
||||
|
||||
getDefaultInvitationMessage() {
|
||||
return "Hey there, I am sharing the " + this.get('space.name') + " space (in " + this.get("appMeta.title") + ") with you so we can both collaborate on documents.";
|
||||
},
|
||||
|
||||
actions: {
|
||||
onSpaceInvite(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var email = this.get('inviteEmail').trim().replace(/ /g, '');
|
||||
var message = this.get('inviteMessage').trim();
|
||||
|
||||
if (message.length === 0) {
|
||||
this.set('inviteMessage', this.getDefaultInvitationMessage());
|
||||
message = this.getDefaultInvitationMessage();
|
||||
}
|
||||
|
||||
if (email.length === 0) {
|
||||
this.$('#space-invite-email').addClass('is-invalid').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
this.showWait();
|
||||
|
||||
var result = {
|
||||
Message: message,
|
||||
Recipients: []
|
||||
};
|
||||
|
||||
// Check for multiple email addresses
|
||||
if (email.indexOf(",") > -1) {
|
||||
result.Recipients = email.split(',');
|
||||
}
|
||||
if (email.indexOf(";") > -1 && result.Recipients.length === 0) {
|
||||
result.Recipients = email.split(';');
|
||||
}
|
||||
|
||||
// Handle just one email address
|
||||
if (result.Recipients.length === 0 && email.length > 0) {
|
||||
result.Recipients.push(email);
|
||||
}
|
||||
|
||||
this.set('inviteEmail', '');
|
||||
|
||||
this.get('spaceSvc').share(this.get('space.id'), result).then(() => {
|
||||
this.showDone();
|
||||
this.$('#space-invite-email').removeClass('is-invalid');
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
|
@ -12,11 +12,12 @@
|
|||
import { inject as service } from '@ember/service';
|
||||
import { A } from '@ember/array';
|
||||
import { debounce } from '@ember/runloop';
|
||||
import ModalMixin from '../../mixins/modal';
|
||||
import { computed } from '@ember/object';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import stringUtil from '../../utils/string';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(ModalMixin, {
|
||||
export default Component.extend(Notifier, {
|
||||
groupSvc: service('group'),
|
||||
spaceSvc: service('folder'),
|
||||
userSvc: service('user'),
|
||||
|
@ -27,6 +28,10 @@ export default Component.extend(ModalMixin, {
|
|||
users: null,
|
||||
searchText: '',
|
||||
|
||||
isSpaceAdmin: computed('permissions', function() {
|
||||
return this.get('permissions.spaceOwner') || this.get('permissions.spaceManage');
|
||||
}),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
|
@ -128,7 +133,11 @@ export default Component.extend(ModalMixin, {
|
|||
},
|
||||
|
||||
actions: {
|
||||
setPermissions() {
|
||||
onSave() {
|
||||
if (!this.get('isSpaceAdmin')) return;
|
||||
|
||||
this.showWait();
|
||||
|
||||
let message = this.getDefaultInvitationMessage();
|
||||
let permissions = this.get('spacePermissions');
|
||||
let folder = this.get('folder');
|
||||
|
@ -164,7 +173,7 @@ export default Component.extend(ModalMixin, {
|
|||
}
|
||||
|
||||
this.get('spaceSvc').savePermissions(folder.get('id'), payload).then(() => {
|
||||
this.modalClose('#space-permission-modal');
|
||||
this.showDone();
|
||||
this.get('onRefresh')();
|
||||
});
|
||||
},
|
37
gui/app/components/folder/settings-templates.js
Normal file
37
gui/app/components/folder/settings-templates.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// 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>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import { inject as service } from '@ember/service';
|
||||
import { computed } from '@ember/object';
|
||||
import stringUtil from '../../utils/string';
|
||||
import AuthMixin from '../../mixins/auth';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(AuthMixin, Notifier, {
|
||||
spaceSvc: service('folder'),
|
||||
|
||||
isSpaceAdmin: computed('permissions', function() {
|
||||
return this.get('permissions.spaceOwner') || this.get('permissions.spaceManage');
|
||||
}),
|
||||
|
||||
actions: {
|
||||
onOpenTemplate(id) {
|
||||
if (is.empty(id)) {
|
||||
return;
|
||||
}
|
||||
let template = this.get('templates').findBy('id', id)
|
||||
|
||||
let slug = stringUtil.makeSlug(template.get('title'));
|
||||
this.get('router').transitionTo('document', this.get('space.id'), this.get('space.slug'), id, slug);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -60,10 +60,6 @@ export default Component.extend(AuthMixin, {
|
|||
this.send('onDocumentFilter', 'category', this.get('categoryFilter'));
|
||||
} else {
|
||||
this.send('onDocumentFilter', 'space', this.get('folder.id'));
|
||||
// } else if (this.get('rootDocCount') > 0) {
|
||||
// this.send('onDocumentFilter', 'space', this.get('folder.id'));
|
||||
// } else if (selectedCategory !== '') {
|
||||
// this.send('onDocumentFilter', 'category', selectedCategory);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -23,10 +23,6 @@ export default Component.extend({
|
|||
let page = this.get('page');
|
||||
return `wysiwyg-editor-${page.id}`;
|
||||
}),
|
||||
toolbarId: computed('page', function () {
|
||||
let page = this.get('page');
|
||||
return `wysiwyg-editor-toolbar-${page.id}`;
|
||||
}),
|
||||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
@ -45,7 +41,6 @@ export default Component.extend({
|
|||
gecko_spellcheck: false,
|
||||
statusbar: false,
|
||||
inline: true,
|
||||
// fixed_toolbar_container: '#' + this.get('toolbarId'),
|
||||
paste_data_images: true,
|
||||
image_advtab: true,
|
||||
image_caption: true,
|
||||
|
|
|
@ -12,12 +12,10 @@
|
|||
import $ from 'jquery';
|
||||
import { computed } from '@ember/object';
|
||||
import { schedule } from '@ember/runloop';
|
||||
import { A } from '@ember/array';
|
||||
import { inject as service } from '@ember/service';
|
||||
import TooltipMixin from '../../mixins/tooltip';
|
||||
import ModalMixin from '../../mixins/modal';
|
||||
import AuthMixin from '../../mixins/auth';
|
||||
import stringUtil from '../../utils/string';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
||||
|
@ -36,8 +34,7 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
|||
return this.get('permissions.spaceOwner') || this.get('permissions.spaceManage');
|
||||
}),
|
||||
deleteSpaceName: '',
|
||||
inviteEmail: '',
|
||||
inviteMessage: '',
|
||||
|
||||
hasTemplates: computed('templates', function() {
|
||||
return this.get('templates.length') > 0;
|
||||
}),
|
||||
|
@ -49,11 +46,6 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
|||
|
||||
dropzone: null,
|
||||
|
||||
spaceTypeOptions: A([]),
|
||||
spaceType: 0,
|
||||
likes: '',
|
||||
allowLikes: false,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.importedDocuments = [];
|
||||
|
@ -68,7 +60,6 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
|||
|
||||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
let constants = this.get('constants');
|
||||
|
||||
let folder = this.get('space');
|
||||
let targets = _.reject(this.get('spaces'), {id: folder.get('id')});
|
||||
|
@ -80,20 +71,6 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
|||
this.set('pinState.newName', folder.get('name'));
|
||||
this.renderTooltips();
|
||||
});
|
||||
|
||||
if (this.get('inviteMessage').length === 0) {
|
||||
this.set('inviteMessage', this.getDefaultInvitationMessage());
|
||||
}
|
||||
|
||||
let spaceTypeOptions = A([]);
|
||||
spaceTypeOptions.pushObject({id: constants.FolderType.Private, label: 'Private - viewable only by me'});
|
||||
spaceTypeOptions.pushObject({id: constants.FolderType.Protected, label: 'Protected - access is restricted to selected users'});
|
||||
spaceTypeOptions.pushObject({id: constants.FolderType.Public, label: 'Public - can be seen by everyone'});
|
||||
this.set('spaceTypeOptions', spaceTypeOptions);
|
||||
this.set('spaceType', spaceTypeOptions.findBy('id', folder.get('folderType')));
|
||||
|
||||
this.set('likes', folder.get('likes'));
|
||||
this.set('allowLikes', folder.get('allowLikes'));
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
|
@ -112,10 +89,6 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
|||
}
|
||||
},
|
||||
|
||||
getDefaultInvitationMessage() {
|
||||
return "Hey there, I am sharing the " + this.get('space.name') + " space (in " + this.get("appMeta.title") + ") with you so we can both collaborate on documents.";
|
||||
},
|
||||
|
||||
setupImport() {
|
||||
// already done init?
|
||||
if (is.not.null(this.get('dropzone'))) {
|
||||
|
@ -194,48 +167,6 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
|||
return true;
|
||||
},
|
||||
|
||||
onSpaceInvite(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var email = this.get('inviteEmail').trim().replace(/ /g, '');
|
||||
var message = this.get('inviteMessage').trim();
|
||||
|
||||
if (message.length === 0) {
|
||||
message = this.getDefaultInvitationMessage();
|
||||
}
|
||||
|
||||
if (email.length === 0) {
|
||||
$('#space-invite-email').addClass('is-invalid').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
var result = {
|
||||
Message: message,
|
||||
Recipients: []
|
||||
};
|
||||
|
||||
// Check for multiple email addresses
|
||||
if (email.indexOf(",") > -1) {
|
||||
result.Recipients = email.split(',');
|
||||
}
|
||||
if (email.indexOf(";") > -1 && result.Recipients.length === 0) {
|
||||
result.Recipients = email.split(';');
|
||||
}
|
||||
|
||||
// Handle just one email address
|
||||
if (result.Recipients.length === 0 && email.length > 0) {
|
||||
result.Recipients.push(email);
|
||||
}
|
||||
|
||||
this.set('inviteEmail', '');
|
||||
|
||||
this.get('spaceService').share(this.get('space.id'), result).then(() => {
|
||||
$('#space-invite-email').removeClass('is-invalid');
|
||||
});
|
||||
|
||||
this.modalClose('#space-invite-modal');
|
||||
},
|
||||
|
||||
onSpaceDelete(e) {
|
||||
e.preventDefault();
|
||||
|
||||
|
@ -359,46 +290,6 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, {
|
|||
let cb = this.get('onRefresh');
|
||||
cb();
|
||||
}
|
||||
},
|
||||
|
||||
onOpenTemplate(e) {
|
||||
e.preventDefault();
|
||||
|
||||
let id = this.get('selectedTemplate');
|
||||
if (is.empty(id)) {
|
||||
return;
|
||||
}
|
||||
let template = this.get('templates').findBy('id', id)
|
||||
|
||||
this.modalClose("#space-template-modal");
|
||||
|
||||
let slug = stringUtil.makeSlug(template.get('title'));
|
||||
this.get('router').transitionTo('document', this.get('space.id'), this.get('space.slug'), id, slug);
|
||||
},
|
||||
|
||||
onSetSpaceType(t) {
|
||||
this.set('spaceType', t);
|
||||
},
|
||||
|
||||
onSetLikes(l) {
|
||||
this.set('allowLikes', l);
|
||||
schedule('afterRender', () => {
|
||||
if (l) $('#space-likes-prompt').focus();
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
onSpaceSettings() {
|
||||
let space = this.get('space');
|
||||
space.set('folderType', this.get('spaceType.id'));
|
||||
|
||||
let allowLikes = this.get('allowLikes');
|
||||
space.set('likes', allowLikes ? this.get('likes') : '');
|
||||
|
||||
this.get('spaceService').save(space).then(() => {
|
||||
});
|
||||
|
||||
this.modalClose("#space-settings-modal");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -167,14 +167,6 @@ export default Controller.extend(Tooltips, Notifier, {
|
|||
});
|
||||
},
|
||||
|
||||
onDeleteBlock(blockId) {
|
||||
return new EmberPromise((resolve) => {
|
||||
this.get('sectionService').deleteBlock(blockId).then(() => {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onSavePageAsBlock(block) {
|
||||
return new EmberPromise((resolve) => {
|
||||
this.get('sectionService').addBlock(block).then(() => {
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
import { Promise as EmberPromise, hash } from 'rsvp';
|
||||
import { inject as service } from '@ember/service';
|
||||
import Route from '@ember/routing/route';
|
||||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default Route.extend(AuthenticatedRouteMixin, {
|
||||
documentService: service('document'),
|
||||
|
|
|
@ -69,7 +69,6 @@
|
|||
onCopyPage=(action 'onCopyPage')
|
||||
onMovePage=(action 'onMovePage')
|
||||
onDeletePage=(action 'onPageDeleted')
|
||||
onDeleteBlock=(action 'onDeleteBlock')
|
||||
onInsertSection=(action 'onInsertSection')
|
||||
onSavePageAsBlock=(action 'onSavePageAsBlock')
|
||||
onPageLevelChange=(action 'onPageLevelChange')
|
||||
|
|
|
@ -10,18 +10,20 @@
|
|||
// https://documize.com
|
||||
|
||||
import { inject as service } from '@ember/service';
|
||||
import Notifier from '../../../mixins/notifier';
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default Controller.extend({
|
||||
sectionService: service('section'),
|
||||
export default Controller.extend(Notifier, {
|
||||
router: service(),
|
||||
sectionSvc: service('section'),
|
||||
|
||||
actions: {
|
||||
onCancel( /*page*/ ) {
|
||||
this.transitionToRoute('document');
|
||||
this.get('router').transitionTo('folder.settings', {queryParams: {tab: 'blocks'}});
|
||||
},
|
||||
|
||||
onAction(page, meta) {
|
||||
let self = this;
|
||||
this.showWait();
|
||||
|
||||
let b = this.get('model.block');
|
||||
b.set('title', page.get('title'));
|
||||
|
@ -31,8 +33,9 @@ export default Controller.extend({
|
|||
b.set('config', meta.get('config'));
|
||||
b.set('externalSource', meta.get('externalSource'));
|
||||
|
||||
this.get('sectionService').updateBlock(b).then(function () {
|
||||
self.transitionToRoute('document');
|
||||
this.get('sectionSvc').updateBlock(b).then(() => {
|
||||
this.showDone();
|
||||
this.get('router').transitionTo('folder.settings', {queryParams: {tab: 'blocks'}});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -11,21 +11,19 @@
|
|||
|
||||
import { hash } from 'rsvp';
|
||||
import { inject as service } from '@ember/service';
|
||||
import Route from '@ember/routing/route';
|
||||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default Route.extend(AuthenticatedRouteMixin, {
|
||||
documentService: service('document'),
|
||||
folderService: service('folder'),
|
||||
sectionService: service('section'),
|
||||
sectionSvc: service('section'),
|
||||
|
||||
model(params) {
|
||||
let self = this;
|
||||
|
||||
return hash({
|
||||
folder: self.modelFor('document').folder,
|
||||
document: self.modelFor('document').document,
|
||||
block: self.get('sectionService').getBlock(params.block_id),
|
||||
space: this.modelFor('folder').folder,
|
||||
permissions: this.modelFor('folder').permissions,
|
||||
block: self.get('sectionSvc').getBlock(params.block_id),
|
||||
});
|
||||
},
|
||||
});
|
30
gui/app/pods/folder/settings/controller.js
Normal file
30
gui/app/pods/folder/settings/controller.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// 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>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import { inject as service } from '@ember/service';
|
||||
import NotifierMixin from '../../../mixins/notifier';
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default Controller.extend(NotifierMixin, {
|
||||
folderService: service('folder'),
|
||||
localStorage: service('localStorage'),
|
||||
tab: 'general',
|
||||
|
||||
actions: {
|
||||
onTab(view) {
|
||||
this.set('tab', view);
|
||||
},
|
||||
|
||||
onRefresh() {
|
||||
this.get('target._routerMicrolib').refresh();
|
||||
}
|
||||
}
|
||||
});
|
29
gui/app/pods/folder/settings/route.js
Normal file
29
gui/app/pods/folder/settings/route.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// 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>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
import { hash } from 'rsvp';
|
||||
// import { inject as service } from '@ember/service';
|
||||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default Route.extend(AuthenticatedRouteMixin, {
|
||||
|
||||
model() {
|
||||
this.get('browser').setTitle(this.modelFor('folder').folder.get('name'));
|
||||
|
||||
return hash({
|
||||
folder: this.modelFor('folder').folder,
|
||||
folders: this.modelFor('folder').folders,
|
||||
permissions: this.modelFor('folder').permissions,
|
||||
templates: this.modelFor('folder').templates,
|
||||
});
|
||||
}
|
||||
});
|
54
gui/app/pods/folder/settings/template.hbs
Normal file
54
gui/app/pods/folder/settings/template.hbs
Normal file
|
@ -0,0 +1,54 @@
|
|||
{{#layout/top-bar}}
|
||||
<li class="item">
|
||||
{{#link-to "folder.index" model.folder.id model.folder.slug class='link'}}
|
||||
{{model.folder.name}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
<li class="item">
|
||||
{{#link-to "folder.settings" model.folder.id model.folder.slug class='link selected'}}
|
||||
Settings
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/layout/top-bar}}
|
||||
|
||||
{{#layout/middle-zone}}
|
||||
{{#layout/middle-zone-content}}
|
||||
{{#if (eq tab 'general')}}
|
||||
{{folder/settings-general permissions=model.permissions space=model.folder}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq tab 'permissions')}}
|
||||
{{folder/settings-permissions permissions=model.permissions folders=model.folders folder=model.folder onRefresh=(action 'onRefresh')}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq tab 'invitations')}}
|
||||
{{folder/settings-invitations permissions=model.permissions space=model.folder}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq tab 'templates')}}
|
||||
{{folder/settings-templates permissions=model.permissions space=model.folder templates=model.templates}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq tab 'blocks')}}
|
||||
{{folder/settings-blocks permissions=model.permissions space=model.folder}}
|
||||
{{/if}}
|
||||
{{/layout/middle-zone-content}}
|
||||
|
||||
{{#layout/middle-zone-sidebar}}
|
||||
<div id="sidebar" class="sidebar">
|
||||
<h1>{{model.folder.name}}</h1>
|
||||
<div class="margin-top-50">
|
||||
<ul class="tabnav-control tabnav-control-centered w-75">
|
||||
<li class="tab tab-vertical {{if (eq tab 'general') 'selected'}}" {{action 'onTab' 'general'}}>Options</li>
|
||||
<li class="tab tab-vertical {{if (eq tab 'permissions') 'selected'}}" {{action 'onTab' 'permissions'}}>Permissions</li>
|
||||
<li class="tab tab-vertical {{if (eq tab 'invitations') 'selected'}}" {{action 'onTab' 'invitations'}}>Invite Users</li>
|
||||
<li class="tab tab-vertical {{if (eq tab 'templates') 'selected'}}" {{action 'onTab' 'templates'}}>Document Templates</li>
|
||||
<li class="tab tab-vertical {{if (eq tab 'blocks') 'selected'}}" {{action 'onTab' 'blocks'}}>Content Blocks</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{/layout/middle-zone-sidebar}}
|
||||
{{/layout/middle-zone}}
|
||||
|
||||
{{#layout/bottom-bar}}
|
||||
{{/layout/bottom-bar}}
|
|
@ -38,6 +38,12 @@ export default Router.map(function () {
|
|||
this.route('category', {
|
||||
path: 'category'
|
||||
});
|
||||
this.route('settings', {
|
||||
path: 'settings'
|
||||
});
|
||||
this.route('block', {
|
||||
path: 'block/:block_id'
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -50,9 +56,6 @@ export default Router.map(function () {
|
|||
this.route('section', {
|
||||
path: 'section/:page_id'
|
||||
});
|
||||
this.route('block', {
|
||||
path: 'block/:block_id'
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -2,4 +2,5 @@
|
|||
@import "layout-topbar.scss";
|
||||
@import "layout-sidebar.scss";
|
||||
@import "layout-footer.scss";
|
||||
@import "layout-content.scss";
|
||||
|
||||
|
|
32
gui/app/styles/layout/layout-content.scss
Normal file
32
gui/app/styles/layout/layout-content.scss
Normal file
|
@ -0,0 +1,32 @@
|
|||
.content-zone {
|
||||
> .explainer-header {
|
||||
color: $color-gray;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
> .explainer-text {
|
||||
margin: 3px 0;
|
||||
padding: 0;
|
||||
color: $color-gray;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
> .explainer-list {
|
||||
margin: 5px 20px;
|
||||
padding: 0;
|
||||
color: $color-gray;
|
||||
|
||||
> li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 1.1rem;
|
||||
list-style: square;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
> .explainer-gap {
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
<div class="view-customize">
|
||||
<form class="mt-5 ">
|
||||
<div class="form-group row">
|
||||
<label for="smtp-host " class="col-sm-2 col-form-label ">Enterprise Edition License Key</label>
|
||||
<label for="smtp-host " class="col-sm-2 col-form-label ">Enterprise Edition<br/> License (optional)</label>
|
||||
<div class="col-sm-10 ">
|
||||
{{textarea value=model.license rows="10" class=(if LicenseError 'form-control is-invalid' 'form-control')}}
|
||||
<small class="form-text text-muted ">XML format</small>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="block-editor">
|
||||
{{component editorType document=document folder=folder page=page meta=meta blockMode=true onCancel=(action 'onCancel') onAction=(action 'onAction')}}
|
||||
{{component editorType document=document space=space page=page meta=meta blockMode=true onCancel=(action 'onCancel') onAction=(action 'onAction')}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
<div id="space-permission-modal" class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-80">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Space Permissions</div>
|
||||
<div class="modal-body" style="overflow-x: auto;">
|
||||
<div class="space-admin table-responsive">
|
||||
|
||||
<table class="table table-hover permission-table mb-3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th colspan="3">Spaces</th>
|
||||
<th colspan="9" class="text-info">Documents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>View</th>
|
||||
<th>Manage</th>
|
||||
<th>Owner</th>
|
||||
<th class="text-info">Create</th>
|
||||
<th class="text-info">Edit</th>
|
||||
<th class="text-info">Delete</th>
|
||||
<th class="text-info">Move</th>
|
||||
<th class="text-info">Copy</th>
|
||||
<th class="text-info">Templates</th>
|
||||
<th class="text-info">Approval</th>
|
||||
<th class="text-info">Lifecycle</th>
|
||||
<th class="text-info">Versions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each spacePermissions as |permission|}}
|
||||
<tr>
|
||||
<td>
|
||||
{{#if (eq permission.who "role")}}
|
||||
<span class="button-icon-blue button-icon-small align-middle">
|
||||
<i class="material-icons">people</i>
|
||||
</span>
|
||||
<span class="color-blue"> {{permission.name}}
|
||||
<small class="form-text text-muted d-inline-block">({{permission.members}})</small>
|
||||
</span>
|
||||
{{else}}
|
||||
{{#if (eq permission.whoId constants.EveryoneUserId)}}
|
||||
<span class="button-icon-green button-icon-small align-middle">
|
||||
<i class="material-icons">language</i>
|
||||
</span>
|
||||
<span class="color-green"> {{permission.name}}</span>
|
||||
{{else}}
|
||||
<span class="button-icon-gray button-icon-small align-middle">
|
||||
<i class="material-icons">person</i>
|
||||
</span>
|
||||
<span class=""> {{permission.name}}
|
||||
{{#if (eq permission.whoId session.user.id)}}
|
||||
<small class="form-text text-muted d-inline-block">(you)</small>
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td>{{input type="checkbox" id=(concat 'space-role-view-' permission.whoId) checked=permission.spaceView}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'space-role-manage-' permission.whoId) checked=permission.spaceManage}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'space-role-owner-' permission.whoId) checked=permission.spaceOwner}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-add-' permission.whoId) checked=permission.documentAdd}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-edit-' permission.whoId) checked=permission.documentEdit}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-delete-' permission.whoId) checked=permission.documentDelete}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-move-' permission.whoId) checked=permission.documentMove}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-copy-' permission.whoId) checked=permission.documentCopy}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-template-' permission.whoId) checked=permission.documentTemplate}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-approve-' permission.whoId) checked=permission.documentApprove}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-lifecycle-' permission.whoId) checked=permission.documentLifecycle}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-version-' permission.whoId) checked=permission.documentVersion}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-6">
|
||||
<div class="form-group">
|
||||
{{focus-input id="user-search" type="text" class="form-control mousetrap" placeholder="Search users..." value=searchText key-up=(action 'onSearch')}}
|
||||
<small class="form-text text-muted">firstname, lastname, email</small>
|
||||
</div>
|
||||
{{#each filteredUsers as |user|}}
|
||||
<div class="row my-3">
|
||||
<div class="col-10">{{user.fullname}}</div>
|
||||
<div class="col-2 text-right">
|
||||
<button class="btn btn-primary" {{action 'onAdd' user}}>Add</button>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-success" onclick= {{action 'setPermissions'}}>Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
18
gui/app/templates/components/folder/settings-blocks.hbs
Normal file
18
gui/app/templates/components/folder/settings-blocks.hbs
Normal file
|
@ -0,0 +1,18 @@
|
|||
<div class="content-zone">
|
||||
<div class="explainer-header explainer-gap">Content blocks provide re-usable content that can be inserted into any document</div>
|
||||
{{#each blocks as |block|}}
|
||||
<div class="mb-5">
|
||||
<h1>{{block.title}}</h1>
|
||||
<p>{{block.excerpt}}</p>
|
||||
<button type="button" class="btn btn-outline-success" onclick={{action 'onEdit' block.id}}>Edit</button>
|
||||
<div class="button-gap" />
|
||||
<button type="button" class="btn btn-outline-danger" onclick={{action 'onShowDeleteDialog' block.id}}>Delete</button>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
{{#if isSpaceAdmin}}
|
||||
{{#ui/ui-dialog title="Delete Content Block" confirmCaption="Delete" buttonType="btn-danger" show=showDeleteDialog onAction=(action 'onDeleteBlock')}}
|
||||
<p>Are you sure you want to delete this re-usable content block?</p>
|
||||
{{/ui/ui-dialog}}
|
||||
{{/if}}
|
25
gui/app/templates/components/folder/settings-general.hbs
Normal file
25
gui/app/templates/components/folder/settings-general.hbs
Normal file
|
@ -0,0 +1,25 @@
|
|||
<div class="content-zone">
|
||||
<div class="explainer-header explainer-gap">General options for this space</div>
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label>Space Type</label>
|
||||
{{ui-select id="spacetypes-dropdown" content=spaceTypeOptions optionValuePath="id" optionLabelPath="label" selection=spaceType action=(action 'onSetSpaceType')}}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Content Liking</label>
|
||||
{{#if allowLikes}}
|
||||
{{input type='text' id="space-likes-prompt" class="form-control" placeholder="Did this help you?" value=likes}}
|
||||
<small class="form-text text-muted">Specify the prompt, e.g. Did this help you? Was this helpful? Did you find what you needed?</small>
|
||||
<div class="mt-4">
|
||||
<button type="button" class="btn btn-outline-danger" onclick={{action 'onSetLikes' false}}>Do not allow users to like content</button>
|
||||
</div>
|
||||
{{else}}
|
||||
<div>
|
||||
<button type="button" class="btn btn-outline-success" onclick={{action 'onSetLikes' true}}>Allow users to like content</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</form>
|
||||
<button type="button" class="btn btn-success mt-3" onclick={{action 'onSave'}}>Save</button>
|
||||
</div>
|
16
gui/app/templates/components/folder/settings-invitations.hbs
Normal file
16
gui/app/templates/components/folder/settings-invitations.hbs
Normal file
|
@ -0,0 +1,16 @@
|
|||
<div class="content-zone">
|
||||
<div class="explainer-header">Invite new users to this space</div>
|
||||
<p class="explainer-text explainer-gap">Email invite leads to a smooth onboarding process</p>
|
||||
<form onsubmit={{action 'onSpaceInvite'}}>
|
||||
<div class="form-group">
|
||||
<label for="space-invite-email">Email for space invitation</label>
|
||||
{{input id="space-invite-email" type='email' class="form-control mousetrap" placeholder="Enter email" value=inviteEmail}}
|
||||
<small class="form-text text-muted">Comma separate multiple email addresses</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="space-invite-msg">Message explaining space invitation</label>
|
||||
{{textarea id="space-invite-msg" value=inviteMessage class="form-control" rows="5"}}
|
||||
</div>
|
||||
</form>
|
||||
<button type="button" class="btn btn-success mt-3" onclick={{action 'onSpaceInvite'}}>Invite</button>
|
||||
</div>
|
113
gui/app/templates/components/folder/settings-permissions.hbs
Normal file
113
gui/app/templates/components/folder/settings-permissions.hbs
Normal file
|
@ -0,0 +1,113 @@
|
|||
<div class="content-zone">
|
||||
<div class="explainer-header">Space and document permissions for both users and groups</div>
|
||||
<p class="explainer-text">Space level permissions:</p>
|
||||
<ul class="explainer-list">
|
||||
<li>View — see content within this space</li>
|
||||
<li>Manage — manage all aspects of space except deletion</li>
|
||||
<li>Owner — manage and delete space</li>
|
||||
</ul>
|
||||
<p class="explainer-text">Document level permissions:</p>
|
||||
<ul class="explainer-list explainer-gap">
|
||||
<li>Create — create new documents</li>
|
||||
<li>Edit — edit documents</li>
|
||||
<li>Delete — delete documents</li>
|
||||
<li>Move — move content between documents</li>
|
||||
<li>Copy — copy content between documents</li>
|
||||
<li>Templates — create, edit, delete document templates and content blocks</li>
|
||||
<li>Approval — approve or reject content changes</li>
|
||||
<li>Lifecycle — mark documents as Draft, Live or Archived</li>
|
||||
<li>Versions — create versions of documents (baselining)</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="space-admin table-responsive">
|
||||
<table class="table table-hover permission-table mb-3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th colspan="3">Spaces</th>
|
||||
<th colspan="9" class="text-info">Documents</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>View</th>
|
||||
<th>Manage</th>
|
||||
<th>Owner</th>
|
||||
<th class="text-info">Create</th>
|
||||
<th class="text-info">Edit</th>
|
||||
<th class="text-info">Delete</th>
|
||||
<th class="text-info">Move</th>
|
||||
<th class="text-info">Copy</th>
|
||||
<th class="text-info">Templates</th>
|
||||
<th class="text-info">Approval</th>
|
||||
<th class="text-info">Lifecycle</th>
|
||||
<th class="text-info">Versions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each spacePermissions as |permission|}}
|
||||
<tr>
|
||||
<td>
|
||||
{{#if (eq permission.who "role")}}
|
||||
<span class="button-icon-blue button-icon-small align-middle">
|
||||
<i class="material-icons">people</i>
|
||||
</span>
|
||||
<span class="color-blue"> {{permission.name}}
|
||||
<small class="form-text text-muted d-inline-block">({{permission.members}})</small>
|
||||
</span>
|
||||
{{else}}
|
||||
{{#if (eq permission.whoId constants.EveryoneUserId)}}
|
||||
<span class="button-icon-green button-icon-small align-middle">
|
||||
<i class="material-icons">language</i>
|
||||
</span>
|
||||
<span class="color-green"> {{permission.name}}</span>
|
||||
{{else}}
|
||||
<span class="button-icon-gray button-icon-small align-middle">
|
||||
<i class="material-icons">person</i>
|
||||
</span>
|
||||
<span class=""> {{permission.name}}
|
||||
{{#if (eq permission.whoId session.user.id)}}
|
||||
<small class="form-text text-muted d-inline-block">(you)</small>
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td>{{input type="checkbox" id=(concat 'space-role-view-' permission.whoId) checked=permission.spaceView}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'space-role-manage-' permission.whoId) checked=permission.spaceManage}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'space-role-owner-' permission.whoId) checked=permission.spaceOwner}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-add-' permission.whoId) checked=permission.documentAdd}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-edit-' permission.whoId) checked=permission.documentEdit}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-delete-' permission.whoId) checked=permission.documentDelete}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-move-' permission.whoId) checked=permission.documentMove}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-copy-' permission.whoId) checked=permission.documentCopy}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-template-' permission.whoId) checked=permission.documentTemplate}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-approve-' permission.whoId) checked=permission.documentApprove}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-lifecycle-' permission.whoId) checked=permission.documentLifecycle}}</td>
|
||||
<td>{{input type="checkbox" id=(concat 'doc-role-version-' permission.whoId) checked=permission.documentVersion}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-success my-3" onclick= {{action 'onSave'}}>Save</button>
|
||||
|
||||
<div class="container-fluid mt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-6">
|
||||
<div class="form-group">
|
||||
{{focus-input id="user-search" type="text" class="form-control mousetrap" placeholder="Search for users by firstname, lastname, email" value=searchText key-up=(action 'onSearch')}}
|
||||
<small class="form-text text-muted">Find and add users to this space</small>
|
||||
</div>
|
||||
{{#each filteredUsers as |user|}}
|
||||
<div class="row my-3">
|
||||
<div class="col-10">{{user.fullname}}</div>
|
||||
<div class="col-2 text-right">
|
||||
<button class="btn btn-primary" {{action 'onAdd' user}}>Add</button>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
10
gui/app/templates/components/folder/settings-templates.hbs
Normal file
10
gui/app/templates/components/folder/settings-templates.hbs
Normal file
|
@ -0,0 +1,10 @@
|
|||
<div class="content-zone">
|
||||
<div class="explainer-header explainer-gap">Content Templates provide the basis for new documentation</div>
|
||||
{{#each templates as |item|}}
|
||||
<div class="mb-5">
|
||||
<h1>{{item.title}}</h1>
|
||||
<p>{{item.description}}</p>
|
||||
<button type="button" class="btn btn-outline-success" onclick={{action 'onOpenTemplate' item.id}}>Open</button>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
|
@ -4,7 +4,9 @@
|
|||
<div class="col col-6 col-md-9">
|
||||
<div class="top-bar d-none d-md-block">
|
||||
<ul class="items d-flex align-items-center">
|
||||
<li class="item"><img class="logo" src="/assets/img/icon-white-64x64.png" /></li>
|
||||
<li class="item cursor-auto">
|
||||
<img class="logo" src="/assets/img/icon-white-64x64.png" />
|
||||
</li>
|
||||
{{#if (eq appMeta.edition 'Community')}}
|
||||
<li class="item">
|
||||
{{#link-to "folders" class=(if (eq selectItem 'spaces') 'link selected' 'link')}}SPACES{{/link-to}}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{{#section/base-editor-inline document=document folder=folder page=page
|
||||
blockMode=blockMode contentLinkerButton=true onInsertLink=(action 'onInsertLink')
|
||||
isDirty=(action 'isDirty') onCancel=(action 'onCancel') onAction=(action 'onAction')}}
|
||||
<div id={{toolbarId}}></div>
|
||||
<div id={{editorId}} class="mousetrap wysiwyg wysiwyg-editor">
|
||||
{{{pageBody}}}
|
||||
</div>
|
||||
|
|
|
@ -94,40 +94,10 @@
|
|||
</div>
|
||||
|
||||
<div class="col-6 text-right">
|
||||
{{#if spaceSettings}}
|
||||
<div id="space-permissions-button" class="button-icon-gray align-middle" data-toggle="tooltip" data-placement="top" title="Set permissions">
|
||||
<i class="material-icons" data-toggle="modal" data-target="#space-permission-modal" data-backdrop="static">security</i>
|
||||
</div>
|
||||
<div class="button-icon-gap" />
|
||||
<div id="space-invite-button" class="button-icon-gray align-middle" data-toggle="tooltip" data-placement="top" title="Invite to space">
|
||||
<i class="material-icons" data-toggle="modal" data-target="#space-invite-modal" data-backdrop="static">person_add</i>
|
||||
</div>
|
||||
<div class="button-icon-gap" />
|
||||
{{/if}}
|
||||
|
||||
{{#if permissions.documentTemplate}}
|
||||
<div id="space-template-button" class="button-icon-gray align-middle" data-toggle="tooltip" data-placement="top" title="Manage templates">
|
||||
<i class="material-icons" data-toggle="modal" data-target="#space-template-modal" data-backdrop="static">content_copy</i>
|
||||
</div>
|
||||
<div class="button-icon-gap" />
|
||||
{{/if}}
|
||||
|
||||
{{#if (or permissions.spaceOwner permissions.spaceManage)}}
|
||||
<div id="space-settings-button" class="button-icon-gray align-middle" data-toggle="tooltip" data-placement="top" title="Settings">
|
||||
<i class="material-icons" data-toggle="modal" data-target="#space-settings-modal" data-backdrop="static">settings</i>
|
||||
</div>
|
||||
<div class="button-icon-gap" />
|
||||
{{/if}}
|
||||
|
||||
{{#if pinState.isPinned}}
|
||||
<div id="space-pin-button" class="button-icon-gold align-middle" data-toggle="tooltip" data-placement="top" title="Remove favorite" {{action 'onUnpin'}}>
|
||||
<i class="material-icons">star</i>
|
||||
</div>
|
||||
<div class="button-icon-gap" />
|
||||
{{else if session.authenticated}}
|
||||
<div id="space-pin-button" class="button-icon-gray align-middle" data-toggle="tooltip" data-placement="top" title="Save favorite" {{action 'onPin'}}>
|
||||
<i class="material-icons">star</i>
|
||||
</div>
|
||||
{{#link-to 'folder.settings' space.id space.slug class="button-icon-gray align-middle"}}
|
||||
<i class="material-icons" data-toggle="tooltip" data-placement="top" title="Settings, users, permissions, templates">settings</i>
|
||||
{{/link-to}}
|
||||
<div class="button-icon-gap" />
|
||||
{{/if}}
|
||||
|
||||
|
@ -137,45 +107,20 @@
|
|||
</div>
|
||||
<div class="button-icon-gap" />
|
||||
{{/if}}
|
||||
|
||||
{{#if pinState.isPinned}}
|
||||
<div id="space-pin-button" class="button-icon-gold align-middle" data-toggle="tooltip" data-placement="top" title="Remove favorite" {{action 'onUnpin'}}>
|
||||
<i class="material-icons">star</i>
|
||||
</div>
|
||||
{{else if session.authenticated}}
|
||||
<div id="space-pin-button" class="button-icon-gray align-middle" data-toggle="tooltip" data-placement="top" title="Save favorite" {{action 'onPin'}}>
|
||||
<i class="material-icons">star</i>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="space-settings-modal" class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Space Settings</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label>Space Type</label>
|
||||
{{ui-select id="group-dropdown" content=spaceTypeOptions optionValuePath="id" optionLabelPath="label" selection=spaceType action=(action 'onSetSpaceType')}}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Content Liking</label>
|
||||
{{#if allowLikes}}
|
||||
{{input type='text' id="space-likes-prompt" class="form-control" placeholder="Did this help you?" value=likes}}
|
||||
<small class="form-text text-muted">Specify the prompt, e.g. Did this help you? Was this helpful? Did you find what you needed?</small>
|
||||
<div class="mt-4">
|
||||
<button type="button" class="btn btn-secondary" onclick={{action 'onSetLikes' false}}>Do not allow users to like content</button>
|
||||
</div>
|
||||
{{else}}
|
||||
<div>
|
||||
<button type="button" class="btn btn-outline-success" onclick={{action 'onSetLikes' true}}>Allow users to like content</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-success" onclick={{action 'onSpaceSettings'}}>Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="space-delete-modal" class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
|
@ -197,63 +142,3 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="space-template-modal" class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Manage Templates</div>
|
||||
<div class="modal-body">
|
||||
<div class="widget-list-picker">
|
||||
<ul class="options">
|
||||
{{#each templates as |item|}}
|
||||
<li class="option {{if item.selected 'selected'}}" {{action 'onSelectTemplate' item}}>
|
||||
<div class="text text-truncate">
|
||||
{{item.title}}<br/>{{item.description}}
|
||||
</div>
|
||||
{{#if item.selected}}
|
||||
<i class="material-icons">check</i>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{else}}
|
||||
No document templates
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Close</button>
|
||||
{{#if templates}}
|
||||
<button type="button" class="btn btn-success" onclick={{action 'onOpenTemplate'}}>Open</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="space-invite-modal" class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Space Invitation</div>
|
||||
<div class="modal-body">
|
||||
<form onsubmit={{action 'onSpaceInvite'}}>
|
||||
<div class="form-group">
|
||||
<label for="space-invite-email">Email for space invitation</label>
|
||||
{{input id="space-invite-email" type='email' class="form-control mousetrap" placeholder="Enter email" value=inviteEmail}}
|
||||
<small class="form-text text-muted">Comma separate multiple email addresses</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="space-invite-msg">Message explaining space invitation</label>
|
||||
{{textarea id="space-invite-msg" value=inviteMessage class="form-control" rows="5"}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-success" onclick={{action 'onSpaceInvite'}}>Invite</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{folder/permission-admin folders=spaces folder=space onRefresh=onRefresh}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue