mirror of
https://github.com/documize/community.git
synced 2025-07-23 07:09:43 +02:00
moved emberjs to gui folder
This commit is contained in:
parent
6a18d18f91
commit
dc49dbbeff
999 changed files with 677 additions and 651 deletions
103
gui/app/models/document-activity.js
Normal file
103
gui/app/models/document-activity.js
Normal 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;
|
||||
})
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue