From 7aee3e447cf614bcb4da805eafde0c7b94f13540 Mon Sep 17 00:00:00 2001
From: David Beniamine <david.beniamine@tetras-libre.fr>
Date: Mon, 21 Feb 2022 13:05:02 +0100
Subject: [PATCH] More robust category name and capitalization in CSS

---
 capsule-prototype/css/online-theme.css | 3 +++
 capsule-prototype/js/rekall/Sorting.js | 7 ++-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/capsule-prototype/css/online-theme.css b/capsule-prototype/css/online-theme.css
index a35e65b..a1eeef5 100644
--- a/capsule-prototype/css/online-theme.css
+++ b/capsule-prototype/css/online-theme.css
@@ -352,6 +352,9 @@ html, body {
 .mosaic_filter_disabled>h2:after {
     background-image: url('images/icn-menu-filter.png');
 }
+.mosaic_filter_item>h2, .mosaic_category h2 {
+    text-transform: capitalize;
+}
 
 .mosaic_filter_item:not(.mosaic_filter_disabled)>h2:after{
     background-image: url('images/icn-menu-preview.png');
diff --git a/capsule-prototype/js/rekall/Sorting.js b/capsule-prototype/js/rekall/Sorting.js
index 6255067..2e527cb 100644
--- a/capsule-prototype/js/rekall/Sorting.js
+++ b/capsule-prototype/js/rekall/Sorting.js
@@ -338,11 +338,8 @@ Sorting.prototype.getCategory = function(tag) {
 }
 
 Sorting.prototype.getCategoryName = function(metadata) {
-    if ('_rekall/link' === metadata) {
-        return 'Link';
-    }
     if ('_rekall/marker' === metadata) {
-        return 'Note';
+        return 'note';
     }
-    return metadata.substr(7).toUpperCase();
+    return metadata.split("/").pop().split('.').pop();
 }
-- 
GitLab