Skip to content

Commit 02c6466

Browse files
authored
Merge branch 'main' into update_jatin
2 parents ea237c3 + 7cf1939 commit 02c6466

File tree

3 files changed

+37
-16
lines changed
  • jobsdoor360-website/src/main/ejs/main-files/myaccount/cv_upload
  • staticfiles/mainfiles

3 files changed

+37
-16
lines changed
Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<title>CV Upload</title>
5-
<link rel="stylesheet" href="/staticfiles/mainfiles/myaccount/cv_upload/style.css">
4+
<title>Cv upload</title>
5+
<link
6+
rel="stylesheet"
7+
href="/staticfiles/mainfiles/myaccount/cv_upload/style.css"
8+
/>
69
<%- include('../../../partials/head.ejs') %>
7-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css">
10+
<link
11+
rel="stylesheet"
12+
type="text/css"
13+
href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css"
14+
/>
815
</head>
916
<body>
1017
<%- include('../../../partials/navbar.ejs') %>
11-
<div class="d-flex justify-content-center align-items-center flex-column gap-4" style="margin-block: 100px">
18+
<div
19+
class="d-flex justify-content-center align-items-center flex-column gap-4"
20+
style="margin-block: 100px"
21+
>
1222
<h2>UPLOAD YOUR RESUME</h2>
13-
<form class="d-flex flex-column justify-content-center gap-3" onsubmit="return false;">
23+
<form action="" class="d-flex flex-column justify-content-center gap-3">
1424
<div class="d-flex justify-content-center flex-column">
1525
<input
1626
id="cv"
1727
type="file"
1828
class="form-control cv"
19-
accept=".pdf,.doc,.docx"
29+
accept="cv/*"
2030
required
2131
/>
2232
<span class="form-text"></span>
@@ -33,9 +43,13 @@
3343
</form>
3444
</div>
3545
<%- include('../../../partials/footer.ejs') %>
36-
37-
<!-- Firebase -->
38-
<script type="module" src="/staticfiles/mainfiles/myaccount/cv_upload/script.js"></script>
39-
<script src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
46+
<script
47+
type="module"
48+
src="/staticfiles/mainfiles/myaccount/cv_upload/script.js"
49+
></script>
50+
<script
51+
type="text/javascript"
52+
src="https://cdn.jsdelivr.net/npm/toastify-js"
53+
></script>
4054
</body>
4155
</html>

staticfiles/mainfiles/myaccount/cv_upload/script.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
getDownloadURL
1919
} from "firebase/storage";
2020

21-
// Firebase initialization (you must already have this in your main project setup)
21+
// Firebase initialization
2222
const auth = getAuth();
2323
const db = getFirestore();
2424
const storage = getStorage();
@@ -31,7 +31,6 @@ onAuthStateChanged(auth, (user) => {
3131
userEmail = user.email;
3232
} else {
3333
console.log("No user is signed in");
34-
// Redirect to login with return URL
3534
const currentUrl = encodeURIComponent(window.location.href);
3635
window.location.href = `/login/?redirect_url=${currentUrl}`;
3736
}
@@ -52,7 +51,11 @@ async function saveCVToDatabase() {
5251
const file = fileInput.files[0];
5352

5453
if (!file) {
55-
Toastify({ text: "Please select a file", duration: 3000, style: { background: "red" } }).showToast();
54+
Toastify({
55+
text: "Please select a file",
56+
duration: 3000,
57+
style: { background: "red" }
58+
}).showToast();
5659
return;
5760
}
5861

@@ -62,8 +65,8 @@ async function saveCVToDatabase() {
6265
try {
6366
const cvUrl = await uploadCV(file);
6467
const userRef = doc(db, "user_profile", userEmail);
65-
6668
const userSnap = await getDoc(userRef);
69+
6770
if (!userSnap.exists()) {
6871
await setDoc(userRef, { about: {} });
6972
}
@@ -90,7 +93,11 @@ async function saveCVToDatabase() {
9093

9194
} catch (err) {
9295
console.error("Upload failed:", err);
93-
Toastify({ text: "Upload failed", duration: 3000, style: { background: "red" } }).showToast();
96+
Toastify({
97+
text: "Upload failed",
98+
duration: 3000,
99+
style: { background: "red" }
100+
}).showToast();
94101
}
95102

96103
uploadButton.disabled = false;

staticfiles/mainfiles/signup/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ signupForm.addEventListener("submit", async (e) => {
4848
await sendEmailVerification(auth.currentUser);
4949

5050
window.location.href = "/resend_email_verification/";
51-
} catch (error) {.
51+
} catch (error) {
5252
alert("Error signing up: " + error.message);
5353
} finally {
5454
signupButton.innerHTML = "Sign Up";

0 commit comments

Comments
 (0)