repo-tree-navigation

This commit is contained in:
Dmitry Zuikov 2024-04-21 07:47:14 +03:00
parent f2e6602f51
commit 433ef745de
3 changed files with 26 additions and 3 deletions

View File

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-git-branch" width="20" height="20" viewBox="0 0 24 24" stroke-width="1.5" stroke="#000000" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M7 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
<path d="M7 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
<path d="M17 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
<path d="M7 8l0 8" />
<path d="M9 18h6a2 2 0 0 0 2 -2v-5" />
<path d="M14 14l3 -3l3 3" />
</svg>

After

Width:  |  Height:  |  Size: 548 B

View File

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-tag" width="20" height="20" viewBox="0 0 24 24" stroke-width="1.5" stroke="#000000" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M7.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
<path d="M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3z" />
</svg>

After

Width:  |  Height:  |  Size: 516 B

View File

@ -1,5 +1,5 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# Language OverloadedStrings #-}
{-# Language MultiWayIf #-}
module HBS2.Git.Web.Html.Root where
import HBS2.Git.DashBoard.Prelude
@ -207,10 +207,19 @@ repoRefs :: (DashBoardPerks m, MonadReader DashBoardEnv m)
repoRefs lww refs = do
table_ [] do
for_ refs $ \(r,h) -> do
let r_ = Text.pack $ show $ pretty r
let co = show $ pretty h
let uri = path [ "repo", show $ pretty lww, "tree", co, co ]
tr_ mempty do
td_ mempty (toHtml $ show $ pretty r)
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"] $ a_ [ href_ "#"
, hxGet_ uri
, hxTarget_ "#repo-tab-data"