<div .container>
    <div .content>
        <h1>Hoogle Search
        <p>Within <a href=@{snapshotLink}>#{snapshotTitle snapshot}</a>
        <p style="font-size:0.8em">
            <i>Note that Stackage only displays results for the latest LTS and Nightly snapshot.
            \ #
            <a href="https://github.com/commercialhaskell/stackage-server/issues/305">Learn more.
        ^{hoogleForm}
        $if null results
            <p>Your search produced no results.
        $else
            <ol .search-results>
                $forall HoogleResult url sources self docs <- results
                    <li>
                        <p .self>
                            <a href=#{url}>#{preEscapedToHtml self}
                        <table .sources>
                            $forall (pkg, modules) <- sources
                                <tr>
                                    <th>
                                        <a href=#{plURL pkg}>#{plName pkg}
                                    <td>
                                        $forall ModuleLink name url' <- modules
                                            <a href=#{url'}>#{name}
                        $if null docs
                            <p .nodocs>No documentation available.
                        $else
                            <p .docs>#{preEscapedToHtml docs}
            <p .pagination>
                $with mpageCount <- fmap getPageCount mtotalCount
                    Page #{page} of #{maybe "many" show mpageCount} #
                    $if page > 1
                        |
                        <a href=@?{pageLink $ page - 1}>Previous
                    $if maybe True ((<) page) mpageCount
                        |
                        <a href=@?{pageLink $ page + 1}>Next
