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

upgraded Ember and Bootstrap, merged changes

This commit is contained in:
sauls8t 2018-01-22 10:31:03 +00:00
parent b4fd42da38
commit 5dd7d9c181
114 changed files with 9814 additions and 1361 deletions

View file

@ -0,0 +1,28 @@
// 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(),
document: attr(),
documentId: attr(),
documentSlug: attr(),
tags: attr(),
excerpt: attr(),
itemId: attr(),
itemType: attr(),
space: attr(),
spaceId: attr(),
spaceSlug: attr(),
selected: attr()
});

View file

@ -19,6 +19,7 @@ export default Model.extend({
folderId: attr('string'),
documentId: attr('string'),
pageId: attr('string'),
pageTitle: attr('string'),
userId: attr('string'),
firstname: attr('string'),
lastname: attr('string'),
@ -56,6 +57,9 @@ export default Model.extend({
case constants.UserActivityType.PublishedBlock:
label = 'Published Block';
break;
case constants.UserActivityType.Rejected:
label = 'Rejected';
break;
default:
break;
}
@ -94,11 +98,13 @@ export default Model.extend({
case constants.UserActivityType.PublishedBlock:
color = 'color-blue';
break;
case constants.UserActivityType.Rejected:
color = 'color-red';
break;
default:
break;
}
return color;
})
});

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 { belongsTo, hasMany } from 'ember-data/relationships';
export default Model.extend({
// page: belongsTo('page', { inverse: null }),
// meta: belongsTo('page-meta', { inverse: null }),
// pending: hasMany('page-pending', { inverse: null }),
page: attr(),
meta: attr(),
pending: attr(),
changePending: attr('boolean'),
changeAwaitingReview: attr('boolean'),
changeRejected: attr('boolean'),
userHasChangePending: attr('boolean'),
userHasChangeAwaitingReview: attr('boolean'),
userHasChangeRejected: attr('boolean'),
userHasNewPagePending: attr('boolean')
});

View file

@ -0,0 +1,28 @@
// 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({
// page: belongsTo('page', { inverse: null }),
// meta: belongsTo('page-meta', { inverse: null }),
page: attr(),
meta: attr(),
owner: attr('string'),
changePending: attr('boolean'),
changeAwaitingReview: attr('boolean'),
changeRejected: attr('boolean'),
userHasChangePending: attr('boolean'),
userHasChangeAwaitingReview: attr('boolean'),
userHasChangeRejected: attr('boolean')
});

View file

@ -19,7 +19,7 @@ export default Model.extend({
contentType: attr('string'),
pageType: attr('string'),
level: attr('number', { defaultValue: 1 }),
sequence: attr('number', { defaultValue: 0 }),
sequence: attr('number', { defaultValue: 1024 }),
numbering: attr('string'),
revisions: attr('number', { defaultValue: 0 }),
blockId: attr('string'),
@ -27,8 +27,9 @@ export default Model.extend({
body: attr('string'),
rawBody: attr('string'),
meta: attr(),
approval: attr('number', { defaultValue: 0 }),
status: attr('number', { defaultValue: 0 }),
relativeId: attr('string'),
userId: attr('string'),
tagName: computed('level', function () {
return "h2";
@ -48,5 +49,16 @@ export default Model.extend({
}),
created: attr(),
revised: attr()
revised: attr(),
// is this a new page that is pending and belongs to the user?
isNewPageUserPending(userId) {
return this.get('relativeId') === '' && this.get('userId') === userId && (
this.get('status') === this.get('constants').ChangeState.PendingNew || this.get('status') === this.get('constants').ChangeState.UnderReview);
},
// is this new page ready for review?
isNewPageReviewReady() {
return this.get('relativeId') === '' && this.get('status') === this.get('constants').ChangeState.UnderReview;
}
});

View file

@ -15,10 +15,13 @@ import attr from 'ember-data/attr';
export default Model.extend({
documentName: attr('string'),
documentId: attr('string'),
folderId: attr('string'),
contributed: attr('string'),
viewed: attr('string'),
created: attr('string'),
approved: attr('string'),
rejected: attr('string'),
hasContributed: computed('contributed', function () {
return this.get('contributed').length > 0;
@ -28,5 +31,11 @@ export default Model.extend({
}),
hasCreated: computed('created', function () {
return this.get('created').length > 0;
})
}),
hasApproved: computed('approved', function () {
return this.get('approved').length > 0;
}),
hasRejected: computed('rejected', function () {
return this.get('rejected').length > 0;
})
});