diff options
author | Nico <paetni1@gmail.com> | 2020-04-12 00:56:35 +0200 |
---|---|---|
committer | Nico <paetni1@gmail.com> | 2020-04-12 00:56:35 +0200 |
commit | edf52bc4382823ed8768251954371094a849213e (patch) | |
tree | cf84fa1216ac5001df2204790d299ad5b8f0d1f4 | |
parent | 8f28a409c7dd90319f785e3fc4c1b26803f67f31 (diff) | |
download | wekan-edf52bc4382823ed8768251954371094a849213e.tar.gz wekan-edf52bc4382823ed8768251954371094a849213e.tar.bz2 wekan-edf52bc4382823ed8768251954371094a849213e.zip |
Public boards overview
-rw-r--r-- | client/components/boards/boardsList.jade | 2 | ||||
-rw-r--r-- | client/components/boards/boardsList.js | 18 | ||||
-rw-r--r-- | client/components/main/header.jade | 5 | ||||
-rw-r--r-- | client/components/main/header.styl | 2 | ||||
-rw-r--r-- | config/router.js | 21 | ||||
-rw-r--r-- | server/publications/boards.js | 2 |
6 files changed, 42 insertions, 8 deletions
diff --git a/client/components/boards/boardsList.jade b/client/components/boards/boardsList.jade index 79bae502..f1118aa8 100644 --- a/client/components/boards/boardsList.jade +++ b/client/components/boards/boardsList.jade @@ -55,7 +55,7 @@ template(name="boardList") title="{{_ 'archive-board'}}") template(name="boardListHeaderBar") - h1 {{_ 'my-boards'}} + h1 {{_ title }} .board-header-btns.right a.board-header-btn.js-open-archived-board i.fa.fa-archive diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js index 3918af82..0ff1c4fb 100644 --- a/client/components/boards/boardsList.js +++ b/client/components/boards/boardsList.js @@ -7,6 +7,9 @@ Template.boardListHeaderBar.events({ }); Template.boardListHeaderBar.helpers({ + title(){ + return FlowRouter.getRouteName() == 'home' ? 'my-boards' :'public'; + }, templatesBoardId() { return Meteor.user() && Meteor.user().getTemplatesBoardId(); }, @@ -21,12 +24,17 @@ BlazeComponent.extendComponent({ }, boards() { + let query = { + archived: false, + type: 'board', + } + if (FlowRouter.getRouteName() == 'home') + query['members.userId'] = Meteor.userId() + else + query.permission = 'public' + return Boards.find( - { - archived: false, - 'members.userId': Meteor.userId(), - type: 'board', - }, + query, { sort: ['title'] }, ); }, diff --git a/client/components/main/header.jade b/client/components/main/header.jade index 9a5a6b9b..de7ead93 100644 --- a/client/components/main/header.jade +++ b/client/components/main/header.jade @@ -24,6 +24,11 @@ template(name="header") a(href="{{pathFor 'home'}}") span.fa.fa-home | {{_ 'all-boards'}} + li.separator - + li + a(href="{{pathFor 'public'}}") + span.fa.fa-globe + | {{_ 'public'}} each currentUser.starredBoards li.separator - li(class="{{#if $.Session.equals 'currentBoard' _id}}current{{/if}}") diff --git a/client/components/main/header.styl b/client/components/main/header.styl index 632d1535..38ff0560 100644 --- a/client/components/main/header.styl +++ b/client/components/main/header.styl @@ -127,7 +127,7 @@ &.current color: darken(white, 5%) - &:first-child .fa-home + &:first-child .fa-home,&:nth-child(3) .fa-globe margin-right: 5px a.js-create-board diff --git a/config/router.js b/config/router.js index ad76035b..2e66c67f 100644 --- a/config/router.js +++ b/config/router.js @@ -26,6 +26,27 @@ FlowRouter.route('/', { }, }); +FlowRouter.route('/public', { + name: 'public', + triggersEnter: [AccountsTemplates.ensureSignedIn], + action() { + Session.set('currentBoard', null); + Session.set('currentList', null); + Session.set('currentCard', null); + + Filter.reset(); + EscapeActions.executeAll(); + + Utils.manageCustomUI(); + Utils.manageMatomo(); + + BlazeLayout.render('defaultLayout', { + headerBar: 'boardListHeaderBar', + content: 'boardList', + }); + }, +}); + FlowRouter.route('/b/:id/:slug', { name: 'board', action(params) { diff --git a/server/publications/boards.js b/server/publications/boards.js index f24dce47..6fbd9860 100644 --- a/server/publications/boards.js +++ b/server/publications/boards.js @@ -18,7 +18,7 @@ Meteor.publish('boards', function() { archived: false, $or: [ { - _id: { $in: starredBoards }, + // _id: { $in: starredBoards }, // Commented out, to get a list of all public boards permission: 'public', }, { members: { $elemMatch: { userId, isActive: true } } }, |