diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade index 8a749efd2..7b399710d 100644 --- a/client/components/boards/boardHeader.jade +++ b/client/components/boards/boardHeader.jade @@ -235,9 +235,9 @@ template(name="createBoard") = " " | {{{_ 'board-private-info'}}} a.js-change-visibility {{_ 'change'}}. - //a.flex.js-toggle-add-template-container - // .materialCheckBox#add-template-container - // span {{_ 'add-template-container'}} + a.flex.js-toggle-add-template-container + .materialCheckBox#add-template-container + span {{_ 'add-template-container'}} input.primary.wide(type="submit" value="{{_ 'create'}}") span.quiet | {{_ 'or'}} diff --git a/client/components/boards/boardsList.jade b/client/components/boards/boardsList.jade index 33dcfe087..30d28d8cb 100644 --- a/client/components/boards/boardsList.jade +++ b/client/components/boards/boardsList.jade @@ -14,6 +14,14 @@ template(name="boardList") option(value="-1") {{_ 'organizations'}} : each orgsDatas option(value="{{orgId}}") {{_ orgDisplayName}} + + //li.AllBoardTemplates + // if userHasTemplates + // select.js-AllBoardTemplates#jsAllBoardTemplates("multiple") + // option(value="-1") {{_ 'templates'}} : + // each templatesDatas + // option(value="{{templateId}}") {{_ templateDisplayName}} + li.AllBoardBtns div.AllBoardButtonsContainer if userHasOrgsOrTeams diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js index cdc2430ca..0e345a9c5 100644 --- a/client/components/boards/boardsList.js +++ b/client/components/boards/boardsList.js @@ -8,7 +8,11 @@ Template.boardListHeaderBar.events({ Template.boardListHeaderBar.helpers({ title() { + //if (FlowRouter.getRouteName() === 'template-container') { + // return 'template-container'; + //} else { return FlowRouter.getRouteName() === 'home' ? 'my-boards' : 'public'; + //} }, templatesBoardId() { return Meteor.user() && Meteor.user().getTemplatesBoardId(); @@ -99,6 +103,14 @@ BlazeComponent.extendComponent({ else return false; }, +/* + userHasTemplates(){ + if(Meteor.user() != null && Meteor.user().orgs && Meteor.user().orgs.length > 0) + return true; + else + return false; + }, +*/ orgsDatas() { if(Meteor.user().orgs) return Meteor.user().orgs.sort((a, b) => a.orgDisplayName.localeCompare(b.orgDisplayName)); @@ -122,12 +134,11 @@ BlazeComponent.extendComponent({ }, boards() { let query = { - //archived: false, - ////type: { $in: ['board','template-container'] }, - //type: 'board', + // { type: 'board' }, + // { type: { $in: ['board','template-container'] } }, $and: [ { archived: false }, - { type: 'board' }, + { type: { $in: ['board','template-container'] } }, { $or:[] } ] }; diff --git a/config/router.js b/config/router.js index a35883ee3..7e8f78660 100644 --- a/config/router.js +++ b/config/router.js @@ -124,6 +124,30 @@ FlowRouter.route('/shortcuts', { }, }); +FlowRouter.route('/b/templates', { + name: 'template-container', + triggersEnter: [AccountsTemplates.ensureSignedIn], + action() { + Session.set('currentBoard', null); + Session.set('currentList', null); + Session.set('currentCard', null); + Session.set('popupCardId', null); + Session.set('popupCardBoardId', null); + + Filter.reset(); + Session.set('sortBy', ''); + EscapeActions.executeAll(); + + Utils.manageCustomUI(); + Utils.manageMatomo(); + + BlazeLayout.render('defaultLayout', { + headerBar: 'boardListHeaderBar', + content: 'boardList', + }); + }, +}); + FlowRouter.route('/my-cards', { name: 'my-cards', triggersEnter: [AccountsTemplates.ensureSignedIn], diff --git a/models/users.js b/models/users.js index 1043eaa91..9a12a5ce1 100644 --- a/models/users.js +++ b/models/users.js @@ -719,7 +719,8 @@ Users.helpers({ }, getTemplatesBoardSlug() { - return (Boards.findOne((this.profile || {}).templatesBoardId) || {}).slug; + //return (Boards.findOne((this.profile || {}).templatesBoardId) || {}).slug; + return 'templates'; }, remove() { @@ -1305,13 +1306,13 @@ if (Meteor.isServer) { if (Meteor.user() && Meteor.user().isAdmin) { Users.find({ teams: { - $elemMatch: {teamId: teamId} + $elemMatch: {teamId: teamId} } }).forEach(user => { - Users.update({ + Users.update({ _id: user._id, teams: { - $elemMatch: {teamId: teamId} + $elemMatch: {teamId: teamId} } }, { $set: { @@ -1327,13 +1328,13 @@ if (Meteor.isServer) { if (Meteor.user() && Meteor.user().isAdmin) { Users.find({ orgs: { - $elemMatch: {orgId: orgId} + $elemMatch: {orgId: orgId} } }).forEach(user => { - Users.update({ + Users.update({ _id: user._id, orgs: { - $elemMatch: {orgId: orgId} + $elemMatch: {orgId: orgId} } }, { $set: {