File size: 10,169 Bytes
88da18c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<!DOCTYPE html>
<html>
<head>
    <title>Upload CV Template</title>
    <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.4.0/css/all.min.css">
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f8f9fa;
            padding-top: 30px;
            padding-bottom: 50px;
            color: #343a40;
        }
        .page-header {
            background: linear-gradient(135deg, #0d6efd 0%, #0099ff 100%);
            padding: 2.5rem;
            border-radius: 1rem;
            margin-bottom: 2.5rem;
            color: white;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        .page-header::before {
            content: '';
            position: absolute;
            top: -50px;
            right: -50px;
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
        }
        .page-header::after {
            content: '';
            position: absolute;
            bottom: -30px;
            left: -30px;
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
        }
        .header-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
            color: white;
        }
        .card {
            border: none;
            border-radius: 1rem;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            margin-bottom: 2rem;
            overflow: hidden;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        .card-body {
            padding: 2rem;
        }
        .upload-area {
            border: 2px dashed #dee2e6;
            border-radius: 1rem;
            padding: 3rem 2rem;
            text-align: center;
            transition: all 0.3s ease;
            background-color: #f8f9fa;
            margin-bottom: 1.5rem;
            cursor: pointer;
        }
        .upload-area:hover {
            border-color: #0d6efd;
            background-color: #f1f8ff;
        }
        .upload-icon {
            font-size: 3.5rem;
            color: #0d6efd;
            margin-bottom: 1.5rem;
        }
        .upload-text {
            font-size: 1.2rem;
            color: #495057;
            margin-bottom: 0.5rem;
        }
        .upload-hint {
            font-size: 0.9rem;
            color: #6c757d;
        }
        .btn-primary {
            background: linear-gradient(135deg, #0d6efd 0%, #0099ff 100%);
            border: none;
            padding: 0.6rem 1.5rem;
            border-radius: 0.5rem;
            font-weight: 500;
            transition: all 0.3s ease;
        }
        .btn-primary:hover {
            background: linear-gradient(135deg, #0957cc 0%, #0080d6 100%);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
        }
        .btn-secondary {
            background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
            border: none;
            padding: 0.6rem 1.5rem;
            border-radius: 0.5rem;
            font-weight: 500;
            transition: all 0.3s ease;
        }
        .btn-secondary:hover {
            background: linear-gradient(135deg, #5a6268 0%, #98a1a9 100%);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
        }
        .file-input {
            display: none;
        }
        .info-card {
            background-color: #e9f7fe;
            border-left: 4px solid #0d6efd;
            padding: 1.5rem;
            border-radius: 0.5rem;
            margin-bottom: 2rem;
        }
        .info-icon {
            font-size: 1.5rem;
            color: #0d6efd;
            margin-right: 1rem;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="page-header">
            <div class="header-icon">
                <i class="fas fa-file-upload"></i>
            </div>
            <h1 class="display-5 fw-bold mb-3">Upload Your CV Template</h1>
            <p class="lead fs-4 mb-0">We'll use this template to create tailored versions for each job</p>
        </div>
        
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    <div class="alert alert-{{ category }} alert-dismissible fade show mb-4" role="alert">
                        {{ message }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                    </div>
                {% endfor %}
            {% endif %}
        {% endwith %}
        
        <div class="row justify-content-center">
            <div class="col-md-8">
                <div class="info-card mb-4">
                    <div class="d-flex align-items-center">
                        <div class="info-icon">
                            <i class="fas fa-info-circle"></i>
                        </div>
                        <div>
                            <h5 class="mb-2">Important Information</h5>
                            <p class="mb-0">Please upload a Microsoft Word (.docx) file that will be used as your CV template. Make sure your CV includes sections for skills that can be tailored for each job application.</p>
                        </div>
                    </div>
                </div>
                
                <div class="card">
                    <div class="card-body">
                        <form method="POST" enctype="multipart/form-data" action="{{ url_for('upload_cv') }}">
                            <label for="cv_file" class="upload-area" id="upload-label">
                                <div class="upload-icon">
                                    <i class="fas fa-cloud-upload-alt"></i>
                                </div>
                                <h3 class="upload-text">Drag & Drop your CV here</h3>
                                <p class="upload-hint">or click to browse files</p>
                                <p class="upload-hint text-muted">(Only .docx files are supported)</p>
                            </label>
                            <input type="file" name="cv_file" id="cv_file" class="file-input" accept=".docx" required>
                            
                            <div id="file-selected" class="alert alert-info d-none mb-4">
                                <i class="fas fa-file-word me-2"></i>
                                <span id="file-name">No file selected</span>
                            </div>
                            
                            <div class="d-flex justify-content-between">
                                <a href="{{ url_for('index') }}" class="btn btn-secondary">
                                    <i class="fas fa-arrow-left me-2"></i>Back
                                </a>
                                <button type="submit" class="btn btn-primary">
                                    <i class="fas fa-upload me-2"></i>Upload CV
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const fileInput = document.getElementById('cv_file');
            const uploadLabel = document.getElementById('upload-label');
            const fileSelected = document.getElementById('file-selected');
            const fileName = document.getElementById('file-name');
            
            uploadLabel.addEventListener('click', function() {
                fileInput.click();
            });
            
            fileInput.addEventListener('change', function() {
                if (fileInput.files.length > 0) {
                    fileName.textContent = fileInput.files[0].name;
                    fileSelected.classList.remove('d-none');
                    uploadLabel.style.borderColor = '#0d6efd';
                } else {
                    fileSelected.classList.add('d-none');
                    uploadLabel.style.borderColor = '#dee2e6';
                }
            });
            
            // Drag and drop functionality
            uploadLabel.addEventListener('dragover', function(e) {
                e.preventDefault();
                uploadLabel.style.borderColor = '#0d6efd';
                uploadLabel.style.backgroundColor = '#f1f8ff';
            });
            
            uploadLabel.addEventListener('dragleave', function(e) {
                e.preventDefault();
                uploadLabel.style.borderColor = '#dee2e6';
                uploadLabel.style.backgroundColor = '#f8f9fa';
            });
            
            uploadLabel.addEventListener('drop', function(e) {
                e.preventDefault();
                
                if (e.dataTransfer.files.length > 0) {
                    fileInput.files = e.dataTransfer.files;
                    if (fileInput.files[0].name.endsWith('.docx')) {
                        fileName.textContent = fileInput.files[0].name;
                        fileSelected.classList.remove('d-none');
                    } else {
                        alert('Please upload a .docx file');
                    }
                }
                
                uploadLabel.style.borderColor = '#dee2e6';
                uploadLabel.style.backgroundColor = '#f8f9fa';
            });
        });
    </script>
</body>
</html>