mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-11 19:58:28 +01:00
Package list
This commit is contained in:
parent
fc49565dd8
commit
a1ed3d00ef
@ -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
13
Handler/PackageList.hs
Normal 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")
|
||||
@ -25,3 +25,4 @@
|
||||
/system SystemR GET
|
||||
/haddock/#PackageSetIdent/*Texts HaddockR GET
|
||||
/package/#PackageName PackageR GET
|
||||
/package PackageListR GET
|
||||
|
||||
@ -43,6 +43,7 @@ library
|
||||
Handler.System
|
||||
Handler.Haddock
|
||||
Handler.Package
|
||||
Handler.PackageList
|
||||
|
||||
if flag(dev) || flag(library-only)
|
||||
cpp-options: -DDEVELOPMENT
|
||||
|
||||
5
templates/package-list.hamlet
Normal file
5
templates/package-list.hamlet
Normal file
@ -0,0 +1,5 @@
|
||||
<div .container>
|
||||
<ul>
|
||||
$forall name <- names
|
||||
<li>
|
||||
<a href=@{PackageR name}>#{name}
|
||||
Loading…
Reference in New Issue
Block a user