mirror of
https://github.com/thecyberlearn/quantum-ai.git
synced 2026-08-18 19:33:00 +00:00
🔧 Fix admin field errors and add email verification resend
- Fix BaseAgent admin referencing non-existent fields (cost_per_request -> price, icon_name -> icon) - Add resend verification template and link to login page - Enhance email verification user experience 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
68518a0646
commit
edc3c27e4e
@ -4,7 +4,7 @@ from .models import BaseAgent
|
|||||||
|
|
||||||
@admin.register(BaseAgent)
|
@admin.register(BaseAgent)
|
||||||
class BaseAgentAdmin(admin.ModelAdmin):
|
class BaseAgentAdmin(admin.ModelAdmin):
|
||||||
list_display = ['name', 'slug', 'is_active', 'cost_per_request', 'created_at']
|
list_display = ['name', 'slug', 'is_active', 'price', 'created_at']
|
||||||
list_filter = ['is_active', 'agent_type', 'created_at']
|
list_filter = ['is_active', 'agent_type', 'created_at']
|
||||||
search_fields = ['name', 'slug', 'description']
|
search_fields = ['name', 'slug', 'description']
|
||||||
readonly_fields = ['slug', 'created_at', 'updated_at']
|
readonly_fields = ['slug', 'created_at', 'updated_at']
|
||||||
@ -15,7 +15,7 @@ class BaseAgentAdmin(admin.ModelAdmin):
|
|||||||
'fields': ('name', 'slug', 'description', 'agent_type')
|
'fields': ('name', 'slug', 'description', 'agent_type')
|
||||||
}),
|
}),
|
||||||
('Configuration', {
|
('Configuration', {
|
||||||
'fields': ('is_active', 'cost_per_request', 'icon_name')
|
'fields': ('is_active', 'price', 'icon')
|
||||||
}),
|
}),
|
||||||
('Timestamps', {
|
('Timestamps', {
|
||||||
'fields': ('created_at', 'updated_at'),
|
'fields': ('created_at', 'updated_at'),
|
||||||
|
|||||||
@ -176,6 +176,7 @@
|
|||||||
|
|
||||||
<div class="login-auth-links">
|
<div class="login-auth-links">
|
||||||
<p><a href="{% url 'authentication:forgot_password' %}">Forgot your password?</a></p>
|
<p><a href="{% url 'authentication:forgot_password' %}">Forgot your password?</a></p>
|
||||||
|
<p><a href="{% url 'authentication:resend_verification' %}">Resend email verification</a></p>
|
||||||
<p>Don't have an account? <a href="{% url 'authentication:register' %}">Create account</a></p>
|
<p>Don't have an account? <a href="{% url 'authentication:register' %}">Create account</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
190
templates/authentication/resend_verification.html
Normal file
190
templates/authentication/resend_verification.html
Normal file
@ -0,0 +1,190 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
{% load static %}
|
||||||
|
|
||||||
|
{% block title %}Resend Email Verification{% endblock %}
|
||||||
|
|
||||||
|
{% block extra_css %}
|
||||||
|
<link rel="stylesheet" href="{% static 'css/agent-base.css' %}">
|
||||||
|
<style>
|
||||||
|
/* Override main-container for full-width sections */
|
||||||
|
.main-container {
|
||||||
|
max-width: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Login page using agent-base.css */
|
||||||
|
.login-page {
|
||||||
|
background: var(--background);
|
||||||
|
min-height: calc(100vh - 84px);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: var(--spacing-lg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-container {
|
||||||
|
background: var(--surface);
|
||||||
|
border-radius: var(--radius-lg);
|
||||||
|
padding: 48px;
|
||||||
|
box-shadow: var(--shadow-lg);
|
||||||
|
width: 100%;
|
||||||
|
max-width: 450px;
|
||||||
|
border: 1px solid var(--outline);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-header {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-title {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--on-surface);
|
||||||
|
margin: 0 0 var(--spacing-sm) 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-subtitle {
|
||||||
|
font-size: 16px;
|
||||||
|
color: var(--on-surface-variant);
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-btn {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 32px;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.messages {
|
||||||
|
margin-bottom: var(--spacing-lg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
padding: var(--spacing-md);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
margin-bottom: var(--spacing-sm);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message.success {
|
||||||
|
background: var(--surface-variant);
|
||||||
|
color: var(--on-surface);
|
||||||
|
border-color: var(--outline);
|
||||||
|
}
|
||||||
|
|
||||||
|
.message.error {
|
||||||
|
background: var(--surface-variant);
|
||||||
|
color: var(--on-surface);
|
||||||
|
border-color: var(--outline);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-auth-links {
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 24px;
|
||||||
|
border-top: 1px solid var(--outline);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-auth-links p {
|
||||||
|
margin: var(--spacing-sm) 0;
|
||||||
|
color: var(--on-surface-variant);
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-auth-links a {
|
||||||
|
color: var(--primary);
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: 600;
|
||||||
|
transition: all var(--transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-auth-links a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive */
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
.login-page {
|
||||||
|
padding: var(--spacing-md);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-container {
|
||||||
|
padding: 32px 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-title {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="login-page theme-professional">
|
||||||
|
<div class="login-container">
|
||||||
|
<div class="login-header">
|
||||||
|
<h1 class="login-title">Resend Verification</h1>
|
||||||
|
<p class="login-subtitle">Enter your email to resend verification link</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if messages %}
|
||||||
|
<div class="messages">
|
||||||
|
{% for message in messages %}
|
||||||
|
<div class="message {{ message.tags }}">{{ message }}</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<form method="post" class="login-form">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email" class="form-label">Email Address</label>
|
||||||
|
<input
|
||||||
|
type="email"
|
||||||
|
id="email"
|
||||||
|
name="email"
|
||||||
|
class="form-input"
|
||||||
|
placeholder="Enter your email address"
|
||||||
|
required
|
||||||
|
autocomplete="email"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-primary login-btn">
|
||||||
|
Send Verification Email
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="login-auth-links">
|
||||||
|
<p><a href="{% url 'authentication:login' %}">Back to Sign In</a></p>
|
||||||
|
<p>Don't have an account? <a href="{% url 'authentication:register' %}">Create account</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block extra_js %}
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
const emailField = document.getElementById('email');
|
||||||
|
const form = document.querySelector('.login-form');
|
||||||
|
const submitBtn = document.querySelector('.login-btn');
|
||||||
|
|
||||||
|
// Focus on email field
|
||||||
|
if (emailField) {
|
||||||
|
emailField.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Form submission
|
||||||
|
if (form && submitBtn) {
|
||||||
|
form.addEventListener('submit', function() {
|
||||||
|
submitBtn.innerHTML = 'Sending...';
|
||||||
|
submitBtn.disabled = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
Loading…
Reference in New Issue
Block a user