mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-28 09:54:51 +09:00
In inbox display, show summary when available, otherwise show highlighted JSON
This commit is contained in:
parent
f7b7a417eb
commit
d73c3928a0
2 changed files with 9 additions and 2 deletions
|
@ -236,6 +236,10 @@ getInbox here getInboxId = do
|
||||||
error $ "InboxItem #" ++ show ibid ++ " both local and remote"
|
error $ "InboxItem #" ++ show ibid ++ " both local and remote"
|
||||||
(Just act, Nothing) -> persistJSONObject act
|
(Just act, Nothing) -> persistJSONObject act
|
||||||
(Nothing, Just obj) -> persistJSONObject obj
|
(Nothing, Just obj) -> persistJSONObject obj
|
||||||
|
objectSummary o =
|
||||||
|
case M.lookup "summary" o of
|
||||||
|
Just (String t) | not (T.null t) -> Just t
|
||||||
|
_ -> Nothing
|
||||||
|
|
||||||
getSharerInboxR :: ShrIdent -> Handler TypedContent
|
getSharerInboxR :: ShrIdent -> Handler TypedContent
|
||||||
getSharerInboxR shr = getInbox here getInboxId
|
getSharerInboxR shr = getInbox here getInboxId
|
||||||
|
|
|
@ -21,7 +21,10 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
$forall obj <- items
|
$forall obj <- items
|
||||||
<div><pre>
|
$maybe summary <- objectSummary obj
|
||||||
#{TLB.toLazyText $ encodePrettyToTextBuilder obj}
|
<div>
|
||||||
|
^{preEscapedToHtml summary}
|
||||||
|
$nothing
|
||||||
|
^{renderPrettyJSONSkylighting obj}
|
||||||
|
|
||||||
^{pageNav}
|
^{pageNav}
|
||||||
|
|
Loading…
Reference in a new issue