diff --git a/gui/app/components/customize/general-settings.js b/gui/app/components/customize/general-settings.js index 25b1db10..01df6ae4 100644 --- a/gui/app/components/customize/general-settings.js +++ b/gui/app/components/customize/general-settings.js @@ -9,9 +9,8 @@ // // https://documize.com -import { empty, and } from '@ember/object/computed'; - 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'; diff --git a/gui/app/components/customize/license-key.js b/gui/app/components/customize/license-key.js new file mode 100644 index 00000000..fa3d1e18 --- /dev/null +++ b/gui/app/components/customize/license-key.js @@ -0,0 +1,25 @@ +// Copyright 2016 Documize Inc. . 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 . +// +// https://documize.com + +import { empty } from '@ember/object/computed'; +import Component from '@ember/component'; + +export default Component.extend({ + LicenseError: empty('model.license'), + + actions: { + saveLicense() { + this.get('saveLicense')().then(() => { + window.location.reload(); + }); + } + } +}); diff --git a/gui/app/components/customize/global-settings.js b/gui/app/components/customize/smtp-settings.js similarity index 92% rename from gui/app/components/customize/global-settings.js rename to gui/app/components/customize/smtp-settings.js index 3a1cfdfd..8f661894 100644 --- a/gui/app/components/customize/global-settings.js +++ b/gui/app/components/customize/smtp-settings.js @@ -10,7 +10,6 @@ // https://documize.com import { empty } from '@ember/object/computed'; - import Component from '@ember/component'; export default Component.extend({ @@ -45,12 +44,6 @@ export default Component.extend({ this.get('saveSMTP')().then(() => { }); - }, - - saveLicense() { - this.get('saveLicense')().then(() => { - window.location.reload(); - }); } } }); diff --git a/gui/app/pods/customize/folders/template.hbs b/gui/app/pods/customize/folders/template.hbs index 8e53a2ac..a44b340a 100644 --- a/gui/app/pods/customize/folders/template.hbs +++ b/gui/app/pods/customize/folders/template.hbs @@ -1,7 +1,9 @@ {{#if folders}}
-

{{folders.length}} shared {{label}}

+
+

{{folders.length}} shared {{label}}

+
diff --git a/gui/app/pods/customize/general/controller.js b/gui/app/pods/customize/general/controller.js index d63b4a09..71230b02 100644 --- a/gui/app/pods/customize/general/controller.js +++ b/gui/app/pods/customize/general/controller.js @@ -10,17 +10,14 @@ // https://documize.com import { inject as service } from '@ember/service'; - import Controller from '@ember/controller'; -import NotifierMixin from "../../../mixins/notifier"; -export default Controller.extend(NotifierMixin, { +export default Controller.extend({ orgService: service('organization'), actions: { save() { return this.get('orgService').save(this.model.general).then(() => { - this.showNotification('Saved'); }); } } diff --git a/gui/app/pods/customize/global/template.hbs b/gui/app/pods/customize/global/template.hbs deleted file mode 100644 index 72899e83..00000000 --- a/gui/app/pods/customize/global/template.hbs +++ /dev/null @@ -1 +0,0 @@ -{{customize/global-settings model=model saveSMTP=(action 'saveSMTP') saveLicense=(action 'saveLicense')}} diff --git a/gui/app/pods/customize/global/controller.js b/gui/app/pods/customize/license/controller.js similarity index 67% rename from gui/app/pods/customize/global/controller.js rename to gui/app/pods/customize/license/controller.js index 7a4cf02f..e25fed90 100644 --- a/gui/app/pods/customize/global/controller.js +++ b/gui/app/pods/customize/license/controller.js @@ -10,26 +10,15 @@ // https://documize.com import { inject as service } from '@ember/service'; - import Controller from '@ember/controller'; -import NotifierMixin from "../../../mixins/notifier"; -export default Controller.extend(NotifierMixin, { +export default Controller.extend({ global: service(), actions: { - saveSMTP() { - if(this.get('session.isGlobalAdmin')) { - return this.get('global').saveSMTPConfig(this.model.smtp).then(() => { - this.showNotification('Saved'); - }); - } - }, - saveLicense() { if(this.get('session.isGlobalAdmin')) { return this.get('global').saveLicense(this.model.license).then(() => { - this.showNotification('Saved'); }); } } diff --git a/gui/app/pods/customize/global/route.js b/gui/app/pods/customize/license/route.js similarity index 95% rename from gui/app/pods/customize/global/route.js rename to gui/app/pods/customize/license/route.js index d915493f..cf85c724 100644 --- a/gui/app/pods/customize/global/route.js +++ b/gui/app/pods/customize/license/route.js @@ -28,7 +28,6 @@ export default Route.extend(AuthenticatedRouteMixin, { model() { return RSVP.hash({ - smtp: this.get('global').getSMTPConfig(), license: this.get('global').getLicense() }); }, diff --git a/gui/app/pods/customize/license/template.hbs b/gui/app/pods/customize/license/template.hbs new file mode 100644 index 00000000..4bfb64b0 --- /dev/null +++ b/gui/app/pods/customize/license/template.hbs @@ -0,0 +1 @@ +{{customize/license-key model=model saveLicense=(action 'saveLicense')}} diff --git a/gui/app/pods/customize/smtp/controller.js b/gui/app/pods/customize/smtp/controller.js new file mode 100644 index 00000000..5fc16e69 --- /dev/null +++ b/gui/app/pods/customize/smtp/controller.js @@ -0,0 +1,26 @@ +// Copyright 2016 Documize Inc. . 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 . +// +// https://documize.com + +import { inject as service } from '@ember/service'; +import Controller from '@ember/controller'; + +export default Controller.extend({ + global: service(), + + actions: { + saveSMTP() { + if(this.get('session.isGlobalAdmin')) { + return this.get('global').saveSMTPConfig(this.model.smtp).then(() => { + }); + } + } + } +}); diff --git a/gui/app/pods/customize/smtp/route.js b/gui/app/pods/customize/smtp/route.js new file mode 100644 index 00000000..aee618bc --- /dev/null +++ b/gui/app/pods/customize/smtp/route.js @@ -0,0 +1,37 @@ +// Copyright 2016 Documize Inc. . 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 . +// +// https://documize.com + +import { inject as service } from '@ember/service'; +import Route from '@ember/routing/route'; +import RSVP from 'rsvp'; +import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; + +export default Route.extend(AuthenticatedRouteMixin, { + appMeta: service(), + session: service(), + global: service(), + + beforeModel() { + if (!this.get("session.isGlobalAdmin")) { + this.transitionTo('auth.login'); + } + }, + + model() { + return RSVP.hash({ + smtp: this.get('global').getSMTPConfig() + }); + }, + + activate() { + document.title = "SMTP | Documize"; + } +}); diff --git a/gui/app/pods/customize/smtp/template.hbs b/gui/app/pods/customize/smtp/template.hbs new file mode 100644 index 00000000..64dbab5c --- /dev/null +++ b/gui/app/pods/customize/smtp/template.hbs @@ -0,0 +1 @@ +{{customize/smtp-settings model=model saveSMTP=(action 'saveSMTP')}} diff --git a/gui/app/pods/customize/template.hbs b/gui/app/pods/customize/template.hbs index 227266c8..dd896be7 100644 --- a/gui/app/pods/customize/template.hbs +++ b/gui/app/pods/customize/template.hbs @@ -16,7 +16,8 @@ {{#link-to 'customize.folders' activeClass='selected' class="tab" tagName="li"}}Spaces{{/link-to}} {{#link-to 'customize.users' activeClass='selected' class="tab" tagName="li"}}Users{{/link-to}} {{#if session.isGlobalAdmin}} - {{#link-to 'customize.global' activeClass='selected' class="tab" tagName="li"}}Global{{/link-to}} + {{#link-to 'customize.smtp' activeClass='selected' class="tab" tagName="li"}}SMTP{{/link-to}} + {{#link-to 'customize.license' activeClass='selected' class="tab" tagName="li"}}License{{/link-to}} {{#link-to 'customize.auth' activeClass='selected' class="tab" tagName="li"}}Authentication{{/link-to}} {{/if}} diff --git a/gui/app/router.js b/gui/app/router.js index 3c019c26..8796ef3a 100644 --- a/gui/app/router.js +++ b/gui/app/router.js @@ -55,8 +55,11 @@ export default Router.map(function () { this.route('folders', { path: 'folders' }); - this.route('global', { - path: 'global' + this.route('smtp', { + path: 'smtp' + }); + this.route('license', { + path: 'license' }); this.route('auth', { path: 'auth' diff --git a/gui/app/styles/view/customize.scss b/gui/app/styles/view/customize.scss index 3d16722b..8517b079 100644 --- a/gui/app/styles/view/customize.scss +++ b/gui/app/styles/view/customize.scss @@ -1,10 +1,15 @@ .view-customize { - .admin-heading { + > .admin-heading { font-size: 1.5rem; font-weight: bold; color: $color-black; } + > .sub-heading { + font-size: 1.1rem; + color: $color-gray; + } + > .user-admin { margin: 30px 0; diff --git a/gui/app/templates/components/customize/general-settings.hbs b/gui/app/templates/components/customize/general-settings.hbs index fbad84d1..d4de73f0 100644 --- a/gui/app/templates/components/customize/general-settings.hbs +++ b/gui/app/templates/components/customize/general-settings.hbs @@ -1,34 +1,44 @@ -
-
-
-
-
Instance Settings
-
Settings applicable to your Documize instance
-
-
- -
Describe the title of this Documize instance
- {{focus-input id="siteTitle" type="text" value=model.general.title class=(if hasTitleInputError 'error')}} -
-
- -
Describe the purpose of this Documize instance
- {{textarea id="siteMessage" rows="3" value=model.general.message class=(if hasMessageInputError 'error')}} -
-
- -
Content within "Everyone" will be made available to anonymous users
-
- - -
-
-
- -
Endpoint for handling import/export (e.g. https://api.documize.com, view documentation)
- {{focus-input id="conversionEndpoint" type="text" value=model.general.conversionEndpoint class=(if hasConversionEndpointInputError 'error')}} -
-
save
-
+
+
+
+

Instance Settings

+

Settings applicable to the Documize instance

+
+
+ +
+
+
+ +
+ {{focus-input id="siteTitle" type="text" value=model.general.title class=(if hasTitleInputError 'form-control is-invalid' 'form-control')}} + Provide short title for this Documize instance +
+
+
+ +
+ {{textarea id="siteMessage" rows="3" value=model.general.message class=(if hasMessageInputError 'form-control is-invalid' 'form-control')}} + Provide short message explaining this Documize instance +
+
+
+ +
+ + Content within "Everyone" will be made available to anonymous users +
+
+
+ +
+ {{input id="conversionEndpoint" type="text" value=model.general.conversionEndpoint class=(if hasConversionEndpointInputError 'form-control is-invalid' 'form-control')}} + + Endpoint for handling import/export (e.g. https://api.documize.com, view documentation) + +
+
+
Save
+
\ No newline at end of file diff --git a/gui/app/templates/components/customize/global-settings.hbs b/gui/app/templates/components/customize/global-settings.hbs deleted file mode 100644 index 3e4d0547..00000000 --- a/gui/app/templates/components/customize/global-settings.hbs +++ /dev/null @@ -1,53 +0,0 @@ -
-
-
-
-
Mail Server Settings
-
Used for sending email notifications
-
-
- -
e.g. my.host.com
- {{focus-input id="smtp-host" type="text" value=model.smtp.host class=(if SMTPHostEmptyError 'error')}} -
-
- -
e.g. 587
- {{input id="smtp-port" type="text" value=model.smtp.port class=(if SMTPPortEmptyError 'error')}} -
-
- -
e.g. noreply@documize.com
- {{input id="smtp-sender" type="text" value=model.smtp.sender class=(if SMTPSenderEmptyError 'error')}} -
-
- -
Your credentials
- {{input id="smtp-userid" type="text" value=model.smtp.userid class=(if SMTPUserIdEmptyError 'error')}} -
-
- -
Your credentials
- {{input id="smtp-password" type="text" value=model.smtp.password class=(if SMTPPasswordEmptyError 'error')}} -
-
save
-
-
- -
- -
-
-
-
Optional Edition License
-
Only applies to Enterprise Edition
-
-
- -
XML format accepted
- {{textarea value=model.license rows="15"}} -
-
save
-
-
-
diff --git a/gui/app/templates/components/customize/license-key.hbs b/gui/app/templates/components/customize/license-key.hbs new file mode 100644 index 00000000..1c557185 --- /dev/null +++ b/gui/app/templates/components/customize/license-key.hbs @@ -0,0 +1,21 @@ +
+
+
+

Product License

+

Optional Enterprise Edition license

+
+
+
+ +
+
+
+ +
+ {{textarea value=model.license rows="15" class=(if LicenseError 'form-control is-invalid' 'form-control')}} + XML format +
+
+
Save
+
+
diff --git a/gui/app/templates/components/customize/smtp-settings.hbs b/gui/app/templates/components/customize/smtp-settings.hbs new file mode 100644 index 00000000..350258c2 --- /dev/null +++ b/gui/app/templates/components/customize/smtp-settings.hbs @@ -0,0 +1,49 @@ +
+
+
+

SMTP Settings

+

Used for sending email notifications

+
+
+
+ +
+
+
+ +
+ {{focus-input id="smtp-host" type="text" value=model.smtp.host class=(if SMTPHostEmptyError 'form-control is-invalid' 'form-control')}} + e.g. my.host.com +
+
+
+ +
+ {{input id="smtp-port" type="text" value=model.smtp.port class=(if SMTPPortEmptyError 'form-control is-invalid' 'form-control')}} + e.g. 587 +
+
+
+ +
+ {{input id="smtp-sender" type="text" value=model.smtp.sender class=(if SMTPSenderEmptyError 'form-control is-invalid' 'form-control')}} + e.g. user@some-domain.com +
+
+
+ +
+ {{input id="smtp-userid" type="text" value=model.smtp.userid class=(if SMTPUserIdEmptyError 'form-control is-invalid' 'form-control')}} + e.g. Login username for SMTP server +
+
+
+ +
+ {{input id="smtp-password" type="password" value=model.smtp.password class=(if SMTPPasswordEmptyError 'form-control is-invalid' 'form-control')}} + e.g. Login password for SMTP server +
+
+
Save
+
+
\ No newline at end of file