Skip to content

package page adjustments #1355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions datafiles/static/hackage.css
Original file line number Diff line number Diff line change
Expand Up @@ -328,27 +328,27 @@ blockquote {
line-height: 1.2em;
}

div#properties table.properties thead,
div#properties table.properties tbody,
div#properties table.properties tr,
div#properties table.properties td,
div#properties table.properties th {
#properties table.properties thead,
#properties table.properties tbody,
#properties table.properties tr,
#properties table.properties td,
#properties table.properties th {
display: block;
}

div#properties table.properties td {
#properties table.properties td {
font-size: 1rem;
}

div#properties table.properties tr {
#properties table.properties tr {
padding-bottom: 3px;
}

div#properties table.properties td {
#properties table.properties td {
padding-top: 0px;
}

div#properties table.properties .star-rating {
#properties table.properties .star-rating {
overflow: hidden;
padding: 2px 0;
}
Expand Down Expand Up @@ -493,7 +493,7 @@ table.properties td, table.properties th {
margin-bottom: 0px;
}

div #properties {
#properties {
width: 40%;
margin-bottom: 2em;
}
Expand Down Expand Up @@ -554,7 +554,7 @@ table.properties td, table.properties th {
padding-top: 9px;
}

div #properties {
#properties {
width: 100%;
margin: 1.3em 0;
}
Expand Down Expand Up @@ -1057,9 +1057,8 @@ p.tip {
}

.embedded-author-content {
border-left: 1px solid #d8d7ad;
padding: 0.5em 1em;
margin: 0.5em 0 1em 1em;
padding: 0.5em 0;
margin: 0.5em 0;
}

.embedded-author-content img {
Expand Down
56 changes: 29 additions & 27 deletions datafiles/templates/Html/package-page.html.st
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<body>
$hackagePageHeader()$

<div id="content">
<main id="content">
<h1><a href="$baseurl$/package/$package.name$">$package.name$</a>$if(package.optional.hasSynopsis)$: <small>$package.optional.synopsis$</small>$endif$</h1>
<div style="font-size: small">
[ $tags$ ]
Expand Down Expand Up @@ -95,34 +95,11 @@
$downloadSection$
</div>

<div id="maintainer-corner">
<h4>Maintainer's Corner</h4>
<p><a href="$package.maintainerURL$">Package maintainers</a></p>
<ul>
<li>
$maintainers$
</li>
</ul>
<p>For package maintainers and hackage trustees</p>
<ul>
<li>
<a href="$baseurl$/package/$package.name$/maintain">
edit package information
</a>
</li>
</ul>
<p>Candidates</p>
<ul>
<li>
$candidates$
</li>
</ul>
</div>

</div><!-- /left-pane -->


<div id="properties">
<aside id="properties">
<table class="properties">
<tbody>

Expand Down Expand Up @@ -283,9 +260,34 @@
<th>Status</th>
<td>$buildStatus$</td>
</tr>
<tr>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with moving to sidebar, but do not want it hidden by default. all the info except "edit package information" is generally relevant -- checking who the maintainers are, what the candidates are, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you still get the maintainer entry that is the cabal file - I feel like that the hackage maintainers and the candidates are technical details that don't matter for 99% of the people visiting a package page.

I can of course revert this change but I thought it would be nice to discuss this :)

<th>Maintainer's Corner</th>
<td>
<p><a href="$package.maintainerURL$">Package maintainers</a></p>
<ul>
<li>
$maintainers$
</li>
</ul>
<p>For package maintainers and hackage trustees</p>
<ul>
<li>
<a href="$baseurl$/package/$package.name$/maintain">
edit package information
</a>
</li>
</ul>
<p>Candidates</p>
<ul>
<li>
$candidates$
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div> <!-- /properties -->
</aside> <!-- /properties -->
</div><!-- /flex-container -->

$if(package.optional.hasReadme)$
Expand All @@ -298,7 +300,7 @@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/components/prism-core.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/plugins/autoloader/prism-autoloader.min.js"></script>
$endif$
</div> <!-- /content -->
</main> <!-- /content -->

$packagePageAssets()$
<div style="clear:both"></div>
Expand Down
4 changes: 2 additions & 2 deletions datafiles/templates/footer.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="footer">
<footer id="footer">
<p>
Produced by <a href="/">hackage</a> and <a href="http://haskell.org/cabal/">Cabal</a> $cabalVersion$.
</p>
</div>
</footer>
44 changes: 23 additions & 21 deletions datafiles/templates/hackagePageHeader.st
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
<div id="page-header">
<header id="page-header">

<a class="caption" href="/">Hackage :: [Package]</a>

<ul class="links" id="page-menu">
<nav>
<ul class="links" id="page-menu">

<li>
<form action="/packages/search" method="get" class="search">
<button type="submit">Search&nbsp;</button>
<input type="text" name="terms" />
</form>
</li>
<li>
<form action="/packages/search" method="get" class="search">
<button type="submit">Search&nbsp;</button>
<input type="text" name="terms" />
</form>
</li>

<li><a href="/packages/browse">Browse</a></li>
<li><a href="/packages/browse">Browse</a></li>

<li><a href="/packages/recent">What's new</a></li>
<li><a href="/packages/recent">What's new</a></li>

<li><a href="/upload">Upload</a></li>
<li><a href="/upload">Upload</a></li>

<li><a href="/accounts">User accounts</a></li>
$if(deauthPack)$
<li><a title="If authenticated" href="/packages/deauth">Logout</a></li>
$elseif(deauthAdmin)$
<li><a title="If authenticated" href="/admin/deauth">Logout</a></li>
$elseif(deauthUser)$
<li><a title="If authenticated" href="./deauth">Logout</a></li>
$endif$
<li><a href="/accounts">User accounts</a></li>
$if(deauthPack)$
<li><a title="If authenticated" href="/packages/deauth">Logout</a></li>
$elseif(deauthAdmin)$
<li><a title="If authenticated" href="/admin/deauth">Logout</a></li>
$elseif(deauthUser)$
<li><a title="If authenticated" href="./deauth">Logout</a></li>
$endif$

</ul>
</ul>
</nav>

</div>
</header>
2 changes: 1 addition & 1 deletion src/Distribution/Server/Pages/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ downloadSection PackageRender{..} =
[ anchor ! [href cabalURL] << "Package description" ]
(True,Nothing) ->
[ anchor ! [href cabalURL] << "Package description"
, toHtml " (as included in the package)"
, toHtml " (as included in the package cabal file)"
]
(True,Just _) ->
[ anchor ! [href cabalURL] << "Package description"
Expand Down
10 changes: 7 additions & 3 deletions src/Distribution/Server/Pages/Template.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Distribution.Server.Pages.Template
) where

import Text.XHtml.Strict
import qualified Text.XHtml as XHtml

--TODO: replace all this with external templates

Expand Down Expand Up @@ -36,21 +37,22 @@ hackagePageWith headExtra docTitle docSubtitle docContent bodyExtra =
, thetype "image/png"] << noHtml
, meta ! [ name "viewport"
, content "width=device-width, initial-scale=1"]
, (script noHtml) ! [ src "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js", thetype "text/javascript"]
, script noHtml ! [ src "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js", thetype "text/javascript"]
-- if Search is enabled
, thelink ! [ rel "search", href "/packages/opensearch.xml"
, thetype "application/opensearchdescription+xml"
, title "Hackage" ] << noHtml
]
docBody = [ thediv ! [identifier "page-header"] << docHeader
docBody = [ theheader ! [identifier "page-header"] << docHeader
, thediv ! [identifier "content"] << docContent ]
docHeader = [ docSubtitle
, navigationBar
]
theheader = XHtml.tag "header"

navigationBar :: Html
navigationBar =
ulist ! [theclass "links", identifier "page-menu"]
thenav $ ulist ! [theclass "links", identifier "page-menu"]
<< map (li <<)
[ anchor ! [href introductionURL] << "Home"
, form ! [action "/packages/search", theclass "search", method "get"]
Expand All @@ -61,6 +63,8 @@ navigationBar =
, anchor ! [href uploadURL] << "Upload"
, anchor ! [href accountsURL] << "User accounts"
]
where
thenav = XHtml.tag "nav"


googleFontURL :: URL
Expand Down
Loading