restructure login pages

This commit is contained in:
2025-05-25 11:48:03 +02:00
parent 651de5019d
commit e07d438fb2
4 changed files with 97 additions and 132 deletions

View File

@@ -3,25 +3,23 @@
{% block title %}Profile - DocuPulse{% endblock %}
{% block content %}
<div class="container mx-auto px-4 py-8">
<div class="container mx-auto px-4 py-6">
<div class="max-w-3xl mx-auto">
<div class="flex justify-between items-center mb-6">
<h1 class="text-2xl font-bold text-gray-800">My Profile</h1>
</div>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="mb-4 p-4 rounded-lg {% if category == 'error' %}bg-red-100 text-red-700{% else %}bg-green-100 text-green-700{% endif %}">
<div class="mb-3 p-3 rounded-lg {% if category == 'error' %}bg-red-100 text-red-700{% else %}bg-green-100 text-green-700{% endif %}">
{{ message }}
</div>
{% endfor %}
{% endif %}
{% endwith %}
<div class="bg-white rounded-lg shadow overflow-hidden">
<form method="POST" action="{{ url_for('main.profile') }}" class="p-6" enctype="multipart/form-data">
<div class="flex flex-col items-center mb-6">
<form method="POST" enctype="multipart/form-data" class="bg-white rounded-lg shadow overflow-hidden">
<!-- Profile Picture Section -->
<div class="p-4 border-b border-gray-200">
<h2 class="text-lg font-medium text-gray-900 mb-3">Profile Picture</h2>
<div class="flex flex-col items-center">
<div class="relative group flex flex-col items-center">
<label for="profile_picture" class="cursor-pointer">
<img id="avatarPreview" src="{{ url_for('profile_pic', filename=current_user.profile_picture) if current_user.profile_picture else url_for('static', filename='default-avatar.png') }}" alt="Profile Picture" class="w-32 h-32 rounded-full object-cover border-4 border-gray-200 mb-0 transition duration-200 group-hover:opacity-80 group-hover:ring-4 group-hover:ring-primary-200 shadow-sm">
@@ -32,7 +30,12 @@
{% endif %}
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
</div>
<!-- Personal Information Section -->
<div class="p-4 border-b border-gray-200">
<h2 class="text-lg font-medium text-gray-900 mb-3">Personal Information</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">First Name</label>
<input type="text" name="first_name" value="{{ current_user.username }}"
@@ -53,6 +56,13 @@
<input type="tel" name="phone" value="{{ current_user.phone or '' }}"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
</div>
</div>
<!-- Professional Information Section -->
<div class="p-4 border-b border-gray-200">
<h2 class="text-lg font-medium text-gray-900 mb-3">Professional Information</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Company</label>
<input type="text" name="company" value="{{ current_user.company or '' }}"
@@ -64,30 +74,33 @@
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
</div>
<div class="mt-6">
<div class="mt-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Notes</label>
<textarea name="notes" rows="4"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">{{ current_user.notes or '' }}</textarea>
</div>
</div>
<div class="mt-6">
<h3 class="text-lg font-medium text-gray-900 mb-4">Change Password</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">New Password</label>
<input type="password" name="new_password"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Confirm New Password</label>
<input type="password" name="confirm_password"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<!-- Password Change Section -->
<div class="p-4 border-b border-gray-200">
<h2 class="text-lg font-medium text-gray-900 mb-3">Change Password</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">New Password</label>
<input type="password" name="new_password"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Confirm New Password</label>
<input type="password" name="confirm_password"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
</div>
</div>
<div class="mt-8 flex justify-end">
<!-- Submit Button -->
<div class="p-4 bg-gray-50">
<div class="flex justify-end">
<button type="submit"
class="text-white px-6 py-2 rounded-lg transition duration-200"
style="background-color: #16767b; border: 1px solid #16767b;"
@@ -96,10 +109,11 @@
Save Changes
</button>
</div>
</form>
</div>
</div>
</form>
</div>
</div>
<script>
function previewAvatar(event) {
const [file] = event.target.files;