From 910734b78628c6b00b75d2fc9032d0f5186a8f7e Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Thu, 24 Oct 2024 14:42:46 +0100 Subject: [PATCH] tags.html: Add ability to add a tag --- .ci/tags.html | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.ci/tags.html b/.ci/tags.html index 36b9c4706f..dd4cee7dea 100644 --- a/.ci/tags.html +++ b/.ci/tags.html @@ -21,11 +21,19 @@ +
+
+ + + +
+
+
@@ -49,6 +57,7 @@
+
@@ -56,6 +65,9 @@
+
+

No families found for this tag. Please add some

+
{{ family.Family }} @@ -84,6 +96,7 @@ ready: false, isEdited: false, commit: "refs/heads/main", + newTag: "", newFamily: '', newWeight: '', CurrentCategory: "/Expressive/Calm", @@ -116,7 +129,7 @@ }, CurrentCategory(newCategory) { this.updateURL(); - } + }, }, created() { this.loadCSV(); @@ -144,11 +157,11 @@ uniqueFamilies() { return Array.from(new Set(this.Families.map((family) => family.Family))); }, - sortedCategories() { - return Array.from(this.Categories).sort(); - } }, methods: { + sortedCategories() { + return Array.from(this.Categories).sort(); + }, updateURL() { const url = new URL(window.location); if (this.commit && this.commit !== "refs/heads/main") { @@ -230,6 +243,12 @@ familyStyle(Family) { return `font-family: "${Family.Family}", "Adobe NotDef"; font-size: 32pt;` }, + AddTag() { + this.isEdited = true; + this.Categories.add(this.newTag); + this.history.push(`+ Tag added "${this.newTag}"`); + this.CurrentCategory = this.newTag; + }, AddFamily() { this.isEdited = true; let newFamily = { Weight: this.newWeight, Family: this.newFamily, "Group/Tag": this.CurrentCategory } -- 2.47.2