Fixed Templates are Missing, Error: Site not Found "/templates" is missing in the URL.

Shared Templates part 5: Make visible Create template board checkbox and templates at All Boards page, In Progress.

Thanks to xet7 !

Fixes #4253,
related #3313
This commit is contained in:
Lauri Ojansivu 2021-12-25 21:59:43 +02:00
parent c46ec4a155
commit 7f32de3bec
5 changed files with 58 additions and 14 deletions

View file

@ -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:[] }
]
};