Skip to content

Commit 88de93c

Browse files
authored
Merge pull request #1308 from haskell/janus/tested-with
Add Tested-With to package page
2 parents 19b4737 + 7c8b019 commit 88de93c

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

datafiles/templates/Html/package-page.html.st

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,15 @@
140140
<td>$package.buildDepends$</td>
141141
</tr>
142142

143+
$if(package.optional.hasTestedWith)$
144+
<tr>
145+
<th>Tested with</th>
146+
<td class="word-wrap">
147+
$package.optional.testedWith$
148+
</td>
149+
</tr>
150+
$endif$
151+
143152
<tr>
144153
<th>License</th>
145154
<td class="word-wrap">$package.license$</td>

src/Distribution/Server/Pages/PackageFromTemplate.hs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import Text.XHtml.Strict hiding (p, name, title, content)
3333
import qualified Text.XHtml.Strict as XHtml
3434

3535
import Data.Maybe (maybeToList, fromMaybe, isJust)
36-
import Data.List (intersperse)
36+
import Data.List (intercalate, intersperse)
3737
import System.FilePath.Posix ((</>), takeFileName, dropTrailingPathSeparator)
3838
import Data.Time.Format (defaultTimeLocale, formatTime)
3939

@@ -228,6 +228,12 @@ packagePageTemplate render
228228
(vList $ map sourceRepositoryToHtml (sourceRepos desc))
229229
] ++
230230

231+
[ templateVal "hasTestedWith"
232+
(not $ null pkgTestedWith)
233+
, templateVal "testedWith"
234+
(intercalate ", " pkgTestedWith)
235+
] ++
236+
231237
[ templateVal "hasSynopsis"
232238
(not . Short.null $ synopsis (rendOther render))
233239
, templateVal "synopsis"
@@ -238,6 +244,10 @@ packagePageTemplate render
238244
pkgid = rendPkgId render
239245
pkgVer = display $ pkgVersion pkgid
240246
pkgName = display $ packageName pkgid
247+
pkgTestedWith =
248+
[ display compilerFlavor ++ " " ++ display versionRange
249+
| (compilerFlavor, versionRange) <- testedWith desc
250+
]
241251

242252
desc = rendOther render
243253

0 commit comments

Comments
 (0)