summaryrefslogtreecommitdiffstats
path: root/collections
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-05-25 21:49:06 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-05-26 00:18:45 +0200
commit1b4fcc67f4ec94ed53a2f86ad6889e551f00815e (patch)
tree134083028cb512e67f864566130c30b44c1626ba /collections
parentfc2435b042babd8a9b0f946a9cc5696b98cc837c (diff)
downloadwekan-1b4fcc67f4ec94ed53a2f86ad6889e551f00815e.tar.gz
wekan-1b4fcc67f4ec94ed53a2f86ad6889e551f00815e.tar.bz2
wekan-1b4fcc67f4ec94ed53a2f86ad6889e551f00815e.zip
Upgrade sandstorm integration
Both sandstorm and LibreBoard have significantly evolved since the last release of LibreBoard on sandstorm. This commit: * adds some more attributes on the sandstorm manifest * introduces support with the sandstorm sharing box * uses a server redirection to point to the board document * hides the top shortcut bar on sandstorm Fixes #163.
Diffstat (limited to 'collections')
-rw-r--r--collections/boards.js17
-rw-r--r--collections/users.js5
2 files changed, 5 insertions, 17 deletions
diff --git a/collections/boards.js b/collections/boards.js
index e406b10c..2d5c6099 100644
--- a/collections/boards.js
+++ b/collections/boards.js
@@ -139,7 +139,7 @@ Boards.before.insert(function(userId, doc) {
// In some cases (Chinese and Japanese for instance) the `getSlug` function
// return an empty string. This is causes bugs in our application so we set
// a default slug in this case.
- doc.slug = getSlug(doc.title) || 'board';
+ doc.slug = doc.slug || getSlug(doc.title) || 'board';
doc.createdAt = new Date();
doc.archived = false;
doc.members = [{
@@ -153,22 +153,13 @@ Boards.before.insert(function(userId, doc) {
// Handle labels
var colors = Boards.simpleSchema()._schema['labels.$.color'].allowedValues;
var defaultLabelsColors = _.clone(colors).splice(0, 6);
- doc.labels = [];
- _.each(defaultLabelsColors, function(val) {
- doc.labels.push({
+ doc.labels = _.map(defaultLabelsColors, function(val) {
+ return {
_id: Random.id(6),
name: '',
color: val
- });
- });
-
- // We randomly chose one of the default background colors for the board
- if (Meteor.isClient) {
- doc.background = {
- type: 'color',
- color: Random.choice(Boards.simpleSchema()._schema.color.allowedValues)
};
- }
+ });
});
Boards.before.update(function(userId, doc, fieldNames, modifier) {
diff --git a/collections/users.js b/collections/users.js
index 1dcccf12..54c0a298 100644
--- a/collections/users.js
+++ b/collections/users.js
@@ -33,13 +33,10 @@ Users.helpers({
});
Users.before.insert(function(userId, doc) {
- doc.profile = {};
+ doc.profile = doc.profile || {};
// connect profile.status default
doc.profile.status = 'offline';
-
- // slugify to username
- //doc.username = getSlug(doc.profile.name, '');
});
if (Meteor.isServer) {