Package list

This commit is contained in:
Michael Snoyman 2014-10-23 02:45:32 +03:00
parent fc49565dd8
commit a1ed3d00ef
5 changed files with 21 additions and 0 deletions

View File

@ -54,6 +54,7 @@ import Handler.Progress
import Handler.System
import Handler.Haddock
import Handler.Package
import Handler.PackageList
-- This line actually creates our YesodDispatch instance. It is the second half
-- of the call to mkYesodData which occurs in Foundation.hs. Please see the

13
Handler/PackageList.hs Normal file
View File

@ -0,0 +1,13 @@
module Handler.PackageList where
import Import
import qualified Database.Esqueleto as E
getPackageListR :: Handler Html
getPackageListR = do
names <- fmap (map E.unValue) $ runDB $ E.selectDistinct $ E.from $ \u -> do
E.orderBy [E.asc $ u E.^. UploadedName]
return $ u E.^. UploadedName
defaultLayout $ do
setTitle "Package list"
$(widgetFile "package-list")

View File

@ -25,3 +25,4 @@
/system SystemR GET
/haddock/#PackageSetIdent/*Texts HaddockR GET
/package/#PackageName PackageR GET
/package PackageListR GET

View File

@ -43,6 +43,7 @@ library
Handler.System
Handler.Haddock
Handler.Package
Handler.PackageList
if flag(dev) || flag(library-only)
cpp-options: -DDEVELOPMENT

View File

@ -0,0 +1,5 @@
<div .container>
<ul>
$forall name <- names
<li>
<a href=@{PackageR name}>#{name}