Skip to content

Commit

Permalink
Merge pull request #1512 from FusionIIIT/ac-3-final
Browse files Browse the repository at this point in the history
AC-3 to AC-final
  • Loading branch information
prabhatsuman authored Apr 21, 2024
2 parents 7466500 + 22ae8c0 commit e71308f
Show file tree
Hide file tree
Showing 33 changed files with 2,955 additions and 1,113 deletions.
2 changes: 1 addition & 1 deletion FusionIIIT/Fusion/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,4 @@


CORS_ORIGIN_ALLOW_ALL = True
ALLOW_PASS_RESET = True
ALLOW_PASS_RESET = True
2 changes: 1 addition & 1 deletion FusionIIIT/applications/academic_procedures/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def academic_procedures_student(request):
except Exception as e:
final_registered_courses = None
final_registered_course_show = None
# drop_courses_options = None
drop_courses_options = None
add_courses_options = None
replace_courses_options = None

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.ui-alerts {
position: fixed;
/* width: 360px; */
z-index: 2060;
padding: 23px;
}

.ui-alerts.center {
top: 50%;
left: 50%;
margin-top: -100px;
margin-left: -222px;
}

.ui-alerts.top-right{
top: 20px;
right: 20px;
}

.ui-alerts.top-center{
top: 20px;
margin-left: -222px;
left: 50%;
}

.ui-alerts.top-left{
top: 20px;
left: 20px;
}

.ui-alerts.bottom-right{
bottom: 0;
right: 20px;
}
.ui-alerts.bottom-center{
bottom: 0;
margin-left: -222px;
left: 50%;
}

.ui-alerts.bottom-left{
bottom: 0;
left: 20px;
}

.ui-alerts.ui-alerts > .message > .content > .header {
padding-right: 13px;
}

@media (min-width:320px) {
/* smartphones, portrait iPhone, portrait 480x320 phones (Android) */
.ui-alerts.top-center{
margin-left: -163px;
}
}
@media (min-width:480px) {
/* smartphones, Android phones, landscape iPhone */
}
@media (min-width:600px) {
/* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */
}
@media (min-width:801px) {
/* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) {
/* big landscape tablets, laptops, and desktops */
}
@media (min-width:1281px) {
/* hi-res laptops and desktops */
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
$.suiAlert = function (permanents) {
var options = $.extend({
title: 'Semantic UI Alerts',
description: 'semantic ui alerts library',
// alert types 'info, success, error, warning'
type: "error",
time: 5,
position: "top-right",
icon: false,
}, permanents);

// set alert icon
if (options.icon === false) {
if (options.type == "info") {
// announcement
options.icon = "announcement";
} else if (options.type == "success") {
// checkmark, checkmark box
options.icon = "checkmark";
} else if (options.type == "error") {
// ban, remove, remove circle
options.icon = "remove";
} else if (options.type == "warning") {
// warning sign, warning circle
options.icon = "warning circle";
}
}

// set close animation
var close_anim = "drop";
if (options.position == "top-right") {
close_anim = "fly left";
} else if (options.position == "top-center") {
close_anim = "fly down";
} else if (options.position == "top-left") {
close_anim = "fly right";
} else if (options.position == "bottom-right") {
close_anim = "fly left";
} else if (options.position == "bottom-center") {
close_anim = "fly up";
} else if (options.position == "bottom-left") {
close_anim = "fly right";
}

// screen size check
var alert_size = '';
var screen_width = $(window).width();
if (screen_width < 425)
alert_size = 'mini';

var alerts_class = "ui-alerts." + options.position;
if (!$('body > .' + alerts_class).length) {
$('body').append('<div class="ui-alerts ' + options.position + '"></div>');
}

var _alert = $('<div class="ui icon floating ' + alert_size + ' message ' + options.type + '" id="alert"> <i class="' + options.icon + ' icon"></i> <i class="close icon" id="alertclose"></i> <div class="content"> <div class="header">' + options.title + '</div> <p>' + options.description + '</p> </div> </div>');
$('.' + alerts_class).prepend(_alert);

_alert.transition('pulse');

/**
* Close the alert
*/
$('#alertclose').on('click', function () {
$(this).closest('#alert').transition({
animation: close_anim,
onComplete: function () {
_alert.remove();
}
});
});

var timer = 0;
$(_alert).mouseenter(function () {
clearTimeout(timer);
}).mouseleave(function () {
alertHide();
});

alertHide();

function alertHide() {
timer = setTimeout(function () {
_alert.transition({
animation: close_anim,
duration: '2s',
onComplete: function () {
_alert.remove();
}
});
}, (options.time * 1000));
}
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions FusionIIIT/applications/notifications_extension/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ def mark_as_read_and_redirect(request, slug=None):
if(notification.data['module'] == 'Complaint System'):
complaint_id=notification.description
return HttpResponseRedirect(reverse(notification.data['url'],kwargs={'detailcomp_id1':complaint_id}))
elif(notification.data['module'] == 'Course Management'):
course_code = notification.data['course_code']
print(course_code)
return HttpResponseRedirect(reverse(notification.data['url'],kwargs={'course_code': course_code}))
else:
return HttpResponseRedirect(reverse(notification.data['url']))
1 change: 0 additions & 1 deletion FusionIIIT/applications/online_cms/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class QuizResultAdmin(admin.ModelAdmin):
raw_id_fields = ("student_id",)

admin.site.register(CourseDocuments)

admin.site.register(CourseVideo)

admin.site.register(Quiz)
Expand Down
30 changes: 28 additions & 2 deletions FusionIIIT/applications/online_cms/forms.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# from django import forms
import datetime
from datetime import time, timedelta
#import information from the models
from django import forms
# from .models import StoreMarks
from applications.academic_information.models import Student_attendance
from applications.academic_information.models import (Student_attendance,Timetable)


from .models import *
#the types of exam whose marks can be stored from edit marks in assessment, related to StoreMarks table in models
EXAM_TYPES= [
('quiz1', 'Quiz 1'),
Expand Down Expand Up @@ -112,4 +115,27 @@ def clean(self):

examtype = self.cleaned_data.get("exam_type")
enteredmarks = self.cleaned_data.get("entered_marks")
return self.cleaned_data
return self.cleaned_data

class GradingSchemeForm(forms.Form):
quiz_weightage = forms.DecimalField(label='Quiz', max_digits=10, decimal_places=2)
midsem_weightage = forms.DecimalField(label='Mid Semester', max_digits=10, decimal_places=2)
assignment_weightage = forms.DecimalField(label='Assignment', max_digits=10, decimal_places=2)
endsem_weightage = forms.DecimalField(label='End Semester', max_digits=10, decimal_places=2)
project_weightage = forms.DecimalField(label='Project', max_digits=10, decimal_places=2)


class AcademicTimetableForm(forms.ModelForm):
"""
the form to add a new academic timetable to the database.
It consist of year, programme and the timetable file upload
@attrubutes:
model - the model used is the Timetable class
fields - the fields shown in the form for the user to fill up is year, programme and timetable file upload
widgets - defining the id, required and placeholder of the filed in the form
"""
class Meta:
model = Timetable
fields = ('programme', 'batch', 'branch', 'time_table')
27 changes: 20 additions & 7 deletions FusionIIIT/applications/online_cms/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,25 @@


def semester(roll):
month = datetime.now().month
sem = 0
if month >= 8 and month <= 12:
sem = 1
semester = (datetime.now().year-int(roll))*2+sem
return semester
if not roll.isnumeric():
s=''
s+='2'
s+='0'
s+=roll[0]
s+=roll[1]
month = datetime.now().month
sem = 0
if month >= 8 and month <= 12:
sem = 1
semester = (datetime.now().year-int(s))*2+sem
return semester
else:
month = datetime.now().month
sem = 0
if month >= 8 and month <= 12:
sem = 1
semester = (datetime.now().year-int(roll))*2+sem
return semester

#storing media files like images, videos and assignments
def create_thumbnail(course_code,course, row, name, ext, attach_str, thumb_time, thumb_size):
Expand All @@ -19,4 +32,4 @@ def create_thumbnail(course_code,course, row, name, ext, attach_str, thumb_time,
filename = filename + name.replace(' ', '-') + '-' + attach_str + '.png'
process = 'ffmpeg -y -i ' + filepath + ' -vframes ' + str(1) + ' -an -s '
process = process + thumb_size + ' -ss ' + str(thumb_time) + ' ' + filename
subprocess.call(process, shell=True)
subprocess.call(process, shell=True)
Loading

0 comments on commit e71308f

Please sign in to comment.