Reformatted Code and Optimized Imports
This commit is contained in:
parent
af449eeaa7
commit
20a570e842
|
@ -1,17 +1,14 @@
|
|||
from django.contrib import admin
|
||||
from .models import *
|
||||
from django.contrib import admin
|
||||
from django.contrib.admin.templatetags.admin_urls import admin_urlname
|
||||
from django.shortcuts import resolve_url
|
||||
from django.utils.html import format_html
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
from .models import *
|
||||
|
||||
admin.site.register(User)
|
||||
admin.site.register(Admin)
|
||||
|
||||
|
||||
|
||||
admin.site.site_header = "CDC Recruitment Portal"
|
||||
|
||||
|
||||
|
@ -22,10 +19,21 @@ def model_admin_url(obj, name=None) -> str:
|
|||
|
||||
@admin.register(Student)
|
||||
class Student(admin.ModelAdmin):
|
||||
list_display = ("roll_no", "name", "batch", "branch", "phone_number")
|
||||
search_fields = ("roll_no", "name","phone_number")
|
||||
list_display = ("roll_no", "name", "batch", "branch", "phone_number", 'can_apply')
|
||||
search_fields = ("roll_no", "name", "phone_number")
|
||||
ordering = ("roll_no", "name", "batch", "branch", "phone_number")
|
||||
list_filter = ("batch", "branch")
|
||||
actions = ['mark_can_apply_as_no', 'mark_can_apply_as_yes']
|
||||
|
||||
@admin.action(description="Deregister students")
|
||||
def mark_can_apply_as_no(self, request, queryset):
|
||||
queryset.update(can_apply=False)
|
||||
self.message_user(request, "Deregistered the users")
|
||||
|
||||
@admin.action(description="Register students")
|
||||
def mark_can_apply_as_yes(self, request, queryset):
|
||||
queryset.update(can_apply=True)
|
||||
self.message_user(request, "Registered the users")
|
||||
|
||||
|
||||
@admin.register(Placement)
|
||||
|
@ -52,11 +60,10 @@ class PlacementApplication(admin.ModelAdmin):
|
|||
|
||||
@admin.register(PrePlacementOffer)
|
||||
class PrePlacementOffer(admin.ModelAdmin):
|
||||
list_display = ('company', 'Student', 'accepted')
|
||||
list_display = ('company', 'Student', 'accepted')
|
||||
search_fields = ('company',)
|
||||
ordering = ('company',)
|
||||
list_filter = ('accepted',)
|
||||
|
||||
def Student(self, obj):
|
||||
return model_admin_url(obj.student)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.urls import path
|
||||
from . import adminViews
|
||||
|
||||
from . import adminViews
|
||||
|
||||
urlpatterns = [
|
||||
path('markStatus/', adminViews.markStatus, name="Mark Status"),
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import csv
|
||||
import json
|
||||
|
||||
from rest_framework.decorators import api_view
|
||||
|
||||
|
@ -306,6 +305,7 @@ def generateCSV(request, id, email, user_type):
|
|||
return Response({'action': "Create csv", 'message': "Error Occurred"},
|
||||
status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
|
||||
@api_view(['POST'])
|
||||
@isAuthorized(allowed_users=[ADMIN])
|
||||
@precheck(required_data=[COMPANY_NAME, COMPENSATION_GROSS, OFFER_ACCEPTED, STUDENT_ID, DESIGNATION, TIER])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.urls import path
|
||||
from . import companyViews
|
||||
|
||||
from . import companyViews
|
||||
|
||||
urlpatterns = [
|
||||
path('addPlacement/', companyViews.addPlacement, name="Add Placement"),
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
from rest_framework.decorators import api_view
|
||||
from django.forms.models import model_to_dict
|
||||
|
||||
from .models import *
|
||||
from .utils import *
|
||||
|
||||
logger = logging.getLogger('db')
|
||||
|
|
|
@ -39,7 +39,7 @@ TOTAL_BATCHES = 4 # Total No of Batches
|
|||
CLIENT_ID = "956830229554-290mirc16pdhd5j7ph7v7ukibo4t1qcp.apps.googleusercontent.com" # Google Login Client ID
|
||||
|
||||
# To be Configured Properly
|
||||
PLACEMENT_OPENING_URL = "https://www.googleapis.com/auth/adwords/{id}" # On frontend, this is the URL to be opened
|
||||
PLACEMENT_OPENING_URL = "https://www.googleapis.com/auth/adwords/{id}" # On frontend, this is the URL to be opened
|
||||
LINK_TO_STORAGE_COMPANY_ATTACHMENT = "http://localhost/storage/Company_Attachments/"
|
||||
LINK_TO_STORAGE_RESUME = "http://localhost/storage/Resumes/"
|
||||
LINK_TO_APPLICATIONS_CSV = "http://localhost/storage/Application_CSV/"
|
||||
|
@ -54,8 +54,7 @@ TIER = 'tier'
|
|||
# To be Configured Properly
|
||||
FOURTH_YEAR = '2019'
|
||||
MAX_OFFERS_PER_STUDENT = 2
|
||||
EMAIL_VERIFICATION_TOKEN_TTL = 48 # in hours
|
||||
|
||||
EMAIL_VERIFICATION_TOKEN_TTL = 48 # in hours
|
||||
|
||||
STORAGE_DESTINATION_RESUMES = "./Storage/Resumes/"
|
||||
STORAGE_DESTINATION_COMPANY_ATTACHMENTS = './Storage/Company_Attachments/'
|
||||
|
@ -88,7 +87,6 @@ STATE = 'state'
|
|||
COUNTRY = 'country'
|
||||
PINCODE = 'pincode'
|
||||
|
||||
|
||||
DESIGNATION = 'designation'
|
||||
DESCRIPTION = 'description'
|
||||
DESCRIPTION_PDF = 'description_pdf'
|
||||
|
@ -123,7 +121,6 @@ STUDENT_LIST = "student_list"
|
|||
STUDENT_ID = "student_id"
|
||||
STUDENT_SELECTED = "student_selected"
|
||||
|
||||
|
||||
COMPANY_OPENING_SUBMITTED_TEMPLATE_SUBJECT = "Notification Submitted - {id} - Career Development Cell, IIT Dharwad"
|
||||
STUDENT_APPLICATION_STATUS_TEMPLATE_SUBJECT = 'Application Status : {company_name} - {id}'
|
||||
STUDENT_APPLICATION_SUBMITTED_TEMPLATE_SUBJECT = 'CDC - Application Submitted - {company_name}'
|
||||
|
@ -139,4 +136,4 @@ COMPANY_JNF_RESPONSE_TEMPLATE = 'company_jnf_response.html'
|
|||
APPLICATION_CSV_COL_NAMES = ['Applied At', 'Roll No.', 'Name', 'Email', 'Phone Number', 'Branch', 'Batch', 'CPI',
|
||||
'Resume', 'Selected', ]
|
||||
|
||||
PDF_FILES_SERVING_ENDPOINT = 'http://localhost:5500/CDC_Backend/Storage/Company_Attachments/' # TODO: Change this to actual URL
|
||||
PDF_FILES_SERVING_ENDPOINT = 'http://localhost:5500/CDC_Backend/Storage/Company_Attachments/' # TODO: Change this to actual URL
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
from django.contrib.postgres.fields import ArrayField
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from .constants import *
|
||||
# from .utils import *
|
||||
|
||||
from .constants import *
|
||||
|
||||
|
||||
# from .utils import *
|
||||
|
||||
|
||||
class User(models.Model):
|
||||
email = models.CharField(primary_key=True, blank=False, max_length=50)
|
||||
id = models.CharField(blank=False, max_length=25)
|
||||
user_type = ArrayField(models.CharField(blank=False, max_length=10), size=4, default=list, blank=False)
|
||||
last_login_time = models.DateTimeField(default=timezone.now)
|
||||
|
||||
|
||||
class Student(models.Model):
|
||||
|
@ -21,7 +24,7 @@ class Student(models.Model):
|
|||
phone_number = models.PositiveBigIntegerField(blank=True, default=None, null=True)
|
||||
resumes = ArrayField(models.CharField(null=True, default=None, max_length=100), size=10, default=list, blank=True)
|
||||
cpi = models.DecimalField(decimal_places=2, max_digits=4)
|
||||
can_apply = models.BooleanField(default=True)
|
||||
can_apply = models.BooleanField(default=True, verbose_name='Registered')
|
||||
|
||||
def __str__(self):
|
||||
return str(self.roll_no)
|
||||
|
@ -45,7 +48,8 @@ class Placement(models.Model):
|
|||
nature_of_business = models.CharField(blank=False, max_length=50, default="")
|
||||
website = models.CharField(blank=True, max_length=50)
|
||||
company_details = models.CharField(max_length=500, default=None, null=True)
|
||||
company_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5, default=list, blank=True)
|
||||
company_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5,
|
||||
default=list, blank=True)
|
||||
is_company_details_pdf = models.BooleanField(blank=False, default=False)
|
||||
contact_person_name = models.CharField(blank=False, max_length=50)
|
||||
phone_number = models.PositiveBigIntegerField(blank=False)
|
||||
|
@ -53,24 +57,28 @@ class Placement(models.Model):
|
|||
city = models.CharField(blank=False, max_length=100, default="")
|
||||
state = models.CharField(blank=False, max_length=100, default="")
|
||||
country = models.CharField(blank=False, max_length=100, default="")
|
||||
pin_code = models.IntegerField(blank=False, default=None,null=True)
|
||||
pin_code = models.IntegerField(blank=False, default=None, null=True)
|
||||
city_type = models.CharField(blank=False, max_length=15, choices=OFFER_CITY_TYPE)
|
||||
# Job Details
|
||||
designation = models.CharField(blank=False, max_length=50, default=None, null=True)
|
||||
description = models.CharField(blank=False, max_length=500, default=None, null=True)
|
||||
description_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5, default=list, blank=True)
|
||||
description_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5, default=list,
|
||||
blank=True)
|
||||
is_description_pdf = models.BooleanField(blank=False, default=False)
|
||||
compensation_CTC = models.IntegerField(blank=False, default=None, null=True ) # Job - Per Year
|
||||
compensation_CTC = models.IntegerField(blank=False, default=None, null=True) # Job - Per Year
|
||||
compensation_gross = models.IntegerField(blank=False, default=None, null=True)
|
||||
compensation_take_home = models.IntegerField(blank=False, default=None, null=True)
|
||||
compensation_bonus = models.IntegerField(blank=True, default=None, null=True)
|
||||
compensation_details = models.CharField(blank=True, max_length=500, default=None, null=True)
|
||||
compensation_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5, default=list, blank=True)
|
||||
compensation_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5,
|
||||
default=list, blank=True)
|
||||
is_compensation_details_pdf = models.BooleanField(blank=False, default=False)
|
||||
bond_details = models.CharField(blank=True, max_length=500)
|
||||
selection_procedure_rounds = ArrayField(models.CharField(null=True, default=None, max_length=100), size=10, default=list, blank=True)
|
||||
selection_procedure_rounds = ArrayField(models.CharField(null=True, default=None, max_length=100), size=10,
|
||||
default=list, blank=True)
|
||||
selection_procedure_details = models.CharField(blank=True, max_length=500)
|
||||
selection_procedure_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100), size=5, default=list, blank=True)
|
||||
selection_procedure_details_pdf_names = ArrayField(models.CharField(null=True, default=None, max_length=100),
|
||||
size=5, default=list, blank=True)
|
||||
is_selection_procedure_details_pdf = models.BooleanField(blank=False, default=False)
|
||||
tier = models.CharField(blank=False, choices=TIERS, max_length=10, default=None, null=True)
|
||||
tentative_date_of_joining = models.DateField(blank=False, verbose_name="Tentative Date", default=timezone.now)
|
||||
|
@ -103,6 +111,7 @@ class Placement(models.Model):
|
|||
def __str__(self):
|
||||
return self.company_name + " - " + self.id
|
||||
|
||||
|
||||
class PlacementApplication(models.Model):
|
||||
id = models.CharField(blank=False, primary_key=True, max_length=15)
|
||||
placement = models.ForeignKey(Placement, blank=False, on_delete=models.RESTRICT, default=None, null=True)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import urllib
|
||||
|
||||
from rest_framework import serializers
|
||||
|
||||
from .models import *
|
||||
|
||||
|
||||
|
@ -95,7 +96,7 @@ class PlacementSerializerForStudent(serializers.ModelSerializer):
|
|||
exclude = [CONTACT_PERSON_NAME, PHONE_NUMBER, EMAIL, COMPANY_DETAILS_PDF_NAMES, DESCRIPTION_PDF_NAMES,
|
||||
COMPENSATION_DETAILS_PDF_NAMES, SELECTION_PROCEDURE_DETAILS_PDF_NAMES, OFFER_ACCEPTED,
|
||||
EMAIL_VERIFIED,
|
||||
]
|
||||
]
|
||||
depth = 1
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.urls import path, include
|
||||
from . import studentViews
|
||||
from django.urls import path
|
||||
|
||||
from . import studentViews
|
||||
|
||||
urlpatterns = [
|
||||
path('login/', studentViews.login, name="Login"),
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
import json
|
||||
# from datetime import datetime
|
||||
import datetime
|
||||
import traceback
|
||||
|
||||
from rest_framework.decorators import api_view
|
||||
|
||||
from .serializers import *
|
||||
|
@ -75,7 +70,7 @@ def getDashboard(request, id, email, user_type):
|
|||
placements = Placement.objects.filter(allowed_batch__contains=[studentDetails.batch],
|
||||
allowed_branch__contains=[studentDetails.branch],
|
||||
deadline_datetime__gte=datetime.datetime.now(),
|
||||
offer_accepted=True, email_verified=True).order_by('deadline_datetime')
|
||||
offer_accepted=True, email_verified=True).order_by('deadline_datetime')
|
||||
placementsdata = PlacementSerializerForStudent(placements, many=True).data
|
||||
placementApplications = PlacementApplication.objects.filter(student_id=id)
|
||||
placementApplications = PlacementApplicationSerializer(placementApplications, many=True).data
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.urls import path, include
|
||||
|
||||
from . import studentViews, studentUrls, companyUrls, adminUrls
|
||||
|
||||
urlpatterns = [
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import datetime
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
|
@ -7,9 +8,11 @@ import string
|
|||
import sys
|
||||
import traceback
|
||||
from os import path, remove
|
||||
import json
|
||||
|
||||
import background_task
|
||||
import jwt
|
||||
import pdfkit
|
||||
import requests as rq
|
||||
from django.conf import settings
|
||||
from django.core.mail import EmailMultiAlternatives
|
||||
from django.forms.models import model_to_dict
|
||||
|
@ -21,8 +24,6 @@ from google.auth.transport import requests
|
|||
from google.oauth2 import id_token
|
||||
from rest_framework import status
|
||||
from rest_framework.response import Response
|
||||
import requests as rq
|
||||
import pdfkit
|
||||
|
||||
from .constants import *
|
||||
from .models import User, PrePlacementOffer, PlacementApplication, Placement
|
||||
|
@ -78,7 +79,8 @@ def isAuthorized(allowed_users=None):
|
|||
print(email)
|
||||
user = get_object_or_404(User, email=email)
|
||||
if user:
|
||||
|
||||
user.last_login_time = datetime.datetime.now()
|
||||
user.save()
|
||||
if len(set(user.user_type).intersection(set(allowed_users))) or allowed_users == '*':
|
||||
return view_func(request, user.id, user.email, user.user_type, *args, **kwargs)
|
||||
else:
|
||||
|
@ -150,7 +152,8 @@ def sendEmail(email_to, subject, data, template, attachment_jnf_respone=None):
|
|||
msg.attach_alternative(html_content, "text/html")
|
||||
if attachment_jnf_respone:
|
||||
logger.info(attachment_jnf_respone)
|
||||
pdf = pdfkit.from_string(attachment_jnf_respone['html'], False,options={"--enable-local-file-access": "",'--dpi':'96'})
|
||||
pdf = pdfkit.from_string(attachment_jnf_respone['html'], False,
|
||||
options={"--enable-local-file-access": "", '--dpi': '96'})
|
||||
msg.attach(attachment_jnf_respone['name'], pdf, 'application/pdf')
|
||||
msg.send()
|
||||
return True
|
||||
|
@ -248,6 +251,7 @@ def generateOneTimeVerificationLink(email, opening_id, opening_type):
|
|||
logger.warning("Utils - generateOneTimeVerificationLink: " + str(sys.exc_info()))
|
||||
return False, "_"
|
||||
|
||||
|
||||
def verify_recaptcha(request):
|
||||
try:
|
||||
print(settings.RECAPTCHA_SECRET_KEY)
|
||||
|
@ -269,19 +273,25 @@ def verify_recaptcha(request):
|
|||
logger.warning("Utils - verify_recaptcha: " + str(sys.exc_info()))
|
||||
return False, "_"
|
||||
|
||||
|
||||
def opening_description_table_html(opening):
|
||||
details = model_to_dict(opening, fields = [field.name for field in Placement._meta.fields], exclude = ['id','is_company_details_pdf','offer_accepted','is_description_pdf','is_compensation_details_pdf','is_selection_procedure_details_pdf','email_verified'])
|
||||
details = model_to_dict(opening, fields=[field.name for field in Placement._meta.fields],
|
||||
exclude=['id', 'is_company_details_pdf', 'offer_accepted', 'is_description_pdf',
|
||||
'is_compensation_details_pdf', 'is_selection_procedure_details_pdf',
|
||||
'email_verified'])
|
||||
keys = list(details.keys())
|
||||
newdetails = {}
|
||||
for key in keys:
|
||||
if isinstance(details[key], list):
|
||||
details[key] = {"details": details[key], "type": ["list"]}
|
||||
if key in ['website','company_details_pdf_names','description_pdf_names','compensation_details_pdf_names','selection_procedure_pdf_names']:
|
||||
if key in ['website', 'company_details_pdf_names', 'description_pdf_names', 'compensation_details_pdf_names',
|
||||
'selection_procedure_pdf_names']:
|
||||
if key == 'website':
|
||||
details[key] = {"details": details[key], "type": ["link"]}
|
||||
else:
|
||||
details[key] = {"details": details[key]["details"], "type": ["list","link"], "link": PDF_FILES_SERVING_ENDPOINT+opening.id+"/"}
|
||||
new_key = key.replace('_',' ')
|
||||
details[key] = {"details": details[key]["details"], "type": ["list", "link"],
|
||||
"link": PDF_FILES_SERVING_ENDPOINT + opening.id + "/"}
|
||||
new_key = key.replace('_', ' ')
|
||||
if key.endswith(' names'):
|
||||
new_key = key[:-6]
|
||||
new_key = new_key.capitalize()
|
||||
|
@ -289,7 +299,7 @@ def opening_description_table_html(opening):
|
|||
imagepath = os.path.abspath('./templates/image.png')
|
||||
print(imagepath)
|
||||
data = {
|
||||
"data": newdetails,
|
||||
"imgpath": imagepath
|
||||
"data": newdetails,
|
||||
"imgpath": imagepath
|
||||
}
|
||||
return render_to_string(COMPANY_JNF_RESPONSE_TEMPLATE, data)
|
||||
return render_to_string(COMPANY_JNF_RESPONSE_TEMPLATE, data)
|
||||
|
|
|
@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/2.2/ref/settings/
|
|||
"""
|
||||
|
||||
import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv("../dev.env")
|
||||
|
|
|
@ -158,7 +158,6 @@ Request_Body:
|
|||
|
||||
> Only users with `student` role can access this Api.
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
Response is a Json with these fields
|
||||
|
@ -565,8 +564,6 @@ Request_Body:
|
|||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
> Headers <br>
|
||||
> Authorization: "Bearer {tokenID}"
|
||||
|
||||
|
@ -728,7 +725,6 @@ Response is a Json with these fields
|
|||
- ongoing: Gives us the list of placements that are accepting applications.
|
||||
- previous: Gives us the list of placements that stopped accepting applications.
|
||||
|
||||
|
||||
### Status Codes
|
||||
|
||||
The possible responses for this api request are as follows
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
"token_uri": "https://oauth2.googleapis.com/token",
|
||||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
||||
"client_secret": "ZzvcweJylL1IDLUnYOi1ws2W",
|
||||
"redirect_uris": ["https://www.getpostman.com/oauth2/callback"],
|
||||
"javascript_origins": ["http://localhost:3000"]
|
||||
"redirect_uris": [
|
||||
"https://www.getpostman.com/oauth2/callback"
|
||||
],
|
||||
"javascript_origins": [
|
||||
"http://localhost:3000"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
||||
<tr>
|
||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/>
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
||||
style="height:auto;display:block;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -43,7 +44,8 @@
|
|||
<td style="padding:0 0 36px 0;color:#153643;">
|
||||
|
||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
||||
We have received your Job Notification. Kindly verify your email by clicking <a href="{{ one_time_link }}">here</a>.
|
||||
We have received your Job Notification. Kindly verify your email by clicking <a
|
||||
href="{{ one_time_link }}">here</a>.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -5,57 +5,69 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<style>
|
||||
#details_table tr:nth-child(even) {background: #FFF}
|
||||
#details_table tr:nth-child(odd) {background: #bfe3f3}
|
||||
#details_table td {padding: 10px; width: 50%;}
|
||||
#details_table{
|
||||
#details_table tr:nth-child(even) {
|
||||
background: #FFF
|
||||
}
|
||||
|
||||
#details_table tr:nth-child(odd) {
|
||||
background: #bfe3f3
|
||||
}
|
||||
|
||||
#details_table td {
|
||||
padding: 10px;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
#details_table {
|
||||
border: #334878 1px solid;
|
||||
border-collapse: collapse;
|
||||
width: 80%;
|
||||
margin:auto;
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body style="margin: 0;">
|
||||
|
||||
<header style="background-color: #334878;"><img style="height: 3cm; margin: auto; display: block; padding: 0.5cm;" src='{{imgpath}}' alt="cdc logo"></header>
|
||||
<h1 style="text-align: center;"> Job Notification Form Response</h1>
|
||||
<table id="details_table">
|
||||
{% for key, value in data.items %}
|
||||
<tr>
|
||||
<td >
|
||||
{{ key }}
|
||||
</td>
|
||||
<td>
|
||||
{% if 'list' in value.type %}
|
||||
|
||||
{% for item in value.details %}
|
||||
<li>
|
||||
{% if 'link' in value.type and value.link %}
|
||||
<a href="{{value.link|add:item}}">{{ item }}</a>
|
||||
{% elif 'link' in value.type %}
|
||||
<a href="{{item}}">{{ item }}</a>
|
||||
{% else %}
|
||||
{{ item }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% if 'link' in value.type %}
|
||||
<a href="{{ value.details }}">{{ value.details }}</a>
|
||||
{% else %}
|
||||
{{ value }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<p style="margin-left: 10%;">In case of any descripency regarding above details, please contact <a href="mailto:cdc@iitdh.ac.in">cdc@iitdh.ac.in</a>
|
||||
|
||||
</p>
|
||||
<header style="background-color: #334878;"><img style="height: 3cm; margin: auto; display: block; padding: 0.5cm;"
|
||||
src='{{ imgpath }}' alt="cdc logo"></header>
|
||||
<h1 style="text-align: center;"> Job Notification Form Response</h1>
|
||||
<table id="details_table">
|
||||
{% for key, value in data.items %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ key }}
|
||||
</td>
|
||||
<td>
|
||||
{% if 'list' in value.type %}
|
||||
|
||||
{% for item in value.details %}
|
||||
<li>
|
||||
{% if 'link' in value.type and value.link %}
|
||||
<a href="{{ value.link|add:item}}">{{ item }}</a>
|
||||
{% elif 'link' in value.type %}
|
||||
<a href="{{ item }}">{{ item }}</a>
|
||||
{% else %}
|
||||
{{ item }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% if 'link' in value.type %}
|
||||
<a href="{{ value.details }}">{{ value.details }}</a>
|
||||
{% else %}
|
||||
{{ value }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<p style="margin-left: 10%;">In case of any descripency regarding above details, please contact <a
|
||||
href="mailto:cdc@iitdh.ac.in">cdc@iitdh.ac.in</a>
|
||||
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -21,10 +21,20 @@
|
|||
table, td, div, h1, p {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
#details_table tr:nth-child(even) {background: #FFF}
|
||||
#details_table tr:nth-child(odd) {background: #f9f9f9}
|
||||
#details_table td {padding: 10px}
|
||||
#details_table{
|
||||
|
||||
#details_table tr:nth-child(even) {
|
||||
background: #FFF
|
||||
}
|
||||
|
||||
#details_table tr:nth-child(odd) {
|
||||
background: #f9f9f9
|
||||
}
|
||||
|
||||
#details_table td {
|
||||
padding: 10px
|
||||
}
|
||||
|
||||
#details_table {
|
||||
border: #334878 1px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
@ -40,7 +50,8 @@
|
|||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
||||
<tr>
|
||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/>
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
||||
style="height:auto;display:block;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -52,8 +63,10 @@
|
|||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
||||
">Thank You for filling the form</h1>
|
||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
||||
We have received your <b>{{ opening_type }}</b> notification for a <b>{{ designation }}</b> offer at <b>
|
||||
{{ company_name }}</b>. Click <a href="{{ opening_link }}">here</a> to view your notification.
|
||||
We have received your <b>{{ opening_type }}</b> notification for a
|
||||
<b>{{ designation }}</b> offer at <b>
|
||||
{{ company_name }}</b>. Click <a href="{{ opening_link }}">here</a> to view your
|
||||
notification.
|
||||
</p>
|
||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
||||
We will keep you informed with the updates. If you have any queries, please
|
||||
|
@ -64,30 +77,30 @@
|
|||
<table id="details_table">
|
||||
{% for key, value in data.items %}
|
||||
<tr>
|
||||
<td >
|
||||
{{ key }}
|
||||
<td>
|
||||
{{ key }}
|
||||
</td>
|
||||
<td>
|
||||
{% if 'list' in value.type %}
|
||||
|
||||
{% for item in value.details %}
|
||||
{% for item in value.details %}
|
||||
<li>
|
||||
{% if 'link' in value.type and value.link %}
|
||||
<a href="{{value.link|add:item}}">{{ item }}</a>
|
||||
<a href="{{ value.link|add:item}}">{{ item }}</a>
|
||||
{% elif 'link' in value.type %}
|
||||
<a href="{{item}}">{{ item }}</a>
|
||||
<a href="{{ item }}">{{ item }}</a>
|
||||
{% else %}
|
||||
{{ item }}
|
||||
{{ item }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% if 'link' in value.type %}
|
||||
<a href="{{ value.details }}">{{ value.details }}</a>
|
||||
<a href="{{ value.details }}">{{ value.details }}</a>
|
||||
{% else %}
|
||||
{{ value }}
|
||||
{{ value }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -111,7 +124,6 @@
|
|||
</td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
||||
<tr>
|
||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/>
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
||||
style="height:auto;display:block;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -42,17 +43,19 @@
|
|||
<tr>
|
||||
<td style="padding:0 0 36px 0;color:#153643;">
|
||||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
||||
">{{opening_type}} Opportunity at {{company_name}}</h1>
|
||||
">{{ opening_type }} Opportunity at {{ company_name }}</h1>
|
||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
||||
Greetings of the day. Hope you are fine and doing well !
|
||||
</p>
|
||||
<p style="text-indent: 4ch; margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
||||
CDC is excited to announce that <b>{{company_name}}</b> is interested in recruiting <b>{{designation}}</b> from IIT Dharwad.
|
||||
CDC is excited to announce that <b>{{ company_name }}</b> is interested in
|
||||
recruiting <b>{{ designation }}</b> from IIT Dharwad.
|
||||
More details can be found in the CDC-webportal.
|
||||
</p>
|
||||
|
||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
||||
Interested students can apply before <b>{{deadline}}</b> in the <a href="{{link}}">CDC-webportal</a>.
|
||||
Interested students can apply before <b>{{ deadline }}</b> in the <a
|
||||
href="{{ link }}">CDC-webportal</a>.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -72,7 +75,6 @@
|
|||
</td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
||||
<tr>
|
||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/>
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
||||
style="height:auto;display:block;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -43,7 +44,8 @@
|
|||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
||||
">Hey, {{ student_name }}</h1>
|
||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
||||
We regret to inform you that you have not been selected for <b>{{ designation }}</b> role at <b>{{ company_name }}</b>.
|
||||
We regret to inform you that you have not been selected for
|
||||
<b>{{ designation }}</b> role at <b>{{ company_name }}</b>.
|
||||
CDC will keep bringing more such opportunities for you in the future.
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
||||
<tr>
|
||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/>
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
||||
style="height:auto;display:block;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -43,7 +44,8 @@
|
|||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
||||
">Hey, {{ student_name }}</h1>
|
||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
||||
Congratulations, You have been selected for the <b>{{ designation }}</b> at <b>{{ company_name }}</b>.<br>
|
||||
Congratulations, You have been selected for the <b>{{ designation }}</b> at
|
||||
<b>{{ company_name }}</b>.<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
||||
<tr>
|
||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/>
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
||||
style="height:auto;display:block;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -44,26 +45,27 @@
|
|||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
||||
">Hello, {{ name }}</h1>
|
||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
||||
We have received your application for a <b>{{ application_type }}</b> offer at <b>
|
||||
{{ company_name }}</b>.
|
||||
We have received your application for a <b>{{ application_type }}</b> offer at
|
||||
<b>
|
||||
{{ company_name }}</b>.
|
||||
{% if additional_info_items %}
|
||||
We received these additional details
|
||||
<br>
|
||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family:
|
||||
We received these additional details
|
||||
<br>
|
||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family:
|
||||
'Roboto', sans-serif;text-align: center">
|
||||
|
||||
<table style="border:solid 1px; margin: auto; text-align: center;width: 80%;
|
||||
<table style="border:solid 1px; margin: auto; text-align: center;width: 80%;
|
||||
border-radius:15px; background-color: #e0e3ee">
|
||||
|
||||
{% for i,j in additional_info.items %}
|
||||
{% for i,j in additional_info.items %}
|
||||
|
||||
<tr>
|
||||
<td style="padding:8px 10px;color:#153643; ">{{ i }}:</td>
|
||||
<td style="padding:8px 10px;color:#153643;">{{ j }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td style="padding:8px 10px;color:#153643; ">{{ i }}:</td>
|
||||
<td style="padding:8px 10px;color:#153643;">{{ j }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
</p>
|
||||
</p>
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
style="width:602px;border-collapse:collapse;border:1px solid #334878;border-spacing:0;text-align:left;">
|
||||
<tr>
|
||||
<td align="center" style="padding:40px 0 30px 0;background:#334878;">
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200" style="height:auto;display:block;"/>
|
||||
<img src="https://drive.google.com/uc?id=1QTA6dB7jnsZfU1kzyUqfD_2V5xODpWFt" alt="" width="200"
|
||||
style="height:auto;display:block;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -42,10 +43,11 @@
|
|||
<tr>
|
||||
<td style="padding:0 0 36px 0;color:#153643;">
|
||||
<h1 style="font-size:24px;margin:0 0 20px 0;font-family: 'Roboto', sans-serif;
|
||||
">{{opening_type}} Opportunity at {{company_name}}</h1>
|
||||
">{{ opening_type }} Opportunity at {{ company_name }}</h1>
|
||||
<p style="margin:0 0 12px 0;font-size:16px;line-height:24px;font-family: 'Roboto', sans-serif;">
|
||||
Gentle reminder for the same.
|
||||
Interested students can apply before <b>{{deadline}}</b> in the <a href="{{link}}">CDC-webportal</a>.
|
||||
Gentle reminder for the same.
|
||||
Interested students can apply before <b>{{ deadline }}</b> in the <a
|
||||
href="{{ link }}">CDC-webportal</a>.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -12,7 +12,7 @@ python# CDC - Backend
|
|||
4. Install the dependencies <br>
|
||||
`pip install -r requirements.txt `
|
||||
5. Ensure that you have the PostgreSQL installed on your machine and is running on PORT **5432** <br>
|
||||
6. Make sure to give the correct database credentials in [settings.py](./CDC_Backend/CDC_Backend/settings.py)
|
||||
6. Make sure to give the correct database credentials in [settings.py](./CDC_Backend/CDC_Backend/settings.py)
|
||||
|
||||
### Running the Application
|
||||
|
||||
|
@ -35,10 +35,13 @@ python# CDC - Backend
|
|||
2. Update the `CORS_ORIGIN_WHITELIST` list and `CORS_ORIGIN_ALLOW_ALL` variable
|
||||
|
||||
### Starting the Email Server
|
||||
|
||||
Run the following command to start the email backend process <br>
|
||||
`python manage.py process_tasks`
|
||||
|
||||
### API Reference
|
||||
|
||||
Check [here](./CDC_Backend/README.md) for Api Reference
|
||||
|
||||
For Documentation with Postman Collection, click [here](https://documenter.getpostman.com/view/15531322/UVJfhuhQ#568ad036-ad0e-449a-a26f-4d86616b1393)
|
||||
For Documentation with Postman Collection,
|
||||
click [here](https://documenter.getpostman.com/view/15531322/UVJfhuhQ#568ad036-ad0e-449a-a26f-4d86616b1393)
|
||||
|
|
Loading…
Reference in New Issue