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 (y, "") <- either (const Nothing) Just $ decimal t3
Just (x, y) Just (x, y)
packageUrl :: SnapName -> PackageName -> Version -> Route App
packageUrl sname pkgname pkgver = SnapshotR sname sdistR
where
sdistR = StackageSdistR (PNVNameVersion pkgname pkgver)
haddockUrl :: SnapName haddockUrl :: SnapName
-> Text -- ^ package-version -> Text -- ^ package-version
-> Text -- ^ module name -> Text -- ^ module name

View File

@ -33,15 +33,23 @@
$else $else
<option value=@{StackageDiffR name1 name2'}>#{toPathPiece name2'} <option value=@{StackageDiffR name1 name2'}>#{toPathPiece name2'}
<tbody> <tbody>
$forall (PackageName name, VersionChange verChange) <- toDiffList snapDiff $forall (pkgname, VersionChange verChange) <- toDiffList snapDiff
<tr> <tr>
$case verChange $case verChange
$of This (Version oldVersion) $of This oldVersion
<td>#{name}-#{oldVersion}
<td> <td>
$of That (Version newVersion) <a href=@{packageUrl name1 pkgname oldVersion}>
#{pkgname}-#{oldVersion}
<td> <td>
<td>#{name}-#{newVersion} $of That newVersion
$of These (Version oldVersion) (Version newVersion) <td>
<td>#{name}-#{oldVersion} <td>
<td>#{name}-#{newVersion} <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 $forall pli <- packages
<tr> <tr>
<td> <td>
<a href=@{SnapshotR name $ StackageSdistR $ PNVNameVersion (PackageName $ toPathPiece $ pliName pli) $ Version (pliVersion pli)}> <a href=@{packageUrl name (PackageName $ pliName pli) (Version $ pliVersion pli)}>
#{pliName pli} #{pliName pli}-#{pliVersion pli}
-#{pliVersion pli}
<td> <td>
#{strip $ pliSynopsis pli} #{strip $ pliSynopsis pli}