mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-27 19:30:25 +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
|
-> m [(Snapshot, Text)] -- version
|
||||||
getSnapshotsForPackage pname = run $ do
|
getSnapshotsForPackage pname = run $ do
|
||||||
pid <- getPackageId pname
|
pid <- getPackageId pname
|
||||||
sps <- selectList [SnapshotPackagePackage ==. pid] []
|
fmap (map go) $ E.select $ E.from $ \(s, sp) -> do
|
||||||
fmap catMaybes $ forM sps $ \(Entity _ sp) -> do
|
E.where_ $ s E.^. SnapshotId E.==. sp E.^. SnapshotPackageSnapshot
|
||||||
let sid = snapshotPackageSnapshot sp
|
E.&&. sp E.^. SnapshotPackagePackage E.==. E.val pid
|
||||||
ms <- get sid
|
E.orderBy [E.desc $ s E.^. SnapshotCreated]
|
||||||
return $ case ms of
|
return (s, sp E.^. SnapshotPackageVersion)
|
||||||
Nothing -> Nothing
|
where
|
||||||
Just s -> Just (s, snapshotPackageVersion sp)
|
go (Entity _ snapshot, E.Value version) = (snapshot, version)
|
||||||
|
|
||||||
-- | Count snapshots that belong to a specific SnapshotBranch
|
-- | Count snapshots that belong to a specific SnapshotBranch
|
||||||
countSnapshots :: (GetStackageDatabase m) => Maybe SnapshotBranch -> m Int
|
countSnapshots :: (GetStackageDatabase m) => Maybe SnapshotBranch -> m Int
|
||||||
|
|||||||
@ -6,7 +6,7 @@ $newline never
|
|||||||
<p>Back to <a href=@{PackageR pn}>#{toHtml pn}
|
<p>Back to <a href=@{PackageR pn}>#{toHtml pn}
|
||||||
<table .table .snapshots>
|
<table .table .snapshots>
|
||||||
<thead>
|
<thead>
|
||||||
<th colspan=2>
|
<th>
|
||||||
Package
|
Package
|
||||||
<th>
|
<th>
|
||||||
Snapshot
|
Snapshot
|
||||||
|
|||||||
@ -49,6 +49,9 @@ $newline never
|
|||||||
This package is not currently in any snapshots. If you're interested in using it, we recommend #
|
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
|
<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.
|
. 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 .row>
|
||||||
<div .span12>
|
<div .span12>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user