Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirection Bugs Fixed #1639

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 24 additions & 18 deletions FusionIIIT/applications/examination/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ def updateEntergradesDean(request):

if not course_present:
context = {"message": "THIS COURSE IS NOT SUBMITTED BY THE INSTRUCTOR"}
return render(request, "../templates/examination/message.html", context)
return render(request, "../templates/examination/messageDean.html", context)

context = {"registrations": course_present}

Expand Down Expand Up @@ -1182,23 +1182,29 @@ def validateDeanSubmit(request):
csv_file = request.FILES["csv_file"]

if not csv_file.name.endswith(".csv"):
return JsonResponse(
{"error": "Invalid file format. Please upload a CSV file."}, status=400
)
message = "Please Submit a csv file "
context = {
"message":message,
}
return render(request, "../templates/examination/messageDean.html", context)

course_id = request.POST.get("course")
academic_year = request.POST.get("year")
# semester = request.POST.get('semester')
print(academic_year)
if academic_year is None or not academic_year.isdigit():
return JsonResponse(
{"error": "Academic year must be a valid number."}, status=400
)
message = "Academic Year must be a number"
context = {
"message":message,
}
return render(request, "../templates/examination/messageDean.html", context)

if not course_id or not academic_year:
return JsonResponse(
{"error": "Course ID and Academic Year are required."}, status=400
)
message = "Course and Academic year are required"
context = {
"message":message,
}
return render(request, "../templates/examination/messageDean.html", context)

# courses_info = Courses.objects.get(id=course_id)

Expand All @@ -1218,12 +1224,12 @@ def validateDeanSubmit(request):

required_columns = ["roll_no", "name", "grade", "remarks"]
if not all(column in reader.fieldnames for column in required_columns):
return JsonResponse(
{
"error": "CSV file must contain the following columns: roll_no, name, grade, remarks."
},
status=400,
)
message = "CSV file must contain the following columns: roll_no, name, grade, remarks."
context = {
"message":message,
}
return render(request, "../templates/examination/messageDean.html", context)
semester = students.first().semester_id_id
mismatch=[]
for row in reader:
Expand Down Expand Up @@ -1259,7 +1265,7 @@ def validateDeanSubmit(request):
context = {
"message":message,
}
return render(request, "../templates/examination/message.html", context)
return render(request, "../templates/examination/messageDean.html", context)
context = {
"mismatch": mismatch,
}
Expand All @@ -1271,4 +1277,4 @@ def validateDeanSubmit(request):
context = {
"message": error_message,
}
return render(request, "../templates/examination/message.html", context)
return render(request, "../templates/examination/messageDean.html", context)
7 changes: 1 addition & 6 deletions FusionIIIT/templates/examination/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,12 @@

</style>
<div class="ui medium fluid vertical pointing menu" style="max-width: 320px;">
<a class="active item" href="{% url 'examination:submitGrades' %}"></B>Submit</B>
<a class="item" href="{% url 'examination:submitGrades' %}">Submit
<i class="right floated chevron right icon"></i>
</a>
<a class="item" href="{% url 'examination:updateGrades' %}">Verify
<i class="right floated chevron right icon"></i>
</a>
{% comment %} <a class="item" href="{% url 'examination:authenticate' %}">Authenticate Course
<i class="right floated chevron right icon"></i>
</a> {% endcomment %}


<a class="item" href="{% url 'examination:announcement' %}">Announcement
<i class="right floated chevron right icon"></i>
</a>
Expand Down
63 changes: 63 additions & 0 deletions FusionIIIT/templates/examination/messageDean.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{% extends 'examination/base.html' %}

{% block sidetabmenu %}
<style>
/* Your existing CSS styles */

.sortable-icon {
margin-left: 5px;
font-size: 1.2em;
color: blue;
}

.sortable-icon + .sortable-icon {
margin-left: 2px;
}
/* Your existing CSS styles */

.sortable-icon {
margin-left: 5px;
font-size: 1.2em;
color: blue;
display: inline-block;
}

th {
white-space: nowrap; /* Prevent line breaks */
}

th:first-child .sortable-icon {
margin-left: 0; /* Remove left margin for the first icon */
}

.sortable-icon + .sortable-icon {
margin-left: 2px;
}

</style>
<div class="ui medium fluid vertical pointing menu" style="max-width: 320px;">

<a class="active item" href="{% url 'examination:verifyGradesDean' %}">Verify
<i class="right floated chevron right icon"></i>
</a>
<a class="item" href="{% url 'examination:validateDean' %}"> Validate
<i class="right floated chevron right icon"></i>
</a>



</div>
{% endblock %}

{% block content %}
<div class="ui segment">
<div class="ui message">
<div class="header">
{{message}}
</div>

<p>Please check back later or contact support for assistance.</p>
</div>
</div>

{% endblock %}
2 changes: 1 addition & 1 deletion FusionIIIT/templates/examination/validation.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% comment %} <a class="item" href="{% url 'examination:authenticate' %}">Authenticate Course
<i class="right floated chevron right icon"></i>
</a> {% endcomment %}
<a class="item" href="{% url 'examination:validateDean' %}"> Validate
<a class="item" href="{% url 'examination:validateDean' %}"><B> Validate</B>
<i class="right floated chevron right icon"></i>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion FusionIIIT/templates/examination/validationSubmit.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<i class="right floated chevron right icon"></i>
</a> {% endcomment %}

<a class="item" href="{% url 'examination:validateDean' %}"> Validate
<a class="item" href="{% url 'examination:validateDean' %}"><B> Validate</B>
<i class="right floated chevron right icon"></i>
</a>
</div>
Expand Down
Loading