{{ notice.data.module }}
+
+ ✖
+
{{ notice.timesince }} ago
diff --git a/FusionIIIT/templates/dashboard/alerts1.html b/FusionIIIT/templates/dashboard/alerts1.html
index e2844039f..442570f29 100644
--- a/FusionIIIT/templates/dashboard/alerts1.html
+++ b/FusionIIIT/templates/dashboard/alerts1.html
@@ -14,6 +14,9 @@
Date: Tue, 20 Feb 2024 09:25:40 +0530
Subject: [PATCH 04/10] resolved error in sending notification for
announcements
---
FusionIIIT/applications/department/views.py | 4 ++--
FusionIIIT/notification/views.py | 7 ++++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/FusionIIIT/applications/department/views.py b/FusionIIIT/applications/department/views.py
index ef7e71c64..f138c77db 100644
--- a/FusionIIIT/applications/department/views.py
+++ b/FusionIIIT/applications/department/views.py
@@ -178,7 +178,7 @@ def faculty_view(request):
upload_announcement=upload_announcement,
department = department,
ann_date=ann_date)
- # department_notif(usrnm, recipients , message)
+ department_notif(usrnm, recipients , message)
context = browse_announcements()
return render(request, 'department/dep_request.html', {"user_designation":user_info.user_type,
@@ -223,7 +223,7 @@ def staff_view(request):
upload_announcement=upload_announcement,
department = department,
ann_date=ann_date)
- # department_notif(usrnm, recipients , message)
+ department_notif(usrnm, recipients , message)
context = browse_announcements()
return render(request, 'department/dep_request.html', {"user_designation":user_info.user_type,
diff --git a/FusionIIIT/notification/views.py b/FusionIIIT/notification/views.py
index 0480575b8..54e68ea0f 100644
--- a/FusionIIIT/notification/views.py
+++ b/FusionIIIT/notification/views.py
@@ -1,4 +1,5 @@
from django.shortcuts import render
+from requests import Response
from notifications.signals import notify
# Create your views here.
@@ -69,6 +70,7 @@ def central_mess_notif(sender, recipient, type, message=None):
sender = sender
recipient = recipient
verb = ''
+
if type == 'feedback_submitted':
verb = 'Your feedback has been successfully submitted.'
elif type == 'menu_change_accepted':
@@ -125,8 +127,6 @@ def healthcare_center_notif(sender, recipient, type):
if type == 'amb_req':
verb = "You have a new ambulance request"
-
-
notify.send(sender=sender, recipient=recipient, url=url, module=module, verb=verb)
@@ -384,4 +384,5 @@ def research_procedures_notif(sender,recipient,type):
elif type == "created":
verb = "A new Patent has been Created"
- notify.send(sender=sender,recipient=recipient,url=url,module=module,verb=verb)
\ No newline at end of file
+ notify.send(sender=sender,recipient=recipient,url=url,module=module,verb=verb)
+
From 702c197f4f50b3c6cd42307a1fc89b9d9efa0246 Mon Sep 17 00:00:00 2001
From: KK
Date: Tue, 20 Feb 2024 19:16:51 +0530
Subject: [PATCH 05/10] updated alerts.html and alert1.html for implementing
delete notification
---
FusionIIIT/notification/views.py | 16 +++++++++++++++-
FusionIIIT/templates/dashboard/alerts.html | 2 +-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/FusionIIIT/notification/views.py b/FusionIIIT/notification/views.py
index 54e68ea0f..cf55aabcb 100644
--- a/FusionIIIT/notification/views.py
+++ b/FusionIIIT/notification/views.py
@@ -336,7 +336,21 @@ def department_notif(sender, recipient, type):
sender = sender
recipient = recipient
verb = type
- flag = "department"
+ flag = "announcement"
+
+ notify.send(sender=sender,
+ recipient=recipient,
+ url=url,
+ module=module,
+ verb=verb,
+ flag=flag)
+def examination_notif(sender, recipient, type):
+ url='examination:examination'
+ module='examination'
+ sender = sender
+ recipient = recipient
+ verb = type
+ flag = "announcement"
notify.send(sender=sender,
recipient=recipient,
diff --git a/FusionIIIT/templates/dashboard/alerts.html b/FusionIIIT/templates/dashboard/alerts.html
index 76fcd3c60..42edc5df7 100755
--- a/FusionIIIT/templates/dashboard/alerts.html
+++ b/FusionIIIT/templates/dashboard/alerts.html
@@ -5,7 +5,7 @@
{{ notice.data.module }}
+
+ ✖
+
{{ notice.timesince }} ago
@@ -27,7 +30,6 @@
{% endifnotequal %}
-
{% if notice.unread %}
Mark as Read
From a1ebc28d081f168f65a74107e39f0bdc6af6d381 Mon Sep 17 00:00:00 2001
From: KK
{% for notice in notifications %}
{% comment %}A single notification starts here!{% endcomment %}
- {% ifnotequal notice.data.flag "department" %}
+ {% ifnotequal notice.data.flag "announcement" %}
{% if notice.unread %}
{% else %}
From b54f99982ce74340d22ded68e11adf3aabd12e54 Mon Sep 17 00:00:00 2001
From: kishankoushal <134288275+kishankoushal@users.noreply.github.com>
Date: Tue, 19 Mar 2024 14:48:24 +0530
Subject: [PATCH 06/10] Notifications module(OS-3)_updated dashboard (#1340)
* GAD-5: Fix responsiveness (#1125)
Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com>
Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com>
* updated alerts.html and alert1.html for implementing delete notification
* Added pylint (#1302)
* Create bandit_security_test.yml
Added Bandit security test for python
* Update bandit_security_test.yml
* Update bandit_security_test.yml
* Create pylint.yml
* Update pylint.yml
* Update pylint.yml
* Revert "Added pylint (#1302)" (#1324)
This reverts commit c1359b7ce8a1945e41e90330fe39bc634d9ca6f3.
* GAD -5 Dashboard Changes (#1325)
* dashboard and usercard updated (#1329)
* changes in programme_cuuriculam,adding version to models (#1330)
* made few changes for delete notification
* created sidebar for notifications
* Fixing ui bugs (#1335)
* updated dashboard
* updated dashboard
* updated dashboard
---------
Co-authored-by: Harshvardhan Singh <73544247+Lawful2002@users.noreply.github.com>
Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com>
Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com>
Co-authored-by: akshatnema <20bcs022@iiitdmj.ac.in>
Co-authored-by: Hardik Sharma <104981324+hardiksharma11@users.noreply.github.com>
Co-authored-by: Raman Chaudhary <97114586+ChaudharyRaman@users.noreply.github.com>
Co-authored-by: BlackHAWK2001 <150950834+BlackHAWK2001@users.noreply.github.com>
Co-authored-by: Arpit Tak <140220904+Ishu-ji@users.noreply.github.com>
Co-authored-by: Anudeep Sanapala <71971574+anudeeps0306@users.noreply.github.com>
Co-authored-by: SukulSarve <143542658+SukulSarve@users.noreply.github.com>
---
FusionIIIT/Fusion/context_processors.py | 5 +
.../Fusion/middleware/custom_middleware.py | 48 +++
FusionIIIT/Fusion/settings/common.py | 2 +
FusionIIIT/applications/globals/urls.py | 3 +-
FusionIIIT/applications/globals/views.py | 87 +++++-
.../notifications_extension/api/views.py | 2 +-
.../notifications_extension/views.py | 4 +-
.../programme_curriculum/models.py | 53 ++--
FusionIIIT/notification/views.py | 1 -
.../academic_procedures/academic.html | 44 ++-
FusionIIIT/templates/dashboard/dashboard.html | 11 +-
FusionIIIT/templates/dashboard/modules.html | 279 ++++++++++++++----
FusionIIIT/templates/dashboard/navbar.html | 213 +++++++------
.../templates/dashboard/sidenavbar.html | 46 +--
FusionIIIT/templates/globals/usercard.html | 95 +++---
.../templates/notifications/sidepanel.html | 26 ++
16 files changed, 645 insertions(+), 274 deletions(-)
create mode 100644 FusionIIIT/Fusion/context_processors.py
create mode 100644 FusionIIIT/Fusion/middleware/custom_middleware.py
mode change 100755 => 100644 FusionIIIT/templates/academic_procedures/academic.html
mode change 100755 => 100644 FusionIIIT/templates/dashboard/dashboard.html
mode change 100755 => 100644 FusionIIIT/templates/dashboard/modules.html
mode change 100755 => 100644 FusionIIIT/templates/dashboard/navbar.html
mode change 100755 => 100644 FusionIIIT/templates/globals/usercard.html
create mode 100644 FusionIIIT/templates/notifications/sidepanel.html
diff --git a/FusionIIIT/Fusion/context_processors.py b/FusionIIIT/Fusion/context_processors.py
new file mode 100644
index 000000000..54566d56e
--- /dev/null
+++ b/FusionIIIT/Fusion/context_processors.py
@@ -0,0 +1,5 @@
+def global_vars(request):
+ return {
+ 'global_var': request.session.get('currentDesignationSelected', 'default_value'),
+ 'global_var2': request.session.get('allDesignations', 'default_value2'),
+ }
\ No newline at end of file
diff --git a/FusionIIIT/Fusion/middleware/custom_middleware.py b/FusionIIIT/Fusion/middleware/custom_middleware.py
new file mode 100644
index 000000000..f77873534
--- /dev/null
+++ b/FusionIIIT/Fusion/middleware/custom_middleware.py
@@ -0,0 +1,48 @@
+# custom_middleware.py
+from django.contrib.auth.signals import user_logged_in
+from django.dispatch import receiver
+from applications.globals.models import (ExtraInfo, Feedback, HoldsDesignation,
+ Issue, IssueImage, DepartmentInfo)
+from django.shortcuts import get_object_or_404, redirect, render
+
+def user_logged_in_middleware(get_response):
+ @receiver(user_logged_in)
+ def user_logged_in_handler(sender, user, request, **kwargs):
+ if 'function_executed' not in request.session:
+ # Run the function only if the flag is not set
+ # Assuming user is a model with the desired data field, retrieve the data
+ # For example, if your User model has a field named 'custom_field', you can access it like:
+ if user.is_authenticated:
+ desig = list(HoldsDesignation.objects.select_related('user','working','designation').all().filter(working = request.user).values_list('designation'))
+ print(desig)
+ b = [i for sub in desig for i in sub]
+ design = HoldsDesignation.objects.select_related('user','designation').filter(working=request.user)
+
+ designation=[]
+
+ designation.append(str(user.extrainfo.user_type))
+ for i in design:
+ if str(i.designation) != str(user.extrainfo.user_type):
+ print('-------')
+ print(i.designation)
+ print(user.extrainfo.user_type)
+ print('')
+ designation.append(str(i.designation))
+
+ for i in designation:
+ print(i)
+
+ request.session['currentDesignationSelected'] = designation[0]
+ request.session['allDesignations'] = designation
+ print("logged iN")
+
+ # Set the flag in the session to indicate that the function has bee+n executed
+ request.session['function_executed'] = True
+
+ def middleware(request):
+ if request.user.is_authenticated:
+ user_logged_in_handler(request.user, request.user, request)
+ response = get_response(request)
+ return response
+
+ return middleware
\ No newline at end of file
diff --git a/FusionIIIT/Fusion/settings/common.py b/FusionIIIT/Fusion/settings/common.py
index b98ea6960..fabe81ec2 100644
--- a/FusionIIIT/Fusion/settings/common.py
+++ b/FusionIIIT/Fusion/settings/common.py
@@ -163,6 +163,7 @@
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
+ 'Fusion.middleware.custom_middleware.user_logged_in_middleware',
]
ROOT_URLCONF = 'Fusion.urls'
@@ -178,6 +179,7 @@
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
+ 'Fusion.context_processors.global_vars',
],
},
},
diff --git a/FusionIIIT/applications/globals/urls.py b/FusionIIIT/applications/globals/urls.py
index f8d82ee71..2dea4e77d 100644
--- a/FusionIIIT/applications/globals/urls.py
+++ b/FusionIIIT/applications/globals/urls.py
@@ -23,5 +23,6 @@
# Endpoint to reset all passwords in DEV environment
url(r'^resetallpass/$', views.reset_all_pass, name='resetallpass'),
# API urls
- url(r'^api/', include('applications.globals.api.urls'))
+ url(r'^api/', include('applications.globals.api.urls')),
+ url(r'^update_global_variable/$', views.update_global_variable, name='update_global_var'),
]
diff --git a/FusionIIIT/applications/globals/views.py b/FusionIIIT/applications/globals/views.py
index a7f3886c9..5b023abb5 100644
--- a/FusionIIIT/applications/globals/views.py
+++ b/FusionIIIT/applications/globals/views.py
@@ -740,21 +740,26 @@ def dashboard(request):
}
# a=HoldsDesignation.objects.select_related('user','working','designation').filter(designation = user)
+ print(context)
+ print(type(user.extrainfo.user_type))
if(request.user.get_username() == 'director'):
return render(request, "dashboard/director_dashboard2.html", {})
elif( "dean_rspc" in designation):
return render(request, "dashboard/dashboard.html", context)
- elif user.extrainfo.user_type != 'student':
+ elif user.extrainfo.user_type != "student":
+ print ("inside")
designat = HoldsDesignation.objects.select_related().filter(user=user)
response = {'designat':designat}
context.update(response)
return render(request, "dashboard/dashboard.html", context)
else:
+ print ("inside2")
+
return render(request, "dashboard/dashboard.html", context)
@login_required(login_url=LOGIN_URL)
-def profile(request, username=None):
+def profile(request, username=None):
"""
Generic endpoint for views.
If it's a faculty, redirects to /eis/profile/*
@@ -768,16 +773,76 @@ def profile(request, username=None):
"""
user = get_object_or_404(User, Q(username=username)) if username else request.user
-
editable = request.user == user
+ print("editable",editable)
profile = get_object_or_404(ExtraInfo, Q(user=user))
+ print("profile",profile)
if(str(user.extrainfo.user_type)=='faculty'):
+ print("profile")
return HttpResponseRedirect('/eis/profile/' + (username if username else ''))
if(str(user.extrainfo.department)=='department: Academics'):
+ print("profile2")
return HttpResponseRedirect('/aims')
- current = HoldsDesignation.objects.select_related('user','working','designation').filter(Q(working=user, designation__name="student"))
+
+ array = [
+ "student",
+ "CC convenor",
+ "Mechatronic convenor",
+ "mess_committee",
+ "mess_convener",
+ "alumini",
+ "Electrical_AE",
+ "Electrical_JE",
+ "Civil_AE",
+ "Civil_JE",
+ "co-ordinator",
+ "co co-ordinator",
+ "Convenor",
+ "Convener",
+ "cc1convener",
+ "CC2 convener",
+ "mess_convener_mess2",
+ "mess_committee_mess2"
+]
+
+ # queryset = HoldsDesignation.objects.select_related('user','working','designation').filter(Q(working=user))
+
+ # for obj in queryset:
+ # designation_name = obj.designation.name
+ # print("designation_name",designation_name)
+
+ # design = False
+ # if designation_name in array:
+ # design = True
+ # print("design",design)
+ # print("designation_name",designation_name)
+ # if design:
+ # current = HoldsDesignation.objects.select_relapted('user','working','designation').filter(Q(working=user, designation__name=designation_name))
+ # for obj in current:
+ # obj.designation.name = obj.designation.name.replace(designation_name, 'student')
+
+ designation_name = ""
+ design = False
+
+ current = HoldsDesignation.objects.select_related('user', 'working', 'designation').filter(Q(working=user))
+
+ for obj in current:
+ designation_name = obj.designation.name
+ if designation_name in array:
+ design = True
+ break
+
+ if design:
+ current = HoldsDesignation.objects.filter(working=user, designation__name=designation_name)
+ for obj in current:
+ obj.designation.name = obj.designation.name.replace(designation_name, 'student')
+
+ print(user.extrainfo.user_type)
+ print("current",current)
if current:
+ print("profile3")
student = get_object_or_404(Student, Q(id=profile.id))
+ print("student",student)
if editable and request.method == 'POST':
if 'studentapprovesubmit' in request.POST:
status = PlacementStatus.objects.select_related('notify_id','unique_id__id__user','unique_id__id__department').filter(pk=request.POST['studentapprovesubmit']).update(invitation='ACCEPTED', timestamp=timezone.now())
@@ -979,6 +1044,7 @@ def profile(request, username=None):
return render(request, "globals/student_profile4.html", context)
if 'achievementsubmit' in request.POST or 'deleteach' in request.POST:
return render(request, "globals/student_profile5.html", context)
+ print("context",context)
return render(request, "globals/student_profile.html", context)
else:
return redirect("/")
@@ -1176,4 +1242,15 @@ def search(request):
if len(search_results) == 0:
search_results = []
context = {'sresults':search_results}
- return render(request, "globals/search.html", context)
+ return render(request, "globals/search.html", context),
+
+@login_required(login_url=LOGIN_URL)
+def update_global_variable(request):
+ if request.method == 'POST':
+ selected_option = request.POST.get('dropdown')
+ request.session['currentDesignationSelected'] = selected_option
+ print(selected_option)
+ print(request.session['currentDesignationSelected'])
+ return HttpResponseRedirect(request.META.get('HTTP_REFERER', '/'))
+ # Redirect to home if not a POST request or some issue occurs
+ return HttpResponseRedirect(reverse('home'))
diff --git a/FusionIIIT/applications/notifications_extension/api/views.py b/FusionIIIT/applications/notifications_extension/api/views.py
index 1ed9fe720..b87b488da 100644
--- a/FusionIIIT/applications/notifications_extension/api/views.py
+++ b/FusionIIIT/applications/notifications_extension/api/views.py
@@ -31,7 +31,7 @@
office_module_DeanRSPC_notif,
research_procedures_notif)
-# import user
+
class LeaveModuleNotificationAPIView(APIView):
def post(self, request, *args, **kwargs):
diff --git a/FusionIIIT/applications/notifications_extension/views.py b/FusionIIIT/applications/notifications_extension/views.py
index 57142f0a6..59a37547a 100644
--- a/FusionIIIT/applications/notifications_extension/views.py
+++ b/FusionIIIT/applications/notifications_extension/views.py
@@ -9,7 +9,9 @@ def delete(request, slug=None):
notification = get_object_or_404(
Notification, recipient=request.user, id=notification_id)
notification.delete()
- return HttpResponseRedirect('/')
+ previous_page = request.META.get('HTTP_REFERER', '/')
+ # Redirect to the previous page or the home page if the referrer is not available
+ return HttpResponseRedirect(previous_page)
# return HttpResponseRedirect('dashboard/')
def mark_as_read_and_redirect(request, slug=None):
notification_id = slug2id(slug)
diff --git a/FusionIIIT/applications/programme_curriculum/models.py b/FusionIIIT/applications/programme_curriculum/models.py
index 248079cd3..733217fff 100644
--- a/FusionIIIT/applications/programme_curriculum/models.py
+++ b/FusionIIIT/applications/programme_curriculum/models.py
@@ -7,6 +7,7 @@
from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ValidationError
from applications.globals.models import ExtraInfo
+from django.core.validators import MinValueValidator, MaxValueValidator, DecimalValidator
# Create your models here.
@@ -26,7 +27,8 @@
('Design', 'Design'),
('Manufacturing', 'Manufacturing'),
('Management Science', 'Management Science'),
- ('Optional Elective', 'Optional Elective'),
+ ('Open Elective', 'Open Elective'),
+ ('Swayam','Swayam'),
('Project', 'Project'),
('Optional', 'Optional'),
('Others', 'Others')
@@ -59,7 +61,7 @@ class Programme(models.Model):
name = models.CharField(max_length=70, null=False, unique=True, blank=False)
programme_begin_year = models.PositiveIntegerField(default=datetime.date.today().year, null=False)
- def __str__(self):
+ def _str_(self):
return str(self.category + " - "+ self.name)
@property
@@ -90,7 +92,7 @@ class Discipline(models.Model):
acronym = models.CharField(max_length=10, null=False, default="", blank=False)
programmes = models.ManyToManyField(Programme, blank=True)
- def __str__(self):
+ def _str_(self):
return str(self.name) + " " + str(self.acronym)
@property
@@ -117,7 +119,11 @@ class Curriculum(models.Model):
'''
programme = models.ForeignKey(Programme, on_delete=models.CASCADE, null=False)
name = models.CharField(max_length=100, null=False, blank=False)
- version = models.PositiveIntegerField(default=1, null=False)
+ version = models.DecimalField(
+ max_digits=2,
+ decimal_places=1,
+ default=1.0,
+ validators=[MinValueValidator(1.0), DecimalValidator(max_digits=2, decimal_places=1)])
working_curriculum = models.BooleanField(default=True, null=False)
no_of_semester = models.PositiveIntegerField(default=1, null=False)
min_credit = models.PositiveIntegerField(default=0, null=False)
@@ -125,7 +131,7 @@ class Curriculum(models.Model):
class Meta:
unique_together = ('name', 'version',)
- def __str__(self):
+ def _str_(self):
return str(self.name + " v" + str(self.version))
@property
@@ -166,8 +172,8 @@ class Semester(models.Model):
class Meta:
unique_together = ('curriculum', 'semester_no',)
- def __str__(self):
- return str(Curriculum.__str__(self.curriculum) + ", sem-" + str(self.semester_no))
+ def _str_(self):
+ return str(Curriculum._str_(self.curriculum) + ", sem-" + str(self.semester_no))
@property
def courseslots(self):
@@ -207,8 +213,13 @@ class Course(models.Model):
'''
- code = models.CharField(max_length=10, null=False, unique=True, blank=False)
- name = models.CharField(max_length=100, null=False, unique=True, blank=False)
+ code = models.CharField(max_length=10, null=False, blank=False)
+ name = models.CharField(max_length=100, null=False, blank=False)
+ version = models.DecimalField(
+ max_digits=2,
+ decimal_places=1,
+ default=1.0,
+ validators=[MinValueValidator(1.0), DecimalValidator(max_digits=2, decimal_places=1)])
credit = models.PositiveIntegerField(default=0, null=False, blank=False)
lecture_hours = PositiveIntegerField(null=True, )
tutorial_hours = PositiveIntegerField(null=True)
@@ -228,12 +239,14 @@ class Course(models.Model):
ref_books = models.TextField()
working_course = models.BooleanField(default=True)
disciplines = models.ManyToManyField(Discipline, blank=True)
+ latest_version = models.BooleanField(default=True)
class Meta:
- unique_together = ('code', 'name',)
+ unique_together = ('code','version')
- def __str__(self):
- return str(self.code + " - " +self.name)
+ def _str_(self):
+ return str(self.code + " - " +self.name+"- v"+str(self.version))
+
@property
def courseslots(self):
@@ -268,7 +281,7 @@ class Batch(models.Model):
class Meta:
unique_together = ('name', 'discipline', 'year',)
- def __str__(self):
+ def _str_(self):
return str(self.name) + " " + str(self.discipline.acronym) + " " + str(self.year)
@@ -277,11 +290,6 @@ class CourseSlot(models.Model):
Current Purpose : To store the details regarding a course slot
Course slot : is defined as per the curriculum for a programme to have specific type of courses
for a given semester
-
-
-
-
-
ATTRIBUTES :
semester(programme_curriculum.Semester) - [not nullable] to denote link to the semester details for which the courseslot is made
@@ -304,8 +312,8 @@ class CourseSlot(models.Model):
max_registration_limit = models.PositiveIntegerField(default = 1000)
- def __str__(self):
- return str(Semester.__str__(self.semester) + ", " + self.name)
+ def _str_(self):
+ return str(Semester._str_(self.semester) + ", " + self.name)
class Meta:
unique_together = ('semester', 'name', 'type')
@@ -324,6 +332,5 @@ class Meta:
unique_together = ('course_id', 'instructor_id', 'batch_id')
- def __self__(self):
- return '{} - {}'.format(self.course_id, self.instructor_id)
-
\ No newline at end of file
+ def _self_(self):
+ return '{} - {}'.format(self.course_id, self.instructor_id)
\ No newline at end of file
diff --git a/FusionIIIT/notification/views.py b/FusionIIIT/notification/views.py
index cf55aabcb..b5f325a64 100644
--- a/FusionIIIT/notification/views.py
+++ b/FusionIIIT/notification/views.py
@@ -1,7 +1,6 @@
from django.shortcuts import render
from requests import Response
from notifications.signals import notify
-
# Create your views here.
def leave_module_notif(sender, recipient, type, date=None):
diff --git a/FusionIIIT/templates/academic_procedures/academic.html b/FusionIIIT/templates/academic_procedures/academic.html
old mode 100755
new mode 100644
index 6b04a54fb..35eebf446
--- a/FusionIIIT/templates/academic_procedures/academic.html
+++ b/FusionIIIT/templates/academic_procedures/academic.html
@@ -22,6 +22,39 @@
}
+
+
{% endblock css %}
@@ -30,13 +63,12 @@
{% include 'dashboard/navbar.html' %}
{% endblock %}
-
+
- {% comment %}The left-margin segment!{% endcomment %}
-
+
{% comment %}The left-rail segment starts here!{% endcomment %}
-
+
{% comment %}The user image card starts here!{% endcomment %}
{% block usercard %}
{% include 'globals/usercard.html' %}
@@ -46,8 +78,8 @@
{% comment %}The Tab-Menu starts here!{% endcomment %}
-
+
+
{% if student_flag %}
Current Semester
diff --git a/FusionIIIT/templates/dashboard/dashboard.html b/FusionIIIT/templates/dashboard/dashboard.html
old mode 100755
new mode 100644
index 2b940cdbb..172465aca
--- a/FusionIIIT/templates/dashboard/dashboard.html
+++ b/FusionIIIT/templates/dashboard/dashboard.html
@@ -41,8 +41,8 @@
{% comment %}The Tab-Menu starts here!{% endcomment %}
-
- View Professional Profile
+
+ View Professional Profile
{% if "dean_rspc" in designation %}
@@ -62,11 +62,12 @@
{% comment %}The Tab-Menu ends here!{% endcomment %}
- {% if 'student' != request.user.extrainfo.user_type %}
+ {% if 'student' == request.user.extrainfo.user_type %}
{% comment %}The Tab-Menu starts here!{% endcomment %}
-
+
View Administrative Profile
@@ -77,7 +78,7 @@
{% comment %}The Tab-Menu starts here!{% endcomment %}
-
+
{% if request.user.extrainfo.user_type == 'faculty' %}
{%for desig in designat%}
{% if 'hradmin' == desig.designation.name %}
diff --git a/FusionIIIT/templates/dashboard/modules.html b/FusionIIIT/templates/dashboard/modules.html
old mode 100755
new mode 100644
index a8680958a..8c2ca9174
--- a/FusionIIIT/templates/dashboard/modules.html
+++ b/FusionIIIT/templates/dashboard/modules.html
@@ -12,47 +12,58 @@
-
+
{% comment %}A single modules row starts here!{% endcomment %}
{% comment %}A single modules row ends here!{% endcomment %}
{% comment %}A single modules row starts here!{% endcomment %}
-
-
-
+
+ {% if request.user.extrainfo.user_type != "staff" or "acadadmin" == global_var or "corelabcaretaker" == global_var %}
+
-
-
+ {% endif %}
+
+
{% comment %}A single modules row ends here!{% endcomment %}
{% comment %}A single modules row starts here!{% endcomment %}
-
-
-
+
+ {% if request.user.extrainfo.user_type == "student" or "mess_manager" == global_var or "mess_warden" == global_var %}
+
+
-
-
@@ -64,9 +75,11 @@
-
+ {% endif %}
+
+
{% comment %}A single modules row ends here!{% endcomment %}
{% comment %}A single modules row starts here!{% endcomment %}
-
-
-
+
+
+
-
-
@@ -96,9 +111,11 @@
-
+ {% if request.user.extrainfo.user_type != "student" %}
+
+ {% endif %}
+
{% comment %}A single modules row ends here!{% endcomment %}
{% comment %}A single modules row starts here!{% endcomment %}
-
-
-
+
+ {% if request.user.extrainfo.user_type == "student" or "spacsconvenor" == global_var or "spacsassistant" == global_var %}
+
+
-
-
@@ -128,9 +149,11 @@
-
+ {% endif %}
+
+
{% comment %}A single modules row ends here!{% endcomment %}
-
-
-
+
+ {% if request.user.extrainfo.user_type == "student" or "placement chairman" == global_var or "placement officer" == global_var %}
+
+
-
-
@@ -158,9 +184,11 @@
-
+ {% endif %}
+
+
{% comment %}A single modules row ends here!{% endcomment %}
-
-
-
+
+ {% if request.user.extrainfo.user_type != "staff" %}
+
diff --git a/FusionIIIT/templates/dashboard/navbar.html b/FusionIIIT/templates/dashboard/navbar.html
old mode 100755
new mode 100644
index 7d0e7e3f9..f277b5046
--- a/FusionIIIT/templates/dashboard/navbar.html
+++ b/FusionIIIT/templates/dashboard/navbar.html
@@ -1,137 +1,134 @@
{% load static %}
-{% block navBar %}
- {% include 'dashboard/sidenavbar.html' %}
-
-
+
-
@@ -189,8 +220,11 @@
-
+ {% endif %}
+
+
{% comment %}A single modules row ends here!{% endcomment %}
-
-
-
+
+
-
{% comment %}
{% endcomment %}
+
-
-
-
-
-
-
-
- {% load notifications_tags %}
- {% register_notify_callbacks badge_class='badge' callbacks='fill_notification_badge' %}
-
- Dashboard
-
{% live_notify_badge badge_class='badge' %}
-
-
-
- Feedback
-
-
-
-
-
-
- {% comment %}
- TODO: User details! depending on type of user say: STUDENT/FACULTY/STAFF!
- {% endcomment %}
-
- {{request.user.first_name}} {{request.user.last_name}}
+
+ {% block navBar %}
+ {% include 'dashboard/sidenavbar.html' %}
+
+
- {{request.user.first_name}} {{request.user.last_name}}
+
+ {% block navBar %}
+ {% include 'dashboard/sidenavbar.html' %}
+
+
+
+
+
- {% comment %}
-
-
Notifications
-
- 22
- TODO: Make dropdown menu
-
-
- {% endcomment %}
+
+
+
+ {% load notifications_tags %}
+ {% register_notify_callbacks badge_class='badge' callbacks='fill_notification_badge' %}
+
+ Dashboard
+ Notification1
- Notification1
- {% live_notify_badge badge_class='badge' %}
-
-
-
{% endif %}
+<<<<<<< HEAD
+ {% if request.user.extrainfo.user_type == "student" or "acadadmin" == global_var %}
+=======
{% if request.user.extrainfo.user_type != "staff" or "acadadmin" == global_var or "corelabcaretaker" == global_var %}
+>>>>>>> upstream/os-3
-
@@ -128,77 +128,77 @@
-
Notifications
+ +
+
-{% endblock %}
+ {% endblock %}
\ No newline at end of file
diff --git a/FusionIIIT/templates/dashboard/sidenavbar.html b/FusionIIIT/templates/dashboard/sidenavbar.html
index 8febe7cdf..19ee052c1 100644
--- a/FusionIIIT/templates/dashboard/sidenavbar.html
+++ b/FusionIIIT/templates/dashboard/sidenavbar.html
@@ -18,7 +18,7 @@
TODO: User Details!
{% endcomment %}
{{request.user.first_name}} {{request.user.last_name}}
- {{request.user.extrainfo.user_type}} + {{global_var}}File Tracking
{% comment %}The Modules Accordian ends here!{% endcomment %} {% comment %}The Profile Item starts here!{% endcomment %} - + {% comment %} Profile - + {% endcomment %} {% comment %}The Profile Item starts here!{% endcomment %} - +{% comment %} Office Of Dean Students - + {% endcomment %} {% comment %}The email Item ends here!{% endcomment %} -{% if "Dean (RSPC)" in desig %} +{% comment %} {% if "Dean (RSPC)" in desig %} {% endcomment %} {% comment %}The Profile Item starts here!{% endcomment %} - +{% comment %} Office Of Dean RSPC - + {% endcomment %} -{% endif %} - +{% comment %} {% endif %} {% endcomment %} +{% comment %} Office Of Dean Academics - + {% endcomment %} {% comment %}The email Item ends here!{% endcomment %} {% comment %}The Profile Item starts here!{% endcomment %} - +{% comment %} Director Office - + {% endcomment %} {% comment %}The email Item ends here!{% endcomment %} {% comment %}The Profile Item starts here!{% endcomment %} - +{% comment %} Office Of Purchase Officer - + {% endcomment %} {% comment %}The email Item ends here!{% endcomment %} {% comment %}The Profile Item starts here!{% endcomment %} - +{% comment %} Office Of Registrar - + {% endcomment %} {% comment %}The email Item ends here!{% endcomment %} {% comment %}The Profile Item starts here!{% endcomment %} - +{% comment %} Office Of P & D - + {% endcomment %} {% comment %}The email Item ends here!{% endcomment %} {% comment %}The Profile Item starts here!{% endcomment %} - +{% comment %} Office Of HOD {Branch} Finance and Accounts - + {% endcomment %} {% comment %}The email Item ends here!{% endcomment %} {% comment %}The Activity Log Item starts here!{% endcomment %} - + {% comment %} Meet our team! - + {% endcomment %} {% comment %}The Activity Log Item ends here!{% endcomment %} {% comment %}The Logout Item starts here!{% endcomment %} diff --git a/FusionIIIT/templates/globals/usercard.html b/FusionIIIT/templates/globals/usercard.html old mode 100755 new mode 100644 index ecb758bd3..a910fa4c3 --- a/FusionIIIT/templates/globals/usercard.html +++ b/FusionIIIT/templates/globals/usercard.html @@ -1,14 +1,12 @@ {% load static %} {% block usercard %} - {% comment %} TODO: Something! {% endcomment %} - {% comment %}The Employee Image Card starts here!{% endcomment %} -
+ {% comment %}The Employee Image Card starts here!{% endcomment %}
+
@@ -18,61 +16,60 @@
TODO: Add a If-Else here!
{% endcomment %}
{% if user %}
-
- {% comment %}The Employee Image Card ends here!{% endcomment %}
-
-
-{% endblock %}
+ {% comment %} The Employee Image Card ends here! {% endcomment %}
+{% endblock %}
\ No newline at end of file
diff --git a/FusionIIIT/templates/notifications/sidepanel.html b/FusionIIIT/templates/notifications/sidepanel.html
new file mode 100644
index 000000000..7051eeb2f
--- /dev/null
+++ b/FusionIIIT/templates/notifications/sidepanel.html
@@ -0,0 +1,26 @@
+{% load static %}
+{% block sidepanel %}
+ {% load notifications_tags %}
+ {% for notice in notifications %}
+ {% if notice.unread %}
+ {% if notice.data.module == 'Central Mess' %}
+
- {{ user.first_name}}
- {{ user.last_name}}
-
- {{ user.extrainfo.department.name}}
-
-
-
+
{% else %}
-
+
+
+
+ {{ user.first_name }}
+ {{ user.last_name }}
+
+
+
+ {{ user.extrainfo.department.name }}
+
+
{% if user.extrainfo.user_type == 'student' %}
- {{user.extrainfo.student.programme}}
- {{ user.extrainfo.student.batch}}
-
- Sem - {{user.extrainfo.student.curr_semester_no}} + {{ user.extrainfo.student.programme }} + {{ user.extrainfo.student.batch }} +
+ Sem - {{ user.extrainfo.student.curr_semester_no }} {% endif %} - - -
+ - Sem - {{user.extrainfo.student.curr_semester_no}} + {{ user.extrainfo.student.programme }} + {{ user.extrainfo.student.batch }} +
+ Sem - {{ user.extrainfo.student.curr_semester_no }} {% endif %} - - -
- {{ request.user.first_name}}
- {{ request.user.last_name}}
-
- {{ request.user.extrainfo.department.name}}
-
- {% if request.user.extrainfo.user_type == 'student' %}
- {{request.user.extrainfo.student.programme}}
- {{ request.user.extrainfo.student.batch}}
-
- Sem - {{request.user.extrainfo.student.curr_semester_no}} +
{% endif %}
- Sem - {{request.user.extrainfo.student.curr_semester_no}} +
+
+
+
+ {{ request.user.first_name }}
+ {{ request.user.last_name }}
+
+
+
+ {{ request.user.extrainfo.department.name }}
+
+
+ {% if user.extrainfo.user_type == 'student' %}
+ {{ request.user.extrainfo.student.programme }}
+ {{ request.user.extrainfo.student.batch }}
- {% endif %} - + Sem - {{ request.user.extrainfo.student.curr_semester_no }} + {% endif %} +
+
- {{user.extrainfo.student.programme}}
- {{ user.extrainfo.student.batch}}
- {{user.extrainfo.student.curr_semester_no}}
+ {{ user.extrainfo.student.programme }}
+ {{ user.extrainfo.student.batch }}
+ {{ user.extrainfo.student.curr_semester_no }}
- - {% endif %} - + Sem - {{ request.user.extrainfo.student.curr_semester_no }} + {% endif %} +
- {% for i in Curr_desig %}
- {% comment %}Should this be inside if else?{% endcomment %}
- {% if i == "co-ordinator" or i == "co co-ordinator" %}
- {{ i }} of {{ club_details }} club
- {% else %}
- {{ i }}
- {% endif %}
+
+
+ {{global_var|capfirst}}
-
- {% endfor %}
- {% endfor %}
+
+
+ {% endif%}
+ {% endif %}
+ {% endfor %}
+{% endblock %}
\ No newline at end of file
From 14df71f40526f107e0bfa7f4ca20157dc7c1558d Mon Sep 17 00:00:00 2001
From: kishankoushal <134288275+kishankoushal@users.noreply.github.com>
Date: Wed, 20 Mar 2024 13:12:50 +0530
Subject: [PATCH 07/10] Notification_OS_3 (#1366)
* GAD-5: Fix responsiveness (#1125)
Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com>
Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com>
* updated alerts.html and alert1.html for implementing delete notification
* Added pylint (#1302)
* Create bandit_security_test.yml
Added Bandit security test for python
* Update bandit_security_test.yml
* Update bandit_security_test.yml
* Create pylint.yml
* Update pylint.yml
* Update pylint.yml
* Revert "Added pylint (#1302)" (#1324)
This reverts commit c1359b7ce8a1945e41e90330fe39bc634d9ca6f3.
* GAD -5 Dashboard Changes (#1325)
* dashboard and usercard updated (#1329)
* changes in programme_cuuriculam,adding version to models (#1330)
* made few changes for delete notification
* created sidebar for notifications
* Fixing ui bugs (#1335)
* updated dashboard
* updated dashboard
* updated dashboard
---------
Co-authored-by: Harshvardhan Singh <73544247+Lawful2002@users.noreply.github.com>
Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com>
Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com>
Co-authored-by: akshatnema <20bcs022@iiitdmj.ac.in>
Co-authored-by: Hardik Sharma <104981324+hardiksharma11@users.noreply.github.com>
Co-authored-by: Raman Chaudhary <97114586+ChaudharyRaman@users.noreply.github.com>
Co-authored-by: BlackHAWK2001 <150950834+BlackHAWK2001@users.noreply.github.com>
Co-authored-by: Arpit Tak <140220904+Ishu-ji@users.noreply.github.com>
Co-authored-by: Anudeep Sanapala <71971574+anudeeps0306@users.noreply.github.com>
Co-authored-by: SukulSarve <143542658+SukulSarve@users.noreply.github.com>
From ec73676c71aa7561a66ac73afe8611dc2a0c4730 Mon Sep 17 00:00:00 2001
From: kishankoushal <134288275+kishankoushal@users.noreply.github.com>
Date: Wed, 20 Mar 2024 21:01:20 +0530
Subject: [PATCH 08/10] Change made in models.py in programme_curriculum
(#1380)
* GAD-5: Fix responsiveness (#1125)
Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com>
Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com>
* updated alerts.html and alert1.html for implementing delete notification
* GAD -5 Dashboard Changes (#1325)
* dashboard and usercard updated (#1329)
* made few changes for delete notification
* created sidebar for notifications
* Fixing ui bugs (#1335)
* updated dashboard
* updated dashboard
* updated dashboard
* updated models.py in programmes and curriculum
---------
Co-authored-by: Harshvardhan Singh <73544247+Lawful2002@users.noreply.github.com>
Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com>
Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com>
Co-authored-by: akshatnema <20bcs022@iiitdmj.ac.in>
Co-authored-by: BlackHAWK2001 <150950834+BlackHAWK2001@users.noreply.github.com>
Co-authored-by: Arpit Tak <140220904+Ishu-ji@users.noreply.github.com>
Co-authored-by: SukulSarve <143542658+SukulSarve@users.noreply.github.com>
---
.../programme_curriculum/models.py | 306 ++++++++++++------
FusionIIIT/templates/dashboard/modules.html | 4 +
2 files changed, 218 insertions(+), 92 deletions(-)
diff --git a/FusionIIIT/applications/programme_curriculum/models.py b/FusionIIIT/applications/programme_curriculum/models.py
index b595a9e8c..0835c5e3e 100644
--- a/FusionIIIT/applications/programme_curriculum/models.py
+++ b/FusionIIIT/applications/programme_curriculum/models.py
@@ -10,7 +10,7 @@
from django.core.validators import MinValueValidator, MaxValueValidator, DecimalValidator
# Create your models here.
-
+# Create your models here.
PROGRAMME_CATEGORY_CHOICES = [
('UG', 'Undergraduate'),
('PG', 'Postgraduate'),
@@ -28,7 +28,7 @@
('Manufacturing', 'Manufacturing'),
('Management Science', 'Management Science'),
('Open Elective', 'Open Elective'),
- ('Swayam', 'Swayam'),
+ ('Swayam','Swayam'),
('Project', 'Project'),
('Optional', 'Optional'),
('Others', 'Others')
@@ -37,17 +37,16 @@
BATCH_NAMES = [
('B.Tech', 'B.Tech'),
('M.Tech', 'M.Tech'),
- ('B.Des', 'B.Des'),
- ('M.Des', 'M.Des'),
+ ('B.Des','B.Des'),
+ ('M.Des','M.Des'),
('Phd', 'Phd')
]
-
class Programme(models.Model):
'''
Current Purpose : To store the details regardina a programme
-
-
+
+
ATTRIBUTES :
@@ -58,15 +57,12 @@ class Programme(models.Model):
! - the name attribute has ambiguous entries
'''
- category = models.CharField(
- max_length=3, choices=PROGRAMME_CATEGORY_CHOICES, null=False, blank=False)
- name = models.CharField(max_length=70, null=False,
- unique=True, blank=False)
- programme_begin_year = models.PositiveIntegerField(
- default=datetime.date.today().year, null=False)
+ category = models.CharField(max_length=3, choices=PROGRAMME_CATEGORY_CHOICES, null=False, blank=False)
+ name = models.CharField(max_length=70, null=False, unique=True, blank=False)
+ programme_begin_year = models.PositiveIntegerField(default=datetime.date.today().year, null=False)
- def _str_(self):
- return str(self.category + " - " + self.name)
+ def __str__(self):
+ return str(self.category + " - "+ self.name)
@property
def curriculums(self):
@@ -80,8 +76,8 @@ def get_discipline_objects(self):
class Discipline(models.Model):
'''
Current Purpose : To store the details regarding a discipline
-
-
+
+
ATTRIBUTES :
@@ -91,27 +87,26 @@ class Discipline(models.Model):
'''
- name = models.CharField(max_length=100, null=False,
- unique=True, blank=False)
- acronym = models.CharField(
- max_length=10, null=False, default="", blank=False)
- programmes = models.ManyToManyField(Programme, blank=True)
- def _str_(self):
+ name = models.CharField(max_length=100, null=False, unique=True, blank=False)
+ acronym = models.CharField(max_length=10, null=False, default="", blank=False)
+ programmes = models.ManyToManyField(Programme, blank=True)
+
+ def __str__(self):
return str(self.name) + " " + str(self.acronym)
@property
def batches(self):
return Batch.objects.filter(discipline=self.id).order_by('year')
-
+
class Curriculum(models.Model):
'''
Current Purpose : To store the details regarding a curriculum
Curriculum definition : a set of all courses offered by the institute within a programme
-
-
+
+
ATTRIBUTES :
@@ -122,40 +117,43 @@ class Curriculum(models.Model):
no_of_semester(Integer) - the number of semesters defined for the curriculum
min_credit(Integer) - the minimum credits required for the curriculum
'''
- programme = models.ForeignKey(
- Programme, on_delete=models.CASCADE, null=False)
+ programme = models.ForeignKey(Programme, on_delete=models.CASCADE, null=False)
name = models.CharField(max_length=100, null=False, blank=False)
+ # version = models.FloatField(default=1.0, null=False)
+ # version = models.PositiveIntegerField(default=1, null=False)
version = models.DecimalField(
- max_digits=2,
- decimal_places=1,
- default=1.0,
- validators=[MinValueValidator(1.0), DecimalValidator(max_digits=2, decimal_places=1)])
+ max_digits=2,
+ decimal_places=1,
+ default=1.0,
+ validators=[MinValueValidator(1.0), DecimalValidator(max_digits=2, decimal_places=1)])
working_curriculum = models.BooleanField(default=True, null=False)
no_of_semester = models.PositiveIntegerField(default=1, null=False)
min_credit = models.PositiveIntegerField(default=0, null=False)
class Meta:
unique_together = ('name', 'version',)
-
- def _str_(self):
+
+ def __str__(self):
return str(self.name + " v" + str(self.version))
@property
def batches(self):
return Batch.objects.filter(curriculum=self.id).order_by('year')
+
@property
def semesters(self):
return Semester.objects.filter(curriculum=self.id).order_by('semester_no')
+
class Semester(models.Model):
'''
Current Purpose : To store the details regarding a semester
+
-
-
-
+
+
ATTRIBUTES :
@@ -166,8 +164,7 @@ class Semester(models.Model):
end_semester(DateTime) - to store the end date of the semester
'''
- curriculum = models.ForeignKey(
- Curriculum, null=False, on_delete=models.CASCADE)
+ curriculum = models.ForeignKey(Curriculum, null=False, on_delete=models.CASCADE)
semester_no = models.PositiveIntegerField(null=False)
instigate_semester = models.BooleanField(default=False, null=True)
start_semester = models.DateField(blank=True, null=True)
@@ -176,22 +173,21 @@ class Semester(models.Model):
class Meta:
unique_together = ('curriculum', 'semester_no',)
-
- def _str_(self):
- return str(Curriculum._str_(self.curriculum) + ", sem-" + str(self.semester_no))
+
+ def __str__(self):
+ return str(Curriculum.__str__(self.curriculum) + ", sem-" + str(self.semester_no))
@property
def courseslots(self):
return CourseSlot.objects.filter(semester=self.id).order_by("id")
-
class Course(models.Model):
'''
Current Purpose : To store the details regarding a course
+
-
-
-
+
+
ATTRIBUTES :
@@ -222,10 +218,10 @@ class Course(models.Model):
code = models.CharField(max_length=10, null=False, blank=False)
name = models.CharField(max_length=100, null=False, blank=False)
version = models.DecimalField(
- max_digits=2,
+ max_digits=5,
decimal_places=1,
default=1.0,
- validators=[MinValueValidator(1.0), DecimalValidator(max_digits=2, decimal_places=1)])
+ validators=[MinValueValidator(1.0), DecimalValidator(max_digits=5, decimal_places=1)])
credit = models.PositiveIntegerField(default=0, null=False, blank=False)
lecture_hours = PositiveIntegerField(null=True, )
tutorial_hours = PositiveIntegerField(null=True)
@@ -235,20 +231,13 @@ class Course(models.Model):
pre_requisits = models.TextField(null=True, blank=True)
pre_requisit_courses = models.ManyToManyField('self', blank=True)
syllabus = models.TextField()
- percent_quiz_1 = models.PositiveIntegerField(
- default=10, null=False, blank=False)
- percent_midsem = models.PositiveIntegerField(
- default=20, null=False, blank=False)
- percent_quiz_2 = models.PositiveIntegerField(
- default=10, null=False, blank=False)
- percent_endsem = models.PositiveIntegerField(
- default=30, null=False, blank=False)
- percent_project = models.PositiveIntegerField(
- default=15, null=False, blank=False)
- percent_lab_evaluation = models.PositiveIntegerField(
- default=10, null=False, blank=False)
- percent_course_attendance = models.PositiveIntegerField(
- default=5, null=False, blank=False)
+ percent_quiz_1 = models.PositiveIntegerField(default=10, null=False, blank=False)
+ percent_midsem = models.PositiveIntegerField(default=20, null=False, blank=False)
+ percent_quiz_2 = models.PositiveIntegerField(default=10, null=False, blank=False)
+ percent_endsem = models.PositiveIntegerField(default=30, null=False, blank=False)
+ percent_project = models.PositiveIntegerField(default=15, null=False, blank=False)
+ percent_lab_evaluation = models.PositiveIntegerField(default=10, null=False, blank=False)
+ percent_course_attendance = models.PositiveIntegerField(default=5, null=False, blank=False)
ref_books = models.TextField()
working_course = models.BooleanField(default=True)
disciplines = models.ManyToManyField(Discipline, blank=True)
@@ -257,7 +246,7 @@ class Course(models.Model):
class Meta:
unique_together = ('code','version')
- def _str_(self):
+ def __str__(self):
return str(self.code + " - " +self.name+"- v"+str(self.version))
@@ -265,15 +254,16 @@ def _str_(self):
def courseslots(self):
return CourseSlot.objects.filter(courses=self.id)
-
class Batch(models.Model):
- '''
- Current Purpose : To store the details regarding a batch(eg details of curriculum assigned for batch)
-
+ '''
+ Current Purpose : To store the details regarding a batch(eg details of curriculum assigned for batch)
+
+
+
ATTRIBUTES :
@@ -284,23 +274,19 @@ class Batch(models.Model):
running_batch(Boolean) - to denote whether the batch is currently active or has graduated
'''
- name = models.CharField(choices=BATCH_NAMES,
- max_length=50, null=False, blank=False)
- discipline = models.ForeignKey(
- Discipline, null=False, on_delete=models.CASCADE)
- year = models.PositiveIntegerField(
- default=datetime.date.today().year, null=False)
- curriculum = models.ForeignKey(
- Curriculum, null=True, blank=True, on_delete=models.SET_NULL)
+ name = models.CharField(choices=BATCH_NAMES, max_length=50, null=False, blank=False)
+ discipline = models.ForeignKey(Discipline, null=False, on_delete=models.CASCADE)
+ year = models.PositiveIntegerField(default=datetime.date.today().year, null=False)
+ curriculum = models.ForeignKey(Curriculum, null=True, blank=True, on_delete=models.SET_NULL)
running_batch = models.BooleanField(default=True)
class Meta:
unique_together = ('name', 'discipline', 'year',)
- def _str_(self):
+ def __str__(self):
return str(self.name) + " " + str(self.discipline.acronym) + " " + str(self.year)
-
+
class CourseSlot(models.Model):
'''
Current Purpose : To store the details regarding a course slot
@@ -318,19 +304,18 @@ class CourseSlot(models.Model):
maximum_registration_limit(integer) - maximum students required for a course
'''
- semester = models.ForeignKey(
- Semester, null=False, on_delete=models.CASCADE)
+ semester = models.ForeignKey(Semester, null=False, on_delete=models.CASCADE)
name = models.CharField(max_length=100, null=False, blank=False)
- type = models.CharField(
- max_length=70, choices=COURSESLOT_TYPE_CHOICES, null=False)
+ type = models.CharField(max_length=70, choices=COURSESLOT_TYPE_CHOICES, null=False)
course_slot_info = models.TextField(null=True)
courses = models.ManyToManyField(Course, blank=True)
duration = models.PositiveIntegerField(default=1)
- min_registration_limit = models.PositiveIntegerField(default=0)
- max_registration_limit = models.PositiveIntegerField(default=1000)
+ min_registration_limit = models.PositiveIntegerField(default = 0)
+ max_registration_limit = models.PositiveIntegerField(default = 1000)
+
- def _str_(self):
- return str(Semester._str_(self.semester) + ", " + self.name)
+ def __str__(self):
+ return str(Semester.__str__(self.semester) + ", " + self.name)
class Meta:
unique_together = ('semester', 'name', 'type')
@@ -339,16 +324,153 @@ class Meta:
def for_batches(self):
return ((Semester.objects.get(id=self.semester.id)).curriculum).batches
-
class CourseInstructor(models.Model):
- course_id = models.ForeignKey(Course, on_delete=models.CASCADE)
- instructor_id = models.ForeignKey(ExtraInfo, on_delete=models.CASCADE)
- batch_id = models.ForeignKey(Batch, on_delete=models.CASCADE, default=1)
- # change extra info to faculty(globals)
+ course_id = models.ForeignKey(Course, on_delete = models.CASCADE)
+ instructor_id = models.ForeignKey(ExtraInfo, on_delete = models.CASCADE)
+ batch_id = models.ForeignKey(Batch, on_delete=models.CASCADE, default=1)
+ #change extra info to faculty(globals)
class Meta:
unique_together = ('course_id', 'instructor_id', 'batch_id')
- def _self_(self):
- return '{} - {}'.format(self.course_id, self.instructor_id)
\ No newline at end of file
+
+ def __self__(self):
+ return '{} - {}'.format(self.course_id, self.instructor_id)
+
+
+
+
+class CourseProposal(models.Model):
+ '''
+ Current Purpose : To store the details regarding a course
+
+
+
+
+
+ ATTRIBUTES :
+
+ code(char) - the course code (eg CS3005)
+ name(char) - the name of the course(eg Machine Learning)
+ credit(Integer) - the credits defined for the course
+ lecture_hours(integer) - lecture hours defined for the course
+ tutorial_hours(Integer) - tutorial hours defined for the course
+ practical_hours(Integer) - practical hours defined for the course
+ discussion_hours(Integer) - discussion hours
+ project_hours(Integer) - project hours
+ pre_requisits(Boolean) - denote whether this course has prerequisites(courses that one should take before opting this )
+ pre_requisit_courses(programme_curriculum.Course) - link to set of prerequisite courses
+ syllabus(text) - syllabus described for the course
+ percent_quiz_1(+ve int) - defined weightage in marking
+ percent_midsem(+ve int) - defined weightage in marking
+ percent_quiz_2(+ve int) - defined weightage in marking
+ percent_endsem (+ve int) - defined weightage in marking
+ percent_project(+ve int) - defined weightage in marking
+ percent_lab_evaluation (+ve int) - defined weightage in marking
+ percent_course_attendance (+ve int) - defined weightage in marking
+ ref_books(text) - reference books suggested for the course
+ working_course(boolean) - to denote whether the course is currently in execution or not
+ disciplines(programme_curriculum.Discipline) - to store which discipline is offering the course
+
+
+ '''
+ faculty_name=models.CharField(max_length=100, null=False,blank=False)
+ faculty_code = models.CharField(max_length=10, null=False, blank=False)
+ code = models.CharField(max_length=10, null=False, blank=False)
+ name = models.CharField(max_length=100, null=False,blank=False)
+ credit = models.PositiveIntegerField(default=3, null=False, blank=False)
+ lecture_hours = PositiveIntegerField(default=3,null=True, )
+ tutorial_hours = PositiveIntegerField(default=0,null=True)
+ pratical_hours = PositiveIntegerField(default=0,null=True)
+ discussion_hours = PositiveIntegerField(default=0,null=True)
+ project_hours = PositiveIntegerField(default=0,null=True)
+ pre_requisits = models.TextField(null=True, blank=True)
+ pre_requisit_courses = models.ManyToManyField(Course, blank=True)
+ syllabus = models.TextField()
+ percent_quiz_1 = models.PositiveIntegerField(default=10, null=False, blank=False)
+ percent_midsem = models.PositiveIntegerField(default=20, null=False, blank=False)
+ percent_quiz_2 = models.PositiveIntegerField(default=10, null=False, blank=False)
+ percent_endsem = models.PositiveIntegerField(default=30, null=False, blank=False)
+ percent_project = models.PositiveIntegerField(default=15, null=False, blank=False)
+ percent_lab_evaluation = models.PositiveIntegerField(default=10, null=False, blank=False)
+ percent_course_attendance = models.PositiveIntegerField(default=5, null=False, blank=False)
+ ref_books = models.TextField()
+ disciplines = models.ManyToManyField(Discipline, blank=True)
+ status = models.PositiveIntegerField(default=0,null=False, blank=False)
+
+ class Meta:
+ unique_together = ('code', 'faculty_code',)
+
+ def __str__(self):
+ return str(self.faculty_name + " - " +self.faculty_code+" - "+self.code + " - "+self.name)
+
+ # @property
+ # def courseslots(self):
+ # return CourseSlot.objects.filter(courses=self.id)
+
+
+
+class UpdateCourseProposal(models.Model):
+ '''
+ Current Purpose : To store the details regarding a update course proposal forms
+ ATTRIBUTES :
+
+ code(char) - the course code (eg CS3005)
+ name(char) - the name of the course(eg Machine Learning)
+ credit(Integer) - the credits defined for the course
+ lecture_hours(integer) - lecture hours defined for the course
+ tutorial_hours(Integer) - tutorial hours defined for the course
+ practical_hours(Integer) - practical hours defined for the course
+ discussion_hours(Integer) - discussion hours
+ project_hours(Integer) - project hours
+ pre_requisits(Boolean) - denote whether this course has prerequisites(courses that one should take before opting this )
+ pre_requisit_courses(programme_curriculum.Course) - link to set of prerequisite courses
+ syllabus(text) - syllabus described for the course
+ percent_quiz_1(+ve int) - defined weightage in marking
+ percent_midsem(+ve int) - defined weightage in marking
+ percent_quiz_2(+ve int) - defined weightage in marking
+ percent_endsem (+ve int) - defined weightage in marking
+ percent_project(+ve int) - defined weightage in marking
+ percent_lab_evaluation (+ve int) - defined weightage in marking
+ percent_course_attendance (+ve int) - defined weightage in marking
+ ref_books(text) - reference books suggested for the course
+ working_course(boolean) - to denote whether the course is currently in execution or not
+ disciplines(programme_curriculum.Discipline) - to store which discipline is offering the course
+
+
+ '''
+ faculty_name=models.CharField(max_length=100, null=False,blank=False)
+ faculty_code = models.CharField(max_length=10, null=False, blank=False)
+ code = models.CharField(max_length=10, null=False, blank=False)
+ name = models.CharField(max_length=100, null=False,blank=False)
+ credit = models.PositiveIntegerField(default=0, null=False, blank=False)
+ lecture_hours = PositiveIntegerField(null=True, )
+ tutorial_hours = PositiveIntegerField(null=True)
+ pratical_hours = PositiveIntegerField(null=True)
+ discussion_hours = PositiveIntegerField(null=True)
+ project_hours = PositiveIntegerField(null=True)
+ pre_requisits = models.TextField(null=True, blank=True)
+ pre_requisit_courses = models.ManyToManyField(Course, blank=True)
+ syllabus = models.TextField()
+ percent_quiz_1 = models.PositiveIntegerField(default=10, null=False, blank=False)
+ percent_midsem = models.PositiveIntegerField(default=20, null=False, blank=False)
+ percent_quiz_2 = models.PositiveIntegerField(default=10, null=False, blank=False)
+ percent_endsem = models.PositiveIntegerField(default=30, null=False, blank=False)
+ percent_project = models.PositiveIntegerField(default=15, null=False, blank=False)
+ percent_lab_evaluation = models.PositiveIntegerField(default=10, null=False, blank=False)
+ percent_course_attendance = models.PositiveIntegerField(default=5, null=False, blank=False)
+ ref_books = models.TextField()
+ working_course = models.BooleanField(default=True)
+ disciplines = models.ManyToManyField(Discipline, blank=True)
+ status = models.PositiveIntegerField(default=0,null=False, blank=False)
+
+ class Meta:
+ unique_together = ('code', 'faculty_code',)
+
+ def __str__(self):
+ return str(self.faculty_name + " - " +self.faculty_code+" - "+self.code + " - "+self.name)
+
+ # @property
+ # def courseslots(self):
+ # return CourseSlot.objects.filter(courses=self.id)
diff --git a/FusionIIIT/templates/dashboard/modules.html b/FusionIIIT/templates/dashboard/modules.html
index 54dc3de66..9cc79bde0 100644
--- a/FusionIIIT/templates/dashboard/modules.html
+++ b/FusionIIIT/templates/dashboard/modules.html
@@ -36,7 +36,11 @@
+
+
+ {{ notice.verb }}
+
+
+
+
+
+
From b4be9426edac599a6e490ee8e95018393bbb3d84 Mon Sep 17 00:00:00 2001
From: kishankoushal <134288275+kishankoushal@users.noreply.github.com>
Date: Thu, 21 Mar 2024 17:31:00 +0530
Subject: [PATCH 09/10] os_3_21 (#1386)
* GAD-5: Fix responsiveness (#1125)
Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com>
Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com>
* updated alerts.html and alert1.html for implementing delete notification
* GAD -5 Dashboard Changes (#1325)
* dashboard and usercard updated (#1329)
* made few changes for delete notification
* created sidebar for notifications
* Fixing ui bugs (#1335)
* updated dashboard
* updated dashboard
* updated dashboard
---------
Co-authored-by: Harshvardhan Singh <73544247+Lawful2002@users.noreply.github.com>
Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com>
Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com>
Co-authored-by: akshatnema <20bcs022@iiitdmj.ac.in>
Co-authored-by: BlackHAWK2001 <150950834+BlackHAWK2001@users.noreply.github.com>
Co-authored-by: Arpit Tak <140220904+Ishu-ji@users.noreply.github.com>
Co-authored-by: SukulSarve <143542658+SukulSarve@users.noreply.github.com>
Co-authored-by: Abhikumar Gupta <97209802+abhi87374@users.noreply.github.com>
---
.../programme_curriculum/models.py | 21 ++++++++++++-------
FusionIIIT/templates/dashboard/modules.html | 6 ++----
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/FusionIIIT/applications/programme_curriculum/models.py b/FusionIIIT/applications/programme_curriculum/models.py
index 0835c5e3e..233fa0405 100644
--- a/FusionIIIT/applications/programme_curriculum/models.py
+++ b/FusionIIIT/applications/programme_curriculum/models.py
@@ -61,7 +61,7 @@ class Programme(models.Model):
name = models.CharField(max_length=70, null=False, unique=True, blank=False)
programme_begin_year = models.PositiveIntegerField(default=datetime.date.today().year, null=False)
- def __str__(self):
+ def _str_(self):
return str(self.category + " - "+ self.name)
@property
@@ -92,7 +92,7 @@ class Discipline(models.Model):
acronym = models.CharField(max_length=10, null=False, default="", blank=False)
programmes = models.ManyToManyField(Programme, blank=True)
- def __str__(self):
+ def _str_(self):
return str(self.name) + " " + str(self.acronym)
@property
@@ -119,6 +119,7 @@ class Curriculum(models.Model):
'''
programme = models.ForeignKey(Programme, on_delete=models.CASCADE, null=False)
name = models.CharField(max_length=100, null=False, blank=False)
+
# version = models.FloatField(default=1.0, null=False)
# version = models.PositiveIntegerField(default=1, null=False)
version = models.DecimalField(
@@ -133,7 +134,7 @@ class Curriculum(models.Model):
class Meta:
unique_together = ('name', 'version',)
- def __str__(self):
+ def _str_(self):
return str(self.name + " v" + str(self.version))
@property
@@ -174,8 +175,8 @@ class Semester(models.Model):
class Meta:
unique_together = ('curriculum', 'semester_no',)
- def __str__(self):
- return str(Curriculum.__str__(self.curriculum) + ", sem-" + str(self.semester_no))
+ def _str_(self):
+ return str(Curriculum._str_(self.curriculum) + ", sem-" + str(self.semester_no))
@property
def courseslots(self):
@@ -246,7 +247,9 @@ class Course(models.Model):
class Meta:
unique_together = ('code','version')
+
def __str__(self):
+
return str(self.code + " - " +self.name+"- v"+str(self.version))
@@ -283,7 +286,7 @@ class Batch(models.Model):
class Meta:
unique_together = ('name', 'discipline', 'year',)
- def __str__(self):
+ def _str_(self):
return str(self.name) + " " + str(self.discipline.acronym) + " " + str(self.year)
@@ -314,8 +317,8 @@ class CourseSlot(models.Model):
max_registration_limit = models.PositiveIntegerField(default = 1000)
- def __str__(self):
- return str(Semester.__str__(self.semester) + ", " + self.name)
+ def _str_(self):
+ return str(Semester._str_(self.semester) + ", " + self.name)
class Meta:
unique_together = ('semester', 'name', 'type')
@@ -335,6 +338,7 @@ class Meta:
+
def __self__(self):
return '{} - {}'.format(self.course_id, self.instructor_id)
@@ -474,3 +478,4 @@ def __str__(self):
# @property
# def courseslots(self):
# return CourseSlot.objects.filter(courses=self.id)
+
diff --git a/FusionIIIT/templates/dashboard/modules.html b/FusionIIIT/templates/dashboard/modules.html
index 9cc79bde0..81cb4c8a7 100644
--- a/FusionIIIT/templates/dashboard/modules.html
+++ b/FusionIIIT/templates/dashboard/modules.html
@@ -36,11 +36,9 @@
{% endif %}
-<<<<<<< HEAD
- {% if request.user.extrainfo.user_type == "student" or "acadadmin" == global_var %}
-=======
+
{% if request.user.extrainfo.user_type != "staff" or "acadadmin" == global_var or "corelabcaretaker" == global_var %}
->>>>>>> upstream/os-3
+
From 079286add3e54001d299ecdc21ddecfbfe4ef365 Mon Sep 17 00:00:00 2001
From: kishankoushal <134288275+kishankoushal@users.noreply.github.com>
Date: Thu, 21 Mar 2024 18:54:53 +0530
Subject: [PATCH 10/10] os_3_check (#1387)
* GAD-5: Fix responsiveness (#1125)
Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com>
Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com>
* updated alerts.html and alert1.html for implementing delete notification
* GAD -5 Dashboard Changes (#1325)
* dashboard and usercard updated (#1329)
* made few changes for delete notification
* created sidebar for notifications
* Fixing ui bugs (#1335)
* updated dashboard
* updated dashboard
* updated dashboard
---------
Co-authored-by: Harshvardhan Singh <73544247+Lawful2002@users.noreply.github.com>
Co-authored-by: A Anunaya <76819712+Anunaya07@users.noreply.github.com>
Co-authored-by: Aksh Bansal <63552235+Aksh-Bansal-dev@users.noreply.github.com>
Co-authored-by: akshatnema <20bcs022@iiitdmj.ac.in>
Co-authored-by: BlackHAWK2001 <150950834+BlackHAWK2001@users.noreply.github.com>
Co-authored-by: Arpit Tak <140220904+Ishu-ji@users.noreply.github.com>
Co-authored-by: SukulSarve <143542658+SukulSarve@users.noreply.github.com>
---
FusionIIIT/applications/programme_curriculum/models.py | 8 ++++----
FusionIIIT/templates/dashboard/modules.html | 4 +---
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/FusionIIIT/applications/programme_curriculum/models.py b/FusionIIIT/applications/programme_curriculum/models.py
index 233fa0405..5b6507f0f 100644
--- a/FusionIIIT/applications/programme_curriculum/models.py
+++ b/FusionIIIT/applications/programme_curriculum/models.py
@@ -119,12 +119,12 @@ class Curriculum(models.Model):
'''
programme = models.ForeignKey(Programme, on_delete=models.CASCADE, null=False)
name = models.CharField(max_length=100, null=False, blank=False)
-
# version = models.FloatField(default=1.0, null=False)
# version = models.PositiveIntegerField(default=1, null=False)
version = models.DecimalField(
max_digits=2,
decimal_places=1,
+
default=1.0,
validators=[MinValueValidator(1.0), DecimalValidator(max_digits=2, decimal_places=1)])
working_curriculum = models.BooleanField(default=True, null=False)
@@ -219,10 +219,12 @@ class Course(models.Model):
code = models.CharField(max_length=10, null=False, blank=False)
name = models.CharField(max_length=100, null=False, blank=False)
version = models.DecimalField(
+
max_digits=5,
decimal_places=1,
default=1.0,
validators=[MinValueValidator(1.0), DecimalValidator(max_digits=5, decimal_places=1)])
+
credit = models.PositiveIntegerField(default=0, null=False, blank=False)
lecture_hours = PositiveIntegerField(null=True, )
tutorial_hours = PositiveIntegerField(null=True)
@@ -249,7 +251,6 @@ class Meta:
def __str__(self):
-
return str(self.code + " - " +self.name+"- v"+str(self.version))
@@ -337,8 +338,6 @@ class Meta:
unique_together = ('course_id', 'instructor_id', 'batch_id')
-
-
def __self__(self):
return '{} - {}'.format(self.course_id, self.instructor_id)
@@ -479,3 +478,4 @@ def __str__(self):
# def courseslots(self):
# return CourseSlot.objects.filter(courses=self.id)
+
diff --git a/FusionIIIT/templates/dashboard/modules.html b/FusionIIIT/templates/dashboard/modules.html
index 81cb4c8a7..908dc536e 100644
--- a/FusionIIIT/templates/dashboard/modules.html
+++ b/FusionIIIT/templates/dashboard/modules.html
@@ -36,9 +36,7 @@
{% endif %}
-
- {% if request.user.extrainfo.user_type != "staff" or "acadadmin" == global_var or "corelabcaretaker" == global_var %}
-
+ {% if request.user.extrainfo.user_type != "staff" or "acadadmin" == global_var or "corelabcaretaker" == global_var %}