mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
73d0f99371
commit
4249f98444
|
@ -84,6 +84,9 @@ article {
|
||||||
color: var(--pico-secondary-hover);
|
color: var(--pico-secondary-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.copyable-text {
|
||||||
|
}
|
||||||
|
|
||||||
.copy-button .icon {
|
.copy-button .icon {
|
||||||
width: 1.125rem;
|
width: 1.125rem;
|
||||||
height: 1.125rem;
|
height: 1.125rem;
|
||||||
|
|
|
@ -20,7 +20,6 @@ import Lucid.Base
|
||||||
import Lucid.Html5 hiding (for_)
|
import Lucid.Html5 hiding (for_)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
data IssueOptionalArg w t = IssueOptionalArg w t
|
data IssueOptionalArg w t = IssueOptionalArg w t
|
||||||
|
|
||||||
issueOptionalArg :: Fixme -> FixmeAttrName -> IssueOptionalArg Fixme FixmeAttrName
|
issueOptionalArg :: Fixme -> FixmeAttrName -> IssueOptionalArg Fixme FixmeAttrName
|
||||||
|
@ -49,6 +48,21 @@ issuePage repo@(RepoLww lww) f = rootPage do
|
||||||
|
|
||||||
let txt = fixmePlain fxm & fmap coerce & Text.intercalate "\n"
|
let txt = fixmePlain fxm & fmap coerce & Text.intercalate "\n"
|
||||||
|
|
||||||
|
let mbFile = fixmeGet "file" fxm
|
||||||
|
|
||||||
|
mbBlob <- runMaybeT do
|
||||||
|
blobHashText <- fixmeGet "blob" fxm & toMPlus
|
||||||
|
debug $ red "BLOB HASH TEXT" <+> pretty blobHashText
|
||||||
|
hash <- coerce blobHashText
|
||||||
|
& Text.unpack
|
||||||
|
& fromStringMay @GitHash
|
||||||
|
& toMPlus
|
||||||
|
debug $ red "BLOB" <+> pretty hash
|
||||||
|
lift (lift $ selectBlobInfo (BlobHash hash))
|
||||||
|
>>= toMPlus
|
||||||
|
|
||||||
|
debug $ "BLOB INFO" <> line <> pretty (fmap blobHash mbBlob)
|
||||||
|
|
||||||
main_ [class_ "container-fluid"] do
|
main_ [class_ "container-fluid"] do
|
||||||
div_ [class_ "wrapper"] do
|
div_ [class_ "wrapper"] do
|
||||||
aside_ [class_ "sidebar"] do
|
aside_ [class_ "sidebar"] do
|
||||||
|
@ -71,16 +85,40 @@ issuePage repo@(RepoLww lww) f = rootPage do
|
||||||
table_ do
|
table_ do
|
||||||
tr_ do
|
tr_ do
|
||||||
td_ [colspan_ "2"] do
|
td_ [colspan_ "2"] do
|
||||||
|
let fkKey = coerce @_ @Text $ fixmeKey fxm
|
||||||
strong_ [style_ "margin-right: 1ch;"] $ toHtml (coerce @_ @Text $ fixmeTag fxm)
|
strong_ [style_ "margin-right: 1ch;"] $ toHtml (coerce @_ @Text $ fixmeTag fxm)
|
||||||
span_ [style_ "margin-right: 1ch;"] $ toHtml (H $ fixmeKey fxm)
|
span_ [ style_ "margin-right: 1ch;"
|
||||||
|
-- FIXME: make-underlined-on-hover
|
||||||
|
-- $assigned fastpok
|
||||||
|
, class_ "copyable-text"
|
||||||
|
, onClickCopyText $ Text.take 10 fkKey
|
||||||
|
] $ toHtml (H $ fixmeKey fxm)
|
||||||
|
" "
|
||||||
span_ [] $ toHtml (coerce @_ @Text $ fixmeTitle fxm)
|
span_ [] $ toHtml (coerce @_ @Text $ fixmeTitle fxm)
|
||||||
|
|
||||||
toHtml (issueOptionalArg fxm "workflow")
|
toHtml (issueOptionalArg fxm "workflow")
|
||||||
toHtml (issueOptionalArg fxm "file")
|
|
||||||
toHtml (issueOptionalArg fxm "commit")
|
|
||||||
toHtml (issueOptionalArg fxm "committer-name")
|
toHtml (issueOptionalArg fxm "committer-name")
|
||||||
|
toHtml (issueOptionalArg fxm "commit")
|
||||||
|
|
||||||
|
|
||||||
|
maybe1 mbFile none $ \file -> do
|
||||||
|
tr_ do
|
||||||
|
th_ $ strong_ [] $ "file"
|
||||||
|
|
||||||
|
case mbBlob of
|
||||||
|
Nothing -> do
|
||||||
|
td_ do
|
||||||
|
toHtml $ show $ pretty file
|
||||||
|
Just (BlobInfo{}) -> do
|
||||||
|
td_ do
|
||||||
|
a_ [ href_ "#" ] do
|
||||||
|
toHtml $ show $ pretty file
|
||||||
|
|
||||||
|
-- toHtml (issueOptionalArg fxm "file")
|
||||||
|
|
||||||
section_ [class_ "lim-text"] do
|
section_ [class_ "lim-text"] do
|
||||||
toHtmlRaw $ renderMarkdown txt
|
toHtmlRaw $ renderMarkdown txt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,13 @@ set @data-tooltip to 'Copy'
|
||||||
|]
|
|]
|
||||||
|
|
||||||
|
|
||||||
|
onClickCopyText :: Text -> Attribute
|
||||||
|
onClickCopyText s =
|
||||||
|
hyper_ [qc|on click writeText('{s}') into the navigator's clipboard
|
||||||
|
set @data-tooltip to 'Copied!'
|
||||||
|
|]
|
||||||
|
|
||||||
|
|
||||||
instance ToHtml RepoBrief where
|
instance ToHtml RepoBrief where
|
||||||
toHtml (RepoBrief txt) = toHtmlRaw (renderMarkdown' txt)
|
toHtml (RepoBrief txt) = toHtmlRaw (renderMarkdown' txt)
|
||||||
toHtmlRaw (RepoBrief txt) = toHtmlRaw (renderMarkdown' txt)
|
toHtmlRaw (RepoBrief txt) = toHtmlRaw (renderMarkdown' txt)
|
||||||
|
|
Loading…
Reference in New Issue