1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 16:14:51 +09:00

UI: Actor outbox view: Render URI from route instead of parsing JSON for @id

This commit is contained in:
fr33domlover 2022-09-26 14:20:21 +00:00
parent 89dc9b5c9d
commit ee26ef7b82
7 changed files with 10 additions and 9 deletions

View file

@ -206,7 +206,7 @@ postDeckInboxR recipDeckHash =
_ -> return ("Unsupported activity type for decks", Nothing) _ -> return ("Unsupported activity type for decks", Nothing)
getDeckOutboxR :: KeyHashid Deck -> Handler TypedContent getDeckOutboxR :: KeyHashid Deck -> Handler TypedContent
getDeckOutboxR = getOutbox DeckOutboxR deckActor getDeckOutboxR = getOutbox DeckOutboxR DeckOutboxItemR deckActor
getDeckOutboxItemR getDeckOutboxItemR
:: KeyHashid Deck -> KeyHashid OutboxItem -> Handler TypedContent :: KeyHashid Deck -> KeyHashid OutboxItem -> Handler TypedContent

View file

@ -120,7 +120,7 @@ postGroupInboxR recipGroupHash =
_ -> return ("Unsupported activity type for groups", Nothing) _ -> return ("Unsupported activity type for groups", Nothing)
getGroupOutboxR :: KeyHashid Group -> Handler TypedContent getGroupOutboxR :: KeyHashid Group -> Handler TypedContent
getGroupOutboxR = getOutbox GroupOutboxR groupActor getGroupOutboxR = getOutbox GroupOutboxR GroupOutboxItemR groupActor
getGroupOutboxItemR getGroupOutboxItemR
:: KeyHashid Group -> KeyHashid OutboxItem -> Handler TypedContent :: KeyHashid Group -> KeyHashid OutboxItem -> Handler TypedContent

View file

@ -154,7 +154,7 @@ postLoomInboxR recipLoomHash =
_ -> return ("Unsupported activity type for looms", Nothing) _ -> return ("Unsupported activity type for looms", Nothing)
getLoomOutboxR :: KeyHashid Loom -> Handler TypedContent getLoomOutboxR :: KeyHashid Loom -> Handler TypedContent
getLoomOutboxR = getOutbox LoomOutboxR loomActor getLoomOutboxR = getOutbox LoomOutboxR LoomOutboxItemR loomActor
getLoomOutboxItemR getLoomOutboxItemR
:: KeyHashid Loom -> KeyHashid OutboxItem -> Handler TypedContent :: KeyHashid Loom -> KeyHashid OutboxItem -> Handler TypedContent

View file

@ -230,7 +230,7 @@ postPersonInboxR recipPersonHash = postInbox handle
_ -> return ("Unsupported activity type for Person", Nothing) _ -> return ("Unsupported activity type for Person", Nothing)
getPersonOutboxR :: KeyHashid Person -> Handler TypedContent getPersonOutboxR :: KeyHashid Person -> Handler TypedContent
getPersonOutboxR = getOutbox PersonOutboxR personActor getPersonOutboxR = getOutbox PersonOutboxR PersonOutboxItemR personActor
postPersonOutboxR :: KeyHashid Person -> Handler TypedContent postPersonOutboxR :: KeyHashid Person -> Handler TypedContent
postPersonOutboxR personHash = do postPersonOutboxR personHash = do

View file

@ -277,7 +277,7 @@ postRepoInboxR recipRepoHash =
_ -> return ("Unsupported activity type for repos", Nothing) _ -> return ("Unsupported activity type for repos", Nothing)
getRepoOutboxR :: KeyHashid Repo -> Handler TypedContent getRepoOutboxR :: KeyHashid Repo -> Handler TypedContent
getRepoOutboxR = getOutbox RepoOutboxR repoActor getRepoOutboxR = getOutbox RepoOutboxR RepoOutboxItemR repoActor
getRepoOutboxItemR getRepoOutboxItemR
:: KeyHashid Repo -> KeyHashid OutboxItem -> Handler TypedContent :: KeyHashid Repo -> KeyHashid OutboxItem -> Handler TypedContent

View file

@ -276,11 +276,11 @@ postInbox handler = do
then V.init vec' then V.init vec'
else vec' else vec'
getOutbox here actor hash = do getOutbox here itemRoute grabActorID hash = do
key <- decodeKeyHashid404 hash key <- decodeKeyHashid404 hash
(total, pages, mpage) <- runDB $ do (total, pages, mpage) <- runDB $ do
outboxID <- do outboxID <- do
actorID <- actor <$> get404 key actorID <- grabActorID <$> get404 key
actorOutbox <$> getJust actorID actorOutbox <$> getJust actorID
let countAllItems = count [OutboxItemOutbox ==. outboxID] let countAllItems = count [OutboxItemOutbox ==. outboxID]
selectItems off lim = selectList [OutboxItemOutbox ==. outboxID] [Desc OutboxItemId, OffsetBy off, LimitTo lim] selectItems off lim = selectList [OutboxItemOutbox ==. outboxID] [Desc OutboxItemId, OffsetBy off, LimitTo lim]
@ -328,6 +328,7 @@ getOutbox here actor hash = do
provideRep $ do provideRep $ do
let pageNav = navWidget navModel let pageNav = navWidget navModel
showTime <- getShowTime showTime <- getShowTime
hashItem <- getEncodeKeyHashid
defaultLayout $(widgetFile "person/outbox") defaultLayout $(widgetFile "person/outbox")
getOutboxItem here actor topicHash itemHash = do getOutboxItem here actor topicHash itemHash = do

View file

@ -20,11 +20,11 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
^{pageNav} ^{pageNav}
<div> <div>
$forall Entity _ (OutboxItem _ doc published) <- items $forall Entity itemID (OutboxItem _ doc published) <- items
$with obj <- persistJSONObject doc $with obj <- persistJSONObject doc
<div> <div>
Published Published
<a href="#{objectId obj}"> <a href="@{itemRoute hash $ hashItem itemID}">
#{showTime published} #{showTime published}
$maybe summary <- objectSummary obj $maybe summary <- objectSummary obj