X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FWiki%2FInterpreter%2FPageList.hs;h=8631c8b4bae98d3929b98bbe369ce69925ed429a;hb=4abf7df08bf0a614ea8179e8d1d69a17aac4f197;hp=6afae0fd8750ec9f989a4a0e29a1a7db5871562e;hpb=e751af5e3d23d7757f363bf4e86f9d732d90be7f;p=Rakka.git diff --git a/Rakka/Wiki/Interpreter/PageList.hs b/Rakka/Wiki/Interpreter/PageList.hs index 6afae0f..8631c8b 100644 --- a/Rakka/Wiki/Interpreter/PageList.hs +++ b/Rakka/Wiki/Interpreter/PageList.hs @@ -7,7 +7,6 @@ import Control.Monad import Data.Maybe import Data.Time import Network.HTTP.Lucu.RFC1123DateTime -import Rakka.Page import Rakka.Storage import Rakka.Utils import Rakka.Wiki @@ -53,26 +52,20 @@ recentUpdatesInterp setMax cond items result <- searchPages sto cond - pages <- mapM (getPageBySR sto) result - - mkPageList showSummary pages + mkPageList showSummary (srPages result) } where - getPageBySR :: Storage -> SearchResult -> IO Page - getPageBySR sto sr - = getPage sto (srPageName sr) (Just (srPageRev sr)) >>= return . fromJust - - mkPageList :: Bool -> [Page] -> IO BlockElement + mkPageList :: Bool -> [HitPage] -> IO BlockElement mkPageList showSummary pages = do items <- mapM (mkListItem showSummary) pages return (Div [("class", "recentUpdates")] [ Block (List Bullet items) ]) - mkListItem :: Bool -> Page -> IO ListItem + mkListItem :: Bool -> HitPage -> IO ListItem mkListItem showSummary page - = do lastMod <- utcToLocalZonedTime (entityLastMod page) + = do lastMod <- utcToLocalZonedTime (hpLastMod page) return ( [ Inline ( PageLink { - linkPage = Just (pageName page) + linkPage = Just (hpPageName page) , linkFragment = Nothing , linkText = Nothing } @@ -82,7 +75,7 @@ recentUpdatesInterp ) ] ++ - case (showSummary, entitySummary page) of + case (showSummary, hpSummary page) of (True, Just s) -> [ Block (Paragraph [Text s]) ] _ -> []