mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
refactored license/smtp/genral settings UI
This commit is contained in:
parent
fd6b4c051b
commit
75aa00beca
19 changed files with 221 additions and 117 deletions
|
@ -1,7 +1,9 @@
|
|||
{{#if folders}}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 class="admin-heading">{{folders.length}} shared {{label}}</h1>
|
||||
<div class="view-customize">
|
||||
<h1 class="admin-heading">{{folders.length}} shared {{label}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="view-customize">
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{{customize/global-settings model=model saveSMTP=(action 'saveSMTP') saveLicense=(action 'saveLicense')}}
|
|
@ -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');
|
||||
});
|
||||
}
|
||||
}
|
|
@ -28,7 +28,6 @@ export default Route.extend(AuthenticatedRouteMixin, {
|
|||
|
||||
model() {
|
||||
return RSVP.hash({
|
||||
smtp: this.get('global').getSMTPConfig(),
|
||||
license: this.get('global').getLicense()
|
||||
});
|
||||
},
|
1
gui/app/pods/customize/license/template.hbs
Normal file
1
gui/app/pods/customize/license/template.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
{{customize/license-key model=model saveLicense=(action 'saveLicense')}}
|
26
gui/app/pods/customize/smtp/controller.js
Normal file
26
gui/app/pods/customize/smtp/controller.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
// 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 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(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
37
gui/app/pods/customize/smtp/route.js
Normal file
37
gui/app/pods/customize/smtp/route.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 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";
|
||||
}
|
||||
});
|
1
gui/app/pods/customize/smtp/template.hbs
Normal file
1
gui/app/pods/customize/smtp/template.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
{{customize/smtp-settings model=model saveSMTP=(action 'saveSMTP')}}
|
|
@ -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}}
|
||||
</ul>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue