From 067bab6bc837b6929168639bd55deac4d898efe4 Mon Sep 17 00:00:00 2001 From: Marcel Lauhoff Date: Sat, 9 Mar 2024 18:34:21 +0100 Subject: [PATCH] reader: better breadcrumbs --- resources/status/llar.css | 11 +++++------ src/llar/apis/reader.clj | 31 +++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/resources/status/llar.css b/resources/status/llar.css index dee1417..a30932c 100644 --- a/resources/status/llar.css +++ b/resources/status/llar.css @@ -420,12 +420,6 @@ div.item-content-body p > code { } #navbar .path { - height: 42px; - font-weight: 300; - padding-bottom: 0.75rem; - padding-top: 0.75rem; - border-width: 0; - border-radius: 0; margin: 0; font-size: 0.8em; background-color: rgb(0 0 0 / 0%); @@ -578,6 +572,11 @@ div.item-content-body p > code { font-weight: 400; } +#navbar .path a { + color: #fff; + text-decoration: none; +} + #headlines .toolbox a { font-size: 0.8em; margin: 0; diff --git a/src/llar/apis/reader.clj b/src/llar/apis/reader.clj index e5ad3c7..efe34da 100644 --- a/src/llar/apis/reader.clj +++ b/src/llar/apis/reader.clj @@ -126,6 +126,11 @@ :recreation "fas fa-umbrella-beach" :highlight "fas fa-sun"}) +(def +group-icons+ + {:item-tags "fas fa-tag" + :source-tag "fas fa-hashtag" + :type "fas fa-shapes"}) + (def +tags-skip-group-list+ "Do not display in group list on the left side" #{"unread"}) @@ -324,13 +329,23 @@ ;; previous: ;; "(╯°□°)╯︵ ┻━┻" - [:ol {:class "col-xs-12 form-control-dark breadcrumb w-100 path flex-nowrap"} - (for [item [group-item]] - [:li {:class "breadcrumb-item"} (name item)]) + [:ol {:class "col-xs-12 form-control-dark breadcrumb w-100 path flex-nowrap" + :style "--bs-breadcrumb-divider-color: #fff;"} + (when-let [item group-item] + [:li {:class "breadcrumb-item"} + (when-let [ico (get +group-icons+ active-group)] + (icon ico)) + [:a {:href (make-site-href ["/reader/group" (name active-group) (name item) "source/all/items"] x)} + (name item)]]) (when-not (= source-key :all) - [:li {:class "breadcrumb-item"} (:title (first selected-sources))]) + [:li {:class "breadcrumb-item"} + [:a {:href (make-site-href ["/reader/group" (name active-group) (name group-item) "source" (name source-key) "items"] x)} + (:title (first selected-sources))]]) (when (= mode :show-item) - [:li {:class "breadcrumb-item"} (-> items first :source-key)]) + (let [source-key (-> items first :source-key)] + [:li {:class "breadcrumb-item"} + [:a {:href (make-site-href ["/reader/group" (name active-group) (name group-item) "source" (name source-key) "items"] x)} + source-key]])) (when (= mode :show-item) [:li {:class "breadcrumb-item"} (-> items first :title)])] @@ -478,7 +493,7 @@ ;; item tags [:h6 {:class "sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted"} - [:span "item tags"]] + [:span (icon (:item-tags +group-icons+)) " Item Tags"]] [:ul {:class "nav flex-column"} (group-list x "/reader/group/item-tags" (->> x :item-tags (remove +tags-skip-group-list+) sort) @@ -487,7 +502,7 @@ ;; source tags [:h6 {:class "sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted"} - [:span "source tags"]] + [:span (icon (:source-tag +group-icons+)) " Source Tags"]] [:ul {:class "nav flex-column"} (group-list x "/reader/group/source-tag" (->> (:sources x) vals (map :tags) (apply set/union) sort) @@ -496,7 +511,7 @@ ;; source types [:h6 {:class "sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted"} - [:span "type"]] + [:span (icon (:type +group-icons+)) " Type"]] [:ul {:class "nav flex-column"} (group-list x "/reader/group/type" (->> x :sources vals (map :type) (into (sorted-set)))