DEGTEVUWU/java-project-72

View on GitHub
app/src/main/resources/templates/layout/page.jte

Summary

Maintainability
Test Coverage
@import gg.jte.Content
@import hexlet.code.dto.BasePage
@import hexlet.code.utils.NamedRoutes

@param Content content = null
@param Content footer = null
@param BasePage page = null

<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Анализатор страниц</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
</head>

<body class="d-flex flex-column min-vh-100">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container-fluid">
            <a class="navbar-brand" href="/">Анализатор страниц</a>
            <div class="collapse navbar-collapse" id="navbarNav">
                <div class="navbar-nav">
                    <a class="nav-link" href="${NamedRoutes.rootPath()}">Главная</a>
                    <a class="nav-link" href="${NamedRoutes.urlsPath()}">Сайты</a>
                </div>
            </div>
        </div>
</nav>
</body>
<main>

    @if(page != null && page.getFlash() != null)
        <div class="alert alert-${page.getFlashType()}" role="alert">
            ${page.getFlash()}
        </div>
    @endif

    ${content}

</main>
<footer class="text-center text-lg-start bg-light text-muted fixed-bottom">
    <div class="text-center p-4" style="background-color: rgba(0, 0, 0, 0.05);">
        ${footer}
    </div>
</footer>
</html>