Skip to content

Commit 7c94de4

Browse files
committed
Fixup bad layout in page-header <div>
The issue was the <a> element being rendered into a different row from the <ul> element on Firefox (but not on Chromium). This reverts a change from 0858245 While at it, this also fixes some minor inconsistencies/simplifies code.
1 parent 6396f24 commit 7c94de4

File tree

4 files changed

+11
-25
lines changed

4 files changed

+11
-25
lines changed

Distribution/Server/Pages/Package.hs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module Distribution.Server.Pages.Package
2525

2626
import Distribution.Server.Features.PreferredVersions
2727

28-
import Distribution.Server.Pages.Template (hackagePageWith)
28+
import Distribution.Server.Pages.Template (hackagePageWithHead)
2929
import qualified Distribution.Server.Pages.Package.HaddockParse as Haddock
3030
import Distribution.Server.Pages.Package.HaddockHtml
3131
import Distribution.Server.Packages.ModuleForest
@@ -37,7 +37,6 @@ import qualified Distribution.ModuleName as Module
3737
import Distribution.ModuleName (ModuleName)
3838
import Distribution.Package
3939
import Distribution.PackageDescription as P
40-
import Distribution.Simple.Utils ( cabalVersion )
4140
import Distribution.Version
4241
import Distribution.Types.CondTree
4342
import Distribution.Text (display)
@@ -72,7 +71,7 @@ packagePage :: PackageRender -> [Html] -> [Html] -> [(String, Html)]
7271
packagePage render headLinks top sections
7372
bottom mdocIndex mreadMe
7473
docURL isCandidate =
75-
hackagePageWith [canonical] docTitle docSubtitle docBody [docFooter]
74+
hackagePageWithHead [canonical] docTitle docBody
7675
where
7776
pkgid = rendPkgId render
7877
pkgName = display $ packageName pkgid
@@ -85,7 +84,6 @@ packagePage render headLinks top sections
8584
++ case synopsis (rendOther render) of
8685
"" -> ""
8786
short -> ": " ++ short
88-
docSubtitle = anchor ! [theclass "caption"] << "Hackage :: [Package]"
8987

9088
docBody = bodyTitle
9189
: concat [
@@ -123,14 +121,6 @@ packagePage render headLinks top sections
123121
items -> [thediv ! [thestyle "font-size: small"] <<
124122
(map (\item -> "[" +++ item +++ "] ") items)]
125123

126-
docFooter = thediv ! [identifier "footer"]
127-
<< paragraph
128-
<< [ toHtml "Produced by "
129-
, anchor ! [href "/"] << "hackage"
130-
, toHtml " and "
131-
, anchor ! [href cabalHomeURL] << "Cabal"
132-
, toHtml (" " ++ display cabalVersion) ]
133-
134124
pair (title, content) =
135125
toHtml [ h2 << title, content ]
136126

@@ -676,7 +666,3 @@ packageURL pkgId = "/package" </> display pkgId
676666

677667
--cabalLogoURL :: URL
678668
--cabalLogoURL = "/built-with-cabal.png"
679-
680-
-- global URLs
681-
cabalHomeURL :: URL
682-
cabalHomeURL = "http://haskell.org/cabal/"

Distribution/Server/Pages/Template.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ hackagePageWith headExtra docTitle docSubtitle docContent bodyExtra =
4040
]
4141
docBody = [ thediv ! [identifier "page-header"] << docHeader
4242
, thediv ! [identifier "content"] << docContent ]
43-
docHeader = [ docSubtitle
44-
, navigationBar
43+
docHeader = [ navigationBar
44+
, docSubtitle
4545
]
4646
googleFontURL = "https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700"
4747

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</head>
1616

1717
<body>
18-
$hackagePageHeader(title={<a class="caption" href="$baseurl$/">Hackage :: [Package]</a>})$
18+
$hackagePageHeader()$
1919

2020
<div id="content">
2121
<h1><a href="$baseurl$/package/$package.name$">$package.name$</a>$if(package.optional.hasSynopsis)$: <small>$package.optional.synopsis$</small>$endif$</h1>

datafiles/templates/hackagePageHeader.st

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
<div id="page-header">
22

3-
$if(title)$
4-
$title$
5-
$else$
6-
<a class="caption" href="/">Hackage : : [Package]</a>
7-
$endif$
8-
93
<ul class="links" id="page-menu">
104

115
<li><a href="/">Home</a></li>
@@ -27,4 +21,10 @@ $endif$
2721

2822
</ul>
2923

24+
$if(title)$
25+
$title$
26+
$else$
27+
<a class="caption" href="/">Hackage :: [Package]</a>
28+
$endif$
29+
3030
</div>

0 commit comments

Comments
 (0)