diff options
author | Maxime Quandalle <maxime@quandalle.com> | 2015-10-31 10:27:20 +0100 |
---|---|---|
committer | Maxime Quandalle <maxime@quandalle.com> | 2015-10-31 12:49:58 +0100 |
commit | 2b134ff7a986eb97f8ec360321be284a7a8ea11e (patch) | |
tree | 0ff579909b402db5916b66ec7bc7469534881a15 /client/config | |
parent | 3507c6565bb16b5f45c6f269f7376902f8b1ff37 (diff) | |
parent | 41b23f88aea0f421226f92b081cdb1b61c64bde4 (diff) | |
download | wekan-2b134ff7a986eb97f8ec360321be284a7a8ea11e.tar.gz wekan-2b134ff7a986eb97f8ec360321be284a7a8ea11e.tar.bz2 wekan-2b134ff7a986eb97f8ec360321be284a7a8ea11e.zip |
Merge branch 'devel' into minicard-editor
Conflicts:
client/components/lists/listBody.js
Diffstat (limited to 'client/config')
-rw-r--r-- | client/config/accounts.js | 2 | ||||
-rw-r--r-- | client/config/blazeHelpers.js | 4 | ||||
-rw-r--r-- | client/config/router.js | 23 |
3 files changed, 28 insertions, 1 deletions
diff --git a/client/config/accounts.js b/client/config/accounts.js index df0935f7..d475e6b2 100644 --- a/client/config/accounts.js +++ b/client/config/accounts.js @@ -25,7 +25,7 @@ AccountsTemplates.configure({ }, }); -_.each(['signIn', 'signUp', 'resetPwd', 'forgotPwd', 'enrollAccount'], +['signIn', 'signUp', 'resetPwd', 'forgotPwd', 'enrollAccount'].forEach( (routeName) => AccountsTemplates.configureRoute(routeName)); // We display the form to change the password in a popup window that already diff --git a/client/config/blazeHelpers.js b/client/config/blazeHelpers.js index 12990ed7..adf5ef6a 100644 --- a/client/config/blazeHelpers.js +++ b/client/config/blazeHelpers.js @@ -13,3 +13,7 @@ Blaze.registerHelper('currentCard', () => { }); Blaze.registerHelper('getUser', (userId) => Users.findOne(userId)); + +UI.registerHelper('concat', function (...args) { + return Array.prototype.slice.call(args, 0, -1).join(''); +}); diff --git a/client/config/router.js b/client/config/router.js index 1cac43a0..0a6958d0 100644 --- a/client/config/router.js +++ b/client/config/router.js @@ -88,3 +88,26 @@ _.each(redirections, (newPath, oldPath) => { }], }); }); + +// As it is not possible to use template helpers in the page <head> we create a +// reactive function whose role is to set any page-specific tag in the <head> +// using the `kadira:dochead` package. Currently we only use it to display the +// board title if we are in a board page (see #364) but we may want to support +// some <meta> tags in the future. +const appTitle = 'Wekan'; + +// XXX The `Meteor.startup` should not be necessary -- we don't need to wait for +// the complete DOM to be ready to call `DocHead.setTitle`. But the problem is +// that the global variable `Boards` is undefined when this file loads so we +// wait a bit until hopefully all files are loaded. This will be fixed in a +// clean way once Meteor will support ES6 modules -- hopefully in Meteor 1.3. +Meteor.startup(() => { + Tracker.autorun(() => { + const currentBoard = Boards.findOne(Session.get('currentBoard')); + const titleStack = [appTitle]; + if (currentBoard) { + titleStack.push(currentBoard.title); + } + DocHead.setTitle(titleStack.reverse().join(' - ')); + }); +}); |