From 05399b3916df7311d07e7c375f90261e9c8ead80 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Tue, 25 Feb 2020 00:57:37 -0500 Subject: added optional display templates for metadata field values --- src/server/authentication/models/current_user_utils.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/server/authentication/models/current_user_utils.ts') diff --git a/src/server/authentication/models/current_user_utils.ts b/src/server/authentication/models/current_user_utils.ts index 8fe2257fc..aaf3a3eb6 100644 --- a/src/server/authentication/models/current_user_utils.ts +++ b/src/server/authentication/models/current_user_utils.ts @@ -37,13 +37,19 @@ export class CurrentUserUtils { static setupDefaultDocTemplates(doc: Doc, buttons?: string[]) { const noteTemplates = [ - Docs.Create.TextDocument("", { title: "Note", backgroundColor: "yellow", isTemplateDoc: true }), - Docs.Create.TextDocument("", { title: "Idea", backgroundColor: "pink", isTemplateDoc: true }), - Docs.Create.TextDocument("", { title: "Topic", backgroundColor: "lightBlue", isTemplateDoc: true }), - Docs.Create.TextDocument("", { title: "Person", backgroundColor: "lightGreen", isTemplateDoc: true }), - Docs.Create.TextDocument("", { title: "Todo", backgroundColor: "orange", isTemplateDoc: true }) + Docs.Create.TextDocument("", { title: "Note", backgroundColor: "yellow" }), + Docs.Create.TextDocument("", { title: "Idea", backgroundColor: "pink" }), + Docs.Create.TextDocument("", { title: "Topic", backgroundColor: "lightBlue" }), + Docs.Create.TextDocument("", { title: "Person", backgroundColor: "lightGreen" }), + Docs.Create.TextDocument("", { title: "Todo", backgroundColor: "orange" }) ]; - doc.noteTypes = new PrefetchProxy(Docs.Create.TreeDocument(noteTemplates, { title: "Note Types", _height: 75 })); + const modes = [ + Docs.Create.TextDocument("", { title: "todo", _backgroundColor: "blue", color: "white" }), + Docs.Create.TextDocument("", { title: "in progress", _backgroundColor: "yellow", color: "black" }), + Docs.Create.TextDocument("", { title: "completed", _backgroundColor: "green", color: "white" }) + ] + Doc.enumeratedTextTemplate(Doc.GetProto(noteTemplates[4]), FormattedTextBox.LayoutString("Todo"), "Todo", "taskStatus", modes); + doc.noteTypes = new PrefetchProxy(Docs.Create.TreeDocument(noteTemplates.map(nt => makeTemplate(nt) ? nt : nt), { title: "Note Types", _height: 75 })); } // setup the "creator" buttons for the sidebar-- eg. the default set of draggable document creation tools -- cgit v1.2.3-70-g09d2