Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
client: use a "Beta" badge for beta note types
Adorian Doran5e62f4999df6
diff --git a/src/public/app/widgets/note_type.js b/src/public/app/widgets/note_type.jsindex 09c73d3cf2..1db1f99e5d 100644--- a/src/public/app/widgets/note_type.js+++ b/src/public/app/widgets/note_type.js@@ -21,7 +21,7 @@ const NOTE_TYPES = [{ type: "mermaid", mime: "text/mermaid", title: t("note_types.mermaid-diagram"), selectable: true },{ type: "book", mime: "", title: t("note_types.book"), selectable: true },{ type: "webView", mime: "", title: t("note_types.web-view"), selectable: true },- { type: "geoMap", mime: "application/json", title: t("note_types.geo-map"), selectable: true },+ { type: "geoMap", mime: "application/json", title: t("note_types.geo-map"), isBeta: true, selectable: true },{ type: "code", mime: "text/plain", title: t("note_types.code"), selectable: true }];@@ -30,11 +30,18 @@ const NOT_SELECTABLE_NOTE_TYPES = NOTE_TYPES.filter((nt) => !nt.selectable).map(const TPL = `<div class="dropdown note-type-widget"><style>- .note-type-dropdown {- max-height: 500px;- overflow-y: auto;- overflow-x: hidden;- }+ .note-type-dropdown {+ max-height: 500px;+ overflow-y: auto;+ overflow-x: hidden;+ }++ .note-type-dropdown .badge {+ margin-left: 8px;+ background: var(--accented-background-color);+ font-weight: normal;+ color: var(--menu-text-color);+ }</style><button type="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="btn btn-sm dropdown-toggle select-button note-type-button"><span class="note-type-desc"></span>@@ -74,11 +81,16 @@ export default class NoteTypeWidget extends NoteContextAwareWidget {for (const noteType of NOTE_TYPES.filter((nt) => nt.selectable)) {let $typeLink;+ const $title = $("<span>").text(noteType.title);+ if (noteType.isBeta) {+ $title.append($(`<span class="badge">`).text(t("note_types.beta-feature")));+ }+if (noteType.type !== "code") {$typeLink = $('<a class="dropdown-item">').attr("data-note-type", noteType.type).append('<span class="check">✓</span> ')- .append($("<span>").text(noteType.title))+ .append($title).on("click", (e) => {const type = $typeLink.attr("data-note-type");const noteType = NOTE_TYPES.find((nt) => nt.type === type);diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.jsonindex 958df556bc..62de582019 100644--- a/src/public/translations/en/translation.json+++ b/src/public/translations/en/translation.json@@ -1414,7 +1414,8 @@"doc": "Doc","widget": "Widget","confirm-change": "It is not recommended to change note type when note content is not empty. Do you want to continue anyway?",- "geo-map": "Geo Map (beta)"+ "geo-map": "Geo Map",+ "beta-feature": "Beta"},"protect_note": {"toggle-on": "Protect the note",diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.jsonindex 280a003022..9f4c1ade98 100644--- a/src/public/translations/ro/translation.json+++ b/src/public/translations/ro/translation.json@@ -1381,7 +1381,8 @@"launcher": "Scurtătură","widget": "Widget","confirm-change": "Nu se recomandă schimbarea tipului notiței atunci când ea are un conținut. Procedați oricum?",- "geo-map": "Hartă geografică (beta)"+ "geo-map": "Hartă geografică",+ "beta-feature": "Beta"},"protect_note": {"toggle-off": "Deprotejează notița",