160 lines
5.9 KiB
HTML
160 lines
5.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<link
|
|
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
|
|
rel="stylesheet"
|
|
/>
|
|
<link
|
|
rel="stylesheet"
|
|
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.3/font/bootstrap-icons.css"
|
|
/>
|
|
<title>axum使用SeaORM</title>
|
|
</head>
|
|
<body>
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-success">
|
|
<div class="container-fluid">
|
|
<a class="navbar-brand" href="https://axum.rs" target="_blank"
|
|
><i class="bi bi-arrow-through-heart-fill"></i> axum.rs</a
|
|
>
|
|
<button
|
|
class="navbar-toggler"
|
|
type="button"
|
|
data-bs-toggle="collapse"
|
|
data-bs-target="#navbarNav"
|
|
aria-controls="navbarNav"
|
|
aria-expanded="false"
|
|
aria-label="Toggle navigation"
|
|
>
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/" id="navbar-home">首页</a>
|
|
</li>
|
|
<li class="nav-item dropdown">
|
|
<a
|
|
class="nav-link dropdown-toggle"
|
|
href="#"
|
|
id="navbar-category"
|
|
role="button"
|
|
data-bs-toggle="dropdown"
|
|
aria-expanded="false"
|
|
id="navbar-category"
|
|
>
|
|
分类管理
|
|
</a>
|
|
<ul class="dropdown-menu" aria-labelledby="navbar-category">
|
|
<li>
|
|
<a
|
|
class="dropdown-item"
|
|
href="/category"
|
|
id="navbar-category-list"
|
|
>分类列表</a
|
|
>
|
|
</li>
|
|
<li>
|
|
<a
|
|
class="dropdown-item"
|
|
href="/category/add"
|
|
id="navbar-category-add"
|
|
>添加分类</a
|
|
>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-item dropdown">
|
|
<a
|
|
class="nav-link dropdown-toggle"
|
|
href="#"
|
|
id="navbar-article"
|
|
role="button"
|
|
data-bs-toggle="dropdown"
|
|
aria-expanded="false"
|
|
id="navbar-article"
|
|
>
|
|
文章管理
|
|
</a>
|
|
<ul class="dropdown-menu" aria-labelledby="navbar-article">
|
|
<li>
|
|
<a
|
|
class="dropdown-item"
|
|
href="/article"
|
|
id="navbar-article-list"
|
|
>文章列表</a
|
|
>
|
|
</li>
|
|
<li>
|
|
<a
|
|
class="dropdown-item"
|
|
href="/article/add"
|
|
id="navbar-article-add"
|
|
>添加文章</a
|
|
>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a
|
|
class="nav-link"
|
|
href="https://github.com/AxumCourse/axum-with-seaorm"
|
|
target="_blank"
|
|
><i class="bi bi-github"></i
|
|
></a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="container py-3">
|
|
<div class="row">
|
|
<div class="col">
|
|
<h2>{% block title %}标题{%endblock%}</h2>
|
|
</div>
|
|
<div class="col-2 text-end">
|
|
<nav aria-label="breadcrumb">
|
|
<ol class="breadcrumb">
|
|
{% block bc %} {%endblock%}
|
|
<li class="breadcrumb-item active" aria-current="page">
|
|
{%block title%}{%endblock%}
|
|
</li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
<main>{% block content %} 在此输入内容 {%endblock %}</main>
|
|
</div>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
|
|
<script>
|
|
$(function () {
|
|
activeNavItem();
|
|
function activeNavItem() {
|
|
const path = location.pathname;
|
|
$("#navbarNav .nav-link").removeClass("active");
|
|
$("#navbarNav .dropdown-item").removeClass("active");
|
|
if (path === "/") {
|
|
$("#navbar-home").addClass("active");
|
|
return;
|
|
}
|
|
if (path.indexOf("/category") >= 0) {
|
|
$("#navbar-category").addClass("active");
|
|
if (path === "/category") {
|
|
$("#navbar-category-list").addClass("active");
|
|
return;
|
|
}
|
|
if (path.indexOf("/add") >= 0) {
|
|
$("#navbar-category-add").addClass("active");
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |