diff --git a/Handler/Package.hs b/Handler/Package.hs index 098f0ea..5f5f392 100644 --- a/Handler/Package.hs +++ b/Handler/Package.hs @@ -7,6 +7,7 @@ module Handler.Package , getPackageSnapshotsR , packagePage , getPackageBadgeR + , renderNoPackages ) where import Data.Char @@ -226,3 +227,7 @@ getPackageSnapshotsR pn = $(combineStylesheets 'StaticR [css_font_awesome_min_css]) $(widgetFile "package-snapshots")) + +renderNoPackages :: Int -> Text +renderNoPackages n = + T.pack $ show n ++ " package" ++ (if n == 1 then "" else "s") diff --git a/templates/package.hamlet b/templates/package.hamlet index e31c85c..9118d7b 100644 --- a/templates/package.hamlet +++ b/templates/package.hamlet @@ -122,7 +122,7 @@ $if not (LT.null (LT.renderHtml (packageChangelog package)))
- Depends on + Depends on:
$forall (i,(name, range)) <- deps $if i /= 0 @@ -131,7 +131,7 @@ $if not (LT.null (LT.renderHtml (packageChangelog package))) #{name} $if not $ null revdeps
- Used by #{length revdeps} packages: + Used by #{renderNoPackages $ length revdeps}:
$forall (i,(name, range)) <- revdeps $if i /= 0