mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
add #workspaceTemplate which works as workspace-scoped template, closes #3137
This commit is contained in:
parent
3c49ea6cb1
commit
b816773d02
@ -207,6 +207,7 @@ const ATTR_HELP = {
|
||||
"workspaceIconClass": "defines box icon CSS class which will be used in tab when hoisted to this note",
|
||||
"workspaceTabBackgroundColor": "CSS color used in the note tab when hoisted to this note",
|
||||
"workspaceCalendarRoot": "Defines per-workspace calendar root",
|
||||
"workspaceTemplate": "This note will appear in the selection of available template when creating new note, but only when hoisted into a workspace containing this template",
|
||||
"searchHome": "new search notes will be created as children of this note",
|
||||
"hoistedSearchHome": "new search notes will be created as children of this note when hoisted to some ancestor of this note",
|
||||
"inbox": "default inbox location for new notes",
|
||||
|
@ -6,6 +6,7 @@ const log = require('../../services/log');
|
||||
const scriptService = require('../../services/script');
|
||||
const searchService = require('../../services/search/services/search');
|
||||
const bulkActionService = require("../../services/bulk_actions");
|
||||
const cls = require("../../services/cls");
|
||||
const {formatAttrForSearch} = require("../../services/attribute_formatter");
|
||||
|
||||
function searchFromNoteInt(note) {
|
||||
@ -189,7 +190,9 @@ function getRelatedNotes(req) {
|
||||
}
|
||||
|
||||
function searchTemplates() {
|
||||
const query = formatAttrForSearch({type: 'label', name: "template"}, false);
|
||||
const query = cls.getHoistedNoteId() === 'root'
|
||||
? '#template'
|
||||
: '#template OR #workspaceTemplate';
|
||||
|
||||
return searchService.searchNotes(query, {
|
||||
includeArchivedNotes: true,
|
||||
|
@ -30,6 +30,7 @@ module.exports = [
|
||||
{ type: 'label', name: 'workspaceIconClass' },
|
||||
{ type: 'label', name: 'workspaceTabBackgroundColor' },
|
||||
{ type: 'label', name: 'workspaceCalendarRoot' },
|
||||
{ type: 'label', name: 'workspaceTemplate' },
|
||||
{ type: 'label', name: 'searchHome' },
|
||||
{ type: 'label', name: 'hoistedInbox' },
|
||||
{ type: 'label', name: 'hoistedSearchHome' },
|
||||
|
Loading…
x
Reference in New Issue
Block a user