mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-11 19:58:28 +01:00
Link to the snapshot listing
This commit is contained in:
parent
f9632d734c
commit
354374b0db
@ -741,13 +741,13 @@ getSnapshotsForPackage
|
||||
-> m [(Snapshot, Text)] -- version
|
||||
getSnapshotsForPackage pname = run $ do
|
||||
pid <- getPackageId pname
|
||||
sps <- selectList [SnapshotPackagePackage ==. pid] []
|
||||
fmap catMaybes $ forM sps $ \(Entity _ sp) -> do
|
||||
let sid = snapshotPackageSnapshot sp
|
||||
ms <- get sid
|
||||
return $ case ms of
|
||||
Nothing -> Nothing
|
||||
Just s -> Just (s, snapshotPackageVersion sp)
|
||||
fmap (map go) $ E.select $ E.from $ \(s, sp) -> do
|
||||
E.where_ $ s E.^. SnapshotId E.==. sp E.^. SnapshotPackageSnapshot
|
||||
E.&&. sp E.^. SnapshotPackagePackage E.==. E.val pid
|
||||
E.orderBy [E.desc $ s E.^. SnapshotCreated]
|
||||
return (s, sp E.^. SnapshotPackageVersion)
|
||||
where
|
||||
go (Entity _ snapshot, E.Value version) = (snapshot, version)
|
||||
|
||||
-- | Count snapshots that belong to a specific SnapshotBranch
|
||||
countSnapshots :: (GetStackageDatabase m) => Maybe SnapshotBranch -> m Int
|
||||
|
||||
@ -6,7 +6,7 @@ $newline never
|
||||
<p>Back to <a href=@{PackageR pn}>#{toHtml pn}
|
||||
<table .table .snapshots>
|
||||
<thead>
|
||||
<th colspan=2>
|
||||
<th>
|
||||
Package
|
||||
<th>
|
||||
Snapshot
|
||||
|
||||
@ -49,6 +49,9 @@ $newline never
|
||||
This package is not currently in any snapshots. If you're interested in using it, we recommend #
|
||||
<a href="https://github.com/fpco/stackage/#add-your-package">adding it to Stackage Nightly
|
||||
. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
|
||||
$else
|
||||
<p>
|
||||
<a href=@{PackageSnapshotsR pn}>See all snapshots <code>#{pn}</code> appears in
|
||||
|
||||
<div .row>
|
||||
<div .span12>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user