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

47
static/css/auth.css Normal file
View File

@@ -0,0 +1,47 @@
:root {
--primary-color: #16767b;
--secondary-color: #741b5f;
--primary-light: #1a8a90;
--secondary-light: #8a2170;
}
body {
background-color: #f8f9fa;
}
.auth-container {
max-width: 400px;
margin: 100px auto;
}
.auth-card {
border: none;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.auth-header {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
color: white;
padding: 20px;
border-radius: 10px 10px 0 0;
}
.btn-primary {
background-color: var(--primary-color);
border-color: var(--primary-color);
}
.btn-primary:hover {
background-color: var(--primary-light);
border-color: var(--primary-light);
}
.form-control:focus {
border-color: var(--primary-color);
box-shadow: 0 0 0 0.2rem rgba(22, 118, 123, 0.25);
}
.alert {
border-radius: 10px;
}

View File

@@ -6,61 +6,13 @@
<title>Login - DocuPulse</title> <title>Login - DocuPulse</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style> <link rel="stylesheet" href="{{ url_for('static', filename='css/auth.css') }}">
:root {
--primary-color: #16767b;
--secondary-color: #741b5f;
--primary-light: #1a8a90;
--secondary-light: #8a2170;
}
body {
background-color: #f8f9fa;
}
.login-container {
max-width: 400px;
margin: 100px auto;
}
.login-card {
border: none;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.login-header {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
color: white;
padding: 20px;
border-radius: 10px 10px 0 0;
}
.btn-primary {
background-color: var(--primary-color);
border-color: var(--primary-color);
}
.btn-primary:hover {
background-color: var(--primary-light);
border-color: var(--primary-light);
}
.form-control:focus {
border-color: var(--primary-color);
box-shadow: 0 0 0 0.2rem rgba(22, 118, 123, 0.25);
}
.alert {
border-radius: 10px;
}
</style>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<div class="login-container"> <div class="auth-container">
<div class="card login-card"> <div class="card auth-card">
<div class="login-header text-center"> <div class="auth-header text-center">
<h2>Welcome Back</h2> <h2>Welcome Back</h2>
<p class="mb-0">Sign in to your account</p> <p class="mb-0">Sign in to your account</p>
</div> </div>

View File

@@ -3,25 +3,23 @@
{% block title %}Profile - DocuPulse{% endblock %} {% block title %}Profile - DocuPulse{% endblock %}
{% block content %} {% 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="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) %} {% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %} {% if messages %}
{% for category, message in 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 }} {{ message }}
</div> </div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endwith %} {% endwith %}
<div class="bg-white rounded-lg shadow overflow-hidden"> <form method="POST" enctype="multipart/form-data" class="bg-white rounded-lg shadow overflow-hidden">
<form method="POST" action="{{ url_for('main.profile') }}" class="p-6" enctype="multipart/form-data"> <!-- Profile Picture Section -->
<div class="flex flex-col items-center mb-6"> <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"> <div class="relative group flex flex-col items-center">
<label for="profile_picture" class="cursor-pointer"> <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"> <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 %} {% endif %}
</div> </div>
</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> <div>
<label class="block text-sm font-medium text-gray-700 mb-1">First Name</label> <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 }}" <input type="text" name="first_name" value="{{ current_user.username }}"
@@ -53,6 +56,13 @@
<input type="tel" name="phone" value="{{ current_user.phone or '' }}" <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"> 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>
<!-- 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> <div>
<label class="block text-sm font-medium text-gray-700 mb-1">Company</label> <label class="block text-sm font-medium text-gray-700 mb-1">Company</label>
<input type="text" name="company" value="{{ current_user.company or '' }}" <input type="text" name="company" value="{{ current_user.company or '' }}"
@@ -64,16 +74,17 @@
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"> 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>
<div class="mt-4">
<div class="mt-6">
<label class="block text-sm font-medium text-gray-700 mb-1">Notes</label> <label class="block text-sm font-medium text-gray-700 mb-1">Notes</label>
<textarea name="notes" rows="4" <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> 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>
<div class="mt-6"> <!-- Password Change Section -->
<h3 class="text-lg font-medium text-gray-900 mb-4">Change Password</h3> <div class="p-4 border-b border-gray-200">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <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> <div>
<label class="block text-sm font-medium text-gray-700 mb-1">New Password</label> <label class="block text-sm font-medium text-gray-700 mb-1">New Password</label>
<input type="password" name="new_password" <input type="password" name="new_password"
@@ -87,7 +98,9 @@
</div> </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" <button type="submit"
class="text-white px-6 py-2 rounded-lg transition duration-200" class="text-white px-6 py-2 rounded-lg transition duration-200"
style="background-color: #16767b; border: 1px solid #16767b;" style="background-color: #16767b; border: 1px solid #16767b;"
@@ -96,10 +109,11 @@
Save Changes Save Changes
</button> </button>
</div> </div>
</div>
</form> </form>
</div> </div>
</div>
</div> </div>
<script> <script>
function previewAvatar(event) { function previewAvatar(event) {
const [file] = event.target.files; const [file] = event.target.files;

View File

@@ -6,61 +6,13 @@
<title>Register - DocuPulse</title> <title>Register - DocuPulse</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style> <link rel="stylesheet" href="{{ url_for('static', filename='css/auth.css') }}">
:root {
--primary-color: #16767b;
--secondary-color: #741b5f;
--primary-light: #1a8a90;
--secondary-light: #8a2170;
}
body {
background-color: #f8f9fa;
}
.register-container {
max-width: 400px;
margin: 100px auto;
}
.register-card {
border: none;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.register-header {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
color: white;
padding: 20px;
border-radius: 10px 10px 0 0;
}
.btn-primary {
background-color: var(--primary-color);
border-color: var(--primary-color);
}
.btn-primary:hover {
background-color: var(--primary-light);
border-color: var(--primary-light);
}
.form-control:focus {
border-color: var(--primary-color);
box-shadow: 0 0 0 0.2rem rgba(22, 118, 123, 0.25);
}
.alert {
border-radius: 10px;
}
</style>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<div class="register-container"> <div class="auth-container">
<div class="card register-card"> <div class="card auth-card">
<div class="register-header text-center"> <div class="auth-header text-center">
<h2>Create Account</h2> <h2>Create Account</h2>
<p class="mb-0">Join DocuPulse today</p> <p class="mb-0">Join DocuPulse today</p>
</div> </div>