From fa72d6a59dbc7d77ea5d1d27484b1b3db79a1200 Mon Sep 17 00:00:00 2001
From: trisua <me@trisua.com>
Date: Thu, 19 Jun 2025 19:27:42 -0400
Subject: [PATCH] fix: journals ui panic

---
 crates/app/src/public/html/components.lisp   | 4 ++--
 crates/app/src/public/html/journals/app.lisp | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/crates/app/src/public/html/components.lisp b/crates/app/src/public/html/components.lisp
index 75a24ef..2726b26 100644
--- a/crates/app/src/public/html/components.lisp
+++ b/crates/app/src/public/html/components.lisp
@@ -1928,7 +1928,7 @@
     (text "{%- endif %}")
 
     ; note listings
-    (text "{% for note in notes %}")
+    (text "{% for note in notes %} {% if not view_mode or note.title != \"journal.css\" -%}")
     (div
         ("class" "flex flex-row gap-1")
         (a
@@ -1958,6 +1958,6 @@
                     (icon (text "trash"))
                     (str (text "general:action.delete")))))
         (text "{%- endif %}"))
-    (text "{% endfor %}"))
+    (text "{%- endif %} {% endfor %}"))
 (text "{%- endif %}")
 (text "{%- endmacro %}")
diff --git a/crates/app/src/public/html/journals/app.lisp b/crates/app/src/public/html/journals/app.lisp
index d65163d..a5136ff 100644
--- a/crates/app/src/public/html/journals/app.lisp
+++ b/crates/app/src/public/html/journals/app.lisp
@@ -68,10 +68,12 @@
                         ("href" "/api/v1/auth/user/find/{{ journal.owner }}")
                         (text "{{ components::avatar(username=journal.owner, selector_type=\"id\", size=\"18px\") }}"))
 
+                    (text "{% if (view_mode and owner) or not view_mode -%}")
                     (a
                         ("class" "flush")
                         ("href" "{% if view_mode -%} /@{{ owner.username }}/{{ journal.title }} {%- else -%} /journals/{{ journal.id }}/0 {%- endif %}")
                         (b (text "{{ journal.title }}")))
+                    (text "{%- endif %}")
 
                     (text "{% if note -%}")
                     (span (text "/"))