From 7c816f7322dce24e657bac678ddf979d8e6ba7a5 Mon Sep 17 00:00:00 2001 From: papi Date: Tue, 16 Jan 2024 21:38:01 +0300 Subject: [PATCH] Fix report generator --- result/views.py | 10 ++++--- templates/course/course_allocation_view.html | 28 ++++-------------- templates/course/course_registration.html | 31 ++++---------------- templates/navbar.html | 5 ++-- templates/search/search_view.html | 12 ++++---- 5 files changed, 25 insertions(+), 61 deletions(-) diff --git a/result/views.py b/result/views.py index 57f594c..8654046 100644 --- a/result/views.py +++ b/result/views.py @@ -42,12 +42,14 @@ def add_score(request): to him for score entry. in a specific semester and session """ current_session = Session.objects.filter(is_current_session=True).first() - current_semester = Semester.objects.filter(is_current_semester=True, session=current_session).first() + current_semester = Semester.objects.filter( + is_current_semester=True, session=current_session + ).first() if not current_session or not current_semester: messages.error(request, "No active semester found.") return render(request, "result/add_score.html") - + # semester = Course.objects.filter( # allocated_course__lecturer__pk=request.user.id, # semester=current_semester) @@ -327,7 +329,7 @@ def result_sheet_pdf_view(request, id): print("\nsettings.MEDIA_ROOT", settings.MEDIA_ROOT) print("\nsettings.STATICFILES_DIRS[0]", settings.STATICFILES_DIRS[0]) - logo = settings.STATICFILES_DIRS[0] + "/img/logo.png" + logo = settings.STATICFILES_DIRS[0] + "/img/dj-lms.png" im = Image(logo, 1 * inch, 1 * inch) im.__setattr__("_offs_x", -200) im.__setattr__("_offs_y", -45) @@ -739,7 +741,7 @@ def course_registration_form(request): # FIRST SEMESTER ENDS HERE - logo = settings.STATICFILES_DIRS[0] + "/img/logo.png" + logo = settings.STATICFILES_DIRS[0] + "/img/dj-lms.png" im_logo = Image(logo, 1 * inch, 1 * inch) im_logo.__setattr__("_offs_x", -218) im_logo.__setattr__("_offs_y", 480) diff --git a/templates/course/course_allocation_view.html b/templates/course/course_allocation_view.html index 6072b41..4160852 100644 --- a/templates/course/course_allocation_view.html +++ b/templates/course/course_allocation_view.html @@ -17,31 +17,13 @@ {% endif %}
Course Allocations
+
+
-{% if messages %} - {% for message in messages %} - {% if message.tags == 'error' %} -
- {{ message }} -
- {% else %} -
- {{ message }} -
- {% endif %} - {% endfor %} -{% endif %} +{% include 'snippets/messages.html' %} +{% include 'snippets/filter_form.html' %} -
-
- {{ filter.form }} - -
-
- -
+
diff --git a/templates/course/course_registration.html b/templates/course/course_registration.html index 8d0ca1c..6f17578 100644 --- a/templates/course/course_registration.html +++ b/templates/course/course_registration.html @@ -15,20 +15,7 @@

Course Add & Drop

-{% if messages %} -{% for message in messages %} -{% if message.tags == 'error' %} -
- {{ message }} -
-{% else %} -
- {{ message }} -
-{% endif %} -{% endfor %} -{% endif %} - +{% include 'snippets/messages.html' %} {% if current_semester %} {% if is_calender_on == False %} @@ -44,12 +31,7 @@ {% csrf_token %}
-

- Course Add -

-
{{ student.level }}
-
-

+

Course Add

- + @@ -201,10 +182,8 @@ {% if not no_course_is_registered %} - - - Print Registration Form - + + Print Registerd Courses
diff --git a/templates/navbar.html b/templates/navbar.html index 4d44dc9..702f975 100644 --- a/templates/navbar.html +++ b/templates/navbar.html @@ -20,13 +20,14 @@
Total credit(s): {{ total_sec_semester_credit|add:total_first_semester_credit - }} Total credit(s): {{ total_sec_semester_credit|add:total_first_semester_credit }}