Skip to content

Commit dbb300c

Browse files
committed
fixed personalprofile and jobprofile bugs
1 parent 462e9f1 commit dbb300c

File tree

58 files changed

+697
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+697
-74
lines changed

about/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,17 @@ <h5 class="modal-title" id="exampleModalLabel">
457457
const welcomeText = document.getElementById("welcome-text");
458458
const userMail = document.getElementById("user-mail");
459459

460+
461+
460462
if (user) {
461463
// Save email to localStorage
462464
localStorage.setItem("email", user.email);
465+
const userProfileRef = doc(db, "user_profile", user.email);
466+
const docSnap = await getDoc(userProfileRef);
467+
let name = "";
468+
if(docSnap.exists()){
469+
name = docSnap.data().about.firstname + " " + docSnap.data().about.lastname || "";
470+
}
463471

464472
// Hide the signup button and show "Logout"
465473
document.getElementById("login-button").innerHTML = "Logout";
@@ -487,7 +495,10 @@ <h5 class="modal-title" id="exampleModalLabel">
487495
localStorage.setItem("username", username);
488496

489497
// Update welcome text with the username
490-
if(username)
498+
if(name){
499+
welcomeText.innerHTML = `Hii, ${name}`;
500+
}
501+
else if(username)
491502
welcomeText.innerHTML = `Hii, ${username}`;
492503
else{
493504
userMail.innerHTML = username; // Optionally update email

admin/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,17 @@ <h5 class="modal-title" id="exampleModalLabel">
421421
const welcomeText = document.getElementById("welcome-text");
422422
const userMail = document.getElementById("user-mail");
423423

424+
425+
424426
if (user) {
425427
// Save email to localStorage
426428
localStorage.setItem("email", user.email);
429+
const userProfileRef = doc(db, "user_profile", user.email);
430+
const docSnap = await getDoc(userProfileRef);
431+
let name = "";
432+
if(docSnap.exists()){
433+
name = docSnap.data().about.firstname + " " + docSnap.data().about.lastname || "";
434+
}
427435

428436
// Hide the signup button and show "Logout"
429437
document.getElementById("login-button").innerHTML = "Logout";
@@ -451,7 +459,10 @@ <h5 class="modal-title" id="exampleModalLabel">
451459
localStorage.setItem("username", username);
452460

453461
// Update welcome text with the username
454-
if(username)
462+
if(name){
463+
welcomeText.innerHTML = `Hii, ${name}`;
464+
}
465+
else if(username)
455466
welcomeText.innerHTML = `Hii, ${username}`;
456467
else{
457468
userMail.innerHTML = username; // Optionally update email

apply/cv_upload/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,17 @@ <h5 class="modal-title" id="exampleModalLabel">
477477
const welcomeText = document.getElementById("welcome-text");
478478
const userMail = document.getElementById("user-mail");
479479

480+
481+
480482
if (user) {
481483
// Save email to localStorage
482484
localStorage.setItem("email", user.email);
485+
const userProfileRef = doc(db, "user_profile", user.email);
486+
const docSnap = await getDoc(userProfileRef);
487+
let name = "";
488+
if(docSnap.exists()){
489+
name = docSnap.data().about.firstname + " " + docSnap.data().about.lastname || "";
490+
}
483491

484492
// Hide the signup button and show "Logout"
485493
document.getElementById("login-button").innerHTML = "Logout";
@@ -507,7 +515,10 @@ <h5 class="modal-title" id="exampleModalLabel">
507515
localStorage.setItem("username", username);
508516

509517
// Update welcome text with the username
510-
if(username)
518+
if(name){
519+
welcomeText.innerHTML = `Hii, ${name}`;
520+
}
521+
else if(username)
511522
welcomeText.innerHTML = `Hii, ${username}`;
512523
else{
513524
userMail.innerHTML = username; // Optionally update email

apply/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,17 @@ <h5 class="modal-title" id="exampleModalLabel">
552552
const welcomeText = document.getElementById("welcome-text");
553553
const userMail = document.getElementById("user-mail");
554554

555+
556+
555557
if (user) {
556558
// Save email to localStorage
557559
localStorage.setItem("email", user.email);
560+
const userProfileRef = doc(db, "user_profile", user.email);
561+
const docSnap = await getDoc(userProfileRef);
562+
let name = "";
563+
if(docSnap.exists()){
564+
name = docSnap.data().about.firstname + " " + docSnap.data().about.lastname || "";
565+
}
558566

559567
// Hide the signup button and show "Logout"
560568
document.getElementById("login-button").innerHTML = "Logout";
@@ -582,7 +590,10 @@ <h5 class="modal-title" id="exampleModalLabel">
582590
localStorage.setItem("username", username);
583591

584592
// Update welcome text with the username
585-
if(username)
593+
if(name){
594+
welcomeText.innerHTML = `Hii, ${name}`;
595+
}
596+
else if(username)
586597
welcomeText.innerHTML = `Hii, ${username}`;
587598
else{
588599
userMail.innerHTML = username; // Optionally update email

apply/thanks/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,17 @@ <h5 class="modal-title" id="exampleModalLabel">
411411
const welcomeText = document.getElementById("welcome-text");
412412
const userMail = document.getElementById("user-mail");
413413

414+
415+
414416
if (user) {
415417
// Save email to localStorage
416418
localStorage.setItem("email", user.email);
419+
const userProfileRef = doc(db, "user_profile", user.email);
420+
const docSnap = await getDoc(userProfileRef);
421+
let name = "";
422+
if(docSnap.exists()){
423+
name = docSnap.data().about.firstname + " " + docSnap.data().about.lastname || "";
424+
}
417425

418426
// Hide the signup button and show "Logout"
419427
document.getElementById("login-button").innerHTML = "Logout";
@@ -441,7 +449,10 @@ <h5 class="modal-title" id="exampleModalLabel">
441449
localStorage.setItem("username", username);
442450

443451
// Update welcome text with the username
444-
if(username)
452+
if(name){
453+
welcomeText.innerHTML = `Hii, ${name}`;
454+
}
455+
else if(username)
445456
welcomeText.innerHTML = `Hii, ${username}`;
446457
else{
447458
userMail.innerHTML = username; // Optionally update email

biographies/BillGates.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,17 @@ <h5 class="modal-title" id="exampleModalLabel">
548548
const welcomeText = document.getElementById("welcome-text");
549549
const userMail = document.getElementById("user-mail");
550550

551+
552+
551553
if (user) {
552554
// Save email to localStorage
553555
localStorage.setItem("email", user.email);
556+
const userProfileRef = doc(db, "user_profile", user.email);
557+
const docSnap = await getDoc(userProfileRef);
558+
let name = "";
559+
if(docSnap.exists()){
560+
name = docSnap.data().about.firstname + " " + docSnap.data().about.lastname || "";
561+
}
554562

555563
// Hide the signup button and show "Logout"
556564
document.getElementById("login-button").innerHTML = "Logout";
@@ -578,7 +586,10 @@ <h5 class="modal-title" id="exampleModalLabel">
578586
localStorage.setItem("username", username);
579587

580588
// Update welcome text with the username
581-
if(username)
589+
if(name){
590+
welcomeText.innerHTML = `Hii, ${name}`;
591+
}
592+
else if(username)
582593
welcomeText.innerHTML = `Hii, ${username}`;
583594
else{
584595
userMail.innerHTML = username; // Optionally update email

biographies/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,17 @@ <h5 class="modal-title" id="exampleModalLabel">
544544
const welcomeText = document.getElementById("welcome-text");
545545
const userMail = document.getElementById("user-mail");
546546

547+
548+
547549
if (user) {
548550
// Save email to localStorage
549551
localStorage.setItem("email", user.email);
552+
const userProfileRef = doc(db, "user_profile", user.email);
553+
const docSnap = await getDoc(userProfileRef);
554+
let name = "";
555+
if(docSnap.exists()){
556+
name = docSnap.data().about.firstname + " " + docSnap.data().about.lastname || "";
557+
}
550558

551559
// Hide the signup button and show "Logout"
552560
document.getElementById("login-button").innerHTML = "Logout";
@@ -574,7 +582,10 @@ <h5 class="modal-title" id="exampleModalLabel">
574582
localStorage.setItem("username", username);
575583

576584
// Update welcome text with the username
577-
if(username)
585+
if(name){
586+
welcomeText.innerHTML = `Hii, ${name}`;
587+
}
588+
else if(username)
578589
welcomeText.innerHTML = `Hii, ${username}`;
579590
else{
580591
userMail.innerHTML = username; // Optionally update email

biographies/swami.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,17 @@ <h5 class="modal-title" id="exampleModalLabel">
525525
const welcomeText = document.getElementById("welcome-text");
526526
const userMail = document.getElementById("user-mail");
527527

528+
529+
528530
if (user) {
529531
// Save email to localStorage
530532
localStorage.setItem("email", user.email);
533+
const userProfileRef = doc(db, "user_profile", user.email);
534+
const docSnap = await getDoc(userProfileRef);
535+
let name = "";
536+
if(docSnap.exists()){
537+
name = docSnap.data().about.firstname + " " + docSnap.data().about.lastname || "";
538+
}
531539

532540
// Hide the signup button and show "Logout"
533541
document.getElementById("login-button").innerHTML = "Logout";
@@ -555,7 +563,10 @@ <h5 class="modal-title" id="exampleModalLabel">
555563
localStorage.setItem("username", username);
556564

557565
// Update welcome text with the username
558-
if(username)
566+
if(name){
567+
welcomeText.innerHTML = `Hii, ${name}`;
568+
}
569+
else if(username)
559570
welcomeText.innerHTML = `Hii, ${username}`;
560571
else{
561572
userMail.innerHTML = username; // Optionally update email

businessplans/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,17 @@ <h5 class="modal-title" id="exampleModalLabel">
490490
const welcomeText = document.getElementById("welcome-text");
491491
const userMail = document.getElementById("user-mail");
492492

493+
494+
493495
if (user) {
494496
// Save email to localStorage
495497
localStorage.setItem("email", user.email);
498+
const userProfileRef = doc(db, "user_profile", user.email);
499+
const docSnap = await getDoc(userProfileRef);
500+
let name = "";
501+
if(docSnap.exists()){
502+
name = docSnap.data().about.firstname + " " + docSnap.data().about.lastname || "";
503+
}
496504

497505
// Hide the signup button and show "Logout"
498506
document.getElementById("login-button").innerHTML = "Logout";
@@ -520,7 +528,10 @@ <h5 class="modal-title" id="exampleModalLabel">
520528
localStorage.setItem("username", username);
521529

522530
// Update welcome text with the username
523-
if(username)
531+
if(name){
532+
welcomeText.innerHTML = `Hii, ${name}`;
533+
}
534+
else if(username)
524535
welcomeText.innerHTML = `Hii, ${username}`;
525536
else{
526537
userMail.innerHTML = username; // Optionally update email

buyproject/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,17 @@ <h5 class="modal-title" id="exampleModalLabel">
525525
const welcomeText = document.getElementById("welcome-text");
526526
const userMail = document.getElementById("user-mail");
527527

528+
529+
528530
if (user) {
529531
// Save email to localStorage
530532
localStorage.setItem("email", user.email);
533+
const userProfileRef = doc(db, "user_profile", user.email);
534+
const docSnap = await getDoc(userProfileRef);
535+
let name = "";
536+
if(docSnap.exists()){
537+
name = docSnap.data().about.firstname + " " + docSnap.data().about.lastname || "";
538+
}
531539

532540
// Hide the signup button and show "Logout"
533541
document.getElementById("login-button").innerHTML = "Logout";
@@ -555,7 +563,10 @@ <h5 class="modal-title" id="exampleModalLabel">
555563
localStorage.setItem("username", username);
556564

557565
// Update welcome text with the username
558-
if(username)
566+
if(name){
567+
welcomeText.innerHTML = `Hii, ${name}`;
568+
}
569+
else if(username)
559570
welcomeText.innerHTML = `Hii, ${username}`;
560571
else{
561572
userMail.innerHTML = username; // Optionally update email

0 commit comments

Comments
 (0)