summaryrefslogtreecommitdiffstats
path: root/sandstorm.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-12-08 16:05:59 -0500
committerMaxime Quandalle <maxime@quandalle.com>2015-12-09 19:10:26 -0500
commit71b9a42f00d8871bb09944ec80979c61ad84e655 (patch)
tree4ede6eaaea591a0b1c797498a6a8daaaa6cac489 /sandstorm.js
parent3b2eb0ffa12a0b3cc2eaa0a1e26ed6532e3f5d93 (diff)
downloadwekan-71b9a42f00d8871bb09944ec80979c61ad84e655.tar.gz
wekan-71b9a42f00d8871bb09944ec80979c61ad84e655.tar.bz2
wekan-71b9a42f00d8871bb09944ec80979c61ad84e655.zip
Allow the header bar customization
This commit also provide a way to escape the Shorcuts page on Sandstorm.
Diffstat (limited to 'sandstorm.js')
-rw-r--r--sandstorm.js46
1 files changed, 29 insertions, 17 deletions
diff --git a/sandstorm.js b/sandstorm.js
index a711a960..5148095f 100644
--- a/sandstorm.js
+++ b/sandstorm.js
@@ -3,24 +3,24 @@
const isSandstorm = Meteor.settings && Meteor.settings.public &&
Meteor.settings.public.sandstorm;
-if (isSandstorm && Meteor.isServer) {
- // In sandstorm we only have one board per sandstorm instance. Since we want
- // to keep most of our code unchanged, we simply hard-code a board `_id` and
- // redirect the user to this particular board.
- const sandstormBoard = {
- _id: 'sandstorm',
-
- // XXX Should be shared with the grain instance name.
- title: 'Wekan',
- slug: 'libreboard',
- members: [],
-
- // Board access security is handled by sandstorm, so in our point of view we
- // can alway assume that the board is public (unauthorized users won't be
- // able to access it anyway).
- permission: 'public',
- };
+// In sandstorm we only have one board per sandstorm instance. Since we want to
+// keep most of our code unchanged, we simply hard-code a board `_id` and
+// redirect the user to this particular board.
+const sandstormBoard = {
+ _id: 'sandstorm',
+
+ // XXX Should be shared with the grain instance name.
+ title: 'Wekan',
+ slug: 'libreboard',
+ members: [],
+
+ // Board access security is handled by sandstorm, so in our point of view we
+ // can alway assume that the board is public (unauthorized users won't be able
+ // to access it anyway).
+ permission: 'public',
+};
+if (isSandstorm && Meteor.isServer) {
function updateUserPermissions(userId, permissions) {
const isActive = permissions.indexOf('participate') > -1;
const isAdmin = permissions.indexOf('configure') > -1;
@@ -142,6 +142,18 @@ if (isSandstorm && Meteor.isClient) {
updateSandstormMetaData({ setTitle: DocHead.getTitle() });
});
+ // Runtime redirection from the home page to the unique board -- since the
+ // home page contains a list of a single board it's not worth to display.
+ //
+ // XXX Hack. The home route is already defined at this point so we need to
+ // add the redirection trigger to the internal route object.
+ FlowRouter._routesMap.home._triggersEnter.push((context, redirect) => {
+ redirect(FlowRouter.path('board', {
+ id: sandstormBoard._id,
+ slug: sandstormBoard.slug,
+ }));
+ });
+
// XXX Hack. `Meteor.absoluteUrl` doesn't work in Sandstorm, since every
// session has a different URL whereas Meteor computes absoluteUrl based on
// the ROOT_URL environment variable. So we overwrite this function on a