From 087fadfd6caff2ca1e4a6ef829dabb5b1187c71b Mon Sep 17 00:00:00 2001 From: Prajjwal Kapoor Date: Sat, 4 May 2024 23:27:56 +0530 Subject: [PATCH] dep final push --- .../department/api/permissions.py | 18 + .../department/api/serializers.py | 62 ++ .../applications/department/api/urls.py | 12 + .../applications/department/api/views.py | 216 +++++ .../department/migrations/0001_initial.py | 2 +- FusionIIIT/applications/department/models.py | 26 +- .../applications/department/serializers.py | 12 - .../static/department/js/function.js | 115 ++- FusionIIIT/applications/department/urls.py | 16 +- FusionIIIT/applications/department/views.py | 735 +++++++----------- .../templates/department/AllStudents.html | 155 ++-- .../templates/department/admin_cse.html | 140 ++++ .../templates/department/admin_ece.html | 140 ++++ FusionIIIT/templates/department/admin_me.html | 139 ++++ FusionIIIT/templates/department/admin_sm.html | 139 ++++ FusionIIIT/templates/department/alumni.html | 55 ++ .../department/browse_announcements.html | 2 +- .../browse_announcements_staff.html | 2 +- FusionIIIT/templates/department/cse_dep.html | 194 ++--- .../templates/department/cse_index.html | 110 +++ .../templates/department/csedep_request.html | 140 ++++ .../templates/department/dep_request.html | 57 +- .../templates/department/design_dep.html | 401 ---------- FusionIIIT/templates/department/ece_dep.html | 186 ++--- .../templates/department/ece_index.html | 110 +++ .../templates/department/ecedep_request.html | 140 ++++ FusionIIIT/templates/department/faculty.html | 12 +- .../templates/department/file_request.html | 15 +- FusionIIIT/templates/department/index.html | 24 +- .../department/make_announcements_fac.html | 1 + .../department/make_announcements_staff.html | 1 + FusionIIIT/templates/department/me_dep.html | 251 ++---- FusionIIIT/templates/department/me_index.html | 110 +++ .../templates/department/medep_request.html | 135 ++++ .../templates/department/request_history.html | 2 +- .../templates/department/request_status.html | 2 +- FusionIIIT/templates/department/sm_dep.html | 181 ++--- FusionIIIT/templates/department/sm_index.html | 110 +++ .../templates/department/smdep_request.html | 135 ++++ .../update_department_information.html | 69 ++ 40 files changed, 2841 insertions(+), 1531 deletions(-) create mode 100644 FusionIIIT/applications/department/api/permissions.py create mode 100644 FusionIIIT/applications/department/api/serializers.py create mode 100644 FusionIIIT/applications/department/api/urls.py create mode 100644 FusionIIIT/applications/department/api/views.py delete mode 100644 FusionIIIT/applications/department/serializers.py create mode 100644 FusionIIIT/templates/department/admin_cse.html create mode 100644 FusionIIIT/templates/department/admin_ece.html create mode 100644 FusionIIIT/templates/department/admin_me.html create mode 100644 FusionIIIT/templates/department/admin_sm.html create mode 100644 FusionIIIT/templates/department/alumni.html create mode 100644 FusionIIIT/templates/department/cse_index.html create mode 100644 FusionIIIT/templates/department/csedep_request.html delete mode 100644 FusionIIIT/templates/department/design_dep.html create mode 100644 FusionIIIT/templates/department/ece_index.html create mode 100644 FusionIIIT/templates/department/ecedep_request.html create mode 100644 FusionIIIT/templates/department/me_index.html create mode 100644 FusionIIIT/templates/department/medep_request.html create mode 100644 FusionIIIT/templates/department/sm_index.html create mode 100644 FusionIIIT/templates/department/smdep_request.html create mode 100644 FusionIIIT/templates/department/update_department_information.html diff --git a/FusionIIIT/applications/department/api/permissions.py b/FusionIIIT/applications/department/api/permissions.py new file mode 100644 index 000000000..2b870575b --- /dev/null +++ b/FusionIIIT/applications/department/api/permissions.py @@ -0,0 +1,18 @@ +from rest_framework import permissions +from django.shortcuts import get_object_or_404 +from applications.academic_information.models import ExtraInfo +from applications.globals.models import User + + +class IsFacultyStaffOrReadOnly(permissions.BasePermission): + """ + Custom permission to only allow faculty and staff to edit it. + """ + + def has_permission(self, request, view): + # Read permissions are allowed to any request, + # so we'll always allow GET, HEAD or OPTIONS requests. + if request.method in permissions.SAFE_METHODS: + return True + #only faculty and staff are able to make post request + return not request.user.holds_designations.filter(designation__name='student').exists() diff --git a/FusionIIIT/applications/department/api/serializers.py b/FusionIIIT/applications/department/api/serializers.py new file mode 100644 index 000000000..aa005ad31 --- /dev/null +++ b/FusionIIIT/applications/department/api/serializers.py @@ -0,0 +1,62 @@ +from rest_framework import serializers +from applications.department.models import Announcements +from applications.academic_information.models import Spi, Student +from applications.globals.models import (Designation, ExtraInfo, + HoldsDesignation,Faculty) +from applications.eis.models import (faculty_about, emp_research_projects) + + +class AnnouncementSerializer(serializers.ModelSerializer): + class Meta: + model = Announcements + fields = ('__all__') + + extra_kwargs = { + 'maker_id': {'required': False} + } + + def create(self, validated_data): + user = self.context['request'].user + user_info = ExtraInfo.objects.all().select_related('user','department').filter(user=user).first() + validated_data['maker_id'] = user_info + return Announcements.objects.create(**validated_data) + +class ExtraInfoSerializer(serializers.ModelSerializer): + class Meta: + model = ExtraInfo + fields = ('__all__') + +class SpiSerializer(serializers.ModelSerializer): + class Meta: + model = Spi + fields = ('__all__') + +class StudentSerializer(serializers.ModelSerializer): + class Meta: + model = Student + fields = ('__all__') + +class DesignationSerializer(serializers.ModelSerializer): + class Meta: + model = Designation + fields = ('__all__') + +class HoldsDesignationSerializer(serializers.ModelSerializer): + class Meta: + model = HoldsDesignation + fields = ('__all__') + +class FacultySerializer(serializers.ModelSerializer): + class Meta: + model = Faculty + fields = ('__all__') + +class faculty_aboutSerializer(serializers.ModelSerializer): + class Meta: + model = faculty_about + fields = ('__all__') + +class emp_research_projectsSerializer(serializers.ModelSerializer): + class Meta: + model = emp_research_projects + fields = ('__all__') \ No newline at end of file diff --git a/FusionIIIT/applications/department/api/urls.py b/FusionIIIT/applications/department/api/urls.py new file mode 100644 index 000000000..9e0dae890 --- /dev/null +++ b/FusionIIIT/applications/department/api/urls.py @@ -0,0 +1,12 @@ +from django.conf.urls import url + +from . import views + +urlpatterns = [ + url(r'announcements/$', views.ListCreateAnnouncementView.as_view(),name='announcements'), + url(r'dep-main/$', views.DepMainAPIView.as_view(), name='depmain'), + url(r'fac-view/$', views.FacAPIView.as_view(), name='facapi'), + url(r'staff-view/$',views.StaffAPIView.as_view(),name='staffapi'), + url(r'all-students/(?P[0-9]+)/$', views.AllStudentsAPIView.as_view() ,name='all_students') + +] diff --git a/FusionIIIT/applications/department/api/views.py b/FusionIIIT/applications/department/api/views.py new file mode 100644 index 000000000..686f0268e --- /dev/null +++ b/FusionIIIT/applications/department/api/views.py @@ -0,0 +1,216 @@ +from rest_framework import generics +from rest_framework.views import APIView +from applications.department.models import Announcements +from applications.academic_information.models import Spi, Student +from applications.globals.models import (Designation, ExtraInfo, + HoldsDesignation,Faculty) +from applications.eis.models import (faculty_about, emp_research_projects) +from .serializers import (AnnouncementSerializer,ExtraInfoSerializer,SpiSerializer,StudentSerializer,DesignationSerializer + ,HoldsDesignationSerializer,FacultySerializer,faculty_aboutSerializer,emp_research_projectsSerializer) +from rest_framework.permissions import IsAuthenticated +from .permissions import IsFacultyStaffOrReadOnly +from django.http import JsonResponse +from django.shortcuts import get_object_or_404, render, redirect +from django.contrib.auth.models import User +from rest_framework.response import Response +from rest_framework import status +from django.contrib.auth.decorators import login_required +from django.urls import reverse +from datetime import date +from notification.views import department_notif + + +class ListCreateAnnouncementView(generics.ListCreateAPIView): + queryset = Announcements.objects.all() + serializer_class = AnnouncementSerializer + permission_classes = (IsAuthenticated, IsFacultyStaffOrReadOnly) + + +class DepMainAPIView(APIView): + def get(self, request): + user = request.user + usrnm = get_object_or_404(User, username=user.username) + user_info = ExtraInfo.objects.all().select_related('user', 'department').filter(user=usrnm).first() + ann_maker_id = user_info.id + user_info = ExtraInfo.objects.all().select_related('user', 'department').get(id=ann_maker_id) + + fac_view = user.holds_designations.filter(designation__name='faculty').exists() + student = user.holds_designations.filter(designation__name='student').exists() + staff = user.holds_designations.filter(designation__name='staff').exists() + + context = browse_announcements() + context_f = faculty() + user_designation = "" + + if fac_view: + user_designation = "faculty" + elif student: + user_designation = "student" + else: + user_designation = "staff" + + # serailizing the data + # announcements_serailizer = AnnouncementSerializer(context, many=True) + + + response_data = { + "user_designation": user_designation, + "announcements": context, + "fac_list": context_f + } + + + return Response(data = response_data, status=status.HTTP_200_OK) + # return Response(data = response_data, status=status.HTTP_200_OK) + +class FacAPIView(APIView): + def get(self,request): + usrnm = get_object_or_404(User, username=request.user.username) + user_info = ExtraInfo.objects.all().select_related('user','department').filter(user=usrnm).first() + + + context = browse_announcements() + + + # Serialize the data into JSON formats + data = { + "user_designation": user_info.user_type, + "announcements": list(context.values()), # Assuming 'context' is a dictionary + } + + return Response(data) + +class StaffAPIView(APIView): + def get(self,request): + usrnm = get_object_or_404(User, username=request.user.username) + user_info = ExtraInfo.objects.all().select_related('user','department').filter(user=usrnm).first() + + + context = browse_announcements() + + + # Serialize the data into JSON formats + data = { + "user_designation": user_info.user_type, + "announcements": list(context.values()), # Assuming 'context' is a dictionary + } + + return Response(data) + +class AllStudentsAPIView(APIView): + def get(self,request,bid): + print(self.request.query_params) + # bid = self.request.query_params.get() + + # Decode bid into filter criteria + filter_criteria = decode_bid(bid) + if not filter_criteria: + return Response({'detail': 'Invalid bid value'}, status=status.HTTP_400_BAD_REQUEST) + + # Apply additional department filter since it seems fixed + filter_criteria['id__department__name'] = 'CSE' + + student_list1 = Student.objects.order_by('id').filter( + id__user_type='student', + **filter_criteria + ).select_related('id') + + # paginator = Paginator(student_list1, 25, orphans=5) + # page_number = request.GET.get('page') + # student_list = paginator.get_page(page_number) + + # Serialize the queryset + serializer = StudentSerializer(student_list1, many=True) + serialized_data = serializer.data + + # Create a response dictionary + response_data = {'student_list': serialized_data} + + return Response(response_data) + + +def decode_bid(bid): + """Decodes the bid structure into programme, batch, and department (if applicable).""" + try: + department_code = bid[0] + programme = { + '1': 'B.Tech', + '2': 'M.Tech', + '3': 'PhD', # Assuming there are more departments + }[department_code] + batch = 2021 - len(bid) + 1 + return {'programme': programme, 'batch': batch} + except (IndexError, KeyError): + return None # Handle malformed bid values + +def browse_announcements(): + """ + This function is used to browse Announcements Department-Wise + made by different faculties and admin. + + @variables: + cse_ann - Stores CSE Department Announcements + ece_ann - Stores ECE Department Announcements + me_ann - Stores ME Department Announcements + sm_ann - Stores SM Department Announcements + all_ann - Stores Announcements intended for all Departments + context - Dictionary for storing all above data + + """ + cse_ann = Announcements.objects.filter(department="CSE") + ece_ann = Announcements.objects.filter(department="ECE") + me_ann = Announcements.objects.filter(department="ME") + sm_ann = Announcements.objects.filter(department="SM") + all_ann = Announcements.objects.filter(department="ALL") + + # serailizing the data + cse_ann_serialized = AnnouncementSerializer(cse_ann, many=True) + ece_ann_serialized = AnnouncementSerializer(ece_ann, many=True) + me_ann_serialized = AnnouncementSerializer(me_ann, many=True) + sm_ann_serialized = AnnouncementSerializer(sm_ann, many=True) + all_ann_serialized = AnnouncementSerializer(all_ann, many=True) + + context = { + "cse" : cse_ann_serialized.data, + "ece" : ece_ann_serialized.data, + "me" : me_ann_serialized.data, + "sm" : sm_ann_serialized.data, + "all" : all_ann_serialized.data + } + + return context + +def faculty(): + """ + This function is used to Return data of Faculties Department-Wise. + + @variables: + cse_f - Stores data of faculties from CSE Department + ece_f - Stores data of faculties from ECE Department + me_f - Stores data of faculties from ME Department + sm_f - Stores data of faculties from ME Department + context_f - Stores all above variables in Dictionary + + """ + cse_f=ExtraInfo.objects.filter(department__name='CSE',user_type='faculty') + ece_f=ExtraInfo.objects.filter(department__name='ECE',user_type='faculty') + me_f=ExtraInfo.objects.filter(department__name='ME',user_type='faculty') + sm_f=ExtraInfo.objects.filter(department__name='SM',user_type='faculty') + staff=ExtraInfo.objects.filter(user_type='staff') + + # serailizing the data + cse_f = ExtraInfoSerializer(cse_f, many=True) + ece_f = ExtraInfoSerializer(ece_f, many=True) + me_f = ExtraInfoSerializer(me_f, many=True) + sm_f = ExtraInfoSerializer(sm_f, many=True) + staff = ExtraInfoSerializer(staff, many=True) + + + context_f = { + "cse_f" : cse_f.data, + "ece_f" : ece_f.data, + "me_f" : me_f.data, + "sm_f" : sm_f.data, + "staff" : staff.data, + } + return context_f \ No newline at end of file diff --git a/FusionIIIT/applications/department/migrations/0001_initial.py b/FusionIIIT/applications/department/migrations/0001_initial.py index 0d36c4ef9..fc8a34834 100644 --- a/FusionIIIT/applications/department/migrations/0001_initial.py +++ b/FusionIIIT/applications/department/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 3.1.5 on 2024-04-27 23:48 +# Generated by Django 3.1.5 on 2023-03-15 18:53 import datetime from django.db import migrations, models diff --git a/FusionIIIT/applications/department/models.py b/FusionIIIT/applications/department/models.py index f8e1392db..caebb4d50 100644 --- a/FusionIIIT/applications/department/models.py +++ b/FusionIIIT/applications/department/models.py @@ -3,15 +3,16 @@ from datetime import date # Create your models here. -from applications.globals.models import ExtraInfo +from applications.globals.models import ExtraInfo , DepartmentInfo + class SpecialRequest(models.Model): request_maker = models.ForeignKey(ExtraInfo, on_delete=models.CASCADE) request_date = models.DateTimeField(default=date.today) brief = models.CharField(max_length=20, default='--') request_details = models.CharField(max_length=200) upload_request = models.FileField(blank=True) - status = models.CharField(max_length=50, default='Pending') + status = models.CharField(max_length=50,default='Pending') remarks = models.CharField(max_length=300, default="--") request_receiver = models.CharField(max_length=30, default="--") @@ -21,13 +22,22 @@ def __str__(self): class Announcements(models.Model): maker_id = models.ForeignKey(ExtraInfo, on_delete=models.CASCADE) - ann_date = models.DateTimeField(default="04-04-2021") + ann_date = models.DateTimeField(auto_now_add=True) message = models.CharField(max_length=200) - batch = models.CharField(max_length=40, default="Year-1") - department = models.CharField(max_length=40, default="ALL") + batch = models.CharField(max_length=40,default="Year-1") + department = models.CharField(max_length=40,default="ALL") programme = models.CharField(max_length=10) - upload_announcement = models.FileField( - upload_to='department/upload_announcement', null=True, default=" ") - + upload_announcement = models.FileField(upload_to='department/upload_announcement', null=True, default=" ") def __str__(self): return str(self.maker_id.user.username) + +class Information(models.Model): + department = models.OneToOneField( + DepartmentInfo, + on_delete=models.CASCADE, + ) + + phone_number = models.BigIntegerField() + email = models.CharField(max_length=200) + facilites = models.TextField() + labs = models.TextField() diff --git a/FusionIIIT/applications/department/serializers.py b/FusionIIIT/applications/department/serializers.py deleted file mode 100644 index eb65119c9..000000000 --- a/FusionIIIT/applications/department/serializers.py +++ /dev/null @@ -1,12 +0,0 @@ -from rest_framework import serializers -from .models import * - -class AnnouncementSerializer(serializers.ModelSerializer): - class Meta: - model=Announcements - fields="__all__" - -class SpecialRequestSerializer(serializers.ModelSerializer): - class Meta: - model=SpecialRequest - fields="__all__" \ No newline at end of file diff --git a/FusionIIIT/applications/department/static/department/js/function.js b/FusionIIIT/applications/department/static/department/js/function.js index bdf859afd..0a64c2c95 100644 --- a/FusionIIIT/applications/department/static/department/js/function.js +++ b/FusionIIIT/applications/department/static/department/js/function.js @@ -5,46 +5,79 @@ $(document).ready(function(){ function announce(event) - { - var message= $('input[name="announcement"]').val(); - var batch = $('input[name="batch"]').val(); - var programme = $('input[name="programme"]').val(); - var department = $('input[name="department"]').val(); - var upload_announcement =$('input[name="upload_announcement"]').val(); - if(message=="" || batch=="" || programme =="" || department=="") - { - alert("Please fill all the details!"); - return; - } - else - { - event.preventDefault(); - $.ajax({ - type : 'POST', - url : '.', - data : { - 'message' : message, - 'batch' : batch, - 'programme' : programme, - 'upload_announcement' : upload_announcement, - 'department' : department, - }, - success : function (data){ + { + var message= $('input[name="announcement"]').val(); + var batch = $('input[name="batch"]').val(); + var programme = $('input[name="programme"]').val(); + var department = $('input[name="department"]').val(); + var upload_announcement =$('input[name="upload_announcement"]').val(); + if(message=="" || batch=="" || programme =="" || department=="") + { + alert("Please fill all the details!"); + return; + } + else + { + event.preventDefault(); + $.ajax({ + type : 'POST', + url : '.', + data : { + 'message' : message, + 'batch' : batch, + 'programme' : programme, + 'upload_announcement' : upload_announcement, + 'department' : department, + }, + success : function (data){ + + alert("Announcement successfully made!!"); + setTimeout(function() { + window.location.reload(); + }, 1500); + + + }, + error : function (data,err){ + alert('Announcement successfully made ... '); - alert("Announcement successfully made!!"); - setTimeout(function() { - window.location.reload(); - }, 1500); + } + }); + } +}; - - }, - error : function (data,err){ - alert('Announcement successfully made ... '); +function updateDepartment(event) { + var email = $('input[name="email"]').val(); + var contactNumber = $('input[name="contact_number"]').val(); + var facilities = $('textarea[name="facilities"]').val(); + var labs = $('textarea[name="labs"]').val(); - } - }); - } - }; + if (email === "" || contactNumber === "" || facilities === "" || labs === "" || departmentId === "") { + alert("Please fill all the details!"); + return; + } else { + event.preventDefault(); + $.ajax({ + type: 'POST', + url: '.', // Specify the URL to your view for updating department information + data: { + 'email': email, + 'contact_number': contactNumber, + 'facilities': facilities, + 'labs': labs, + }, + success: function(data) { + alert("Department information updated successfully!"); + setTimeout(function() { + window.location.reload(); + }, 1500); + }, + error: function(data, err) { + alert('Failed to update department information.'); + } + }); + } +} function request(event) { @@ -52,7 +85,6 @@ function request(event) var request_to = $('input[name="request_to"]').val(); var request_details = $('input[name="request_details"]').val(); - if(request_type=="" || request_to=="" || request_details =="" ) { alert("Please fill all the details!"); @@ -60,8 +92,7 @@ function request(event) } else { - // event.preventDefault(); - alert("please wait we are processing your request."); + event.preventDefault(); $.ajax({ type : 'POST', url : '.', @@ -75,11 +106,11 @@ function request(event) alert("Request successfully made!!"); setTimeout(function() { window.location.reload(); - }, 0); + }, 1500); }, error : function (data,err){ - alert('Request not created'); + alert('Request successfully made ... '); } }); diff --git a/FusionIIIT/applications/department/urls.py b/FusionIIIT/applications/department/urls.py index 30a4adfd4..094e1e90d 100644 --- a/FusionIIIT/applications/department/urls.py +++ b/FusionIIIT/applications/department/urls.py @@ -1,4 +1,5 @@ from django.conf.urls import url +from django.urls import include from . import views @@ -9,14 +10,11 @@ url(r'^$', views.dep_main, name='dep'), url(r'^facView/$', views.faculty_view, name='faculty_view'), url(r'^staffView/$', views.staff_view, name='staff_view'), - url(r'^All_Students/(?P[0-9]+)/$', views.all_students,name='all_students'), + url(r'All_Students/(?P[0-9]+)/$', views.all_students,name='all_students'), + url(r'alumni/$', views.alumni, name='alumni'), url(r'^approved/$', views.approved, name='approved'), url(r'^deny/$', views.deny, name='deny'), - - #api routes - url(r'^fetchAnnouncements/$', views.AnnouncementAPI.as_view(http_method_names=['get']), name='fetchAnnouncements'), - url(r'^addNewAnnouncement/$', views.AnnouncementAPI.as_view(http_method_names=['post']), name='addNewAnnouncement'), - url(r'^fetchRequest/$', views.SpecialRequestAPI.as_view(http_method_names=['get']), name='fetchRequest'), - url(r'^addNewRequest/$', views.SpecialRequestAPI.as_view(http_method_names=['post']), name='addNewRequest'), -] - \ No newline at end of file + + url(r'^api/', include("applications.department.api.urls")) + +] \ No newline at end of file diff --git a/FusionIIIT/applications/department/views.py b/FusionIIIT/applications/department/views.py index 3bd39ea80..6e5a0d936 100644 --- a/FusionIIIT/applications/department/views.py +++ b/FusionIIIT/applications/department/views.py @@ -5,7 +5,7 @@ from django.contrib import messages from django.contrib.auth.decorators import login_required -from django.http import HttpResponse, HttpResponseRedirect +from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest # Create your views here. from django.db.models import Q from django.shortcuts import get_object_or_404, render, redirect @@ -13,135 +13,30 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from applications.academic_information.models import Spi, Student from applications.globals.models import (Designation, ExtraInfo, - HoldsDesignation,Faculty) + HoldsDesignation,Faculty,DepartmentInfo) from applications.eis.models import (faculty_about, emp_research_projects) - +from .models import Information from notification.views import department_notif -from .models import SpecialRequest, Announcements +from .models import SpecialRequest, Announcements , Information from jsonschema import validate from jsonschema.exceptions import ValidationError -# API -from rest_framework.views import APIView -from rest_framework.response import Response -from .serializers import AnnouncementSerializer, SpecialRequestSerializer - -# Announcement Api class to handle request related to announcements -class AnnouncementAPI(APIView): - """ - overriding the get method - if request body is empty then all the announcements will be fetched - else body should contain id of the Announcement that is to be fetched - """ - - def get(self , request): - data = request.data - if data: - id = data['id'] - announcemets_obj = Announcements.objects.get(id=id) - serializer_obj = AnnouncementSerializer(announcemets_obj , partial=True) - return Response({'status':HttpResponse.status_code , 'payload':serializer_obj.data}) - else: - announcemets_obj = Announcements.objects.all() - serializer_obj = AnnouncementSerializer(announcemets_obj , many=True) - return Response({'status':HttpResponse.status_code , 'payload':serializer_obj.data}) - - """ - body should contain following attributes - batch, programme, department, message and upload_announcement - """ - def post(self , request): - data = request.data - batch = data['batch'] - programme = data['programme'] - department = data['department'] - message = data['message'] - upload_announcement = data['upload_announcement'] - ann_date = date.today() - - usrnm = get_object_or_404(User, username=request.user.username) - user_info = ExtraInfo.objects.all().select_related('user','department').get(user=usrnm) - - announcement_obj = Announcements( - maker_id=user_info, - batch=batch, - programme=programme, - message=message, - upload_announcement=upload_announcement, - department = department, - ann_date=ann_date - ) - if announcement_obj: - announcement_obj.save() - return Response({'status':HttpResponse.status_code , 'payload':'Announcement added successfully'}) - else: - return Response({'status':HttpResponse.status_code , 'payload':'Unable to add announcement'}) - -# SpecialRequest Api class to handle request related to Request -class SpecialRequestAPI(APIView): - """ - overriding the get method - if api-request body is empty then all the requests will be fetched - else body should contain id of the requests that is to be fetched - """ - def get(self , request): - data = request.data - if data: - id = data['id'] - specialRequest_obj = SpecialRequest.objects.get(id=id) - serializer_obj = SpecialRequestSerializer(specialRequest_obj , partial=True) - return Response({'status':HttpResponse.status_code , 'payload':serializer_obj.data}) - else: - specialRequest_obj = SpecialRequest.objects.all() - serializer_obj = SpecialRequestSerializer(specialRequest_obj , many=True) - return Response({'status':HttpResponse.status_code , 'payload':serializer_obj.data}) - - """ - body should contain following attributes - request_type, request_to and request_details - """ - def post(self , request): - data = request.data - request_type = data['request_type'] - request_to = data['request_to'] - request_details = data['request_details'] - request_date = date.today() - - usrnm = get_object_or_404(User, username=request.user.username) - user_info = ExtraInfo.objects.all().select_related('user','department').get(user=usrnm) - - specialRequest_obj = SpecialRequest( - request_maker=user_info, - request_date=request_date, - brief=request_type, - request_details=request_details, - status="Pending", - remarks="--", - request_receiver=request_to - ) - if specialRequest_obj: - specialRequest_obj.save() - return Response({'status':HttpResponse.status_code , 'payload':'Request added successfully'}) - else: - return Response({'status':HttpResponse.status_code , 'payload':'Unable to add Request'}) - """ - body should contain following attributes - id, remark and status - """ - def put(self, request): - data = request.data - request_id = data['id'] - remark = data['remark'] - status = data['status'] - - SpecialRequest.objects.filter(id=request_id).update(status=status, remarks=remark) - - return Response({'status':HttpResponse.status_code , 'payload':status}) - - -# Create your views here. +def department_information(request): + cse_info = Information.objects.filter(department_id=51).first() + ece_info = Information.objects.filter(department_id=30).first() + me_info = Information.objects.filter(department_id=37).first() + sm_info = Information.objects.filter(department_id=28).first() + department_context = { + "cse_info" : cse_info, + "ece_info" : ece_info, + "me_info" : me_info, + "sm_info" : sm_info + } + # print(department_context) + # print(me_info.phone_number,me_info.email,me_info.department_id) + return department_context def browse_announcements(): """ @@ -170,7 +65,7 @@ def browse_announcements(): "sm" : sm_ann, "all" : all_ann } - + # print(context) return context def get_make_request(user_id): @@ -216,7 +111,8 @@ def dep_main(request): user_info = ExtraInfo.objects.all().select_related('user','department').filter(user=usrnm).first() ann_maker_id = user_info.id user_info = ExtraInfo.objects.all().select_related('user','department').get(id=ann_maker_id) - + user_departmentid = ExtraInfo.objects.all().select_related('user','department').get(id=ann_maker_id).department_id + requests_made = get_make_request(user_info) fac_view = request.user.holds_designations.filter(designation__name='faculty').exists() @@ -226,7 +122,10 @@ def dep_main(request): context = browse_announcements() context_f = faculty() user_designation = "" - + + + department_context = department_information(request) + if fac_view: user_designation = "faculty" elif student: @@ -239,25 +138,37 @@ def dep_main(request): request_to = request.POST.get('request_to', '') request_details = request.POST.get('request_details', '') request_date = date.today() - - if request_type and request_to and request_details: - obj_sprequest, created_object = SpecialRequest.objects.get_or_create(request_maker=user_info, - request_date=request_date, - brief=request_type, - request_details=request_details, - status="Pending", - remarks="--", - request_receiver=request_to - ) + + obj_sprequest, created_object = SpecialRequest.objects.get_or_create(request_maker=user_info, + request_date=request_date, + brief=request_type, + request_details=request_details, + status="Pending", + remarks="--", + request_receiver=request_to + ) if user_designation == "student": - return render(request,"department/index.html", {"announcements":context, - "fac_list" : context_f, - "requests_made" : requests_made - }) - # elif(str(user.extrainfo.user_type)=="faculty"): + department_templates = { + 51: 'department/cse_index.html', + 30: 'department/ece_index.html', + 37: 'department/me_index.html', + 53: 'department/sm_index.html' + } + default_template = 'department/cse_index.html' + template_name = department_templates.get(user_departmentid, default_template) + + return render(request, template_name, { + "announcements": context, + "fac_list": context_f, + "requests_made": requests_made, + "department_info": department_context + + }) + elif user_designation=="faculty": return HttpResponseRedirect("facView") + elif user_designation=="staff": return HttpResponseRedirect("staffView") @@ -275,11 +186,15 @@ def faculty_view(request): department, ann_date, user_info - Gets and store data from FORM used for Announcements. """ + context_f = faculty() usrnm = get_object_or_404(User, username=request.user.username) user_info = ExtraInfo.objects.all().select_related('user','department').filter(user=usrnm).first() num = 1 ann_maker_id = user_info.id requests_received = get_to_request(usrnm) + user_departmentid = ExtraInfo.objects.all().select_related('user','department').get(id=ann_maker_id).department_id + department_context = department_information(request) + if request.method == 'POST': batch = request.POST.get('batch', '') programme = request.POST.get('programme', '') @@ -298,13 +213,29 @@ def faculty_view(request): upload_announcement=upload_announcement, department = department, ann_date=ann_date) + department_notif(usrnm, recipients , message) context = browse_announcements() - return render(request, 'department/dep_request.html', {"user_designation":user_info.user_type, - "announcements":context, - "request_to":requests_received - }) + + department_templates = { + 51: 'department/csedep_request.html', + 30: 'department/ecedep_request.html', + 37: 'department/medep_request.html', + 53: 'department/smdep_request.html' + } + default_template = 'department/dep_request.html' + + template_name = department_templates.get(user_departmentid, default_template) + + return render(request, template_name, { + "user_designation": user_info.user_type, + "announcements": context, + "request_to": requests_received, + "fac_list": context_f, + "department_info": department_context + }) + def staff_view(request): """ @@ -320,39 +251,143 @@ def staff_view(request): department, ann_date, user_info - Gets and store data from FORM used for Announcements for Students. """ + context_f = faculty() usrnm = get_object_or_404(User, username=request.user.username) user_info = ExtraInfo.objects.all().select_related('user','department').filter(user=usrnm).first() num = 1 ann_maker_id = user_info.id + user_departmentid = ExtraInfo.objects.all().select_related('user','department').get(id=ann_maker_id).department_id + + department_context = department_information(request) + requests_received = get_to_request(usrnm) if request.method == 'POST': - batch = request.POST.get('batch', '') - programme = request.POST.get('programme', '') - message = request.POST.get('announcement', '') - upload_announcement = request.FILES.get('upload_announcement') - department = request.POST.get('department') - ann_date = date.today() - user_info = ExtraInfo.objects.all().select_related('user','department').get(id=ann_maker_id) - getstudents = ExtraInfo.objects.select_related('user') - recipients = User.objects.filter(extrainfo__in=getstudents) - - obj1, created = Announcements.objects.get_or_create(maker_id=user_info, - batch=batch, - programme=programme, - message=message, - upload_announcement=upload_announcement, - department = department, - ann_date=ann_date) - department_notif(usrnm, recipients , message) + form_type = request.POST.get('form_type', '') + if form_type == 'form1' : + + batch = request.POST.get('batch', '') + programme = request.POST.get('programme', '') + message = request.POST.get('announcement', '') + upload_announcement = request.FILES.get('upload_announcement') + department = request.POST.get('department') + ann_date = date.today() + user_info = ExtraInfo.objects.all().select_related('user','department').get(id=ann_maker_id) + getstudents = ExtraInfo.objects.select_related('user') + recipients = User.objects.filter(extrainfo__in=getstudents) + + obj1, created = Announcements.objects.get_or_create(maker_id=user_info, + batch=batch, + programme=programme, + message=message, + upload_announcement=upload_announcement, + department = department, + ann_date=ann_date) + department_notif(usrnm, recipients , message) + + elif form_type == 'form2' : + + email = request.POST.get('email', '') + phone_number = request.POST.get('contact_number', '') + facilites = request.POST.get('facilities', '') + labs = request.POST.get('labs', '') + department_id = user_departmentid + + # Check if a row with the specified department_id already exists + try: + department_info = Information.objects.get(department_id=department_id) + # If row exists, update the values + department_info.email = email + department_info.phone_number_number = phone_number + department_info.facilites = facilites + department_info.labs = labs + department_info.save() + except Information.DoesNotExist: + # If row does not exist, create a new one + department_info = Information.objects.create( + department_id=department_id, + email=email, + phone_number=phone_number, + facilites=facilites, + labs=labs + ) + context = browse_announcements() - return render(request, 'department/dep_request.html', {"user_designation":user_info.user_type, - "announcements":context, - "request_to":requests_received - }) + + + department_templates = { + 51: 'department/csedep_request.html', + 30: 'department/ecedep_request.html', + 37: 'department/medep_request.html', + 53: 'department/smdep_request.html', + + } + default_template = 'department/dep_request.html' + + desig=request.session.get('currentDesignationSelected', 'default_value') + if desig=='deptadmin_cse': + template_name = 'department/admin_cse.html' + + return render(request, template_name, { + "user_designation": user_info.user_type, + "announcements": context, + "request_to": requests_received, + "fac_list": context_f, + "department_info": department_context + }) + elif desig=='deptadmin_ece': + template_name = 'department/admin_ece.html' + return render(request, template_name, { + "user_designation": user_info.user_type, + "announcements": context, + "request_to": requests_received, + "fac_list": context_f, + "department_info": department_context + }) + elif desig=='deptadmin_me': + template_name = 'department/admin_me.html' + return render(request, template_name, { + "user_designation": user_info.user_type, + "announcements": context, + "request_to": requests_received, + "fac_list": context_f, + "department_info": department_context + }) + elif desig=='deptadmin_sm': + template_name = 'department/admin_sm.html' + return render(request, template_name, { + "user_designation": user_info.user_type, + "announcements": context, + "request_to": requests_received, + "fac_list": context_f, + "department_info": department_context + }) + + # if desig == 'deptadmin_cse': + # return render(request, 'admin_cse.html') + # elif desig == 'deptadmin_ece': + # return render(request, 'admin_ece.html') + # elif desig == 'deptadmin_sm': + # return render(request, 'admin_sm.html') + # elif desig == 'deptadmin_me': + # return render(request, 'admin_me.html') + # else: + # return render(request, 'default.html') + + template_name = department_templates.get(user_departmentid, default_template) + return render(request, template_name, { + "user_designation": user_info.user_type, + "announcements": context, + "request_to": requests_received, + "fac_list": context_f, + "department_info": department_context + }) + + @login_required(login_url='/accounts/login') -def all_students(request,bid): + +def all_students(request, bid): """ This function is used to Return data of Faculties Department-Wise. @@ -365,284 +400,62 @@ def all_students(request,bid): student_list - Stores data pagewise """ - if int(bid)==1: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2021, - id__user_type='student', - id__department__name='CSE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==11: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2020, - id__user_type='student', - id__department__name='CSE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==111: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2019, - id__user_type='student', - id__department__name='CSE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==1111: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2018, - id__user_type='student', - id__department__name='CSE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==11111: - student_list1=Student.objects.order_by('id').filter(programme='M.Tech', - batch=2021, - id__user_type='student', - id__department__name='CSE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==111111: - student_list1=Student.objects.order_by('id').filter(programme='M.Tech', - batch=2020, - id__user_type='student', - id__department__name='CSE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==1111111: - student_list1=Student.objects.order_by('id').filter(programme='PhD', - id__user_type='student', - id__department__name='CSE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==2: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2021, - id__user_type='student', - id__department__name='ECE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==21: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2020, - id__user_type='student', - id__department__name='ECE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==211: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2019, - id__user_type='student', - id__department__name='ECE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==2111: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2018, - id__user_type='student', - id__department__name='ECE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==21111: - student_list1=Student.objects.order_by('id').filter(programme='M.Tech', - batch=2021, - id__user_type='student', - id__department__name='ECE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==211111: - student_list1=Student.objects.order_by('id').filter(programme='M.Tech', - batch=2020, - id__user_type='student', - id__department__name='ECE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==2111111: - student_list1=Student.objects.order_by('id').filter(programme='PhD', - id__user_type='student', - id__department__name='ECE').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==3: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2021, - id__user_type='student', - id__department__name='ME').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==31: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2020, - id__user_type='student', - id__department__name='ME').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==311: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2019, - id__user_type='student', - id__department__name='ME').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==3111: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2018, - id__user_type='student', - id__department__name='ME').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==31111: - student_list1=Student.objects.order_by('id').filter(programme='M.Tech', - batch=2021, - id__user_type='student', - id__department__name='ME').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==311111: - student_list1=Student.objects.order_by('id').filter(programme='M.Tech', - batch=2020, - id__user_type='student', - id__department__name='ME').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==3111111: - student_list1=Student.objects.order_by('id').filter(programme='PhD', - id__user_type='student', - id__department__name='ME').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==4: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2021, - id__user_type='student', - id__department__name='SM').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==41: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2020, - id__user_type='student', - id__department__name='SM').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==411: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2019, - id__user_type='student', - id__department__name='SM').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==4111: - student_list1=Student.objects.order_by('id').filter(programme='B.Tech', - batch=2018, - id__user_type='student', - id__department__name='SM').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==41111: - student_list1=Student.objects.order_by('id').filter(programme='M.Tech', - batch=2021, - id__user_type='student', - id__department__name='SM').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==411111: - student_list1=Student.objects.order_by('id').filter(programme='M.Tech', - batch=2020, - id__user_type='student', - id__department__name='SM').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - elif int(bid)==4111111: - student_list1=Student.objects.order_by('id').filter(programme='PhD', - id__user_type='student', - id__department__name='SM').select_related('id') - paginator=Paginator(student_list1,25,orphans=5) - page_number=request.GET.get('page') - student_list=paginator.get_page(page_number) - id_dict={'student_list':student_list,} - return render(request, 'department/AllStudents.html',context=id_dict) - + def decode_bid(bid): + """Decodes the bid structure into programme, batch, and department (if applicable).""" + + try: + department_code = bid[0] + programme = { + '1': 'B.Tech', + '2': 'M.Tech', + '3': 'PhD', + + }[department_code] + batch = 2021 - len(bid) + 1 + return {'programme': programme, 'batch': batch} + except (IndexError, KeyError): + return None # Handle malformed bid values + # Get sort parameter from the request + sort_by = request.GET.get('sort_by', None) # No default sort + last_sort = request.session.get('last_sort', None) + + # Decode bid into filter criteria + filter_criteria = decode_bid(bid) + if not filter_criteria: + return HttpResponseBadRequest("Invalid bid value") + + # Apply additional department filter since it seems fixed + filter_criteria['id__department__name'] = 'CSE' + + # Apply sort parameter to the queryset + if sort_by: + if last_sort == sort_by: + sort_by = '-' + sort_by # Reverse the order + try: + student_list1 = Student.objects.order_by(sort_by).filter( + id__user_type='student', + **filter_criteria + ).select_related('id') + except: + # If the sort field doesn't exist or isn't sortable, ignore the sort parameter + student_list1 = Student.objects.filter( + id__user_type='student', + **filter_criteria + ).select_related('id') + request.session['last_sort'] = sort_by # Save the sort parameter for the next request + else: + student_list1 = Student.objects.filter( + id__user_type='student', + **filter_criteria + ).select_related('id') + + paginator = Paginator(student_list1, 25, orphans=5) + page_number = request.GET.get('page') + student_list = paginator.get_page(page_number) + id_dict = {'student_list': student_list} + return render(request, 'department/AllStudents.html', context=id_dict) + def faculty(): """ @@ -674,8 +487,35 @@ def faculty(): } + # print(cse_f) return context_f + +def alumni(request): + """ + This function is used to Return data of Alumni Department-Wise. + + @variables: + cse_a - Stores data of alumni from CSE Department + ece_a - Stores data of alumni from ECE Department + me_a - Stores data of alumni from ME Department + sm_a - Stores data of alumni from ME Department + context_a - Stores all above variables in Dictionary + + """ + cse_a=ExtraInfo.objects.filter(department__name='CSE',user_type='alumni') + ece_a=ExtraInfo.objects.filter(department__name='ECE',user_type='alumni') + me_a=ExtraInfo.objects.filter(department__name='ME',user_type='alumni') + sm_a=ExtraInfo.objects.filter(department__name='SM',user_type='alumni') + + context_a = { + "cse_a" : cse_a, + "ece_a" : ece_a, + "me_a" : me_a, + "sm_a" : sm_a + } + return render(request, 'department/alumni.html', context_a) + def approved(request): """ This function is used to approve requests. @@ -692,6 +532,7 @@ def approved(request): request.method = '' return redirect('/dep/facView/') + def deny(request): """ This function is used to deny requests. @@ -706,6 +547,4 @@ def deny(request): remark = request.POST.get('remark') SpecialRequest.objects.filter(id=request_id).update(status="Denied", remarks=remark) request.method = '' - return redirect('/dep/facView/') - - + return redirect('/dep/facView/') \ No newline at end of file diff --git a/FusionIIIT/templates/department/AllStudents.html b/FusionIIIT/templates/department/AllStudents.html index 2d7b5cdf9..8df5683d3 100644 --- a/FusionIIIT/templates/department/AllStudents.html +++ b/FusionIIIT/templates/department/AllStudents.html @@ -2,118 +2,121 @@ {% load static %} {% block title %} - Students_List +Students_List {% endblock %} {% block body %} - - {% block navBar %} - {% include 'dashboard/navbar.html' %} - {% endblock %} - - {% comment %}The tab menu starts here!{% endcomment %} - - {% comment %}
{% endcomment %} -
- - {% if student_list %} - +{% comment %}
{% endcomment %} +
+ + {% if student_list %} +
- - - - - - - - - - - + + + + + + + + + + + {% for stu in student_list %} - + - + - + - + - + - + {% endfor %} - +
RollDepartmentProgrammeBatchCpiCategoryFirst NameLast NameHall No.Room No.SpecializationRollDepartmentProgrammeBatchCPICategoryFirst NameLast NameHall No.Room No.Specialization
{{ stu.id.user }} {{ stu.id.department.name }} {{ stu.programme }}{{ stu.batch }}{{ stu.batch }} {{ stu.cpi }}{{ stu.category }}{{ stu.category }} {{ stu.id.user.first_name }}{{ stu.id.user.last_name }}{{ stu.id.user.last_name }} {{ stu.hall_no }}{{ stu.room_no }}{{ stu.room_no }} {{ stu.specialization }}
- {% comment %}
- - {% if student_list.has_previous %} - Previous < - {% endif %} - - {{student_list.number}} - - {% if student_list.has_next %} - > Next - {% endif %} - -
- - {% else %} + {% comment %}
+ + {% if student_list.has_previous %} + Previous < + {% endif %} + + {{student_list.number}} + + {% if student_list.has_next %} + > Next + {% endif %} + +
+ + {% else %}

No Students Records. Table Not Created.

{% endcomment %} - {% else %} -

No Students Records found.

- + {% else %} +

No Students Records found.

+ - {% endif %} + {% endif %} + - -
- {% comment %}
{% endcomment %} -
+
+ {% comment %} + {% endcomment %} + {% comment %} {% endblock %} {% endcomment %} diff --git a/FusionIIIT/templates/department/admin_cse.html b/FusionIIIT/templates/department/admin_cse.html new file mode 100644 index 000000000..53b8adc76 --- /dev/null +++ b/FusionIIIT/templates/department/admin_cse.html @@ -0,0 +1,140 @@ +{% extends 'globals/base.html' %} +{% load static %} + +{% block title %} + Department - Faculty View +{% endblock %} + +{% block body %} + {% block navBar %} + {% include 'dashboard/navbar.html' %} + {% endblock %} + + {# The grid starts here! #} +
+ {# The left-margin segment! #} +
+ + {# The left-rail segment starts here! #} +
+ {# The user image card starts here! #} + {% block usercard %} + {% include 'globals/usercard.html' %} + {% endblock %} + {# The user image card ends here! #} + +
+ + {# The Tab-Menu starts here! #} + + + {# The Tab-Menu ends here! #} +
+ {# The left-rail segment ends here! #} + + {# The central-rail segment starts here! #} +
+ {# Make announcement #} +
+ {% block make_announcement %} + {% if user_designation == "faculty" %} + {% include "department/make_announcements_fac.html" %} + {% elif user_designation == "staff" %} + {% include "department/make_announcements_staff.html" %} + {% endif %} + {% endblock %} +
+ {# Make announcement #} + + {# See announcement #} +
+ {% block browse_announcement %} + {% if user_designation == "faculty" %} + {% include "department/browse_announcements.html" %} + {% elif user_designation == "staff" %} + {% include "department/browse_announcements_staff.html" %} + {% endif %} + {% endblock %} +
+ {# See announcement #} + + {# CSE Department! #} +
+ {% block CSE_Dep %} + {% include "department/cse_dep.html" %} + {% endblock %} +
+ {# ECE Department! #} +
+ {% block ECE_Dep %} + {% include "department/ece_dep.html" %} + {% endblock %} +
+
+ {% block ME_Dep %} + {% include "department/me_dep.html" %} + {% endblock %} +
+
+ {% block SM_Dep %} + {% include "department/sm_dep.html" %} + {% endblock %} +
+ + {# Status of request! #} +
+ {% block request_status %} + {% include "department/update_department_information.html" %} + {% endblock %} +
+
+ {# The central-rail segment ends here! #} + +
+
+ {# TODO: the right rail! #} +
+
+ {# The right-rail segment ends here! #} + + {# The right-margin segment! #} +
+
+ {# The grid ends here! #} + + {% include 'department/alert.html' %} +{% endblock %} diff --git a/FusionIIIT/templates/department/admin_ece.html b/FusionIIIT/templates/department/admin_ece.html new file mode 100644 index 000000000..e82dfc5ad --- /dev/null +++ b/FusionIIIT/templates/department/admin_ece.html @@ -0,0 +1,140 @@ +{% extends 'globals/base.html' %} +{% load static %} + +{% block title %} + Department - Faculty View +{% endblock %} + +{% block body %} + {% block navBar %} + {% include 'dashboard/navbar.html' %} + {% endblock %} + + {# The grid starts here! #} +
+ {# The left-margin segment! #} +
+ + {# The left-rail segment starts here! #} +
+ {# The user image card starts here! #} + {% block usercard %} + {% include 'globals/usercard.html' %} + {% endblock %} + {# The user image card ends here! #} + +
+ + {# The Tab-Menu starts here! #} + + {# The Tab-Menu ends here! #} +
+ {# The left-rail segment ends here! #} + + {# The central-rail segment starts here! #} +
+ {# Make announcement #} +
+ {% block make_announcement %} + {% if user_designation == "faculty" %} + {% include "department/make_announcements_fac.html" %} + {% elif user_designation == "staff" %} + {% include "department/make_announcements_staff.html" %} + {% endif %} + {% endblock %} +
+ {# Make announcement #} + + {# See announcement #} +
+ {% block browse_announcement %} + {% if user_designation == "faculty" %} + {% include "department/browse_announcements.html" %} + {% elif user_designation == "staff" %} + {% include "department/browse_announcements_staff.html" %} + {% endif %} + {% endblock %} +
+ {# See announcement #} + + {# CSE Department! #} +
+ {% block CSE_Dep %} + {% include "department/ece_dep.html" %} + {% endblock %} +
+ {# ECE Department! #} +
+ {% block ECE_Dep %} + {% include "department/cse_dep.html" %} + {% endblock %} +
+
+ {% block ME_Dep %} + {% include "department/me_dep.html" %} + {% endblock %} +
+
+ {% block SM_Dep %} + {% include "department/sm_dep.html" %} + {% endblock %} +
+ + {# Status of request! #} +
+ {% block request_status %} + {% include "department/update_department_information.html" %} + {% endblock %} +
+
+ {# The central-rail segment ends here! #} + +
+
+ {# TODO: the right rail! #} +
+
+ {# The right-rail segment ends here! #} + + {# The right-margin segment! #} +
+
+ {# The grid ends here! #} + + {% include 'department/alert.html' %} +{% endblock %} diff --git a/FusionIIIT/templates/department/admin_me.html b/FusionIIIT/templates/department/admin_me.html new file mode 100644 index 000000000..e90c3f0e7 --- /dev/null +++ b/FusionIIIT/templates/department/admin_me.html @@ -0,0 +1,139 @@ +{% extends 'globals/base.html' %} +{% load static %} + +{% block title %} + Department - Faculty View +{% endblock %} + +{% block body %} + {% block navBar %} + {% include 'dashboard/navbar.html' %} + {% endblock %} + + {# The grid starts here! #} +
+ {# The left-margin segment! #} +
+ + {# The left-rail segment starts here! #} +
+ {# The user image card starts here! #} + {% block usercard %} + {% include 'globals/usercard.html' %} + {% endblock %} + {# The user image card ends here! #} + +
+ + {# The Tab-Menu starts here! #} + + {# The Tab-Menu ends here! #} +
+ {# The left-rail segment ends here! #} + + {# The central-rail segment starts here! #} +
+ {# Make announcement #} +
+ {% block make_announcement %} + {% if user_designation == "faculty" %} + {% include "department/make_announcements_fac.html" %} + {% elif user_designation == "staff" %} + {% include "department/make_announcements_staff.html" %} + {% endif %} + {% endblock %} +
+ {# Make announcement #} + + {# See announcement #} +
+ {% block browse_announcement %} + {% if user_designation == "faculty" %} + {% include "department/browse_announcements.html" %} + {% elif user_designation == "staff" %} + {% include "department/browse_announcements_staff.html" %} + {% endif %} + {% endblock %} +
+ {# See announcement #} + + {# CSE Department! #} +
+ {% block ME_Dep %} + {% include "department/me_dep.html" %} + {% endblock %} +
+ {# CSE Department! #} +
+ {% block CSE_Dep %} + {% include "department/cse_dep.html" %} + {% endblock %} +
+
+ {% block ECE_Dep %} + {% include "department/ece_dep.html" %} + {% endblock %} +
+
+ {% block SM_Dep %} + {% include "department/sm_dep.html" %} + {% endblock %} +
+ + {# Status of request! #} +
+ {% block request_status %} + {% include "department/update_department_information.html" %} + {% endblock %} +
+
+ {# The central-rail segment ends here! #} + +
+
+ {# TODO: the right rail! #} +
+
+ {# The right-rail segment ends here! #} + + {# The right-margin segment! #} +
+
+ {# The grid ends here! #} + + {% include 'department/alert.html' %} +{% endblock %} diff --git a/FusionIIIT/templates/department/admin_sm.html b/FusionIIIT/templates/department/admin_sm.html new file mode 100644 index 000000000..9630a9e1a --- /dev/null +++ b/FusionIIIT/templates/department/admin_sm.html @@ -0,0 +1,139 @@ +{% extends 'globals/base.html' %} +{% load static %} + +{% block title %} + Department - Faculty View +{% endblock %} + +{% block body %} + {% block navBar %} + {% include 'dashboard/navbar.html' %} + {% endblock %} + + {# The grid starts here! #} +
+ {# The left-margin segment! #} +
+ + {# The left-rail segment starts here! #} +
+ {# The user image card starts here! #} + {% block usercard %} + {% include 'globals/usercard.html' %} + {% endblock %} + {# The user image card ends here! #} + +
+ + {# The Tab-Menu starts here! #} + + {# The Tab-Menu ends here! #} +
+ {# The left-rail segment ends here! #} + + {# The central-rail segment starts here! #} +
+ {# Make announcement #} +
+ {% block make_announcement %} + {% if user_designation == "faculty" %} + {% include "department/make_announcements_fac.html" %} + {% elif user_designation == "staff" %} + {% include "department/make_announcements_staff.html" %} + {% endif %} + {% endblock %} +
+ {# Make announcement #} + + {# See announcement #} +
+ {% block browse_announcement %} + {% if user_designation == "faculty" %} + {% include "department/browse_announcements.html" %} + {% elif user_designation == "staff" %} + {% include "department/browse_announcements_staff.html" %} + {% endif %} + {% endblock %} +
+ {# See announcement #} + + {# CSE Department! #} +
+ {% block SM_Dep %} + {% include "department/sm_dep.html" %} + {% endblock %} +
+ {# CSE Department! #} +
+ {% block CSE_Dep %} + {% include "department/cse_dep.html" %} + {% endblock %} +
+
+ {% block ECE_Dep %} + {% include "department/ece_dep.html" %} + {% endblock %} +
+
+ {% block ME_Dep %} + {% include "department/me_dep.html" %} + {% endblock %} +
+ + {# Status of request! #} +
+ {% block request_status %} + {% include "department/update_department_information.html" %} + {% endblock %} +
+
+ {# The central-rail segment ends here! #} + +
+
+ {# TODO: the right rail! #} +
+
+ {# The right-rail segment ends here! #} + + {# The right-margin segment! #} +
+
+ {# The grid ends here! #} + + {% include 'department/alert.html' %} +{% endblock %} diff --git a/FusionIIIT/templates/department/alumni.html b/FusionIIIT/templates/department/alumni.html new file mode 100644 index 000000000..c752d05a1 --- /dev/null +++ b/FusionIIIT/templates/department/alumni.html @@ -0,0 +1,55 @@ +{% extends 'globals/base.html' %} +{% load static %} + +{% block title %} + Alumni_List +{% endblock %} + +{% block body %} + + {% block navBar %} + {% include 'dashboard/navbar.html' %} + {% endblock %} + + {% comment %}The tab menu starts here!{% endcomment %} + + + {% comment %}
{% endcomment %} +
+ + + + + + + + + + + + + + + + +
+ {% comment %} {% endcomment %} + + + +{% comment %} {% endblock %} {% endcomment %} + +{% include 'department/alert.html' %} +{% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/department/browse_announcements.html b/FusionIIIT/templates/department/browse_announcements.html index aa08eec20..80ee4c96e 100644 --- a/FusionIIIT/templates/department/browse_announcements.html +++ b/FusionIIIT/templates/department/browse_announcements.html @@ -37,7 +37,7 @@

View Department-wise Announcements

{% comment %} {% if ann_list %} {% endcomment %} -
RollDepartmentProgrammeBatchCpiCategoryFirst NameLast NameHall No.Room No.Specialization
+
diff --git a/FusionIIIT/templates/department/browse_announcements_staff.html b/FusionIIIT/templates/department/browse_announcements_staff.html index 1b54e895e..1c30979ff 100644 --- a/FusionIIIT/templates/department/browse_announcements_staff.html +++ b/FusionIIIT/templates/department/browse_announcements_staff.html @@ -37,7 +37,7 @@

View Category-wise Announcements

{% comment %} {% if ann_list %} {% endcomment %} -
Announcement Date Announcement By
+
diff --git a/FusionIIIT/templates/department/cse_dep.html b/FusionIIIT/templates/department/cse_dep.html index bac1a9c7e..210ec0086 100644 --- a/FusionIIIT/templates/department/cse_dep.html +++ b/FusionIIIT/templates/department/cse_dep.html @@ -21,27 +21,18 @@

Welcome to CSE Department

Students - {% if user.extrainfo.department.name == "CSE" %} + Announcements - {% endif %} + + + Alumni + + {% comment %} - Requests {% endcomment %} - - Alumni - - - Track records - - - Alumni - - - Track records -
@@ -74,49 +65,20 @@

+

Phone Number: {{ department_info.cse_info.phone_number }}

+

Email: {{ department_info.cse_info.email }}

- Central Library : + Facilities :

- Institute library has e-resources through INDEST, Science Direct, IEEE, ACM, Springger Link, Nature and ASME. The Institute also has access to various online research journals & articles like following resources SIAm, AMS, ACS, Kluwer, APS, Palgrave, INFORMS, Rev.of Scientific Instruments, Appl.Physics Letters and the search engine Scopus. Total number of books in the Institute library by the year 2009-10 are approximately 6742. -

-

- High Performance Computing Labortory : Specification of Parallel Cluster (for Central Computing Facility)- JS22 Blade No.3, 16GB(2*8GB) DDR2 533 Mhz DiMMs, IBM 146GB SAS 10K SFF HDD, IBM blade center JS22 4-core 4.0 Ghz Processor and WiFi Campus etc. -

+ {{ department_info.cse_info.facilites|linebreaks}} +

Lab Infrastructure :

-
    -
  1. -

    - Advanced Manufacturing Laboratory : This Laboratory contains Rapid Prototyping Machine, CNC Controlled Abrasive Waterjet Machine, CNC Milling Center, CNC Turning Center, Dynamometer, Electro Chemical Machining System, Injection Moulding Machine etc. -

    -
  2. -
    -
  3. -

    - Biometric Laboratory : This Laboratory contains S Series, H Series, W Series cameras and p6 p520(Tower Model), p6 p520:8203 Model servers Made by IBM etc. -

    -
  4. -
    -
  5. -

    - Digital Signal Processing and Image Processing Laboratory : This Laboratory contains DSP Starter SPARTAN-3 kit (DSK), TMS 320C6713 DSK with CCS (Code Composer Studio), Image Daughter Kit with CCD Cameras, Bloom with DSP, Matrox Imaging Library, Matrox Morphis, Frame Graber Card, Color CCD Camera for online Processing etc. -

    -
  6. -
    -
  7. -

    - Infrared Imaging Laboratory : This Laboratory contains Radiometeric calibration, Extender rings, NDT Base Module, Central computing unit with TFT display, Software Modules for Lockin, Transient-and Pulse Measurement, Module Pulse- and Transient- Thermography, Source for Vibro- Thermography etc. -

    -
  8. -
    -
  9. -

    - Materials Research Laboratory : This Laboratory contains three important instruments for material characterization which are X-Ray Diffractometer (XRD), Scanning Electron Microscope (SEM) and Atomic Force Microscope (AFM) including SPM, MFM etc. -

    -
  10. -
+

+ {{ department_info.cse_info.labs|linebreaks }} +

@@ -138,17 +100,14 @@

{% comment %} {% if ann_list %} {% endcomment %} -

Announcement Date Announcement By
- - +
Serial No.
+ + - - - {% comment %} - - - + + + {% comment %} {% endcomment %} @@ -158,12 +117,11 @@

{% for fcu in fac_list.cse_f %}

{% with "/eis/profile/"|add:fcu.user.username as link %} - - + + - {% comment %} + - {% comment %} @@ -185,7 +143,6 @@

{% comment %} tabs contains Announcement_List {% endcomment %}
- {% if user.extrainfo.department.name == "CSE" %}
@@ -240,7 +197,6 @@

- {% endif %}
{% comment %} tabs content students {% endcomment %} @@ -275,13 +231,13 @@


@@ -300,26 +256,26 @@

{% comment %} {% endcomment %}
@@ -333,7 +289,70 @@

-
+
+
+
+
+ + {% comment %}Get student Data{% endcomment %} +
+
+ + PhD Students +
+ +
+ +
+
+ + MTech Students +
+ +
+ + + +
+
+ + BTech Students +
+ +
+ +
+
+
+
+
+
+ + {% comment %}
@@ -361,7 +380,7 @@

{% endblock %} {% endwith %} - {% comment %}
{% endcomment %} +

@@ -376,36 +395,19 @@

{% include "department/request_history.html" %} {% endblock %} - {% comment %}
{% endcomment %} +

- {% comment %}
{% endcomment %} - - - - -
-
-
-
- {% comment %}
{% endcomment %} -
-
-
-
-
-
-
-
- {% comment %}
{% endcomment %} +
-
+ {% endcomment %} + {% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/department/cse_index.html b/FusionIIIT/templates/department/cse_index.html new file mode 100644 index 000000000..bd3e3a97b --- /dev/null +++ b/FusionIIIT/templates/department/cse_index.html @@ -0,0 +1,110 @@ +{% extends 'globals/base.html' %} +{% load static %} + + +{% block title %} + Department +{% endblock %} + + +{% block body %} + {% block navBar %} + {% include 'dashboard/navbar.html' %} + {% endblock %} + + {% comment %}The grid starts here!{% endcomment %} +
+
+ +
+ {% block usercard %} + {% include 'globals/usercard.html' %} + {% endblock %} +
+ +
+ {% comment %} + The left-rail segment ends here! + {% endcomment %} + + + + {% comment %} + The central-rail segment starts here! + {% endcomment %} +
+ + + {% comment %}CSE Department!{% endcomment %} +
+ {% block CSE_Dep %} + {{ user_designation }} + {% include "department/cse_dep.html" %} + {% endblock %} +
+ {% comment %}CSE Department!{% endcomment %} + + {% comment %}ECE Department!{% endcomment %} +
+ {% block ECE_Dep %} + {% include "department/ece_dep.html" %} + {% endblock %} +
+ {% comment %}ECE Department!{% endcomment %} + + {% comment %}ME Department!{% endcomment %} +
+ {% block ME_Dep %} + {% include "department/me_dep.html" %} + {% endblock %} +
+ {% comment %}ME Department!{% endcomment %} + + {% comment %}SM Department!{% endcomment %} +
+ {% block SM_Dep %} + {% include "department/sm_dep.html" %} + {% endblock %} +
+ {% comment %}SM{% endcomment %} +
+ +
+
+ {% comment %} + TODO: the right rail! + {% endcomment %} +
+
+ {% comment %}The right-rail segment ends here!{% endcomment %} + + {% comment %}The right-margin segment!{% endcomment %} +
+ + +
+ {% comment %}The grid ends here!{% endcomment %} + + +{% include 'department/alert.html' %} +{% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/department/csedep_request.html b/FusionIIIT/templates/department/csedep_request.html new file mode 100644 index 000000000..f058565dc --- /dev/null +++ b/FusionIIIT/templates/department/csedep_request.html @@ -0,0 +1,140 @@ +{% extends 'globals/base.html' %} +{% load static %} + +{% block title %} + Department - Faculty View +{% endblock %} + +{% block body %} + {% block navBar %} + {% include 'dashboard/navbar.html' %} + {% endblock %} + + {# The grid starts here! #} +
+ {# The left-margin segment! #} +
+ + {# The left-rail segment starts here! #} +
+ {# The user image card starts here! #} + {% block usercard %} + {% include 'globals/usercard.html' %} + {% endblock %} + {# The user image card ends here! #} + +
+ + {# The Tab-Menu starts here! #} + + + {# The Tab-Menu ends here! #} +
+ {# The left-rail segment ends here! #} + + {# The central-rail segment starts here! #} +
+ {# Make announcement #} +
+ {% block make_announcement %} + {% if user_designation == "faculty" %} + {% include "department/make_announcements_fac.html" %} + {% elif user_designation == "staff" %} + {% include "department/make_announcements_staff.html" %} + {% endif %} + {% endblock %} +
+ {# Make announcement #} + + {# See announcement #} +
+ {% block browse_announcement %} + {% if user_designation == "faculty" %} + {% include "department/browse_announcements.html" %} + {% elif user_designation == "staff" %} + {% include "department/browse_announcements_staff.html" %} + {% endif %} + {% endblock %} +
+ {# See announcement #} + + {# CSE Department! #} +
+ {% block CSE_Dep %} + {% include "department/cse_dep.html" %} + {% endblock %} +
+ {# CSE Department! #} +
+ {% block ECE_Dep %} + {% include "department/ece_dep.html" %} + {% endblock %} +
+
+ {% block ME_Dep %} + {% include "department/me_dep.html" %} + {% endblock %} +
+
+ {% block SM_Dep %} + {% include "department/sm_dep.html" %} + {% endblock %} +
+ + {# Status of request! #} +
+ {% block request_status %} + {% include "department/update_department_information.html" %} + {% endblock %} +
+
+ {# The central-rail segment ends here! #} + +
+
+ {# TODO: the right rail! #} +
+
+ {# The right-rail segment ends here! #} + + {# The right-margin segment! #} +
+
+ {# The grid ends here! #} + + {% include 'department/alert.html' %} +{% endblock %} diff --git a/FusionIIIT/templates/department/dep_request.html b/FusionIIIT/templates/department/dep_request.html index 85954600e..37d375246 100644 --- a/FusionIIIT/templates/department/dep_request.html +++ b/FusionIIIT/templates/department/dep_request.html @@ -47,11 +47,29 @@ - + {% comment %} Request Status + {% endcomment %} + + CSE Department + + + + + ECE Department + + + + + ME Department + + + + + SM Department + - @@ -92,14 +110,44 @@ {% endblock %} {% comment %}See announcement{% endcomment %} + {% comment %}CSE Department!{% endcomment %} +
+ {% block CSE_Dep %} + {% include "department/cse_dep.html" %} + {% endblock %} +
+ {% comment %}CSE Department!{% endcomment %} + + {% comment %}ECE Department!{% endcomment %} +
+ {% block ECE_Dep %} + {% include "department/ece_dep.html" %} + {% endblock %} +
+ {% comment %}ECE Department!{% endcomment %} + + {% comment %}ME Department!{% endcomment %} +
+ {% block ME_Dep %} + {% include "department/me_dep.html" %} + {% endblock %} +
+ {% comment %}ME Department!{% endcomment %} + + {% comment %}SM Department!{% endcomment %} +
+ {% block SM_Dep %} + {% include "department/sm_dep.html" %} + {% endblock %} +
+ {% comment %}SM{% endcomment %} {% comment %}status of request!{% endcomment %} -
+
{% block request_status %} {% include "department/request_status.html" %} {% endblock %}
- {% comment %}status of request!{% endcomment %} @@ -116,6 +164,7 @@ {% comment %}The right-margin segment!{% endcomment %}
+
diff --git a/FusionIIIT/templates/department/design_dep.html b/FusionIIIT/templates/department/design_dep.html deleted file mode 100644 index 1fcac3d4f..000000000 --- a/FusionIIIT/templates/department/design_dep.html +++ /dev/null @@ -1,401 +0,0 @@ -{% load static %} - -{% block CSE_Dep %} - -

Welcome to DESIGN Department

- - {% comment %} tabs ui {% endcomment %} - -
-
-
-
- -

- Our Mission : -

-

- The mission of the Computer Engineering Department is to provide educational programs that would encourage students to read critically, reason analytically, communicate persuasively, apply professionally and prepare them to excel in the field of computing. -

-

- Our Vision : -

-

- The vision of the Computer Engineering Department is to recognize itself as renowned department in the field of technical education in Computer Engineering and strives to carry out the superior level of research based on the quality, innovation and excellence; with the help of its stakeholders viz. the students, research scholars, faculty members, the support staff and the alumni. -

-
-
-
-
-
-
- - {% comment %} tabs content facilities {% endcomment %} -
-
-
-
- -

- Central Library : -

-

- Institute library has e-resources through INDEST, Science Direct, IEEE, ACM, Springger Link, Nature and ASME. The Institute also has access to various online research journals & articles like following resources SIAm, AMS, ACS, Kluwer, APS, Palgrave, INFORMS, Rev.of Scientific Instruments, Appl.Physics Letters and the search engine Scopus. Total number of books in the Institute library by the year 2009-10 are approximately 6742. -

-

- High Performance Computing Labortory : Specification of Parallel Cluster (for Central Computing Facility)- JS22 Blade No.3, 16GB(2*8GB) DDR2 533 Mhz DiMMs, IBM 146GB SAS 10K SFF HDD, IBM blade center JS22 4-core 4.0 Ghz Processor and WiFi Campus etc. -

-

- Lab Infrastructure : -

-
    -
  1. -

    - Advanced Manufacturing Laboratory : This Laboratory contains Rapid Prototyping Machine, CNC Controlled Abrasive Waterjet Machine, CNC Milling Center, CNC Turning Center, Dynamometer, Electro Chemical Machining System, Injection Moulding Machine etc. -

    -
  2. -
    -
  3. -

    - Biometric Laboratory : This Laboratory contains S Series, H Series, W Series cameras and p6 p520(Tower Model), p6 p520:8203 Model servers Made by IBM etc. -

    -
  4. -
    -
  5. -

    - Digital Signal Processing and Image Processing Laboratory : This Laboratory contains DSP Starter SPARTAN-3 kit (DSK), TMS 320C6713 DSK with CCS (Code Composer Studio), Image Daughter Kit with CCD Cameras, Bloom with DSP, Matrox Imaging Library, Matrox Morphis, Frame Graber Card, Color CCD Camera for online Processing etc. -

    -
  6. -
    -
  7. -

    - Infrared Imaging Laboratory : This Laboratory contains Radiometeric calibration, Extender rings, NDT Base Module, Central computing unit with TFT display, Software Modules for Lockin, Transient-and Pulse Measurement, Module Pulse- and Transient- Thermography, Source for Vibro- Thermography etc. -

    -
  8. -
    -
  9. -

    - Materials Research Laboratory : This Laboratory contains three important instruments for material characterization which are X-Ray Diffractometer (XRD), Scanning Electron Microscope (SEM) and Atomic Force Microscope (AFM) including SPM, MFM etc. -

    -
  10. -
-
-
-
-
-
-
- - {% comment %} tabs content faculty {% endcomment %} - - - - {% comment %}The tab menu starts here!{% endcomment %} -
-
-
-
- - -
- - {% comment %} {% if ann_list %} {% endcomment %} -
ID Faculty Name Research Interest Email sex date_of_birth address phone_no Gender DoB Phone Number user_type department github
{{ forloop.counter }}{{ fcu.id }}{{ fcu.id }}{{fcu.title}} {{ fcu.user.first_name}} {{ fcu.user.last_name}} {{ fcu.sex }}{{ fcu.sex }} {{ fcu.date_of_birth }}{{ fcu.address }} {{ fcu.phone_no }}{{ fcu.user_type }} {{ fcu.department.name }}
- - - - - {% comment %} - - - - {% comment %} - - {% endcomment %} - - - - {% for fcu in fac_list.design_f %} - - {% with "/eis/profile/"|add:fcu.user.username as link %} - - - - {% comment %} - - - {% endcomment %} - {% comment %} - - {% endcomment %} - {% endwith %} - - - {% endfor %} - -
Serial No. Faculty Name sex date_of_birth address phone_no user_type department github
{{ fcu.id }}{{ fcu.user.first_name}} {{ fcu.user.last_name}}{{ fcu.sex }}{{ fcu.date_of_birth }}{{ fcu.address }}{{ fcu.phone_no }}{{ fcu.user_type }}{{ fcu.department.name }}{{ fcu.id.faculty_about.github }}
- -
- -
-
- - - - -{% comment %} tabs contains Announcement_List {% endcomment %} -
- {% if user.extrainfo.department.name == "Design" %} -
-
-
- - -
- - {% comment %} {% if ann_list %} {% endcomment %} - - - - - - - - - - - - {% for stu in announcements.design %} - - - - - - - {% if stu.upload_announcement %} - - {% endif %} - - {% endfor %} - {% for stu in announcements.all %} - - - - - - - {% if stu.upload_announcement %} - - {% endif %} - - {% endfor %} - -
Announcement DateAnnouncement ByProgrammeBatch  MessageFile
{{ stu.ann_date.date }}{{ stu.maker_id.user }}{{ stu.programme }}{{ stu.batch }}{{ stu.message }}
{{ stu.ann_date.date }}{{ stu.maker_id.user }}{{ stu.programme }}{{ stu.batch }}{{ stu.message }}
- {% comment %} {% endif %} {% endcomment %} - {% comment %}

{% endcomment %} -
- -
-
-
-
-
- {% endif %} -
- - {% comment %} tabs content students {% endcomment %} -
-
-
-
- - {% comment %}Get student Data{% endcomment %} -
-
- - PhD Students -
- -
- - - - - - - -
-
-
-
-
-
- -
-
-
-
- - - -
-
-
-
- - {% with fac_list.staffNcse as faculty %} - {% block file-requests %} - {% include "department/file_request.html" %} - {% endblock %} - {% endwith %} - - {% comment %}
{% endcomment %} -
-
-
-
- -
-
-
-
- - {% block request_history %} - {% include "department/request_history.html" %} - {% endblock %} - - {% comment %}
{% endcomment %} -
-
-
-
- -
- {% comment %}
{% endcomment %} -
-
-
-
-
-
-
-
- {% comment %}
{% endcomment %} -
-
-
-
-
-
-
-
- {% comment %}
{% endcomment %} -
-
-
-
- - -{% endblock %} \ No newline at end of file diff --git a/FusionIIIT/templates/department/ece_dep.html b/FusionIIIT/templates/department/ece_dep.html index b3e0083e6..cb43e5361 100644 --- a/FusionIIIT/templates/department/ece_dep.html +++ b/FusionIIIT/templates/department/ece_dep.html @@ -17,28 +17,18 @@

Welcome to ECE Department

Faculty - + Students - {% if user.extrainfo.department.name == "ECE" %} + Announcements - {% endif %} - - {% comment %} - - - Requests - {% endcomment %} - + Alumni - - Track records - @@ -74,34 +64,20 @@

+

Phone Number: {{ department_info.ece_info.phone_number }}

+

Email: {{ department_info.ece_info.email }}

- Central Library : + Facilities :

- Institute library has e-resources through INDEST, Science Direct, IEEE, ACM, Springger Link, Nature and ASME. The Institute also has access to various online research journals & articles like following resources SIAm, AMS, ACS, Kluwer, APS, Palgrave, INFORMS, Rev.of Scientific Instruments, Appl.Physics Letters and the search engine Scopus. Total number of books in the Institute library by the year 2009-10 are approximately 6742. -

+ {{ department_info.ece_info.facilites|linebreaks}} +

Lab Infrastructure :

-
    -
  1. -

    - Circuits and Innovation Lab :This laboratory is dedicated to circuits designing, is intended to serve its facilities as one of the teaching labs and also to facilitate teaching projects and research projects. These projects and teaching work include the experimental and innovative study in the field of analog and digital circuits, microcontrollers and its applications. -

    -
  2. -
    -
  3. -

    - Basic Electronics lab : This Laboratory is dedicated to the concepts and implementation of basic circuits designing. It serves its facilities as one of the teaching labs and also to facilitate course projects -

    -
  4. -
    -
  5. -

    - RF&Applied Electromagnetics : This Laboratory acts as a research lab to researchscholars,research associatives. Main research areas of lab include understanding of high frequency devices ,Antenna theory concepts and design fields. -

    -
  6. -
+

+ {{ department_info.ece_info.labs|linebreaks }} +

@@ -120,17 +96,14 @@

{% comment %} {% if ann_list %} {% endcomment %} - - - +
Serial No.
+ + - - - {% comment %} - - - + + + {% comment %} {% endcomment %} @@ -140,14 +113,13 @@

{% for fcu in fac_list.ece_f %}

{% with "/eis/profile/"|add:fcu.user.username as link %} - - - {% comment %} + + + - - + {% comment %} {% endcomment %} {% endwith %} @@ -167,7 +139,6 @@

{% comment %} tabs contains Announcement_List {% endcomment %}
- {% if user.extrainfo.department.name == "ECE" %}
@@ -221,7 +192,6 @@

- {% endif %}
{% comment %} tabs content students {% endcomment %} @@ -256,13 +226,13 @@


@@ -281,26 +251,26 @@

{% comment %} {% endcomment %}
@@ -314,77 +284,69 @@

-
+
-

ID Faculty Name Research Interest Email sex date_of_birth address phone_no Gender DoB Phone Number user_type department github
{{ forloop.counter }}{{ fcu.id }}{{ fcu.id }}{{fcu.title}} {{ fcu.user.first_name}} {{ fcu.user.last_name}} {{ fcu.sex }} {{ fcu.date_of_birth }}{{ fcu.address }} {{ fcu.phone_no }}{{ fcu.user_type }}{{ fcu.user_type }} {{ fcu.department.name }} {{ fcu.id.faculty_about.github }}
- - + + - - - - + + + @@ -48,7 +47,6 @@ - diff --git a/FusionIIIT/templates/department/file_request.html b/FusionIIIT/templates/department/file_request.html index 05c3337ef..033e43c50 100644 --- a/FusionIIIT/templates/department/file_request.html +++ b/FusionIIIT/templates/department/file_request.html @@ -10,7 +10,7 @@ {% endcomment %} {% comment %}
{% endcomment %} -
+
{% csrf_token %}
@@ -77,11 +77,16 @@
{% endcomment %} +
+ + + +
+
+ -
- {% comment %}
{% endcomment %} {% comment %}
{% endcomment %} diff --git a/FusionIIIT/templates/department/index.html b/FusionIIIT/templates/department/index.html index 4aaf7b6cd..10ebb1c26 100644 --- a/FusionIIIT/templates/department/index.html +++ b/FusionIIIT/templates/department/index.html @@ -24,13 +24,15 @@
{% comment %}The user image card starts here!{% endcomment %} + {% block usercard %} + {% include 'globals/usercard.html' %} + {% endblock %} {% comment %}The user image card ends here!{% endcomment %} + +
- - {% comment %}
{% endcomment %} - {% comment %}The Tab-Menu starts here!{% endcomment %} {% comment %}The Tab-Menu ends here!{% endcomment %} @@ -74,7 +70,7 @@ {% comment %} The central-rail segment starts here! {% endcomment %} -
+
{% comment %}CSE Department!{% endcomment %} @@ -109,14 +105,6 @@ {% endblock %}
{% comment %}SM{% endcomment %} - - {% comment %}Design Department!{% endcomment %} -
- {% block DESIGN_Dep %} - {% include "department/design_dep.html" %} - {% endblock %} - {% comment %}Design Department!{% endcomment %} -
diff --git a/FusionIIIT/templates/department/make_announcements_fac.html b/FusionIIIT/templates/department/make_announcements_fac.html index 7f4892535..4ded92f63 100644 --- a/FusionIIIT/templates/department/make_announcements_fac.html +++ b/FusionIIIT/templates/department/make_announcements_fac.html @@ -13,6 +13,7 @@
+ {% csrf_token %}
Make a new Announcement: diff --git a/FusionIIIT/templates/department/make_announcements_staff.html b/FusionIIIT/templates/department/make_announcements_staff.html index 50e38161f..f843bfcea 100644 --- a/FusionIIIT/templates/department/make_announcements_staff.html +++ b/FusionIIIT/templates/department/make_announcements_staff.html @@ -13,6 +13,7 @@ + {% csrf_token %}
Make a new Announcement for Students: diff --git a/FusionIIIT/templates/department/me_dep.html b/FusionIIIT/templates/department/me_dep.html index 4cb7fbe47..37dabf835 100644 --- a/FusionIIIT/templates/department/me_dep.html +++ b/FusionIIIT/templates/department/me_dep.html @@ -21,21 +21,15 @@

Welcome to ME Department

Students - {% if user.extrainfo.department.name == "ME" %} + Announcements - {% endif %} - {% comment %} - - Requests - {% endcomment %} - + + Alumni - - Track records - +
@@ -71,110 +65,26 @@

+

Phone Number: {{ department_info.me_info.phone_number }}

+

Email: {{ department_info.me_info.email }}

- Central Library : + Facilities :

- Institute library has e-resources through INDEST, Science Direct, IEEE, ACM, Springger Link, Nature and ASME. The Institute also has access to various online research journals & articles like following resources SIAm, AMS, ACS, Kluwer, APS, Palgrave, INFORMS, Rev.of Scientific Instruments, Appl.Physics Letters and the search engine Scopus. Total number of books in the Institute library by the year 2009-10 are approximately 6742. -

-

- High Performance Computing Labortory : Specification of Parallel Cluster (for Central Computing Facility)- JS22 Blade No.3, 16GB(2*8GB) DDR2 533 Mhz DiMMs, IBM 146GB SAS 10K SFF HDD, IBM blade center JS22 4-core 4.0 Ghz Processor and WiFi Campus etc. -

+ {{ department_info.me_info.facilites|linebreaks}} +

Lab Infrastructure :

-
    -
  1. -

    - Health Monitoring, Measurement and Instrumentation Lab: -

    -
  2. -
    -
  3. -

    - Kinematics and Dynamics Lab : -

    -
  4. -
    -
  5. -

    - PG Research Lab : -

    -
  6. -
    -
  7. -

    - Fluid Mechaniccs Lab : -

    -
  8. -
    -
  9. -

    - Automobile Lab : -

    -
  10. -
    -
  11. -

    - IT Workshop/Computational Lab: -

    -
  12. -
    -
  13. -

    - Material Characterization Lab : -

    -
  14. -
    -
  15. -

    - Machine Dynamics and Vibrations Lab : -

    -
  16. -
    -
  17. -

    - Mechatronics Lab: -

    -
  18. -
    -
  19. -

    - Robotics Lab: -

    -
  20. -
    -
  21. -

    - Biomedical Engineering and Technology Lab: -

    -
  22. -
    -
  23. -

    - CFD Lab : -

    -
  24. -
    -
  25. -

    - Dieless Manufacturing Center: -

    -
  26. -
    -
  27. -

    - Manufacturing Innovation Center: -

    -
  28. -
+

+ {{ department_info.me_info.labs|linebreaks }} +

- {% comment %} tabs content faculty {% endcomment %} {% comment %}The tab menu starts here!{% endcomment %}
@@ -186,17 +96,14 @@

{% comment %} {% if ann_list %} {% endcomment %} -

id faculty name ID Faculty Name sex date_of_birth address phone_no Gender DoB Phone Number user_type department github {{ fcu.sex }} {{ fcu.date_of_birth }}{{ fcu.address }} {{ fcu.phone_no }} {{ fcu.user_type }} {{ fcu.department.name }}
- - +
Serial No.
+ + - - - {% comment %} - - - + + + {% comment %} {% endcomment %} @@ -206,12 +113,11 @@

{% for fcu in fac_list.me_f %}

{% with "/eis/profile/"|add:fcu.user.username as link %} - - - {% comment %} + + + - {% comment %} @@ -233,7 +139,6 @@

{% comment %} tabs contains Announcement_List {% endcomment %}
- {% if user.extrainfo.department.name == "ME" %}
@@ -292,7 +197,6 @@

- {% endif %}
{% comment %} tabs content students {% endcomment %} @@ -327,13 +231,13 @@


@@ -351,26 +255,26 @@

{% comment %} {% endcomment %}
@@ -384,75 +288,64 @@

-
+
-

ID Faculty Name Research Interest Email sex date_of_birth address phone_no Gender DoB Phone Number user_type department github
{{ forloop.counter }}{{ fcu.id }}{{ fcu.title }}{{ fcu.id }}{{fcu.title}} {{ fcu.user.first_name}} {{ fcu.user.last_name}} {{ fcu.sex }} {{ fcu.date_of_birth }}{{ fcu.address }} {{ fcu.phone_no }}{{ fcu.user_type }} {{ fcu.department.name }}
+
diff --git a/FusionIIIT/templates/department/request_status.html b/FusionIIIT/templates/department/request_status.html index daeeb3672..f86eeb403 100644 --- a/FusionIIIT/templates/department/request_status.html +++ b/FusionIIIT/templates/department/request_status.html @@ -11,7 +11,7 @@

View Requests

{% comment %} {% if ann_list %} {% endcomment %} -
Request Date Request To
+
diff --git a/FusionIIIT/templates/department/sm_dep.html b/FusionIIIT/templates/department/sm_dep.html index 8c672f25a..9ff46c1a4 100644 --- a/FusionIIIT/templates/department/sm_dep.html +++ b/FusionIIIT/templates/department/sm_dep.html @@ -21,21 +21,14 @@

Welcome to SM Department

Students - {% if user.extrainfo.department.name == "SM" %} + Announcements - {% endif %} - {% comment %} - - Requests - {% endcomment %} - + + Alumni - - Track records - @@ -84,34 +77,20 @@

+

Phone Number: {{ department_info.sm_info.phone_number }}

+

Email: {{ department_info.sm_info.email }}

- Central Library : + Facilities :

- Institute library has e-resources through INDEST, Science Direct, IEEE, ACM, Springger Link, Nature and ASME. The Institute also has access to various online research journals & articles like following resources SIAm, AMS, ACS, Kluwer, APS, Palgrave, INFORMS, Rev.of Scientific Instruments, Appl.Physics Letters and the search engine Scopus. Total number of books in the Institute library by the year 2009-10 are approximately 6742. -

+ {{ department_info.sm_info.facilites|linebreaks}} +

Lab Infrastructure :

-
    -
  1. -

    - Circuits and Innovation Lab :This laboratory is dedicated to circuits designing, is intended to serve its facilities as one of the teaching labs and also to facilitate teaching projects and research projects. These projects and teaching work include the experimental and innovative study in the field of analog and digital circuits, microcontrollers and its applications. -

    -
  2. -
    -
  3. -

    - Basic Electronics lab : This Laboratory is dedicated to the concepts and implementation of basic circuits designing. It serves its facilities as one of the teaching labs and also to facilitate course projects -

    -
  4. -
    -
  5. -

    - RF&Applied Electromagnetics : This Laboratory acts as a research lab to researchscholars,research associatives. Main research areas of lab include understanding of high frequency devices ,Antenna theory concepts and design fields. -

    -
  6. -
+

+ {{ department_info.sm_info.labs|linebreaks }} +

@@ -130,31 +109,28 @@

{% comment %} {% if ann_list %} {% endcomment %} -

Request Date Maker
- - +
Serial No.
+ + - - - {% comment %} - - - + + + {% comment %} {% endcomment %} + {%if fac_list.sm_f%} {% for fcu in fac_list.sm_f %} {% with "/eis/profile/"|add:fcu.user.username as link %} - - - {% comment %} --> + + + - {% comment %} @@ -176,7 +152,6 @@

{% comment %} tabs contains Announcement_List {% endcomment %}
- {% if user.extrainfo.department.name == "SM" %}
@@ -235,7 +210,6 @@

- {% endif %}
@@ -271,13 +245,13 @@


@@ -295,26 +269,26 @@

{% comment %} {% endcomment %}
@@ -328,75 +302,64 @@

-
+
-

ID Faculty Name Research Interest Email sex date_of_birth address phone_no Gender DoB Phone Number user_type department github
{{ forloop.counter }}{{ fcu.id }}{{ fcu.title }}{{ fcu.id }}{{fcu.title}} {{ fcu.user.first_name}} {{ fcu.user.last_name}} {{ fcu.sex }} {{ fcu.date_of_birth }}{{ fcu.address }} {{ fcu.phone_no }}{{ fcu.user_type }} {{ fcu.department.name }}