Skip to content

Commit

Permalink
updated department information dynamically and changeed ui layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Mojo-03 committed Apr 24, 2024
1 parent 1b928ad commit 4a0b5ae
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 191 deletions.
55 changes: 41 additions & 14 deletions FusionIIIT/applications/department/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@
from jsonschema.exceptions import ValidationError


def department_information(request):

cse_info = Information.objects.filter(department_id=51).first()
ece_info = Information.objects.filter(department_id=30).first()
me_info = Information.objects.filter(department_id=37).first()
sm_info = Information.objects.filter(department_id=28).first()
department_context = {
"cse_info" : cse_info,
"ece_info" : ece_info,
"me_info" : me_info,
"sm_info" : sm_info
}
# print(department_context)
# print(me_info.phone_number,me_info.email,me_info.department_id)
return department_context

def browse_announcements():
"""
Expand Down Expand Up @@ -50,7 +65,7 @@ def browse_announcements():
"sm" : sm_ann,
"all" : all_ann
}

# print(context)
return context

def get_make_request(user_id):
Expand Down Expand Up @@ -107,7 +122,10 @@ def dep_main(request):
context = browse_announcements()
context_f = faculty()
user_designation = ""



department_context = department_information(request)

if fac_view:
user_designation = "faculty"
elif student:
Expand Down Expand Up @@ -143,7 +161,9 @@ def dep_main(request):
return render(request, template_name, {
"announcements": context,
"fac_list": context_f,
"requests_made": requests_made
"requests_made": requests_made,
"department_info": department_context

})

elif user_designation=="faculty":
Expand Down Expand Up @@ -173,6 +193,7 @@ def faculty_view(request):
ann_maker_id = user_info.id
requests_received = get_to_request(usrnm)
user_departmentid = ExtraInfo.objects.all().select_related('user','department').get(id=ann_maker_id).department_id
department_context = department_information(request)

if request.method == 'POST':
batch = request.POST.get('batch', '')
Expand Down Expand Up @@ -211,7 +232,8 @@ def faculty_view(request):
"user_designation": user_info.user_type,
"announcements": context,
"request_to": requests_received,
"fac_list": context_f
"fac_list": context_f,
"department_info": department_context
})


Expand All @@ -235,6 +257,8 @@ def staff_view(request):
num = 1
ann_maker_id = user_info.id
user_departmentid = ExtraInfo.objects.all().select_related('user','department').get(id=ann_maker_id).department_id

department_context = department_information(request)

requests_received = get_to_request(usrnm)
if request.method == 'POST':
Expand Down Expand Up @@ -288,13 +312,9 @@ def staff_view(request):
)



# update_department_info(request)
#find the name of designation in the table designation
# required_designation = Designation.objects.all().

context = browse_announcements()


department_templates = {
51: 'department/csedep_request.html',
30: 'department/ecedep_request.html',
Expand All @@ -312,31 +332,35 @@ def staff_view(request):
"user_designation": user_info.user_type,
"announcements": context,
"request_to": requests_received,
"fac_list": context_f
"fac_list": context_f,
"department_info": department_context
})
elif desig=='deptadmin_ece':
template_name = 'department/admin_ece.html'
return render(request, template_name, {
"user_designation": user_info.user_type,
"announcements": context,
"request_to": requests_received,
"fac_list": context_f
"fac_list": context_f,
"department_info": department_context
})
elif desig=='deptadmin_me':
template_name = 'department/admin_me.html'
return render(request, template_name, {
"user_designation": user_info.user_type,
"announcements": context,
"request_to": requests_received,
"fac_list": context_f
"fac_list": context_f,
"department_info": department_context
})
elif desig=='deptadmin_sm':
template_name = 'department/admin_sm.html'
return render(request, template_name, {
"user_designation": user_info.user_type,
"announcements": context,
"request_to": requests_received,
"fac_list": context_f
"fac_list": context_f,
"department_info": department_context
})

# if desig == 'deptadmin_cse':
Expand All @@ -355,7 +379,8 @@ def staff_view(request):
"user_designation": user_info.user_type,
"announcements": context,
"request_to": requests_received,
"fac_list": context_f
"fac_list": context_f,
"department_info": department_context
})


Expand Down Expand Up @@ -465,6 +490,7 @@ def faculty():
# print(cse_f)
return context_f


def alumni(request):
"""
This function is used to Return data of Alumni Department-Wise.
Expand Down Expand Up @@ -506,6 +532,7 @@ def approved(request):
request.method = ''
return redirect('/dep/facView/')


def deny(request):
"""
This function is used to deny requests.
Expand Down
2 changes: 1 addition & 1 deletion FusionIIIT/templates/department/admin_me.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
{# Status of request! #}
<div class="ui tab segment" data-tab="seventh">
{% block request_status %}
{% include "department/request_status.html" %}
{% include "department/update_department_information.html" %}
{% endblock %}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion FusionIIIT/templates/department/admin_sm.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
{# Status of request! #}
<div class="ui tab segment" data-tab="seventh">
{% block request_status %}
{% include "department/request_status.html" %}
{% include "department/update_department_information.html" %}
{% endblock %}
</div>
</div>
Expand Down
45 changes: 8 additions & 37 deletions FusionIIIT/templates/department/cse_dep.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,49 +65,20 @@ <h3>
<div class="content">
<div class="description">
<span>
<p>Phone Number: {{ department_info.cse_info.phone_number }}</p>
<p>Email: {{ department_info.cse_info.email }}</p>
<h3>
Central Library :
Facilities :
</h3>
<p>
Institute library has e-resources through INDEST, Science Direct, IEEE, ACM, Springger Link, Nature and ASME. The Institute also has access to various online research journals & articles like following resources SIAm, AMS, ACS, Kluwer, APS, Palgrave, INFORMS, Rev.of Scientific Instruments, Appl.Physics Letters and the search engine Scopus. Total number of books in the Institute library by the year 2009-10 are approximately 6742.
</p>
<p>
High Performance Computing Labortory : Specification of Parallel Cluster (for Central Computing Facility)- JS22 Blade No.3, 16GB(2*8GB) DDR2 533 Mhz DiMMs, IBM 146GB SAS 10K SFF HDD, IBM blade center JS22 4-core 4.0 Ghz Processor and WiFi Campus etc.
</p>
{{ department_info.cse_info.facilites|linebreaks}}
</p>
<h3>
Lab Infrastructure :
</h3>
<ol>
<li>
<p>
<b>Advanced Manufacturing Laboratory :</b> This Laboratory contains Rapid Prototyping Machine, CNC Controlled Abrasive Waterjet Machine, CNC Milling Center, CNC Turning Center, Dynamometer, Electro Chemical Machining System, Injection Moulding Machine etc.
</p>
</li>
<br>
<li>
<p>
<b>Biometric Laboratory :</b> This Laboratory contains S Series, H Series, W Series cameras and p6 p520(Tower Model), p6 p520:8203 Model servers Made by IBM etc.
</p>
</li>
<br>
<li>
<p>
<b>Digital Signal Processing and Image Processing Laboratory :</b> This Laboratory contains DSP Starter SPARTAN-3 kit (DSK), TMS 320C6713 DSK with CCS (Code Composer Studio), Image Daughter Kit with CCD Cameras, Bloom with DSP, Matrox Imaging Library, Matrox Morphis, Frame Graber Card, Color CCD Camera for online Processing etc.
</p>
</li>
<br>
<li>
<p>
<b>Infrared Imaging Laboratory :</b> This Laboratory contains Radiometeric calibration, Extender rings, NDT Base Module, Central computing unit with TFT display, Software Modules for Lockin, Transient-and Pulse Measurement, Module Pulse- and Transient- Thermography, Source for Vibro- Thermography etc.
</p>
</li>
<br>
<li>
<p>
<b>Materials Research Laboratory :</b> This Laboratory contains three important instruments for material characterization which are X-Ray Diffractometer (XRD), Scanning Electron Microscope (SEM) and Atomic Force Microscope (AFM) including SPM, MFM etc.
</p>
</li>
</ol>
<p>
{{ department_info.cse_info.labs|linebreaks }}
</p>
</span>
<div class="ui divider"></div>
</div>
Expand Down
30 changes: 8 additions & 22 deletions FusionIIIT/templates/department/ece_dep.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,34 +64,20 @@ <h3>
<div class="content">
<div class="description">
<span>
<p>Phone Number: {{ department_info.ece_info.phone_number }}</p>
<p>Email: {{ department_info.ece_info.email }}</p>
<h3>
Central Library :
Facilities :
</h3>
<p>
Institute library has e-resources through INDEST, Science Direct, IEEE, ACM, Springger Link, Nature and ASME. The Institute also has access to various online research journals & articles like following resources SIAm, AMS, ACS, Kluwer, APS, Palgrave, INFORMS, Rev.of Scientific Instruments, Appl.Physics Letters and the search engine Scopus. Total number of books in the Institute library by the year 2009-10 are approximately 6742.
</p>
{{ department_info.ece_info.facilites|linebreaks}}
</p>
<h3>
Lab Infrastructure :
</h3>
<ol>
<li>
<p>
<b>Circuits and Innovation Lab :</b>This laboratory is dedicated to circuits designing, is intended to serve its facilities as one of the teaching labs and also to facilitate teaching projects and research projects. These projects and teaching work include the experimental and innovative study in the field of analog and digital circuits, microcontrollers and its applications.
</p>
</li>
<br>
<li>
<p>
<b>Basic Electronics lab :</b> This Laboratory is dedicated to the concepts and implementation of basic circuits designing. It serves its facilities as one of the teaching labs and also to facilitate course projects
</p>
</li>
<br>
<li>
<p>
<b>RF&Applied Electromagnetics :</b> This Laboratory acts as a research lab to researchscholars,research associatives. Main research areas of lab include understanding of high frequency devices ,Antenna theory concepts and design fields.
</p>
</li>
</ol>
<p>
{{ department_info.ece_info.labs|linebreaks }}
</p>
</span>
<div class="ui divider"></div>
</div>
Expand Down
100 changes: 8 additions & 92 deletions FusionIIIT/templates/department/me_dep.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,110 +65,26 @@ <h3>
<div class="content">
<div class="description">
<span>
<p>Phone Number: {{ department_info.me_info.phone_number }}</p>
<p>Email: {{ department_info.me_info.email }}</p>
<h3>
Central Library :
Facilities :
</h3>
<p>
Institute library has e-resources through INDEST, Science Direct, IEEE, ACM, Springger Link, Nature and ASME. The Institute also has access to various online research journals & articles like following resources SIAm, AMS, ACS, Kluwer, APS, Palgrave, INFORMS, Rev.of Scientific Instruments, Appl.Physics Letters and the search engine Scopus. Total number of books in the Institute library by the year 2009-10 are approximately 6742.
</p>
<p>
High Performance Computing Labortory : Specification of Parallel Cluster (for Central Computing Facility)- JS22 Blade No.3, 16GB(2*8GB) DDR2 533 Mhz DiMMs, IBM 146GB SAS 10K SFF HDD, IBM blade center JS22 4-core 4.0 Ghz Processor and WiFi Campus etc.
</p>
{{ department_info.me_info.facilites|linebreaks}}
</p>
<h3>
Lab Infrastructure :
</h3>
<ol>
<li>
<p>
<b>Health Monitoring, Measurement and Instrumentation Lab:</b>
</p>
</li>
<br>
<li>
<p>
<b>Kinematics and Dynamics Lab :</b>
</p>
</li>
<br>
<li>
<p>
<b>PG Research Lab :</b>
</p>
</li>
<br>
<li>
<p>
<b>Fluid Mechaniccs Lab :</b>
</p>
</li>
<br>
<li>
<p>
<b>Automobile Lab :</b>
</p>
</li>
<br>
<li>
<p>
<b>IT Workshop/Computational Lab:</b>
</p>
</li>
<br>
<li>
<p>
<b>Material Characterization Lab :</b>
</p>
</li>
<br>
<li>
<p>
<b>Machine Dynamics and Vibrations Lab :</b>
</p>
</li>
<br>
<li>
<p>
<b>Mechatronics Lab:</b>
</p>
</li>
<br>
<li>
<p>
<b>Robotics Lab:</b>
</p>
</li>
<br>
<li>
<p>
<b>Biomedical Engineering and Technology Lab:</b>
</p>
</li>
<br>
<li>
<p>
<b>CFD Lab :</b>
</p>
</li>
<br>
<li>
<p>
<b>Dieless Manufacturing Center:</b>
</p>
</li>
<br>
<li>
<p>
<b>Manufacturing Innovation Center:</b>
</p>
</li>
</ol>
<p>
{{ department_info.me_info.labs|linebreaks }}
</p>
</span>
<div class="ui divider"></div>
</div>
</div>
</div>
</div>

{% comment %} tabs content faculty {% endcomment %}
{% comment %}The tab menu starts here!{% endcomment %}
<div class="ui tab" data-tab="faculty">
Expand Down
Loading

0 comments on commit 4a0b5ae

Please sign in to comment.