2016-08-16 13:36:26 +02:00
|
|
|
// 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
|
|
|
|
|
2017-11-16 13:28:05 +00:00
|
|
|
import { computed } from '@ember/object';
|
2016-08-08 18:39:28 +02:00
|
|
|
import Model from 'ember-data/model';
|
|
|
|
import attr from 'ember-data/attr';
|
|
|
|
|
|
|
|
export default Model.extend({
|
|
|
|
firstname: attr('string'),
|
|
|
|
lastname: attr('string'),
|
|
|
|
email: attr('string'),
|
|
|
|
initials: attr('string'),
|
|
|
|
active: attr('boolean', { defaultValue: false }),
|
|
|
|
editor: attr('boolean', { defaultValue: false }),
|
|
|
|
admin: attr('boolean', { defaultValue: false }),
|
2017-09-12 09:59:43 +01:00
|
|
|
viewUsers: attr('boolean', { defaultValue: false }),
|
2018-04-05 19:59:57 +01:00
|
|
|
analytics: attr('boolean', { defaultValue: false }),
|
2016-10-18 19:20:51 -07:00
|
|
|
global: attr('boolean', { defaultValue: false }),
|
2016-08-08 18:39:28 +02:00
|
|
|
accounts: attr(),
|
2018-03-01 19:14:27 +00:00
|
|
|
groups: attr(),
|
2018-03-22 17:29:59 +00:00
|
|
|
lastVersion: attr('string'),
|
2018-11-24 18:39:43 +00:00
|
|
|
theme: attr('string'),
|
2016-08-08 18:39:28 +02:00
|
|
|
created: attr(),
|
|
|
|
revised: attr(),
|
|
|
|
|
2017-11-16 13:28:05 +00:00
|
|
|
fullname: computed('firstname', 'lastname', function () {
|
2016-08-08 18:39:28 +02:00
|
|
|
return `${this.get('firstname')} ${this.get('lastname')}`;
|
|
|
|
}),
|
|
|
|
|
|
|
|
generateInitials() {
|
|
|
|
let first = this.get('firstname').trim();
|
|
|
|
let last = this.get('lastname').trim();
|
|
|
|
this.set('initials', first.substr(0, 1) + last.substr(0, 1));
|
2016-08-24 13:10:54 +02:00
|
|
|
}
|
2016-08-08 18:39:28 +02:00
|
|
|
});
|