Revert "Disabled /package/ page. See #299"

This reverts commit 6389b4468f.
This commit is contained in:
Michael Snoyman 2020-11-16 03:53:43 +02:00
parent 54e475e43e
commit b44e9222de
No known key found for this signature in database
GPG Key ID: 907EAE2F42B52046

View File

@ -1,26 +1,22 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
module Handler.PackageList where
import Import
import Text.Blaze
import Stackage.Database
-- FIXME maybe just redirect to the LTS or nightly package list
getPackageListR :: Handler Html
getPackageListR = do
sendResponseStatus status404 =<<
defaultLayout
(toWidget (preEscapedText
("Page has been disabled, see: " <>
"<a href=\"https://github.com/fpco/stackage-server/issues/299\">" <>
"github:fpco/stackage-server#299</a>")))
-- track "Handler.PackageList.getPackageListR" $
-- defaultLayout $ do
-- cacheSeconds $ 60 * 60 * 2
-- setTitle "Package list"
-- packages <- getAllPackages
-- $(widgetFile "package-list")
-- where
-- strip x = fromMaybe x (stripSuffix "." x)
-- makePackageLink snapName pli =
-- SnapshotR snapName $ StackageSdistR $ PNVNameVersion (pliName pli) (pliVersion pli)
getPackageListR =
track "Handler.PackageList.getPackageListR" $
defaultLayout $ do
cacheSeconds $ 60 * 60 * 2
setTitle "Package list"
packages <- getAllPackages
$(widgetFile "package-list")
where
strip x = fromMaybe x (stripSuffix "." x)
makePackageLink snapName pli =
SnapshotR snapName $ StackageSdistR $ PNVNameVersion (pliName pli) (pliVersion pli)