Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions packages/accounts/create/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if (Meteor.isClient) {
orion.accounts.invitations.insert({ roles: roles, email: email }, function(error, result) {
if (error) {
alert(error.reason);
console.log(error);
orion.log.error(error);
} else {
Session.set('accounts.create.invitationId', result);
}
Expand All @@ -69,7 +69,7 @@ if (Meteor.isClient) {
Meteor.call('accountsCreateUser', options, function(error, result) {
if (error) {
alert(error.reason);
console.log(error);
orion.log.error(error);
} else {
RouterLayer.go('accounts.index');
}
Expand Down Expand Up @@ -144,12 +144,12 @@ if (Meteor.isClient) {
}, function(error, result) {
if (error) {
Session.set('registerWithInvitationError', error.reason);
console.log(error);
orion.log.error(error);
} else {
Meteor.loginWithPassword(email, password, function(error) {
if (error) {
Session.set('registerWithInvitationError', error.reason);
console.log(error);
orion.log.error(error);
} else {
RouterLayer.go('admin');
}
Expand Down
10 changes: 5 additions & 5 deletions packages/accounts/package.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Package.describe({
name: 'orionjs:accounts',
summary: 'Orion accounts mannager',
version: '1.4.2',
version: '1.4.3',
git: 'https://github.com/orionjs/orion'
});

Package.onUse(function(api) {
api.versionsFrom('1.0');

api.use([
'orionjs:base@1.4.0',
'orionjs:attributes@1.4.0',
'orionjs:base@1.4.2',
'orionjs:attributes@1.4.1',
'accounts-base',
'accounts-password',
'useraccounts:core@1.12.0',
'aldeed:simple-schema@1.3.2',
'matb33:collection-hooks@0.7.11',
'aldeed:simple-schema@1.3.3',
'matb33:collection-hooks@0.7.13',
'meteorhacks:inject-initial@1.0.2',
]);

Expand Down
22 changes: 11 additions & 11 deletions packages/attributes/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ orion.attribute = function(name, schema, options) {
if (!_.has(orion.attributes, name)) {
throw 'The attribute "' + name + '" does not exist';
}
var schema = schema || {};
var options = options || {};
var attributeSchema = orion.attributes[name].getSchema.call(this, options);
var _schema = schema || {};
var _options = options || {};
var attributeSchema = orion.attributes[name].getSchema.call(this, _options);
var override = {
orionAttribute: name,
autoform: {
type: 'orion.' + name
}
}
var attribute = orion.helpers.deepExtend(orion.helpers.deepExtend(schema, attributeSchema), override);
};
var attribute = orion.helpers.deepExtend(orion.helpers.deepExtend(_schema, attributeSchema), override);
return attribute;
}
};

/**
* Returns proper tabular column for the attribute
Expand All @@ -52,12 +52,12 @@ orion.attributeColumn = function(name, key, title) {
item: rowData,
collection: collection,
schema: schema,
}
};
var template = ReactiveTemplates.get('attributePreview.' + name);
Blaze.renderWithData(Template[template], data, cell);
}
}
}
};
};

/**
* Helper function to use arrays of attributes (Ex: array of images)
Expand All @@ -73,7 +73,7 @@ orion.arrayOfAttribute = function(name, schema, options) {
return orion.helpers.deepExtend(schema, {
type: [subSchema]
});
}
};

/**
* Creates a new attribute
Expand Down Expand Up @@ -112,4 +112,4 @@ orion.attributes.registerAttribute = function(name, attribute) {
});
});
}
}
};
6 changes: 3 additions & 3 deletions packages/attributes/created-at/created-at.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ orion.attributes.registerAttribute('createdAt', {
},
autoValue: function() {
if (this.isInsert) {
return new Date;
return new Date();
} else if (this.isUpsert) {
return {$setOnInsert: new Date};
return {$setOnInsert: new Date()};
} else {
this.unset();
}
Expand All @@ -25,4 +25,4 @@ if (Meteor.isClient) {
return this.value && moment(this.value).format('LLL');
}
});
}
}
6 changes: 3 additions & 3 deletions packages/attributes/created-by/created-by.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ if (Meteor.isServer) {
}
if (Meteor.isClient) {
ReactiveTemplates.onRendered('attributePreview.createdBy', function() {
this.subscribe('userProfileForCreatedByAttributeColumn', this.data.value)
this.subscribe('userProfileForCreatedByAttributeColumn', this.data.value);
});
ReactiveTemplates.helpers('attributePreview.createdBy', {
name: function() {
var user = Meteor.users.findOne(this.value)
var user = Meteor.users.findOne(this.value);
return user && user.profile.name;
}
});
}
}
8 changes: 4 additions & 4 deletions packages/attributes/package.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Package.describe({
name: 'orionjs:attributes',
summary: 'Orion attributes',
version: '1.4.0',
version: '1.4.1',
git: 'https://github.com/orionjs/orion'
});

Package.onUse(function(api) {
api.versionsFrom('1.0');

api.use([
'orionjs:base@1.4.0',
'aldeed:collection2@2.0.0',
'orionjs:base@1.4.2',
'aldeed:collection2@2.3.3',
'aldeed:autoform@5.4.0',
'momentjs:moment@2.10.3'
'momentjs:moment@2.10.6'
]);

api.imply([
Expand Down
6 changes: 3 additions & 3 deletions packages/attributes/updated-at/updated-at.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ orion.attributes.registerAttribute('updatedAt', {
},
autoValue: function() {
if (this.isUpdate || this.isInsert) {
return new Date;
return new Date();
} else if (this.isUpsert) {
return {$setOnInsert: new Date};
return {$setOnInsert: new Date()};
} else {
this.unset();
}
Expand All @@ -25,4 +25,4 @@ if (Meteor.isClient) {
return this.value && moment(this.value).format('LLL');
}
});
}
}
6 changes: 3 additions & 3 deletions packages/base/helpers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Orion Helpers
*/
orion.helpers = {}
orion.helpers = {};

/**
* Searchs a object with a givin string
Expand Down Expand Up @@ -48,5 +48,5 @@ orion.helpers.deepExtend = function(target, source) {
orion.helpers.getTranslation = function(key) {
return function() {
return i18n(key);
}
}
};
};
2 changes: 1 addition & 1 deletion packages/base/helpers_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ orion.helpers.getBase64Image = function(file, callback) {
callback(e.target.result);
};
FR.readAsDataURL(file);
}
};
1 change: 0 additions & 1 deletion packages/base/init.js

This file was deleted.

10 changes: 5 additions & 5 deletions packages/base/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ orion.links.add = function(options) {
}
self._collection.upsert({ identifier: options.identifier }, { $set: options });
});
}
};

orion.links.get = function() {
var links = this._collection.find({ index: { $exists: true }, parent: { $exists: false } }, { sort: { index: 1 } }).fetch();
Expand All @@ -50,11 +50,11 @@ orion.links.get = function() {
}
return true;
});
}
};

orion.links.getLink = function(identifier) {
return this._collection.findOne({ identifier: identifier });
}
};

orion.links._collection.helpers({
childs: function() {
Expand All @@ -70,8 +70,8 @@ orion.links._collection.helpers({

Template.registerHelper('adminLinks', function() {
return orion.links.get();
})
});

Template.registerHelper('getAdminLink', function(identifier) {
return orion.links.getLink(identifier);
})
});
9 changes: 5 additions & 4 deletions packages/base/package.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package.describe({
name: 'orionjs:base',
summary: 'Orion',
version: '1.4.1',
version: '1.4.2',
git: 'https://github.com/orionjs/orion'
});

Expand All @@ -16,7 +16,9 @@ Package.onUse(function(api) {
'nicolaslopezj:roles@1.2.0',
'nicolaslopezj:router-layer@0.0.8',
'aldeed:simple-schema@1.3.3',
'orionjs:lang-en@1.4.0'
'orionjs:namespace@1.4.0',
'orionjs:lang-en@1.4.0',
'orionjs:logging@1.4.0'
]);

api.imply([
Expand All @@ -30,7 +32,6 @@ Package.onUse(function(api) {
]);

api.addFiles([
'init.js',
'helpers.js',
'home-route.js',
'layouts.js',
Expand All @@ -39,7 +40,7 @@ Package.onUse(function(api) {
api.addFiles([
'helpers_client.js',
'links.js'
], 'client')
], 'client');

api.export('orion');
});
Expand Down
6 changes: 3 additions & 3 deletions packages/bootstrap/package.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package.describe({
name: 'orionjs:bootstrap',
summary: 'A simple theme for orion',
version: '1.4.0',
version: '1.4.1',
git: 'https://github.com/orionjs/orion'
});

Expand All @@ -10,10 +10,10 @@ Package.onUse(function(api) {

api.use([
'meteor-platform',
'orionjs:core@1.4.0',
'orionjs:core@1.4.1',
'less',
'aldeed:autoform@5.4.0',
'aldeed:tabular@1.1.0',
'aldeed:tabular@1.2.0',
'useraccounts:bootstrap@1.11.1'
]);

Expand Down
2 changes: 1 addition & 1 deletion packages/bootstrap/views/collections/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Template.orionBootstrapCollectionsIndex.onRendered(function() {
Session.set('orionBootstrapCollectionsIndex_showTable', true);
});
});
})
});

Template.orionBootstrapCollectionsIndex.helpers({
showTable: function () {
Expand Down
4 changes: 2 additions & 2 deletions packages/bootstrap/views/config/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Template.orionBootstrapConfigUpdate.helpers({
class: function() {
return Session.get('configUpdateCurrentCategory') == category ? 'btn-default disabled': 'btn-primary';
}
}
};
});
}
});
});
4 changes: 2 additions & 2 deletions packages/bootstrap/views/dictionary/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Template.orionBootstrapDictionaryUpdate.helpers({
class: function() {
return Session.get('dictionaryUpdateCurrentCategory') == category ? 'btn-default disabled': 'btn-primary';
}
}
};
});
}
});
});
6 changes: 3 additions & 3 deletions packages/bootstrap/views/sidebar/sidebar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Template.orionBootstrapSidebar.onRendered(function() {
this.autorun(function() {
var depend = orion.links._collection.find().fetch();
$('.orion-links a[data-toggle="collapse"]').collapse()
})
})
$('.orion-links a[data-toggle="collapse"]').collapse();
});
});
12 changes: 6 additions & 6 deletions packages/collections/collections_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ orion.collections.onCreated(function() {
var getCollection = function() {
var collection = null;
try {
collection = orion.collections.list[RouterLayer.getPath().split('/')[2]]
collection = orion.collections.list[RouterLayer.getPath().split('/')[2]];
} catch (e) {
console.log('Error getting collection', e);
orion.log.error('Error getting collection', e);
}
return collection;
}
};

ReactiveTemplates.helpers('collections.' + self.name + '.index', {
collection: function() {
Expand All @@ -45,7 +45,7 @@ orion.collections.onCreated(function() {

ReactiveTemplates.helpers('collections.' + self.name + '.update', {
collection: function() {
return getCollection()
return getCollection();
},
item: function() {
return getCollection().findOne(RouterLayer.getParam('_id'));
Expand Down Expand Up @@ -73,7 +73,7 @@ orion.collections.onCreated(function() {
var objectId = RouterLayer.getParam('_id');
self.remove(objectId, function(error, result) {
if (error) {
console.warn('Error while deleting', objectId, 'in collection', getCollection().name, ':', error);
orion.log.warn('Error while deleting', objectId, 'in collection', getCollection().name, ':', error);
}
// Only go back to index in case the deletion has been properly achieved
if (result === 1) {
Expand All @@ -82,4 +82,4 @@ orion.collections.onCreated(function() {
});
}
});
})
});
Loading