X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Rakka.git;a=blobdiff_plain;f=Rakka%2FWiki%2FInterpreter%2FPageList.hs;h=6afae0fd8750ec9f989a4a0e29a1a7db5871562e;hp=1ad6728c3ba370649cb961b8deeb8e452727ab2a;hb=e751af5e3d23d7757f363bf4e86f9d732d90be7f;hpb=f7ff1639d50b827a8ce1e4dd3631ce300ecb3d19 diff --git a/Rakka/Wiki/Interpreter/PageList.hs b/Rakka/Wiki/Interpreter/PageList.hs index 1ad6728..6afae0f 100644 --- a/Rakka/Wiki/Interpreter/PageList.hs +++ b/Rakka/Wiki/Interpreter/PageList.hs @@ -44,22 +44,24 @@ recentUpdatesInterp sto = ctxStorage ctx cond <- newCondition - setPhrase cond "[UVSET]" when onlyEntity $ addAttrCond cond "@type STRNE application/x-rakka-redirection" when onlySummarized $ addAttrCond cond "rakka:summary STRNE" -- summary が空でない - setOrder cond "@mdate NUMD" - setMax cond items + setPhrase cond "[UVSET]" + setOrder cond "@mdate NUMD" + setMax cond items result <- searchPages sto cond - pages <- mapM ( \ (name, rev) - -> getPage sto name (Just rev) >>= return . fromJust - ) result + pages <- mapM (getPageBySR sto) result mkPageList showSummary pages } where + getPageBySR :: Storage -> SearchResult -> IO Page + getPageBySR sto sr + = getPage sto (srPageName sr) (Just (srPageRev sr)) >>= return . fromJust + mkPageList :: Bool -> [Page] -> IO BlockElement mkPageList showSummary pages = do items <- mapM (mkListItem showSummary) pages