diff --git a/controller/user.js b/controller/user.js index 35f7856..ed38bb0 100644 --- a/controller/user.js +++ b/controller/user.js @@ -34,6 +34,54 @@ const candidate = { data.lpk_id = data.lpk_id.substring(0, 8); } + if (String(data.lpk_id.length) == 8 && data.lpk_id.includes("LPK1")) { + db.get() + .collection(collections.CANDIDATES) + .findOne({ + "id": data.lpk_id + }) + .then((response) => { + // console.log(response) + if (response) { + if(data.email.startsWith(" ")){ + data.email = data.email.substring(1); + } + if(data.email.endsWith(" ")){ + data.email = data.email.substring(0, 8); + } + if(response.email == data.email) { + resolve(response) + }else if(response.other_email.original == data.email){ + resolve(response) + }else if(response.other_email.corrected == data.email){ + resolve(response) + }else if(response.other_email.hackerearth == data.email){ + resolve(response) + }else{ + reject("Please enter the correct email address.") + } + } else { + reject("We regret to inform you that we are unable to proceed with your application to the next round. We wish you all the best for your future endeavors.") + } + }).catch((error) => { + reject(error) + }) + } else { + reject("Please enter a valid Launchpad Kerala ID.") + } + }) + }, + + view: (data) => { + return new Promise(async (resolve, reject) => { + + if(data.lpk_id.startsWith(" ")){ + data.lpk_id = data.lpk_id.substring(1); + } + if(data.lpk_id.endsWith(" ")){ + data.lpk_id = data.lpk_id.substring(0, 8); + } + if (String(data.lpk_id.length) == 8 && data.lpk_id.includes("LPK1")) { db.get() .collection(collections.CANDIDATES) diff --git a/routes/index.js b/routes/index.js index f9ef5dc..6cdcc53 100644 --- a/routes/index.js +++ b/routes/index.js @@ -8,116 +8,155 @@ var app_name = 'Launchpad Kerala' /* GET home page. */ router.get('/', (req, res, next) => { - let user = req.user - // console.log(req.user); - if (user && user.permissions.admin) { - res.redirect('/admin/') - } else { - res.render('index', { - title: app_name, - home_page: true - }); - } + let user = req.user + // console.log(req.user); + if (user && user.permissions.admin) { + res.redirect('/admin/') + } else { + res.render('index', { + title: app_name, + home_page: true + }); + } }); router.get('/contact', (req, res, next) => { - let user = req.user; - res.render('pages/contact', { - title: `Test Page | ${app_name}`, - user - }); + let user = req.user; + res.render('pages/contact', { + title: `Test Page | ${app_name}`, + user + }); }); router.post('/contact', (req, res, next) => { - let user = req.user; - if (user) { - req.body.user = user.id; - } else { - req.body.user = null; - } - console.log(req.body) - controller.contact.message(req.body) - .then((response) => { - res.send( - { - response: "acknowledged", - status: true - } - ); - }) - .catch((error) => { - res.send( - { - error, - status: false - } - ); - }) + let user = req.user; + if (user) { + req.body.user = user.id; + } else { + req.body.user = null; + } + // console.log(req.body) + controller.contact.message(req.body) + .then((response) => { + res.send( + { + response: "acknowledged", + status: true + } + ); + }) + .catch((error) => { + res.send( + { + error, + status: false + } + ); + }) }); router.get('/updates', function (req, res, next) { - res.render('updates', - { - title: `Updates | ${app_name}`, - page_head: 'News & Updates', - page_nav_name: 'Updates', - breadcrumbs: true, - updates_page: true - }); + res.render('updates', + { + title: `Updates | ${app_name}`, + page_head: 'News & Updates', + page_nav_name: 'Updates', + breadcrumbs: true, + updates_page: true + }); }); router.get('/privacy-policy', function (req, res, next) { - res.render('pages/privacy_policy', - { - title: `User Pricay Policy | ${app_name}`, - page_head: 'User Pricay Policy', - page_nav_name: 'pricay policy' - }); + res.render('pages/privacy_policy', + { + title: `User Pricay Policy | ${app_name}`, + page_head: 'User Pricay Policy', + page_nav_name: 'pricay policy' + }); }); router.get('/results', function (req, res, next) { - res.render('pages/results', - { - title: `Results | ${app_name}`, - page_head: 'Results', - page_nav_name: 'Results', - reults_page: true - }); + res.render('pages/results', + { + title: `Results | ${app_name}`, + page_head: 'Results', + page_nav_name: 'Results', + reults_page: true + }); }); router.get('/results/view', function (req, res, next) { - let message = req.flash('message'); - res.render('pages/result', - { - title: `Results | ${app_name}`, - page_head: 'Results', - page_nav_name: 'Results', - reults_page: true, - no_preloader: true, - message, - }); + let message = req.flash('message'); + res.render('pages/result', + { + title: `Results | ${app_name}`, + page_head: 'Results', + page_nav_name: 'Results', + reults_page: true, + no_preloader: true, + message, + }); }); router.post('/results/view', function (req, res, next) { - // console.log(req.body); - controller.candidate.viewResult(req.body) - .then((candidate) => { - // res.redirect('/results/view'); - res.render('pages/view_result', + controller.candidate.view(req.body) + .then((candidate) => { + res.render('pages/view_result', + { + title: `View Result | ${app_name}`, + page_head: 'Results', + page_nav_name: 'Results', + reults_page: true, + candidate + }); + }) + .catch((error) => { + req.flash('message', error); + res.redirect('/results/view'); + }) +}); + +router.get('/allotment', function (req, res, next) { + res.render('pages/allotment', + { + title: `Allotment | ${app_name}`, + page_head: 'Allotment', + page_nav_name: 'Allotment', + allotment_page: true + }); +}); + +router.get('/allotment/apply', function (req, res, next) { + let message = req.flash('message'); + res.render('pages/allotment/apply', + { + title: `Allotment Application| ${app_name}`, + page_head: 'Allotment', + page_nav_name: 'Allotment', + allotment_page: true, + message + }); +}); + +router.post('/allotment/apply', function (req, res, next) { + res.render('pages/allotment/apply', + { + title: `Allotment Application | ${app_name}`, + page_head: 'Allotment', + page_nav_name: 'Allotment', + allotment_page: true + }); +}); + +router.get('/allotment/recruiters', function (req, res, next) { + res.render('pages/allotment/recruiters', { - title: `View Result |${app_name}`, - page_head: 'Results', - page_nav_name: 'Results', - reults_page: true, - candidate + title: `Allotment | ${app_name}`, + page_head: 'Allotment', + page_nav_name: 'Allotment', + allotment_page: true }); - }) - .catch((error) => { - // console.log(error); - req.flash('message', error); - res.redirect('/results/view'); - }) }); module.exports = router; \ No newline at end of file diff --git a/views/admin/dashboard.hbs b/views/admin/dashboard.hbs index b71265a..77211c1 100644 --- a/views/admin/dashboard.hbs +++ b/views/admin/dashboard.hbs @@ -78,6 +78,82 @@ +
+ +
+ +
+
+
Total | Test Attendees
+ +
+
+ +
+
+
2509
+
+
+
+
+ +
+
+ +
+
+
Analytical | Test Attendees
+ +
+
+ +
+
+
2484
+
+
+
+
+ +
+
+ +
+
+
Programming | Test Attendees
+ +
+
+ +
+
+
2106
+
+
+
+
+ +
+
+ +
+
+
shortlisted Candidates
+ +
+
+ +
+
+
1000
+
+
+
+
+ +
+ +
diff --git a/views/pages/allotment.hbs b/views/pages/allotment.hbs new file mode 100644 index 0000000..ab77f27 --- /dev/null +++ b/views/pages/allotment.hbs @@ -0,0 +1,103 @@ +
+
+ +
+
+
+ +
+
+

Appy for Recruiter Allotment

+

+ Launchpad Kerala 2023's recruiter allotment process is now open. If you've been + shortlisted, you can apply for the allotment process using the link provided on the + website. Keep in mind that only one allotment will be made based on your + options, rank, + application details, and the requirements of the recruiter pool you've applied for. +

+

+ The recruiters are divided into four pools two at Kochi and two at + Trivandrum. You can + prioritize your preferred pool based on location and preference when you apply for + allotment. However, attending offline interviews is + mandatory, and failure to do so will + result in blacklisting or suspension from future events. +

+

Make sure to review each pool and its recruiters' details before applying for + allotment. + Keep in mind that the allotment is based on the requirements of the companies in the + pools, and there's no guarantee that you'll be able to attend all companies in + the + allotted pool. Your eligibility will be rechecked at the time of offline + interviews. +

+

+ Remember to carefully review each pool and its recruiters, prioritize your preferred + pool based on location and preference, attend offline interviews, and keep in mind that + the allotment is based on the requirements of the companies in the + pools. +

+
 Best of luck!
+
+ +
+ +
+
+
+
+ +
+
+

Errors While Applying?

+

+ + Only qualified candidates are able to apply for the allotment process. If you are + not qualified, you will not be able to apply for allotment. + +

+

+ If you encounter errors while searching for your results, it could be due to an + incorrect launchpad ID. Make sure to enter your launchpad ID carefully without any white + spaces or special characters. +

+

In case you have forgotten your launchpad ID, refer to previous emails from Team + Launchpad Kerala at team@launchpadkerala.org to retrieve your ID.

+
+
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/views/pages/allotment/apply.hbs b/views/pages/allotment/apply.hbs new file mode 100644 index 0000000..fc7309f --- /dev/null +++ b/views/pages/allotment/apply.hbs @@ -0,0 +1,38 @@ +
+
+ +
+
+
+
+

Appy for Recruiter Allotment

+
+ {{#if message}}

{{message}}

{{/if}} +
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/views/pages/allotment/recruiters.hbs b/views/pages/allotment/recruiters.hbs new file mode 100644 index 0000000..2ad123b --- /dev/null +++ b/views/pages/allotment/recruiters.hbs @@ -0,0 +1,223 @@ +
+
+ +
+
+
+ +
+
+

Appy for Recruiter Allotment

+

+ Remember to carefully review each pool and its recruiters, prioritize your preferred + pool based on location and preference, attend offline interviews, and keep in mind that + the allotment is based on the requirements of the companies in the + pools. +

+
+
+ +
+
+
+
+ +
+
+

Pool A - Trivandrum

+
    +
  • + +
    Recruiter 1
    +
  • +
  • + +
    Recruiter 2
    +
  • +
  • + +
    Recruiter 3
    +
  • +
  • + +
    Recruiter 4
    +
  • +
  • + +
    Recruiter 5
    +
  • +
  • + +
    Recruiter 6
    +
  • +
  • + +
    Recruiter 7
    +
  • +
+
+
+ +
+
+
+
+ +
+
+

Pool D - Trivandrum

+
    +
  • + +
    Recruiter 1
    +
  • +
  • + +
    Recruiter 2
    +
  • +
  • + +
    Recruiter 3
    +
  • +
  • + +
    Recruiter 4
    +
  • +
  • + +
    Recruiter 5
    +
  • +
  • + +
    Recruiter 6
    +
  • +
  • + +
    Recruiter 7
    +
  • +
+
+
+ +
+
+
+
+ +
+
+

Pool C - Kochi

+
    +
  • + +
    Recruiter 1
    +
  • +
  • + +
    Recruiter 2
    +
  • +
  • + +
    Recruiter 3
    +
  • +
  • + +
    Recruiter 4
    +
  • +
  • + +
    Recruiter 5
    +
  • +
  • + +
    Recruiter 6
    +
  • +
  • + +
    Recruiter 7
    +
  • +
+
+
+ +
+
+
+
+ +
+
+

Pool D - Kochi

+
    +
  • + +
    Recruiter 1
    +
  • +
  • + +
    Recruiter 2
    +
  • +
  • + +
    Recruiter 3
    +
  • +
  • + +
    Recruiter 4
    +
  • +
  • + +
    Recruiter 5
    +
  • +
  • + +
    Recruiter 6
    +
  • +
  • + +
    Recruiter 7
    +
  • +
+
+
+ +
+
+ +
+
+ +
+
+

+ + Please review the pools and make your choice. Once it has been submitted it can't + be changed. + +

+
 Best of luck!
+
+ +
+ +
+
+
+ +
+
\ No newline at end of file