1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 16:54:53 +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)
getDeckOutboxR :: KeyHashid Deck -> Handler TypedContent
getDeckOutboxR = getOutbox DeckOutboxR deckActor
getDeckOutboxR = getOutbox DeckOutboxR DeckOutboxItemR deckActor
getDeckOutboxItemR
:: KeyHashid Deck -> KeyHashid OutboxItem -> Handler TypedContent

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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