Skip to content

Commit

Permalink
allotment application integrated
Browse files Browse the repository at this point in the history
  • Loading branch information
basil-reji committed May 1, 2023
1 parent f1beb4d commit 3567836
Show file tree
Hide file tree
Showing 10 changed files with 622 additions and 118 deletions.
40 changes: 38 additions & 2 deletions controller/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const contact = {

const candidate = {

viewCanidate: (data) => {
viewCandidate: (data) => {
return new Promise(async (resolve, reject) => {

// let data.lpk_id = data.data.lpk_id;
Expand Down Expand Up @@ -132,8 +132,44 @@ const allotment = {
}
}

const recruiter ={
view: (id) => {
return new Promise(async (resolve, reject) => {

db.get()
.collection(collections.RECRUITERS)
.findOne({
"id": id
})
.then((response) => {
resolve(response)
}).catch((error) => {
reject("Something Went wrong please try again later.")
})
})
},
getPool: (pool) => {
return new Promise(async (resolve, reject) => {

db.get()
.collection(collections.RECRUITERS)
.find({
"pool": pool.toUpperCase()
})
.toArray()
.then((response) => {
console.log(response)
resolve(response)
}).catch((error) => {
reject("Something Went wrong please try again later.")
})
})
}
}

module.exports = {
contact,
candidate,
allotment
allotment,
recruiter
}
53 changes: 50 additions & 3 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ router.get('/results/view', function (req, res, next) {
});

router.post('/results/view', function (req, res, next) {
controller.candidate.viewCanidate(req.body)
controller.candidate.viewCandidate(req.body)
.then((candidate) => {
res.render('pages/view_result',
{
Expand Down Expand Up @@ -140,7 +140,7 @@ router.get('/allotment/apply', function (req, res, next) {
});

router.post('/allotment/apply', function (req, res, next) {
controller.candidate.viewCanidate(req.body)
controller.candidate.viewCandidate(req.body)
.then((candidate) => {
if (candidate.allotment.applied) {
req.session.candidate = null;
Expand All @@ -155,7 +155,7 @@ router.post('/allotment/apply', function (req, res, next) {
});
} else {
req.session.candidate = candidate;
console.log(req.session.candidate);
// console.log(req.session.candidate);
res.render('pages/allotment/application',
{
title: `Allotment Application | ${app_name}`,
Expand All @@ -167,6 +167,7 @@ router.post('/allotment/apply', function (req, res, next) {
}
})
.catch((error) => {
req.flash('message', error);
res.redirect('/allotment/apply');
})
});
Expand Down Expand Up @@ -225,4 +226,50 @@ router.get('/allotment/recruiters', function (req, res, next) {
});
});

//recruiters
router.get('/recruiters', function (req, res, next) {
res.render('pages/recruiters',
{
title: `Recruiters | ${app_name}`,
page_head: 'Recruiters',
page_nav_name: 'Recruiters',
recruiters_page: true,
breadcrumbs: true
});
});

router.get('/recruiters/:id', function (req, res, next) {
controller.recruiter.view(req.params.id)
.then((recruiter) => {
res.render('pages/recruiters/recruiter',
{
title: `Recruiters | ${app_name}`,
page_head: 'Recruiters',
page_nav_name: 'Recruiters',
recruiters_page: true,
breadcrumbs: true,
recruiter
});
})
.catch((error) => {
res.redirect('/recruiters');
})
});

router.get('/recruiters/pool/:pool', function (req, res, next) {
controller.recruiter.getPool(req.params.pool)
.then((pool) => {
res.render('pages/recruiters/pool',
{
title: `Recruiters | ${app_name}`,
page_head: 'Recruiters',
page_nav_name: 'Recruiters',
recruiters_page: true,
breadcrumbs: true,
pool_name: req.params.pool,
pool
});
})
});

module.exports = router;
15 changes: 11 additions & 4 deletions views/pages/allotment.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@
<div class="content">
<h3>Appy for Recruiter Allotment</h3>
<p class="mt-4">
Launchpad Kerala 2023's recruiter allotment process is now open. <strong> If you've been
Launchpad Kerala 2023's recruiter allotment process is now open. All the recruiters
registered for Launchpad Kerala will be divided into four pools.
<strong> If you've been
shortlisted, you can apply for the allotment process using the link provided on the
website.</strong> 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.
website.</strong>
</p>
<p>
<strong style="color: #ff3838;">Applying for the allotment doesn't guarantee that you will be allocated a interview slot.
Based on the options selected, the rank of the candidate, application details, and the
requisites of the applied recruiter pool, a single allotment will be made.</strong> Therefore, it is crucial to read and review the pool and recruiter details
carefully before applying for an allotment. The eligibility of each candidate will also
be rechecked during the offline interviews.
</p>
<p>
<strong>The recruiters are divided into four pools two at Kochi and two at
Expand Down
16 changes: 8 additions & 8 deletions views/pages/allotment/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@
<div class="row justify-content-center align-items-center">

<h5 class="mt-4 mb-2">Recruiter Prefernce</h5>
<div class="col-12 col-md-6">
<div class="col-12">
<div class="form-group">
<label for="active_backlogs">First Preference:</label>
<select name="preference_1" id="preference_1" class="form-control form-select"
required>
<option disabled="disabled" selected="selected"> -- select an option --
</option>
<option value="A">Pool A - Trivandrum</option>
<option value="B">Pool B - Trivandrum</option>
<option value="C">Pool C - Kochi</option>
<option value="D">Pool D - Kochi</option>
<option value="A">Pool A - Technopark, Trivandrum</option>
<option value="B">Pool B - Technopark, Trivandrum</option>
<option value="C">Pool C - Infopark, Kochi</option>
<option value="D">Pool D - Infopark,</option>
</select>
</div>
</div>
<div class="col-12 col-md-6">
<div class="col-12">
<div class="form-group">
<label for="active_backlogs">Second Preference:</label>
<select name="preference_2" id="preference_2" class="form-control form-select"
Expand All @@ -108,7 +108,7 @@
</select>
</div>
</div>
<div class="col-12 col-md-6">
<div class="col-12">
<div class="form-group">
<label for="active_backlogs">Third Preference:</label>
<select name="preference_3" id="preference_3" class="form-control form-select"
Expand All @@ -117,7 +117,7 @@
</select>
</div>
</div>
<div class="col-12 col-md-6">
<div class="col-12">
<div class="form-group">
<label for="active_backlogs">Fourth Preference:</label>
<select name="preference_4" id="preference_4" class="form-control form-select"
Expand Down
Loading

0 comments on commit 3567836

Please sign in to comment.