added userfeed
This commit is contained in:
parent
8346c1d32f
commit
038e4a3399
3 changed files with 23 additions and 1 deletions
|
@ -185,9 +185,25 @@ getCommentFeedR :: RepFeed a => MediumId -> Handler a
|
|||
getCommentFeedR mediumId = do
|
||||
medium <- runDB $ get404 mediumId
|
||||
url <- getUrlRender
|
||||
recentComments <- runDB $ selectList [CommentOrigin ==. mediumId] [Desc CommentTime, LimitTo 10]
|
||||
recentComments <- runDB $ selectList [CommentOrigin ==. mediumId] [Desc CommentTime, LimitTo 100]
|
||||
renderFeed Parameters
|
||||
{ pTitle = "Eidolon :: Newest comments on " `T.append` (mediumTitle medium)
|
||||
, pLink = MediumR mediumId
|
||||
, pImage = url $ StaticR $ mediumStaticThumbRoute medium
|
||||
} (Left recentComments)
|
||||
|
||||
getUserFeedAtomR :: UserId -> Handler RepAtom
|
||||
getUserFeedAtomR = getUserFeedR
|
||||
|
||||
getUserFeedRssR :: UserId -> Handler RepRss
|
||||
getUserFeedRssR = getUserFeedR
|
||||
|
||||
getUserFeedR :: RepFeed a => UserId -> Handler a
|
||||
getUserFeedR userId = do
|
||||
user <- runDB $ get404 userId
|
||||
recentMedia <- runDB $ selectList [MediumOwner ==. userId] [Desc MediumTime, LimitTo 100]
|
||||
renderFeed Parameters
|
||||
{ pTitle = "Eidolon :: Newest media of " `T.append` (userSlug user)
|
||||
, pLink = ProfileR userId
|
||||
, pImage = ""
|
||||
} (Right recentMedia)
|
||||
|
|
|
@ -46,3 +46,5 @@
|
|||
/feed/album/#AlbumId/rss.xml AlbumFeedRssR GET
|
||||
/feed/medium/#MediumId/atom.xml CommentFeedAtomR GET
|
||||
/feed/medium/#MediumId/rss.xml CommentFeedRssR GET
|
||||
/feed/user/#UserId/atom.xml UserFeedAtomR GET
|
||||
/feed/user/#UserId/rss.xml UserFeedRssR GET
|
||||
|
|
|
@ -43,3 +43,7 @@ $else
|
|||
<figure class="thumbnail">
|
||||
<img src=#{mediumThumb medium}>
|
||||
<figcaption>#{mediumTitle medium}
|
||||
|
||||
get a feed from this:
|
||||
<a href=@{UserFeedAtomR ownerId}>Atom
|
||||
<a href=@{UserFeedRssR ownerId}>RSS
|
||||
|
|
Loading…
Reference in a new issue