Initial commit

This commit is contained in:
2025-01-05 10:45:32 +08:00
commit 7634e66541
55 changed files with 2922 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
{% extends 'base.html' %}
{% block content %}
<div class="max-w-md mx-auto py-8">
<h1 class="text-2xl font-bold mb-6">登录</h1>
{% if form.errors %}
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4">
用户名或密码错误,请重试
</div>
{% endif %}
<form method="post" class="bg-white p-6 rounded-lg shadow">
{% csrf_token %}
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="username">
用户名
</label>
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
type="text" name="username" required>
</div>
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2" for="password">
密码
</label>
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 mb-3 leading-tight focus:outline-none focus:shadow-outline"
type="password" name="password" required>
</div>
<div class="flex items-center justify-between">
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
type="submit">
登录
</button>
</div>
</form>
</div>
{% endblock %}

View File

@@ -0,0 +1,32 @@
{% extends 'base.html' %}
{% block content %}
<div class="max-w-md mx-auto py-8 text-center">
<h1 class="text-2xl font-bold mb-6">您已成功退出</h1>
<p class="mb-6">正在跳转到首页...</p>
<div class="spinner"></div>
</div>
<script>
setTimeout(function() {
window.location.href = "{% url 'home' %}";
}, 2000);
</script>
<style>
.spinner {
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
margin: 0 auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
{% endblock %}

View File

@@ -0,0 +1,39 @@
{% extends 'base.html' %}
{% block content %}
<div class="max-w-md mx-auto py-8">
<h1 class="text-2xl font-bold mb-6">注册</h1>
{% if error %}
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4">
{{ error }}
</div>
{% endif %}
<form method="post" class="bg-white p-6 rounded-lg shadow">
{% csrf_token %}
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="username">
用户名
</label>
{{ form.username }}
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="password1">
密码
</label>
{{ form.password1 }}
</div>
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2" for="password2">
确认密码
</label>
{{ form.password2 }}
</div>
<div class="flex items-center justify-between">
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
type="submit">
注册
</button>
</div>
</form>
</div>
{% endblock %}