Skip to content

Commit

Permalink
Move the changelog link on the package page to just after the descrip…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
dcoutts committed Nov 4, 2013
1 parent f4673dc commit f571fce
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions Distribution/Server/Pages/Package.hs
Expand Up @@ -76,8 +76,19 @@ packagePage render headLinks top sections bottom docURL isCandidate =
-- | Body of the package page
pkgBody :: PackageRender -> [(String, Html)] -> [Html]
pkgBody render sections =
prologue (description $ rendOther render) ++
propertySection sections
descriptionSection render
++ propertySection sections

descriptionSection :: PackageRender -> [Html]
descriptionSection PackageRender{..} =
prologue (description rendOther)
++ [ hr
, ulist << li << changelogLink]
where
changelogLink
| rendHasChangeLog = anchor ! [href changeLogURL] << "Changelog"
| otherwise = toHtml << "No changelog available"
changeLogURL = rendPkgUri </> "changelog"

prologue :: String -> [Html]
prologue [] = []
Expand Down Expand Up @@ -111,17 +122,10 @@ downloadSection PackageRender{..} =
, [ anchor ! [href cabalURL] << "Package description"
, toHtml $ if rendHasTarball then " (included in the package)" else ""
]
, case (rendHasTarball, rendHasChangeLog) of
(True, True) -> [ anchor ! [href changeLogURL] << "Changelog"
, toHtml << " (included in the package)"
]
(True, False) -> [ toHtml << "No changelog available" ]
_ -> [ toHtml << "Package tarball not uploaded" ]
]

downloadURL = rendPkgUri </> display rendPkgId <.> "tar.gz"
cabalURL = rendPkgUri </> display (packageName rendPkgId) <.> "cabal"
changeLogURL = rendPkgUri </> "changelog"
srcURL = rendPkgUri </> "src/"
tarGzFileName = display rendPkgId ++ ".tar.gz"

Expand Down

0 comments on commit f571fce

Please sign in to comment.