Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public boards overview #3008

Merged
merged 1 commit into from Apr 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/components/boards/boardsList.jade
Expand Up @@ -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
Expand Down
18 changes: 13 additions & 5 deletions client/components/boards/boardsList.js
Expand Up @@ -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();
},
Expand All @@ -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'] },
);
},
Expand Down
5 changes: 5 additions & 0 deletions client/components/main/header.jade
Expand Up @@ -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}}")
Expand Down
2 changes: 1 addition & 1 deletion client/components/main/header.styl
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions config/router.js
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion server/publications/boards.js
Expand Up @@ -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 } } },
Expand Down