From 518041cf5dbfbd423c766079c515210e2005480b Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Thu, 5 Sep 2024 11:03:03 +0100 Subject: [PATCH] tags.html: Add history panel --- .ci/tags.html | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.ci/tags.html b/.ci/tags.html index 20965b6d69..feae5bab9e 100644 --- a/.ci/tags.html +++ b/.ci/tags.html @@ -31,14 +31,22 @@ -
- +
+
+ +
+

{{ item }}

+
+
+

No changes

+
+
-
Edited
+
@@ -46,7 +54,7 @@ {{ family.Family }}
- +
@@ -91,6 +99,7 @@ ["Tamil", "மனிதக் குடும்பத்தினைச் சேர்ந்த யாவரதும் உள்ளார்ந்த"], ]), FamilyScripts: new Map(), + history: [], }; }, created() { @@ -115,8 +124,9 @@ familyPangram(family) { return this.Pangrams.get(this.FamilyScripts.get(family.Family)); }, - edited() { + edited(family) { this.isEdited = true; + this.history.push(`* ${family.Family},${family["Group/Tag"]},${family.Weight}`); }, parseUnicode(str) { let ranges = str.split(","); @@ -180,11 +190,15 @@ }, AddFamily() { this.isEdited = true; - this.Families.push({ Weight: this.newWeight, Family: this.newFamily, "Group/Tag": this.CurrentCategory }); + let newFamily = { Weight: this.newWeight, Family: this.newFamily, "Group/Tag": this.CurrentCategory } + this.Families.push(newFamily); + + this.history.push(`+ ${newFamily.Family},${newFamily["Group/Tag"]},${newFamily.Weight}`); }, removeFamily(Family) { this.isEdited = true; - this.Families = this.Families.filter((t) => t !== Family) + this.Families = this.Families.filter((t) => t !== Family); + this.history.push(`- ${Family.Family},${Family["Group/Tag"]},${Family.Weight}`); }, saveCSV() { this.Families = this.Families.filter((t) => t.Family !== ""); -- 2.47.2