166 lines
7.1 KiB
HTML
166 lines
7.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>证书管理系统 - {% block title %}{% endblock %}</title>
|
|
<link rel="icon" href="{{ url_for('static', filename='favicon.svg') }}" type="image/svg+xml">
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
|
|
<style>
|
|
body {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 100vh;
|
|
}
|
|
.main-content {
|
|
flex: 1;
|
|
padding-top: 20px;
|
|
padding-bottom: 40px;
|
|
}
|
|
.footer {
|
|
background-color: #f8f9fa;
|
|
padding: 20px 0;
|
|
margin-top: auto;
|
|
}
|
|
.navbar {
|
|
box-shadow: 0 2px 4px rgba(0,0,0,.1);
|
|
background-color: rgb(124 146 157) !important;
|
|
}
|
|
.nav-item.active {
|
|
position: relative;
|
|
}
|
|
.nav-item.active::after {
|
|
content: '';
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
width: 50%;
|
|
height: 3px;
|
|
background-color: #333333;
|
|
border-radius: 3px 3px 0 0;
|
|
}
|
|
.nav-item.active .nav-link {
|
|
font-weight: 500;
|
|
color: #333333 !important;
|
|
}
|
|
</style>
|
|
{% block styles %}{% endblock %}
|
|
</head>
|
|
<body>
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
|
<div class="container">
|
|
<a class="navbar-brand fw-bold" href="{{ url_for('index') }}">
|
|
<i class="fas fa-shield-alt me-2"></i>自签证书管理系统
|
|
</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav me-auto">
|
|
<li class="nav-item {% if request.path.startswith('/cas') %}active{% endif %}">
|
|
<a class="nav-link" href="{{ url_for('ca_list') }}">
|
|
<i class="fas fa-shield-alt me-1"></i>CA机构
|
|
</a>
|
|
</li>
|
|
<li class="nav-item {% if request.path.startswith('/certificates') %}active{% endif %}">
|
|
<a class="nav-link" href="{{ url_for('certificate_list') }}">
|
|
<i class="fas fa-certificate me-1"></i>证书
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
<ul class="navbar-nav">
|
|
{% if current_user.is_authenticated %}
|
|
<li class="nav-item dropdown">
|
|
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-bs-toggle="dropdown">
|
|
<i class="fas fa-user-circle me-1"></i>{{ current_user.username }}
|
|
</a>
|
|
<ul class="dropdown-menu dropdown-menu-end">
|
|
{% if current_user.is_admin %}
|
|
<li><span class="dropdown-item-text text-muted small">管理员</span></li>
|
|
{% else %}
|
|
<li><span class="dropdown-item-text text-muted small">普通用户</span></li>
|
|
{% endif %}
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li>
|
|
<a class="dropdown-item" href="{{ url_for('logout') }}">
|
|
<i class="fas fa-sign-out-alt me-2"></i>退出登录
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
{% else %}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('login') }}">
|
|
<i class="fas fa-sign-in-alt me-1"></i>登录
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('register') }}">
|
|
<i class="fas fa-user-plus me-1"></i>注册
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="main-content">
|
|
<div class="container">
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<div class="alert alert-{{ category }} alert-dismissible fade show mt-3" role="alert">
|
|
<div class="d-flex align-items-center">
|
|
{% if category == 'success' %}
|
|
<i class="fas fa-check-circle me-2"></i>
|
|
{% elif category == 'danger' %}
|
|
<i class="fas fa-exclamation-circle me-2"></i>
|
|
{% elif category == 'warning' %}
|
|
<i class="fas fa-exclamation-triangle me-2"></i>
|
|
{% else %}
|
|
<i class="fas fa-info-circle me-2"></i>
|
|
{% endif %}
|
|
<div>{{ message }}</div>
|
|
</div>
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
|
|
{% block content %}{% endblock %}
|
|
</div>
|
|
</div>
|
|
|
|
<footer class="footer">
|
|
<div class="container text-center text-muted">
|
|
<small>
|
|
<p class="mb-1">自签证书管理系统 © {{ now.year }} - 基于Flask构建</p>
|
|
<p class="mb-0">版本 6.0.0</p>
|
|
</small>
|
|
</div>
|
|
</footer>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
{% block scripts %}{% endblock %}
|
|
<script>
|
|
// 高亮当前导航项
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// 初始化工具提示
|
|
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
|
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
|
return new bootstrap.Tooltip(tooltipTriggerEl);
|
|
});
|
|
|
|
// 初始化弹出框
|
|
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
|
|
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
|
|
return new bootstrap.Popover(popoverTriggerEl);
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |