Add package urls to snapshot diff

This commit is contained in:
Charles Cooper 2016-04-20 08:32:57 -04:00
parent 6a5a29672d
commit dccb89523e
3 changed files with 23 additions and 11 deletions

View file

@ -20,6 +20,11 @@ parseLtsPair t1 = do
(y, "") <- either (const Nothing) Just $ decimal t3
Just (x, y)
packageUrl :: SnapName -> PackageName -> Version -> Route App
packageUrl sname pkgname pkgver = SnapshotR sname sdistR
where
sdistR = StackageSdistR (PNVNameVersion pkgname pkgver)
haddockUrl :: SnapName
-> Text -- ^ package-version
-> Text -- ^ module name

View file

@ -33,15 +33,23 @@
$else
<option value=@{StackageDiffR name1 name2'}>#{toPathPiece name2'}
<tbody>
$forall (PackageName name, VersionChange verChange) <- toDiffList snapDiff
$forall (pkgname, VersionChange verChange) <- toDiffList snapDiff
<tr>
$case verChange
$of This (Version oldVersion)
<td>#{name}-#{oldVersion}
$of This oldVersion
<td>
$of That (Version newVersion)
<a href=@{packageUrl name1 pkgname oldVersion}>
#{pkgname}-#{oldVersion}
<td>
<td>#{name}-#{newVersion}
$of These (Version oldVersion) (Version newVersion)
<td>#{name}-#{oldVersion}
<td>#{name}-#{newVersion}
$of That newVersion
<td>
<td>
<a href=@{packageUrl name2 pkgname newVersion}>
#{pkgname}-#{newVersion}
$of These oldVersion newVersion
<td>
<a href=@{packageUrl name1 pkgname oldVersion}>
#{pkgname}-#{oldVersion}
<td>
<a href=@{packageUrl name2 pkgname newVersion}>
#{pkgname}-#{newVersion}

View file

@ -53,8 +53,7 @@ $newline never
$forall pli <- packages
<tr>
<td>
<a href=@{SnapshotR name $ StackageSdistR $ PNVNameVersion (PackageName $ toPathPiece $ pliName pli) $ Version (pliVersion pli)}>
#{pliName pli}
-#{pliVersion pli}
<a href=@{packageUrl name (PackageName $ pliName pli) (Version $ pliVersion pli)}>
#{pliName pli}-#{pliVersion pli}
<td>
#{strip $ pliSynopsis pli}