From d31c913028eacb894bbce1c6f717439a5e9b058c Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Sun, 21 Apr 2024 09:00:32 +0300 Subject: [PATCH] wip --- .../src/HBS2/Git/Web/Html/Root.hs | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/hbs2-git/hbs2-git-dashboard/src/HBS2/Git/Web/Html/Root.hs b/hbs2-git/hbs2-git-dashboard/src/HBS2/Git/Web/Html/Root.hs index 536db30a..59d37746 100644 --- a/hbs2-git/hbs2-git-dashboard/src/HBS2/Git/Web/Html/Root.hs +++ b/hbs2-git/hbs2-git-dashboard/src/HBS2/Git/Web/Html/Root.hs @@ -205,20 +205,25 @@ repoRefs lww refs = do let r_ = Text.pack $ show $ pretty r let co = show $ pretty h let uri = path [ "repo", show $ pretty lww, "tree", co, co ] - tr_ do - td_ do - if | Text.isPrefixOf "refs/heads" r_ -> do - img_ [src_ "/icon/git-branch.svg"] - | Text.isPrefixOf "refs/tags" r_ -> do - img_ [src_ "/icon/git-tag.svg"] - | otherwise -> mempty + let showRef = Text.isPrefixOf "refs" r_ - td_ (toHtml r_) - td_ [class_ "mono"] $ a_ [ href_ "#" - , hxGet_ uri - , hxTarget_ "#repo-tab-data" - ] (toHtml $ show $ pretty h) + when showRef do + tr_ do + td_ do + + if | Text.isPrefixOf "refs/heads" r_ -> do + img_ [src_ "/icon/git-branch.svg"] + | Text.isPrefixOf "refs/tags" r_ -> do + img_ [src_ "/icon/git-tag.svg"] + | otherwise -> mempty + + td_ (toHtml r_) + td_ [class_ "mono"] $ do + a_ [ href_ "#" + , hxGet_ uri + , hxTarget_ "#repo-tab-data" + ] (toHtml $ show $ pretty h) showRefsHtmxAttribs :: String -> [Attribute]