From 1fca4c851ae306730e1185bf0ddd0bf7dcbf4588 Mon Sep 17 00:00:00 2001 From: kushbatla Date: Thu, 15 Feb 2024 17:24:27 +0530 Subject: [PATCH 01/15] urls --- FusionIIIT/applications/placement_cell/urls.py | 9 +-------- FusionIIIT/templates/dashboard/modules.html | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/FusionIIIT/applications/placement_cell/urls.py b/FusionIIIT/applications/placement_cell/urls.py index 9f3e77307..64814c706 100644 --- a/FusionIIIT/applications/placement_cell/urls.py +++ b/FusionIIIT/applications/placement_cell/urls.py @@ -17,12 +17,5 @@ url(r'^cv/(?P[a-zA-Z0-9\.]{1,20})/$', views.cv, name="cv"), - #added new url - url(r'^add_placement_schedule/$', views.add_placement_schedule, name='add_placement_schedule'), - url(r'^placement_schedule_save/$', views.placement_schedule_save, name='placement_schedule_save'), - url(r'^delete_placement_record/$', views.delete_placement_record, name='delete_placement_record'), - url(r'^add_placement_record/$', views.add_placement_record, name='add_placement_record'), - url(r'^placement_record_save/$', views.placement_record_save, name='placement_record_save'), - url(r'^add_placement_visit/$', views.add_placement_visit, name='add_placement_visit'), - url(r'^placement_visit_save/$', views.placement_visit_save, name='placement_visit_save'), + ] diff --git a/FusionIIIT/templates/dashboard/modules.html b/FusionIIIT/templates/dashboard/modules.html index 73fc33d85..d8b36b0df 100755 --- a/FusionIIIT/templates/dashboard/modules.html +++ b/FusionIIIT/templates/dashboard/modules.html @@ -146,7 +146,7 @@ {% comment %}A single modules row ends here!{% endcomment %}
- +
diff --git a/requirements.txt b/requirements.txt index 4cc3a0a30..c1a68cad8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ click==7.1.2 click-didyoumean==0.0.3 click-plugins==1.1.1 click-repl==0.1.6 -cryptography==36.0.2 +cryptography==3.1.1 defusedxml==0.6.0 Django==3.1.5 django-allauth==0.44.0 From a8abde6c6618e29ad55bf3acf953fbe7a05896f6 Mon Sep 17 00:00:00 2001 From: kushbatla Date: Sat, 17 Feb 2024 13:55:06 +0530 Subject: [PATCH 02/15] added apply for jobs and upload documents --- .../applications/placement_cell/urls.py | 9 +++- .../templates/dashboard/sidenavbar.html | 4 +- .../templates/placementModule/placement.html | 24 ++++++++--- .../placementModule/placementstatistics.html | 41 +++++++++++++++++++ 4 files changed, 69 insertions(+), 9 deletions(-) diff --git a/FusionIIIT/applications/placement_cell/urls.py b/FusionIIIT/applications/placement_cell/urls.py index 64814c706..9f3e77307 100644 --- a/FusionIIIT/applications/placement_cell/urls.py +++ b/FusionIIIT/applications/placement_cell/urls.py @@ -17,5 +17,12 @@ url(r'^cv/(?P[a-zA-Z0-9\.]{1,20})/$', views.cv, name="cv"), - + #added new url + url(r'^add_placement_schedule/$', views.add_placement_schedule, name='add_placement_schedule'), + url(r'^placement_schedule_save/$', views.placement_schedule_save, name='placement_schedule_save'), + url(r'^delete_placement_record/$', views.delete_placement_record, name='delete_placement_record'), + url(r'^add_placement_record/$', views.add_placement_record, name='add_placement_record'), + url(r'^placement_record_save/$', views.placement_record_save, name='placement_record_save'), + url(r'^add_placement_visit/$', views.add_placement_visit, name='add_placement_visit'), + url(r'^placement_visit_save/$', views.placement_visit_save, name='placement_visit_save'), ] diff --git a/FusionIIIT/templates/dashboard/sidenavbar.html b/FusionIIIT/templates/dashboard/sidenavbar.html index 81cecbe94..43307d925 100644 --- a/FusionIIIT/templates/dashboard/sidenavbar.html +++ b/FusionIIIT/templates/dashboard/sidenavbar.html @@ -99,7 +99,7 @@

Health Center Module

Leave Module

- +

Counselling cell Module

@@ -107,7 +107,7 @@

Counselling cell Module

Placement Module

- +

Purchase and Store

diff --git a/FusionIIIT/templates/placementModule/placement.html b/FusionIIIT/templates/placementModule/placement.html index 700a631e7..d18361621 100644 --- a/FusionIIIT/templates/placementModule/placement.html +++ b/FusionIIIT/templates/placementModule/placement.html @@ -57,7 +57,7 @@ {% else %} - Placement Schedule + Placement @@ -86,7 +86,7 @@ {% else %} - Placement Schedule + Placement ss + {% endif %} @@ -114,13 +114,25 @@ Placement Statistics + + + + Apply for jobs + + + + + + Upload documents + + {% if current2 %} - + (9-4-22) diff --git a/FusionIIIT/templates/placementModule/placementstatistics.html b/FusionIIIT/templates/placementModule/placementstatistics.html index fa57d7f9a..2ce31aa4d 100644 --- a/FusionIIIT/templates/placementModule/placementstatistics.html +++ b/FusionIIIT/templates/placementModule/placementstatistics.html @@ -40,6 +40,14 @@ Placement Schedule + {% endif %} {% endfor %} @@ -52,6 +60,14 @@ Placement Schedule + Send Notification @@ -61,6 +77,14 @@ Placement Schedule + Send Notification @@ -82,6 +106,14 @@ Placement Schedule + Send Notification @@ -91,6 +123,7 @@ Placement Schedule + {% if current2 %} From 9cb7602d76cc5f4d80920387bf3647ae0f529fc4 Mon Sep 17 00:00:00 2001 From: kushbatla Date: Sat, 17 Feb 2024 20:03:28 +0530 Subject: [PATCH 03/15] added options for TPO and Chairman --- .../applications/placement_cell/urls.py | 3 + .../applications/placement_cell/views.py | 9 +- .../templates/placementModule/applyJobs.html | 934 ++++++++++++++++++ .../placementModule/hello_world.html | 11 + .../templates/placementModule/placement.html | 2 +- .../placementModule/placementstatistics.html | 21 +- .../templates/placementModule/upload_doc.html | 11 + 7 files changed, 984 insertions(+), 7 deletions(-) create mode 100644 FusionIIIT/templates/placementModule/applyJobs.html create mode 100644 FusionIIIT/templates/placementModule/hello_world.html create mode 100644 FusionIIIT/templates/placementModule/upload_doc.html diff --git a/FusionIIIT/applications/placement_cell/urls.py b/FusionIIIT/applications/placement_cell/urls.py index 9f3e77307..015339516 100644 --- a/FusionIIIT/applications/placement_cell/urls.py +++ b/FusionIIIT/applications/placement_cell/urls.py @@ -13,6 +13,9 @@ url(r'^student_records/$', views.student_records, name='student_records'), url(r'^manage_records/$', views.manage_records, name='manage_records'), url(r'^statistics/$', views.placement_statistics, name='placement_statistics'), + url(r'^upload_doc/$', views.upload_doc, name='upload_doc'), + url(r'^apply_job/$', views.apply_job, name='apply_job'), + url(r'^hello_world/$', views.hello_world, name='hello_world'), url(r'^delete_placement_statistics/$', views.delete_placement_statistics, name='delete_placement_statistics'), url(r'^cv/(?P[a-zA-Z0-9\.]{1,20})/$', views.cv, name="cv"), diff --git a/FusionIIIT/applications/placement_cell/views.py b/FusionIIIT/applications/placement_cell/views.py index 80c8f12d7..c224552f9 100644 --- a/FusionIIIT/applications/placement_cell/views.py +++ b/FusionIIIT/applications/placement_cell/views.py @@ -1824,7 +1824,14 @@ def manage_records(request): return render(request, 'placementModule/managerecords.html', context) - +@login_required +def upload_doc(request): + upload_tab=1 +@login_required +def apply_job(request): + apply_tab=1 +def hello_world(request): + return render(request, 'hello.html', {'message': 'Hello, World!'}) @login_required def placement_statistics(request): diff --git a/FusionIIIT/templates/placementModule/applyJobs.html b/FusionIIIT/templates/placementModule/applyJobs.html new file mode 100644 index 000000000..5a555004c --- /dev/null +++ b/FusionIIIT/templates/placementModule/applyJobs.html @@ -0,0 +1,934 @@ +{% extends 'globals/base.html' %} +{% load static %} + + +{% block title %} + Apply for Jobs +{% endblock %} + + +{% block body %} + {% block navBar %} + {% include 'dashboard/navbar.html' %} + {% endblock %} + + {% comment %}The grid starts here!{% endcomment %} +
+ + {% 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' %} + {% endblock %} + {% comment %}The user image card ends here!{% endcomment %} + +
+ + {% comment %}The Tab-Menu starts here!{% endcomment %} + + {% comment %}The Tab-Menu ends here!{% endcomment %} + +
+ {% comment %} + The left-rail segment ends here! + {% endcomment %} + + + {% comment %} The central-rail segment starts here!{% endcomment %} +
+ + + +
+ {% for c3 in current2 %} + {% if c3.designation.name == 'placement officer' %} +
+
+ +
+ +
+
+ +
+ + +
+
+ {% endif %} + {% endfor %} + + + {% for c in current1 %} + {% if c.designation.name == 'placement chairman' %} +
+
+ +
+ +
+
+ +
+ + +
+
+ {% endif %} + {% endfor %} + + +
+ {% for c in current %} + {% if c.designation.name == 'student' %} + {% if schedules %} + {% for sch in schedules|dictsortreversed:"schedule_at" %} +
+ +
+
+
+

{{ sch.notify_id.placement_type }} | {{ sch.notify_id.company_name }} | {{ sch.placement_date }}


+ Time of Message: {{ sch.notify_id.timestamp }} + +
+
+
+

CTC (LPA): {{ sch.notify_id.ctc }}

+

{{ sch.title }} | {{ sch.role.role }}

+

Date/Time & Location: {{ sch.placement_date }} | {{ sch.time }} | {{ sch.location }}

+

Job Description: {{ sch.description }}

+
+
+

+
+ {% endfor %} + {% else %} +
No Active Schedule.
+ {% endif %} + + + {% endif %} + {% endfor %} + + {% for c1 in current1 %} + {% if c1.designation.name == 'placement chairman' %} + {% if schedules %} +
+
+ + {% for sch in schedules|dictsortreversed:"schedule_at" %} +
+ +
+
+
+

{{ sch.notify_id.placement_type }} | {{ sch.notify_id.company_name }} | {{ sch.placement_date }}


+ Time of Message: {{ sch.notify_id.timestamp }} + +
+
+
+

CTC (LPA): {{ sch.notify_id.ctc }}

+

{{ sch.title }} | {{ sch.role.role }}

+

Date/Time & Location: {{ sch.placement_date }} | {{ sch.time }} | {{ sch.location }}

+

Job Description: {{ sch.description }}

+
+
+

+
+ {% endfor %} + +
+ + {% endif %} + {% endif %} + {% endfor %} + + + + {% for c1 in current2 %} + {% if c1.designation.name == 'placement officer' %} + {% if schedules %} + +
+
+ + {% for sch in schedules|dictsortreversed:"schedule_at" %} +
+ +
+
+
+ +
+ {% csrf_token %} + + +
+ +

{{ sch.notify_id.placement_type }} | {{ sch.notify_id.company_name }} | {{ sch.placement_date }}


+ + Time of Message: {{ sch.notify_id.timestamp }} + +
+
+
+

CTC (LPA): {{ sch.notify_id.ctc }}

+

{{ sch.title }} | {{ sch.get_role }}

+

Date/Time & Location: {{ sch.placement_date }} | {{ sch.time }} | {{ sch.location }}

+

Job Description: {{ sch.description }}

+
+ {% if sch.attached_file %} + download + {% endif %} +
+

+
+ {% endfor %} + +
+ + {% endif %} + {% endif %} + {% endfor %} +
+
+ + {% for c3 in current2 %} + {% if c3.designation.name == 'placement officer'%} +
+
+ {% if form5.errors %} +
+ +
+ There were some errors with your submission +
+
    + {% if form5.company_name.errors %} +
  • {{ form5.company_name.errors }}
  • + {% endif %} + + {% if form5.placement_date.errors %} +
  • {{ form5.placement_date.errors }}
  • + {% endif %} + + {% if form5.location.errors %} +
  • {{ form5.location.errors }}
  • + {% endif %} + + {% if form5.ctc.errors %} +
  • {{ form5.ctc.errors }}
  • + {% endif %} + + {% if form5.time.errors %} +
  • {{ form5.time.errors }}
  • + {% endif %} + + {% if form5.placement_type.errors %} +
  • {{ form5.placement_type.errors }}
  • + {% endif %} + + {% if form5.description.errors %} +
  • {{ form5.description.errors }}
  • + {% endif %} +
+
+ {% endif %} + + {% comment %}Form Tag starts here!{% endcomment %} +
+ {% comment %}The add a new skill Accordian starts here!{% endcomment %} +
+
+ + Add a new Event! +
+ +
+
+ {% csrf_token %} +
+
+ +
+ {% comment %}The Institute Name input!{% endcomment %} + {{ form5.company_name }} + + + +
+
+ +
+ +
+
+ + {{ form5.placement_date }} +
+
+
+ +
+ +
+ {% comment %}The Location input!{% endcomment %} + {{ form5.location }} +
+
+
+
+
+ +
+ {% comment %}The Institute Name input!{% endcomment %} + {{ form5.ctc }} +
+
+
+ +
+ {% comment %}The Institute Name input!{% endcomment %} + {{ form5.time }} +
+
+
+ +
+ {% comment %}The Location input!{% endcomment %} + {{ form5.placement_type }} +
+
+
+
+ + +
+ {% comment %}The Location input!{% endcomment %} + {{ form5.description }} +
+
+
+ + + + + + +
+ +
+ + +
+ +
+
+ +
+
+
+ {% comment %}The add a new Achievement Accordian ends here!{% endcomment %} +
+ {% comment %}Form Tag ends here!{% endcomment %} +
+
+ {% endif %} + {% endfor %} + + {% for c1 in current1 %} + {% if c1.designation.name == 'placement chairman'%} +
+
+ + {% comment %}Form Tag starts here!{% endcomment %} +
+ {% comment %}The add a new skill Accordian starts here!{% endcomment %} +
+
+ + Add a new Event! +
+ {{ form5.non_field_errors }} +
+
+ {% csrf_token %} +
+
+ {{ form5.company_name.errors }} + +
+ {% comment %}The Institute Name input!{% endcomment %} + {{ form5.company_name }} +
+
+ +
+ {{ form5.placement_date.errors }} + +
+
+ + {{ form5.placement_date }} +
+
+
+ +
+ {{ form5.location.errors }} + +
+ {% comment %}The Location input!{% endcomment %} + {{ form5.location }} +
+
+
+
+
+ {{ form5.ctc.errors }} + +
+ {% comment %}The Institute Name input!{% endcomment %} + {{ form5.ctc }} +
+
+
+ {{ form5.time.errors }} + +
+ {% comment %}The Institute Name input!{% endcomment %} + {{ form5.time }} +
+
+
+ {{ form5.placement_type.errors }} + +
+ {% comment %}The Location input!{% endcomment %} + {{ form5.placement_type }} +
+
+
+
+ {{ form5.description.errors }} + + +
+ {% comment %}The Location input!{% endcomment %} + {{ form5.description }} +
+
+
+ +
+ +
+
+ +
+
+
+ {% comment %}The add a new Achievement Accordian ends here!{% endcomment %} +
+ {% comment %}Form Tag ends here!{% endcomment %} +
+
+ {% endif %} + {% endfor %} +
+ + + {% for c in current %} + {% if c.designation.name == 'student' %} + {% comment %}The right-rail segment starts here!{% endcomment %} +
+
+ {% comment %} + TODO: the right rail! + {% endcomment %} + + {% comment %}Generate CV {% endcomment %} +
+
+ + Download a C.V.? +
+
+
+
+ {{ form.non_field_errors }} + {% csrf_token %} +
+ + +
+

+
+ + +
+

+
+ + +
+

+
+ + +
+

+
+ + +
+

+
+ + +
+

+
+ + +
+

+
+ + +
+

+
+ + +
+

+
+ + +
+

+
+ + +
+
+ +
+

+ + +
+
+
+ +
+ +
+ + {% block interviewrequest %} + {% include 'placementModule/interviewrequest.html' %} + {% endblock %} + +
+ + {% comment %}The right-rail segment ends here!{% endcomment %} + {% endif %} + {% endfor %} + {% comment %}The right-margin segment!{% endcomment %} +
+
+
+ +{% endblock %} + + +{% block javascript %} + + + + + + + + + + + + + + + +{% endblock %} diff --git a/FusionIIIT/templates/placementModule/hello_world.html b/FusionIIIT/templates/placementModule/hello_world.html new file mode 100644 index 000000000..98556a728 --- /dev/null +++ b/FusionIIIT/templates/placementModule/hello_world.html @@ -0,0 +1,11 @@ + + + + + + Hello World + + +

{{ message }}

+ + diff --git a/FusionIIIT/templates/placementModule/placement.html b/FusionIIIT/templates/placementModule/placement.html index d18361621..7e6b75b0c 100644 --- a/FusionIIIT/templates/placementModule/placement.html +++ b/FusionIIIT/templates/placementModule/placement.html @@ -116,7 +116,7 @@ - + Apply for jobs diff --git a/FusionIIIT/templates/placementModule/placementstatistics.html b/FusionIIIT/templates/placementModule/placementstatistics.html index 2ce31aa4d..159cd8de2 100644 --- a/FusionIIIT/templates/placementModule/placementstatistics.html +++ b/FusionIIIT/templates/placementModule/placementstatistics.html @@ -106,14 +106,14 @@ Placement Schedule - + Send Notification @@ -153,14 +153,25 @@ - Apply for jobs + Generate reports - Upload documents + Make Announcements - + + Add schedule + + + + Manage Placement schedule + + + + View Alumni Data + + {% if current2 %} {% if current2 %} @@ -134,7 +134,18 @@ (9-4-22) - + + + {% if current2 %} - {% endif %} - {% endfor %} - - - {% for c in current1 %} - {% if c.designation.name == 'placement chairman' %} - {% if students %} - - Placement Schedule - - - - Send Notification - - - {% else %} - - Placement ss - - - - {% endif %} - - - - Manage Records - - (9-4-22) - - Placement Visits - - - - - {% endif %} - {% endfor %} - - - - - Placement Statistics - - - - - - Apply for jobs - - - - - - Upload documents - - - - {% if current2 %} - - Student Record - - (9-4-22) - - - - - - - Add Placement Record - - - {% endif %} - {% if current1 %} - - Add Chairman Visit - - - {% endif %} - -
- {% comment %}The Tab-Menu ends here!{% endcomment %} - -
- {% comment %} - The left-rail segment ends here! - {% endcomment %} - - - {% comment %} The central-rail segment starts here!{% endcomment %} -
- - - -
- {% for c3 in current2 %} - {% if c3.designation.name == 'placement officer' %} -
-
- -
- -
-
- -
- - -
-
- {% endif %} - {% endfor %} - - - {% for c in current1 %} - {% if c.designation.name == 'placement chairman' %} -
-
- -
- -
-
- -
- - -
-
- {% endif %} - {% endfor %} - - -
- {% for c in current %} - {% if c.designation.name == 'student' %} - {% if schedules %} - {% for sch in schedules|dictsortreversed:"schedule_at" %} -
- -
-
-
-

{{ sch.notify_id.placement_type }} | {{ sch.notify_id.company_name }} | {{ sch.placement_date }}


- Time of Message: {{ sch.notify_id.timestamp }} - -
-
-
-

CTC (LPA): {{ sch.notify_id.ctc }}

-

{{ sch.title }} | {{ sch.role.role }}

-

Date/Time & Location: {{ sch.placement_date }} | {{ sch.time }} | {{ sch.location }}

-

Job Description: {{ sch.description }}

-
-
-

-
- {% endfor %} - {% else %} -
No Active Schedule.
- {% endif %} - - - {% endif %} - {% endfor %} - - {% for c1 in current1 %} - {% if c1.designation.name == 'placement chairman' %} - {% if schedules %} -
-
- - {% for sch in schedules|dictsortreversed:"schedule_at" %} -
- -
-
-
-

{{ sch.notify_id.placement_type }} | {{ sch.notify_id.company_name }} | {{ sch.placement_date }}


- Time of Message: {{ sch.notify_id.timestamp }} - -
-
-
-

CTC (LPA): {{ sch.notify_id.ctc }}

-

{{ sch.title }} | {{ sch.role.role }}

-

Date/Time & Location: {{ sch.placement_date }} | {{ sch.time }} | {{ sch.location }}

-

Job Description: {{ sch.description }}

-
-
-

-
- {% endfor %} - -
- - {% endif %} - {% endif %} - {% endfor %} - - - - {% for c1 in current2 %} - {% if c1.designation.name == 'placement officer' %} - {% if schedules %} - -
-
- - {% for sch in schedules|dictsortreversed:"schedule_at" %} -
- -
-
-
- -
- {% csrf_token %} - - -
- -

{{ sch.notify_id.placement_type }} | {{ sch.notify_id.company_name }} | {{ sch.placement_date }}


- - Time of Message: {{ sch.notify_id.timestamp }} - -
-
-
-

CTC (LPA): {{ sch.notify_id.ctc }}

-

{{ sch.title }} | {{ sch.get_role }}

-

Date/Time & Location: {{ sch.placement_date }} | {{ sch.time }} | {{ sch.location }}

-

Job Description: {{ sch.description }}

-
- {% if sch.attached_file %} - download - {% endif %} -
-

-
- {% endfor %} - -
- - {% endif %} - {% endif %} - {% endfor %} -
-
- - {% for c3 in current2 %} - {% if c3.designation.name == 'placement officer'%} -
-
- {% if form5.errors %} -
- -
- There were some errors with your submission -
-
    - {% if form5.company_name.errors %} -
  • {{ form5.company_name.errors }}
  • - {% endif %} - - {% if form5.placement_date.errors %} -
  • {{ form5.placement_date.errors }}
  • - {% endif %} - - {% if form5.location.errors %} -
  • {{ form5.location.errors }}
  • - {% endif %} - - {% if form5.ctc.errors %} -
  • {{ form5.ctc.errors }}
  • - {% endif %} - - {% if form5.time.errors %} -
  • {{ form5.time.errors }}
  • - {% endif %} - - {% if form5.placement_type.errors %} -
  • {{ form5.placement_type.errors }}
  • - {% endif %} - - {% if form5.description.errors %} -
  • {{ form5.description.errors }}
  • - {% endif %} -
-
- {% endif %} - - {% comment %}Form Tag starts here!{% endcomment %} -
- {% comment %}The add a new skill Accordian starts here!{% endcomment %} -
-
- - Add a new Event! -
- -
-
- {% csrf_token %} -
-
- -
- {% comment %}The Institute Name input!{% endcomment %} - {{ form5.company_name }} - - - -
-
- -
- -
-
- - {{ form5.placement_date }} -
-
-
- -
- -
- {% comment %}The Location input!{% endcomment %} - {{ form5.location }} -
-
-
-
-
- -
- {% comment %}The Institute Name input!{% endcomment %} - {{ form5.ctc }} -
-
-
- -
- {% comment %}The Institute Name input!{% endcomment %} - {{ form5.time }} -
-
-
- -
- {% comment %}The Location input!{% endcomment %} - {{ form5.placement_type }} -
-
-
-
- - -
- {% comment %}The Location input!{% endcomment %} - {{ form5.description }} -
-
-
- - - - - - -
- -
- - -
- -
-
- -
-
-
- {% comment %}The add a new Achievement Accordian ends here!{% endcomment %} -
- {% comment %}Form Tag ends here!{% endcomment %} -
-
- {% endif %} - {% endfor %} - - {% for c1 in current1 %} - {% if c1.designation.name == 'placement chairman'%} -
-
- - {% comment %}Form Tag starts here!{% endcomment %} -
- {% comment %}The add a new skill Accordian starts here!{% endcomment %} -
-
- - Add a new Event! -
- {{ form5.non_field_errors }} -
-
- {% csrf_token %} -
-
- {{ form5.company_name.errors }} - -
- {% comment %}The Institute Name input!{% endcomment %} - {{ form5.company_name }} -
-
- -
- {{ form5.placement_date.errors }} - -
-
- - {{ form5.placement_date }} -
-
-
- -
- {{ form5.location.errors }} - -
- {% comment %}The Location input!{% endcomment %} - {{ form5.location }} -
-
-
-
-
- {{ form5.ctc.errors }} - -
- {% comment %}The Institute Name input!{% endcomment %} - {{ form5.ctc }} -
-
-
- {{ form5.time.errors }} - -
- {% comment %}The Institute Name input!{% endcomment %} - {{ form5.time }} -
-
-
- {{ form5.placement_type.errors }} - -
- {% comment %}The Location input!{% endcomment %} - {{ form5.placement_type }} -
-
-
-
- {{ form5.description.errors }} - - -
- {% comment %}The Location input!{% endcomment %} - {{ form5.description }} -
-
-
- -
- -
-
- -
-
-
- {% comment %}The add a new Achievement Accordian ends here!{% endcomment %} -
- {% comment %}Form Tag ends here!{% endcomment %} -
-
- {% endif %} - {% endfor %} -
- - - {% for c in current %} - {% if c.designation.name == 'student' %} - {% comment %}The right-rail segment starts here!{% endcomment %} -
-
- {% comment %} - TODO: the right rail! - {% endcomment %} - - {% comment %}Generate CV {% endcomment %} -
-
- - Download a C.V.? -
-
-
-
- {{ form.non_field_errors }} - {% csrf_token %} -
- - -
-

-
- - -
-

-
- - -
-

-
- - -
-

-
- - -
-

-
- - -
-

-
- - -
-

-
- - -
-

-
- - -
-

-
- - -
-

-
- - -
-
- -
-

- - -
-
-
- -
- -
- - {% block interviewrequest %} - {% include 'placementModule/interviewrequest.html' %} - {% endblock %} - -
- - {% comment %}The right-rail segment ends here!{% endcomment %} - {% endif %} - {% endfor %} - {% comment %}The right-margin segment!{% endcomment %} -
-
- - -{% endblock %} - - -{% block javascript %} - - - - - - - - - - - - - - - -{% endblock %} diff --git a/FusionIIIT/templates/placementModule/hello_world.html b/FusionIIIT/templates/placementModule/hello_world.html deleted file mode 100644 index 98556a728..000000000 --- a/FusionIIIT/templates/placementModule/hello_world.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - Hello World - - -

{{ message }}

- - diff --git a/FusionIIIT/templates/placementModule/placement.html b/FusionIIIT/templates/placementModule/placement.html index a47e4c493..c92f0fb7d 100644 --- a/FusionIIIT/templates/placementModule/placement.html +++ b/FusionIIIT/templates/placementModule/placement.html @@ -128,11 +128,11 @@ --> - {% if current2 %} + - Add Placement Record + Update Placement Data {% endif %} diff --git a/FusionIIIT/templates/placementModule/placementstatistics.html b/FusionIIIT/templates/placementModule/placementstatistics.html index 2044d48e4..ee88d0365 100644 --- a/FusionIIIT/templates/placementModule/placementstatistics.html +++ b/FusionIIIT/templates/placementModule/placementstatistics.html @@ -187,7 +187,7 @@ --> - Add Placement Record + Update Placement Data {% endif %} diff --git a/FusionIIIT/templates/placementModule/upload_doc.html b/FusionIIIT/templates/placementModule/upload_doc.html deleted file mode 100644 index 37aa03f62..000000000 --- a/FusionIIIT/templates/placementModule/upload_doc.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - Document - - - ghjgj - - \ No newline at end of file From 8bdb905807dcc8f2e8891f880c80f14c83624134 Mon Sep 17 00:00:00 2001 From: kushbatla Date: Wed, 21 Feb 2024 23:57:17 +0530 Subject: [PATCH 07/15] fixed ui issue placement.html --- FusionIIIT/templates/placementModule/placement.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FusionIIIT/templates/placementModule/placement.html b/FusionIIIT/templates/placementModule/placement.html index c92f0fb7d..4a0429a74 100644 --- a/FusionIIIT/templates/placementModule/placement.html +++ b/FusionIIIT/templates/placementModule/placement.html @@ -128,11 +128,11 @@ --> - + - Update Placement Data + Update Placement Data {% endif %} From f020a7e749672cc0aeb3da74cdd90c105e1e3d35 Mon Sep 17 00:00:00 2001 From: kushbatla Date: Mon, 11 Mar 2024 01:23:08 +0530 Subject: [PATCH 08/15] send invitation, check invitaion status ,resolved other minor bugs --- .../applications/placement_cell/forms.py | 30 ++ .../applications/placement_cell/models.py | 1 + .../applications/placement_cell/views.py | 436 ++++++++++++++++++ .../templates/placementModule/activity.html | 12 +- .../placementModule/add_placement_visits.html | 4 +- .../placementModule/managerecords.html | 12 +- .../templates/placementModule/placement.html | 26 +- .../placementModule/placementstatistics.html | 20 +- .../placementModule/studentrecords.html | 14 +- 9 files changed, 511 insertions(+), 44 deletions(-) diff --git a/FusionIIIT/applications/placement_cell/forms.py b/FusionIIIT/applications/placement_cell/forms.py index 129ed9f66..58ef86a8f 100644 --- a/FusionIIIT/applications/placement_cell/forms.py +++ b/FusionIIIT/applications/placement_cell/forms.py @@ -547,6 +547,36 @@ class SearchPbiRecord(forms.Form): +class SendInvitation(forms.Form): + """ + The form is used to send invite to students about upcoming placement or pbi events. + @variables: + company - name of company + """ + company = forms.ModelChoiceField(required=True, queryset=NotifyStudent.objects.all(), label="company") + rollno = forms.IntegerField(label="rollno", widget=forms.NumberInput(attrs={'min': 0}), required=False) + programme = forms.ChoiceField(choices = Con.PROGRAMME, required=False, + label="programme", widget=forms.Select(attrs={'style': "height:45px", + 'onchange': "changeDeptForSend()", + 'id': "id_programme_send"})) + + dep_btech = forms.MultipleChoiceField(choices = Constants.BTECH_DEP, required=False, label="department", + widget=forms.CheckboxSelectMultiple) + dep_bdes = forms.MultipleChoiceField(choices = Constants.BDES_DEP, required=False, label="department", + widget=forms.CheckboxSelectMultiple) + dep_mtech = forms.MultipleChoiceField(choices = Constants.MTECH_DEP, required=False, label="department", + widget=forms.CheckboxSelectMultiple) + dep_mdes = forms.MultipleChoiceField(choices = Constants.MDES_DEP, required=False, label="department", + widget=forms.CheckboxSelectMultiple) + dep_phd = forms.MultipleChoiceField(choices = Constants.PHD_DEP, required=False, label="department", + widget=forms.CheckboxSelectMultiple) + cpi = forms.DecimalField(label="cpi", required=False) + no_of_days = forms.CharField(required=True, widget=forms.NumberInput(attrs={ 'min':0, + 'max':30, + 'max_length': 10, + 'class': 'form-control'})) + + class AddPlacementSchedule(forms.Form): """ The form is used to placement or pbi schedule. diff --git a/FusionIIIT/applications/placement_cell/models.py b/FusionIIIT/applications/placement_cell/models.py index d9837608e..103050329 100644 --- a/FusionIIIT/applications/placement_cell/models.py +++ b/FusionIIIT/applications/placement_cell/models.py @@ -56,6 +56,7 @@ class Constants: ('CSE', 'CSE'), ('ME','ME'), ('ECE','ECE'), + ('SM','SM'), ) BDES_DEP = ( diff --git a/FusionIIIT/applications/placement_cell/views.py b/FusionIIIT/applications/placement_cell/views.py index dd848176b..bc4ba7717 100644 --- a/FusionIIIT/applications/placement_cell/views.py +++ b/FusionIIIT/applications/placement_cell/views.py @@ -1162,6 +1162,380 @@ def Placement__Schedule(request): return render(request, 'placementModule/placement.html', context) + + +def invite_status(request): + ''' + function to check the invitation status + ''' + user = request.user + strecord_tab = 1 + mnpbi_tab = 0 + mnplacement_post = 0 + mnpbi_post = 0 + invitation_status_tab = 1 + placementstatus_placement = [] + placementstatus_pbi = [] + mnplacement_tab = 1 + + no_pagination = 1 + is_disabled = 0 + paginator = '' + page_range = '' + placement_get_request = False + pbi_get_request = False + + # invitation status for placement + if 'studentplacementsearchsubmit' in request.POST: + mnplacement_post = 1 + mnpbi_post = 0 + form = ManagePlacementRecord(request.POST) + + if form.is_valid(): + if form.cleaned_data['stuname']: + stuname = form.cleaned_data['stuname'] + else: + stuname = '' + if form.cleaned_data['ctc']: + ctc = form.cleaned_data['ctc'] + else: + ctc = 0 + if form.cleaned_data['company']: + cname = form.cleaned_data['company'] + else: + cname = '' + if form.cleaned_data['roll']: + rollno = form.cleaned_data['roll'] + else: + rollno = '' + + request.session['mn_stuname'] = stuname + request.session['mn_ctc'] = ctc + request.session['mn_cname'] = cname + request.session['mn_rollno'] = rollno + + placementstatus_placement = PlacementStatus.objects.select_related('unique_id','notify_id').filter(Q(notify_id__in=NotifyStudent.objects.filter + (Q(placement_type="PLACEMENT", + company_name__icontains=cname, + ctc__gte=ctc)), + unique_id__in=Student.objects.filter + ((Q(id__in=ExtraInfo.objects.filter + (Q(user__in=User.objects.filter + (Q(first_name__icontains=stuname)), + id__icontains=rollno)) + ))))) + # pagination stuff starts from here + total_query = placementstatus_placement.count() + + if total_query > 30: + no_pagination = 1 + paginator = Paginator(placementstatus_placement, 30) + page = request.GET.get('page', 1) + placementstatus_placement = paginator.page(page) + page = int(page) + total_page = int(page + 3) + + if page<(paginator.num_pages-3): + if total_query > 30 and total_query <=60: + page_range = range(1, 3) + else: + page_range = range(1, total_page+1) + + if page >= 5: + is_disabled = 1 + page_range = range(page-2, total_page) + else: + if page >= 5: + is_disabled = 1 + page_range = range(page-2, paginator.num_pages+1) + else: + page_range = range(1, paginator.num_pages+1) + else: + no_pagination = 0 + else: + # when the request from pagination with some page number + if request.GET.get('placement_page') != None: + mnplacement_post = 1 + mnpbi_post = 0 + no_pagination = 1 + try: + placementstatus_placement = PlacementStatus.objects.select_related('unique_id','notify_id').filter(Q(notify_id__in=NotifyStudent.objects.filter + (Q(placement_type="PLACEMENT", + company_name__icontains=request.session['mn_cname'], + ctc__gte=request.session['mn_ctc'])), + unique_id__in=Student.objects.filter + ((Q(id__in=ExtraInfo.objects.filter + (Q(user__in=User.objects.filter + (Q(first_name__icontains=request.session['mn_stuname'])), + id__icontains=request.session['mn_rollno'])) + ))))) + except: + placementstatus_placement = [] + + if placementstatus_placement != '': + total_query = placementstatus_placement.count() + else: + total_query = 0 + + if total_query > 30: + paginator = Paginator(placementstatus_placement, 30) + page = request.GET.get('placement_page', 1) + placementstatus_placement = paginator.page(page) + page = int(page) + total_page = int(page + 3) + + if page<(paginator.num_pages-3): + if total_query > 30 and total_query <=60: + page_range = range(1, 3) + else: + page_range = range(1, total_page+1) + + if page >= 5: + is_disabled = 1 + page_range = range(page-2, total_page) + else: + if page >= 5: + is_disabled = 1 + page_range = range(page-2, paginator.num_pages+1) + else: + page_range = range(1, paginator.num_pages+1) + else: + no_pagination = 0 + + # invitation status for pbi + if 'studentpbisearchsubmit' in request.POST: + mnpbi_tab = 1 + mnpbi_post = 1 + mnplacement_post = 0 + form = ManagePbiRecord(request.POST) + if form.is_valid(): + if form.cleaned_data['stuname']: + stuname = form.cleaned_data['stuname'] + else: + stuname = '' + if form.cleaned_data['ctc']: + ctc = form.cleaned_data['ctc'] + else: + ctc = 0 + if form.cleaned_data['company']: + cname = form.cleaned_data['company'] + else: + cname = '' + if form.cleaned_data['roll']: + rollno = form.cleaned_data['roll'] + else: + rollno = '' + request.session['mn_pbi_stuname'] = stuname + request.session['mn_pbi_ctc'] = ctc + request.session['mn_pbi_cname'] = cname + request.session['mn_pbi_rollno'] = rollno + placementstatus_pbi = PlacementStatus.objects.select_related('unique_id','notify_id').filter( + Q(notify_id__in=NotifyStudent.objects.filter( + Q(placement_type="PBI", + company_name__icontains=cname, + ctc__gte=ctc)), + unique_id__in=Student.objects.filter( + (Q(id__in=ExtraInfo.objects.filter( + Q(user__in=User.objects.filter( + Q(first_name__icontains=stuname)), + id__icontains=rollno))))))).order_by('id') + + total_query = placementstatus_pbi.count() + + if total_query > 30: + no_pagination = 1 + paginator = Paginator(placementstatus_pbi, 30) + page = request.GET.get('pbi_page', 1) + placementstatus_pbi = paginator.page(page) + page = int(page) + total_page = int(page + 3) + + if page<(paginator.num_pages-3): + if total_query > 30 and total_query <=60: + page_range = range(1, 3) + else: + page_range = range(1, total_page+1) + + if page >= 5: + is_disabled = 1 + page_range = range(page-2, total_page) + else: + if page >= 5: + is_disabled = 1 + page_range = range(page-2, paginator.num_pages+1) + else: + page_range = range(1, paginator.num_pages+1) + else: + no_pagination = 0 + else: + if request.GET.get('pbi_page') != None: + mnpbi_tab = 1 + mnpbi_post = 1 + no_pagination = 1 + try: + placementstatus_pbi = PlacementStatus.objects.select_related('unique_id','notify_id').filter( + Q(notify_id__in=NotifyStudent.objects.filter( + Q(placement_type="PBI", + company_name__icontains=request.session['mn_pbi_cname'], + ctc__gte=request.session['mn_pbi_ctc'])), + unique_id__in=Student.objects.filter( + (Q(id__in=ExtraInfo.objects.filter( + Q(user__in=User.objects.filter( + Q(first_name__icontains=request.session['mn_pbi_stuname'])), + id__icontains=request.session['mn_pbi_rollno'])) + ))))) + except: + placementstatus_pbi = '' + + if placementstatus_pbi != '': + total_query = placementstatus_pbi.count() + else: + total_query = 0 + if total_query > 30: + paginator = Paginator(placementstatus_pbi, 30) + page = request.GET.get('pbi_page', 1) + placementstatus_pbi = paginator.page(page) + page = int(page) + total_page = int(page + 3) + + if page<(paginator.num_pages-3): + if total_query > 30 and total_query <=60: + page_range = range(1, 3) + else: + page_range = range(1, total_page+1) + + if page >= 5: + is_disabled = 1 + page_range = range(page-2, total_page) + else: + if page >= 5: + is_disabled = 1 + page_range = range(page-2, paginator.num_pages+1) + else: + page_range = range(1, paginator.num_pages+1) + else: + no_pagination = 0 + + + if 'pdf_gen_invitation_status' in request.POST: + + placementstatus = None + if 'pdf_gen_invitation_status_placement' in request.POST: + stuname = request.session['mn_stuname'] + ctc = request.session['mn_ctc'] + cname = request.session['mn_cname'] + rollno = request.session['mn_rollno'] + + placementstatus = PlacementStatus.objects.select_related('unique_id','notify_id').filter(Q(notify_id__in=NotifyStudent.objects.filter + (Q(placement_type="PLACEMENT", + company_name__icontains=cname, + ctc__gte=ctc)), + unique_id__in=Student.objects.filter + ((Q(id__in=ExtraInfo.objects.filter + (Q(user__in=User.objects.filter + (Q(first_name__icontains=stuname)), + id__icontains=rollno)) + ))))) + + if 'pdf_gen_invitation_status_pbi' in request.POST: + stuname = request.session['mn_pbi_stuname'] + ctc = request.session['mn_pbi_ctc'] + cname = request.session['mn_pbi_cname'] + rollno = request.session['mn_pbi_rollno'] + + placementstatus = PlacementStatus.objects.select_related('unique_id','notify_id').filter( + Q(notify_id__in=NotifyStudent.objects.filter( + Q(placement_type="PBI", + company_name__icontains=cname, + ctc__gte=ctc)), + unique_id__in=Student.objects.filter( + (Q(id__in=ExtraInfo.objects.filter( + Q(user__in=User.objects.filter( + Q(first_name__icontains=stuname)), + id__icontains=rollno))))))).order_by('id') + + context = { + 'placementstatus' : placementstatus + } + + return render_to_pdf('placementModule/pdf_invitation_status.html', context) + + if 'excel_gen_invitation_status' in request.POST: + + placementstatus = None + if 'excel_gen_invitation_status_placement' in request.POST: + stuname = request.session['mn_stuname'] + ctc = request.session['mn_ctc'] + cname = request.session['mn_cname'] + rollno = request.session['mn_rollno'] + + placementstatus = PlacementStatus.objects.select_related('unique_id','notify_id').filter(Q(notify_id__in=NotifyStudent.objects.filter + (Q(placement_type="PLACEMENT", + company_name__icontains=cname, + ctc__gte=ctc)), + unique_id__in=Student.objects.filter + ((Q(id__in=ExtraInfo.objects.filter + (Q(user__in=User.objects.filter + (Q(first_name__icontains=stuname)), + id__icontains=rollno)) + ))))) + + if 'excel_gen_invitation_status_pbi' in request.POST: + stuname = request.session['mn_pbi_stuname'] + ctc = request.session['mn_pbi_ctc'] + cname = request.session['mn_pbi_cname'] + rollno = request.session['mn_pbi_rollno'] + + placementstatus = PlacementStatus.objects.select_related('unique_id','notify_id').filter( + Q(notify_id__in=NotifyStudent.objects.filter( + Q(placement_type="PBI", + company_name__icontains=cname, + ctc__gte=ctc)), + unique_id__in=Student.objects.filter( + (Q(id__in=ExtraInfo.objects.filter( + Q(user__in=User.objects.filter( + Q(first_name__icontains=stuname)), + id__icontains=rollno))))))).order_by('id') + + context = { + 'placementstatus' : placementstatus + } + + + return export_to_xls_invitation_status(placementstatus) + + form1 = SearchStudentRecord(initial={}) + form9 = ManagePbiRecord(initial={}) + form11 = ManagePlacementRecord(initial={}) + form13 = SendInvite(initial={}) + current1 = HoldsDesignation.objects.filter(Q(working=user, designation__name="placement chairman")) + current2 = HoldsDesignation.objects.filter(Q(working=user, designation__name="placement officer")) + + context = { + 'form1': form1, + 'form9': form9, + 'form11': form11, + 'form13': form13, + 'invitation_status_tab': invitation_status_tab, + 'mnplacement_post': mnplacement_post, + 'mnpbi_tab': mnpbi_tab, + 'mnplacement_tab': mnplacement_tab, + 'placementstatus_placement': placementstatus_placement, + 'placementstatus_pbi': placementstatus_pbi, + 'current1': current1, + 'current2': current2, + 'strecord_tab': strecord_tab, + 'mnpbi_post': mnpbi_post, + 'page_range': page_range, + 'paginator': paginator, + 'no_pagination': no_pagination, + 'is_disabled': is_disabled, + } + + return render(request, 'placementModule/studentrecords.html', context) + + + @login_required def placement(request): ''' @@ -2799,6 +3173,68 @@ def manage_records(request): +@login_required +def delete_invite_status(request): + ''' + function to delete the invitation that has been sent to the students + ''' + user = request.user + strecord_tab = 1 + mnpbi_tab = 0 + mnplacement_post = 0 + mnpbi_post = 0 + invitation_status_tab = 1 + placementstatus = [] + + no_pagination = 1 + is_disabled = 0 + paginator = '' + page_range = '' + + if 'deleteinvitationstatus' in request.POST: + delete_invit_status_key = request.POST['deleteinvitationstatus'] + + try: + PlacementStatus.objects.select_related('unique_id','notify_id').get(pk=delete_invit_status_key).delete() + messages.success(request, 'Invitation Deleted Successfully') + except Exception as e: + logger.error(e) + + if 'pbi_tab_active' in request.POST: + mnpbi_tab = 1 + else: + mnplacement_tab = 1 + + form1 = SearchStudentRecord(initial={}) + form9 = ManagePbiRecord(initial={}) + form11 = ManagePlacementRecord(initial={}) + form13 = SendInvite(initial={}) + current1 = HoldsDesignation.objects.filter(Q(working=user, designation__name="placement chairman")) + current2 = HoldsDesignation.objects.filter(Q(working=user, designation__name="placement officer")) + + context = { + 'form1': form1, + 'form9': form9, + 'form11': form11, + 'form13': form13, + 'invitation_status_tab': invitation_status_tab, + 'mnplacement_post': mnplacement_post, + 'mnpbi_tab': mnpbi_tab, + 'placementstatus': placementstatus, + # 'current':current, + 'current1': current1, + 'current2': current2, + 'strecord_tab': strecord_tab, + 'mnpbi_post': mnpbi_post, + 'page_range': page_range, + 'paginator': paginator, + 'no_pagination': no_pagination, + 'is_disabled': is_disabled, + } + + return render(request, 'placementModule/studentrecords.html', context) + + @login_required def placement_statistics(request): diff --git a/FusionIIIT/templates/placementModule/activity.html b/FusionIIIT/templates/placementModule/activity.html index e96d62d1d..ef43e0d3d 100644 --- a/FusionIIIT/templates/placementModule/activity.html +++ b/FusionIIIT/templates/placementModule/activity.html @@ -65,10 +65,10 @@ {% endif %} - + {% endif %} {% endfor %} @@ -94,15 +94,15 @@ {% endif %} - + + {% endif %} {% endfor %} diff --git a/FusionIIIT/templates/placementModule/add_placement_visits.html b/FusionIIIT/templates/placementModule/add_placement_visits.html index 3542f3263..a04e9264d 100644 --- a/FusionIIIT/templates/placementModule/add_placement_visits.html +++ b/FusionIIIT/templates/placementModule/add_placement_visits.html @@ -133,12 +133,12 @@ {% endif %} - {% if current1 %} + diff --git a/FusionIIIT/templates/placementModule/managerecords.html b/FusionIIIT/templates/placementModule/managerecords.html index 58d1d0201..6f70782f8 100644 --- a/FusionIIIT/templates/placementModule/managerecords.html +++ b/FusionIIIT/templates/placementModule/managerecords.html @@ -65,10 +65,10 @@ {% endif %} - + {% endif %} {% endfor %} @@ -95,14 +95,14 @@ {% endif %} - + + {% endif %} {% endfor %} diff --git a/FusionIIIT/templates/placementModule/placement.html b/FusionIIIT/templates/placementModule/placement.html index 4a0429a74..a6707bb65 100644 --- a/FusionIIIT/templates/placementModule/placement.html +++ b/FusionIIIT/templates/placementModule/placement.html @@ -57,7 +57,7 @@ {% else %} - Placement + Placement Schedule @@ -96,14 +96,14 @@ {% endif %} - - Manage Records + + {% endif %} @@ -128,11 +128,11 @@ --> - {% if current2 %} + - Update Placement Data + Add Placement Record {% endif %} - {% if current1 %} + {% comment %}The Tab-Menu ends here!{% endcomment %} @@ -204,9 +204,9 @@ {% for c in current1 %} {% if c.designation.name == 'placement chairman' %} - + {% endif %} {% endfor %} diff --git a/FusionIIIT/templates/placementModule/placementstatistics.html b/FusionIIIT/templates/placementModule/placementstatistics.html index ee88d0365..668b926e0 100644 --- a/FusionIIIT/templates/placementModule/placementstatistics.html +++ b/FusionIIIT/templates/placementModule/placementstatistics.html @@ -187,16 +187,16 @@ --> - Update Placement Data + Add Placement Record {% endif %} - {% if current1 %} + {% comment %}The Tab-Menu ends here!{% endcomment %} @@ -909,10 +909,10 @@

No Data Found.

- CSE + Package @@ -923,7 +923,7 @@

No Data Found.

{% if record.placement_type != "HIGHER STUDIES" %} {{ record.name }} - + + {{ record.ctc }} {% endif %} {% endif %} {% endfor %} - + diff --git a/FusionIIIT/templates/placementModule/studentrecords.html b/FusionIIIT/templates/placementModule/studentrecords.html index ff849b0d4..362742d2d 100644 --- a/FusionIIIT/templates/placementModule/studentrecords.html +++ b/FusionIIIT/templates/placementModule/studentrecords.html @@ -140,12 +140,12 @@ {% endif %} - {% if current1 %} + {% comment %}The Tab-Menu ends here!{% endcomment %} @@ -561,7 +561,7 @@
{{ form13.dep_btech.errors }} {{ form13.dep_btech }}
@@ -569,7 +569,7 @@
{{ form13.dep_bdes.errors }} {{ form13.dep_bdes }}
@@ -577,7 +577,7 @@
{{ form13.dep_mtech.errors }} {{ form13.dep_mtech }}
@@ -585,7 +585,7 @@
{{ form13.dep_mdes.errors }} {{ form13.dep_mdes }}
@@ -593,7 +593,7 @@
{{ form13.dep_phd.errors }} {{ form13.dep_phd }}
From c1359b7ce8a1945e41e90330fe39bc634d9ca6f3 Mon Sep 17 00:00:00 2001 From: Hardik Sharma <104981324+hardiksharma11@users.noreply.github.com> Date: Mon, 11 Mar 2024 13:36:04 +0530 Subject: [PATCH 09/15] 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 --- .github/workflows/bandit_security_test.yml | 27 ++++++++++++++++++++++ .github/workflows/pylint.yml | 24 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/bandit_security_test.yml create mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/bandit_security_test.yml b/.github/workflows/bandit_security_test.yml new file mode 100644 index 000000000..6c77c2cbc --- /dev/null +++ b/.github/workflows/bandit_security_test.yml @@ -0,0 +1,27 @@ +name: Security check - Bandit + +on: push + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + os: [ ubuntu-latest, macos-latest ] + name: Python ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: Security check - Bandit + uses: ioggstream/bandit-report-artifacts@v0.0.2 + with: + project_path: . + ignore_failure: true + + # This is optional + - name: Security check report artifacts + uses: actions/upload-artifact@v1 + with: + name: Security report + path: output/security_report.txt diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 000000000..2e572c297 --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,24 @@ +name: Pylint + +on: [push] + +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + python-version: ["3.8"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + + - name: Analysing the code with pylint + run: | + pylint $(git ls-files '*.py') From ed210c15c1b8632290e0ed2cc6bfcc717152bc8c Mon Sep 17 00:00:00 2001 From: Raman Chaudhary <97114586+ChaudharyRaman@users.noreply.github.com> Date: Mon, 11 Mar 2024 14:23:25 +0530 Subject: [PATCH 10/15] Revert "Added pylint (#1302)" (#1324) This reverts commit c1359b7ce8a1945e41e90330fe39bc634d9ca6f3. --- .github/workflows/bandit_security_test.yml | 27 ---------------------- .github/workflows/pylint.yml | 24 ------------------- 2 files changed, 51 deletions(-) delete mode 100644 .github/workflows/bandit_security_test.yml delete mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/bandit_security_test.yml b/.github/workflows/bandit_security_test.yml deleted file mode 100644 index 6c77c2cbc..000000000 --- a/.github/workflows/bandit_security_test.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Security check - Bandit - -on: push - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - os: [ ubuntu-latest, macos-latest ] - name: Python ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - - name: Security check - Bandit - uses: ioggstream/bandit-report-artifacts@v0.0.2 - with: - project_path: . - ignore_failure: true - - # This is optional - - name: Security check report artifacts - uses: actions/upload-artifact@v1 - with: - name: Security report - path: output/security_report.txt diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml deleted file mode 100644 index 2e572c297..000000000 --- a/.github/workflows/pylint.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Pylint - -on: [push] - -jobs: - build: - runs-on: ubuntu-22.04 - strategy: - matrix: - python-version: ["3.8"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pylint - - - name: Analysing the code with pylint - run: | - pylint $(git ls-files '*.py') From 19e0fe2de691ef8af70e06116c3614e687a73518 Mon Sep 17 00:00:00 2001 From: kushbatla Date: Sun, 17 Mar 2024 02:14:37 +0530 Subject: [PATCH 11/15] pull --- 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 | 85 +++++- FusionIIIT/templates/dashboard/dashboard.html | 30 +- FusionIIIT/templates/dashboard/modules.html | 279 ++++++++++++++---- FusionIIIT/templates/dashboard/navbar.html | 213 +++++++------ .../templates/dashboard/sidenavbar.html | 82 ++--- FusionIIIT/templates/globals/usercard.html | 95 +++--- 10 files changed, 573 insertions(+), 269 deletions(-) create mode 100644 FusionIIIT/Fusion/context_processors.py create mode 100644 FusionIIIT/Fusion/middleware/custom_middleware.py 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..41c3126ad --- /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..6da788a9b 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..be449d1a9 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/* @@ -770,14 +775,74 @@ def profile(request, username=None): 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/templates/dashboard/dashboard.html b/FusionIIIT/templates/dashboard/dashboard.html index 2b940cdbb..62fa752bd 100755 --- a/FusionIIIT/templates/dashboard/dashboard.html +++ b/FusionIIIT/templates/dashboard/dashboard.html @@ -20,29 +20,28 @@ {% comment %}The grid starts here!{% endcomment %} -
+
{% comment %}The left-margin segment!{% endcomment %} -
+ {% comment %}
{% endcomment %} {% comment %} The left-rail segment starts here! {% endcomment %} -
+
{% comment %}The user image card starts here!{% endcomment %} {% block usercard %} - {% include 'globals/usercard.html' %} + {% comment %} {% include 'globals/usercard.html' %} {% endcomment %} {% endblock %} {% comment %}The user image card ends here!{% endcomment %} -
- + {% if 'staff' != request.user.extrainfo.user_type %} {% comment %}The Tab-Menu starts here!{% endcomment %} -