fc / apps /organization /templates /admin /register.html
jun2024's picture
Upload 2241 files
b4f2238 verified
Raw History Blame Contribute Delete
14 kB
<!DOCTYPE html>
{% load i18n %}
<html lang="zh-hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% trans "用户注册" %} | {% trans "法穿案件管理系统" %}</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
overflow: hidden;
}
/* 动态背景粒子 */
.particles {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
overflow: hidden;
z-index: 0;
}
.particle {
position: absolute;
width: 4px;
height: 4px;
background: rgba(255, 255, 255, 0.3);
border-radius: 50%;
animation: float 15s infinite;
}
@keyframes float {
0%, 100% {
transform: translateY(100vh) rotate(0deg);
opacity: 0;
}
10% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
transform: translateY(-100vh) rotate(720deg);
opacity: 0;
}
}
/* 注册卡片 */
.register-container {
position: relative;
z-index: 1;
width: 100%;
max-width: 420px;
padding: 20px;
}
.register-card {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(20px);
border-radius: 24px;
padding: 40px;
box-shadow:
0 25px 50px rgba(0, 0, 0, 0.3),
inset 0 0 0 1px rgba(255, 255, 255, 0.1);
animation: slideUp 0.6s ease-out;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Logo 和标题 */
.logo-section {
text-align: center;
margin-bottom: 30px;
}
.logo {
width: 70px;
height: 70px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 15px;
box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% {
box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}
50% {
box-shadow: 0 10px 40px rgba(102, 126, 234, 0.6);
}
}
.logo svg {
width: 36px;
height: 36px;
fill: white;
}
.title {
color: #fff;
font-size: 24px;
font-weight: 600;
margin-bottom: 8px;
}
.subtitle {
color: rgba(255, 255, 255, 0.6);
font-size: 14px;
}
.first-user-hint {
color: #4ade80;
font-size: 13px;
margin-top: 12px;
padding: 8px 16px;
background: rgba(74, 222, 128, 0.15);
border-radius: 8px;
border: 1px solid rgba(74, 222, 128, 0.3);
}
.approval-hint {
color: #fbbf24;
font-size: 13px;
margin-top: 12px;
padding: 8px 16px;
background: rgba(251, 191, 36, 0.15);
border-radius: 8px;
border: 1px solid rgba(251, 191, 36, 0.3);
}
.quick-start {
margin-bottom: 24px;
padding: 18px;
border-radius: 16px;
background: rgba(15, 23, 42, 0.28);
border: 1px solid rgba(102, 126, 234, 0.26);
}
.quick-start-title {
color: #fff;
font-size: 15px;
font-weight: 600;
margin-bottom: 8px;
}
.quick-start-desc {
color: rgba(255, 255, 255, 0.72);
font-size: 13px;
line-height: 1.6;
margin-bottom: 14px;
}
.quick-start-credentials {
color: rgba(255, 255, 255, 0.82);
font-size: 12px;
line-height: 1.7;
margin-bottom: 14px;
padding: 10px 12px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.06);
}
.quick-start-credentials strong {
color: #fff;
}
.quick-start-btn {
width: 100%;
padding: 14px 16px;
border-radius: 12px;
border: 1px solid rgba(74, 222, 128, 0.4);
background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 0.92) 100%);
color: #fff;
font-size: 15px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}
.quick-start-btn:hover {
transform: translateY(-1px);
box-shadow: 0 12px 30px rgba(34, 197, 94, 0.24);
}
/* 表单样式 */
.form-group {
margin-bottom: 20px;
position: relative;
}
.form-label {
display: block;
color: rgba(255, 255, 255, 0.8);
font-size: 13px;
font-weight: 500;
margin-bottom: 8px;
transition: color 0.3s;
}
.form-input {
width: 100%;
padding: 14px 16px;
background: rgba(255, 255, 255, 0.08);
border: 2px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
color: #fff;
font-size: 15px;
transition: all 0.3s ease;
outline: none;
}
.form-input::placeholder {
color: rgba(255, 255, 255, 0.4);
}
.form-input:focus {
border-color: #667eea;
background: rgba(255, 255, 255, 0.12);
box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}
.form-input:hover {
border-color: rgba(255, 255, 255, 0.2);
}
/* 错误提示 */
.error-list {
list-style: none;
margin-top: 8px;
}
.error-list li {
color: #ff6b6b;
font-size: 12px;
padding: 4px 0;
}
.error-note {
background: rgba(255, 107, 107, 0.15);
border: 1px solid rgba(255, 107, 107, 0.3);
border-radius: 10px;
padding: 12px 16px;
margin-bottom: 20px;
color: #ff6b6b;
font-size: 13px;
}
/* 帮助文本 */
.help-text {
color: rgba(255, 255, 255, 0.5);
font-size: 11px;
margin-top: 6px;
line-height: 1.4;
}
.chinese-hint {
color: #667eea;
font-size: 11px;
margin-top: 6px;
}
/* 提交按钮 */
.submit-btn {
width: 100%;
padding: 16px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
border-radius: 12px;
color: #fff;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
margin-top: 10px;
position: relative;
overflow: hidden;
}
.submit-btn:hover {
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}
.submit-btn:active {
transform: translateY(0);
}
.submit-btn::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
transform: translate(-50%, -50%);
transition: width 0.6s, height 0.6s;
}
.submit-btn:active::after {
width: 300px;
height: 300px;
}
/* 登录链接 */
.login-link {
text-align: center;
margin-top: 25px;
padding-top: 20px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.login-link span {
color: rgba(255, 255, 255, 0.6);
font-size: 14px;
}
.login-link a {
color: #667eea;
text-decoration: none;
font-weight: 600;
margin-left: 5px;
transition: color 0.3s;
}
.login-link a:hover {
color: #8b9ff5;
}
/* 响应式 */
@media (max-width: 480px) {
.register-card {
padding: 30px 25px;
}
.title {
font-size: 20px;
}
}
</style>
</head>
<body>
<!-- 动态粒子背景 -->
<div class="particles" id="particles"></div>
<div class="register-container">
<div class="register-card">
<!-- Logo -->
<div class="logo-section">
<div class="logo">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M12 3L1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9L12 3zm6.82 6L12 12.72 5.18 9 12 5.28 18.82 9zM17 15.99l-5 2.73-5-2.73v-3.72L12 15l5-2.73v3.72z"/>
</svg>
</div>
<h1 class="title">{% trans "创建账号" %}</h1>
<p class="subtitle">{% trans "加入法穿案件管理系统" %}</p>
{% if is_first_user %}
<p class="first-user-hint">🎉 {% trans "您将成为第一个用户,自动获得管理员权限" %}</p>
{% else %}
<p class="approval-hint">⏳ {% trans "注册后需等待管理员开通权限" %}</p>
{% endif %}
</div>
{% if show_auto_register %}
<div class="quick-start">
<div class="quick-start-title">{% trans "自动注册" %}</div>
<p class="quick-start-desc">{% trans "用于系统首次初始化,点击后会立即创建默认超级管理员并自动登录。" %}</p>
<div class="quick-start-credentials">
<div><strong>{% trans "用户名" %}:</strong>法穿</div>
<div><strong>{% trans "密码" %}:</strong>1234qwer</div>
</div>
<form method="post" action="">
{% csrf_token %}
<input type="hidden" name="action" value="auto_register">
<button type="submit" class="quick-start-btn">{% trans "自动注册默认超级管理员" %}</button>
</form>
</div>
{% endif %}
<!-- 表单 -->
<form method="post" action="">
{% csrf_token %}
{% if form.non_field_errors %}
<div class="error-note">
{% for error in form.non_field_errors %}
{{ error }}
{% endfor %}
</div>
{% endif %}
{% for field in form %}
<div class="form-group">
<label class="form-label" for="{{ field.id_for_label }}">
{{ field.label }}{% if field.field.required %} *{% endif %}
</label>
{{ field }}
{% if field.errors %}
<ul class="error-list">
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{% if field.name == 'username' %}
<p class="chinese-hint">⚠️ {% trans "只能输入中文" %}</p>
{% endif %}
</div>
{% endfor %}
<button type="submit" class="submit-btn">{% trans "注册" %}</button>
</form>
<!-- 登录链接 -->
<div class="login-link">
<span>{% trans "已有账号?" %}</span>
<a href="{% url 'admin:login' %}">{% trans "返回登录" %}</a>
</div>
</div>
</div>
<script>
// 创建动态粒子
function createParticles() {
const container = document.getElementById('particles');
const particleCount = 50;
for (let i = 0; i < particleCount; i++) {
const particle = document.createElement('div');
particle.className = 'particle';
particle.style.left = Math.random() * 100 + '%';
particle.style.animationDelay = Math.random() * 15 + 's';
particle.style.animationDuration = (Math.random() * 10 + 10) + 's';
particle.style.width = (Math.random() * 4 + 2) + 'px';
particle.style.height = particle.style.width;
container.appendChild(particle);
}
}
createParticles();
</script>
</body>
</html>