1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-05 05:25:27 +02:00

moved emberjs to gui folder

This commit is contained in:
Harvey Kandola 2017-07-19 14:48:33 +01:00
parent 6a18d18f91
commit dc49dbbeff
999 changed files with 677 additions and 651 deletions

View file

@ -0,0 +1,25 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
// import { belongsTo, hasMany } from 'ember-data/relationships';
export default Model.extend({
documentId: attr('string'),
extension: attr('string'),
fileId: attr('string'),
filename: attr('string'),
job: attr('string'),
orgId: attr('string'),
created: attr(),
revised: attr(),
});

32
gui/app/models/block.js Normal file
View file

@ -0,0 +1,32 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
export default Model.extend({
orgId: attr('string'),
folderId: attr('string'),
userId: attr('string'),
contentType: attr('string'),
pageType: attr('string'),
title: attr('string'),
body: attr('string'),
excerpt: attr('string'),
used: attr('number', { defaultValue: 0 }),
rawBody: attr(),
config: attr(),
externalSource: attr('boolean', { defaultValue: false }),
firstname: attr('string'),
lastname: attr('string'),
created: attr(),
revised: attr()
});

View file

@ -0,0 +1,103 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
import Ember from 'ember';
import constants from '../utils/constants';
export default Model.extend({
orgId: attr('string'),
folderId: attr('string'),
documentId: attr('string'),
userId: attr('string'),
firstname: attr('string'),
lastname: attr('string'),
activityType: attr('number'),
created: attr(),
activityLabel: Ember.computed('activityType', function() {
let label = '';
switch (this.get('activityType')) {
case constants.UserActivityType.Created:
label = 'Added';
break;
case constants.UserActivityType.Read:
label = 'Viewed';
break;
case constants.UserActivityType.Edited:
label = 'Edited';
break;
case constants.UserActivityType.Deleted:
label = 'Deleted';
break;
case constants.UserActivityType.Archived:
label = 'Archived';
break;
case constants.UserActivityType.Approved:
label = 'Approved';
break;
case constants.UserActivityType.Reverted:
label = 'Reverted';
break;
case constants.UserActivityType.PublishedTemplate:
label = 'Published Template';
break;
case constants.UserActivityType.PublishedBlock:
label = 'Published Block';
break;
default:
break;
}
return label;
}),
activityColor: Ember.computed('activityType', function() {
let color = '';
switch (this.get('activityType')) {
case constants.UserActivityType.Created:
color = 'color-blue';
break;
case constants.UserActivityType.Read:
color = 'color-black';
break;
case constants.UserActivityType.Edited:
color = 'color-green';
break;
case constants.UserActivityType.Deleted:
color = 'color-red';
break;
case constants.UserActivityType.Archived:
color = 'color-gray';
break;
case constants.UserActivityType.Approved:
color = 'color-green';
break;
case constants.UserActivityType.Reverted:
color = 'color-red';
break;
case constants.UserActivityType.PublishedTemplate:
color = 'color-blue';
break;
case constants.UserActivityType.PublishedBlock:
color = 'color-blue';
break;
default:
break;
}
return color;
})
});

View 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
import Ember from 'ember';
import stringUtil from '../utils/string';
// import { belongsTo, hasMany } from 'ember-data/relationships';
export default Model.extend({
name: attr('string'),
excerpt: attr('string'),
job: attr('string'),
location: attr('string'),
orgId: attr('string'),
folderId: attr('string'),
userId: attr('string'),
tags: attr('string'),
template: attr('boolean'),
layout: attr('string'),
// client-side property
selected: attr('boolean', { defaultValue: false }),
slug: Ember.computed('name', function () {
return stringUtil.makeSlug(this.get('name'));
}),
created: attr(),
revised: attr()
});

View file

@ -0,0 +1,23 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
// import { belongsTo, hasMany } from 'ember-data/relationships';
export default Model.extend({
orgId: attr('string'),
folderId: attr('string'),
userId: attr('string'),
fullname: attr('string'),
canView: attr('boolean', { defaultValue: false }),
canEdit: attr('boolean', { defaultValue: false })
});

45
gui/app/models/folder.js Normal file
View file

@ -0,0 +1,45 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
import constants from '../utils/constants';
import stringUtil from '../utils/string';
import Ember from 'ember';
// import { belongsTo, hasMany } from 'ember-data/relationships';
export default Model.extend({
name: attr('string'),
orgId: attr('string'),
userId: attr('string'),
folderType: attr('number', { defaultValue: 2 }),
slug: Ember.computed('name', function () {
return stringUtil.makeSlug(this.get('name'));
}),
markAsRestricted() {
this.set('folderType', constants.FolderType.Protected);
},
markAsPrivate() {
this.set('folderType', constants.FolderType.Private);
},
markAsPublic() {
this.set('folderType', constants.FolderType.Public);
},
// client-side prop that holds who can see this folder
sharedWith: attr(),
created: attr(),
revised: attr()
});

View file

@ -0,0 +1,24 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
// import { belongsTo, hasMany } from 'ember-data/relationships';
export default Model.extend({
title: attr('string'),
message: attr('string'),
email: attr('string'),
conversionEndpoint: attr('string'),
allowAnonymousAccess: attr('boolean', { defaultValue: false }),
created: attr(),
revised: attr()
});

View file

@ -0,0 +1,25 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
// import { belongsTo } from 'ember-data/relationships';
export default Model.extend({
pageId: attr('string'),
documentId: attr('string'),
orgId: attr('string'),
rawBody: attr(),
config: attr(),
externalSource: attr('boolean', { defaultValue: false }),
created: attr(),
revised: attr(),
});

51
gui/app/models/page.js Normal file
View file

@ -0,0 +1,51 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
import Ember from 'ember';
// import { hasMany } from 'ember-data/relationships';
export default Model.extend({
documentId: attr('string'),
orgId: attr('string'),
contentType: attr('string'),
pageType: attr('string'),
level: attr('number', { defaultValue: 1 }),
sequence: attr('number', { defaultValue: 0 }),
revisions: attr('number', { defaultValue: 0 }),
blockId: attr('string'),
title: attr('string'),
body: attr('string'),
rawBody: attr('string'),
meta: attr(),
tagName: Ember.computed('level', function () {
return "h2";
// return "h" + (this.get('level') + 1);
}),
tocIndent: Ember.computed('level', function () {
return (this.get('level') - 1) * 20;
}),
tocIndentCss: Ember.computed('tocIndent', function () {
let tocIndent = this.get('tocIndent');
return `margin-left-${tocIndent}`;
}),
hasRevisions: Ember.computed('revisions', function () {
return this.get('revisions') > 0;
}),
created: attr(),
revised: attr()
});

24
gui/app/models/pin.js Normal file
View file

@ -0,0 +1,24 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
export default Model.extend({
orgId: attr('string'),
userId: attr('string'),
folderId: attr('string'),
documentId: attr('string'),
sequence: attr('number', { defaultValue: 99 }),
pin: attr('string'),
created: attr(),
revised: attr()
});

View 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
import Ember from 'ember';
// import { belongsTo, hasMany } from 'ember-data/relationships';
export default Model.extend({
userId: attr('string'),
email: attr('string'),
firstname: attr('string'),
lastname: attr('string'),
name: attr('string'),
folderId: attr('string'),
folderType: attr('number', { defaultValue: 0 }),
fullname: Ember.computed('firstname', 'lastname', function () {
return `${this.get('firstname')} ${this.get('lastname')}`;
})
});

31
gui/app/models/section.js Normal file
View file

@ -0,0 +1,31 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
import Ember from 'ember';
// import { belongsTo, hasMany } from 'ember-data/relationships';
export default Model.extend({
contentType: attr('string'),
pageType: attr('string'),
title: attr('string'),
description: attr('string'),
iconFont: attr('string'),
iconFile: attr('string'),
hasImage: Ember.computed('iconFont', 'iconFile', function () {
return this.get('iconFile').length > 0;
}),
created: attr(),
revised: attr()
});

View 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
import stringUtil from '../utils/string';
import Ember from 'ember';
// import { belongsTo, hasMany } from 'ember-data/relationships';
export default Model.extend({
author: attr('string'),
dated: attr(),
description: attr('string'),
title: attr('string'),
type: attr('number', { defaultValue: 0 }),
slug: Ember.computed('title', function () {
return stringUtil.makeSlug(this.get('title'));
}),
created: attr(),
revised: attr()
});

View file

@ -0,0 +1,32 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
import Ember from 'ember';
export default Model.extend({
documentName: attr('string'),
folderId: attr('string'),
contributed: attr('string'),
viewed: attr('string'),
created: attr('string'),
hasContributed: Ember.computed('contributed', function () {
return this.get('contributed').length > 0;
}),
hasViewed: Ember.computed('viewed', function () {
return this.get('viewed').length > 0;
}),
hasCreated: Ember.computed('created', function () {
return this.get('created').length > 0;
})
});

39
gui/app/models/user.js Normal file
View file

@ -0,0 +1,39 @@
// 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 Model from 'ember-data/model';
import attr from 'ember-data/attr';
import Ember from 'ember';
// import { belongsTo, hasMany } from 'ember-data/relationships';
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 }),
global: attr('boolean', { defaultValue: false }),
accounts: attr(),
created: attr(),
revised: attr(),
fullname: Ember.computed('firstname', 'lastname', function () {
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));
}
});