Skip to content

Commit 335ee1f

Browse files
Harshul-25Lawful2002Anunaya07Aksh-Bansal-devakshatnema
authored
Sa 2 bug fixes (FusionIIIT#1414)
* GAD-5: Fix responsiveness (FusionIIIT#1125) Co-authored-by: A Anunaya <[email protected]> Co-authored-by: Aksh Bansal <[email protected]> * updated models * Revert "updated models" This reverts commit 83e2e73. * revert to old * some changes in frontend * some updates in frontend files * added the api for mobiles and updated urls and views of web * some updates in backend * Added frontend for new apis Created frontend for registered students and update menu features * updated admin and ui * resolved errors * Menu UI changes * Updated Menu_card * some fixes * migrations fixed * added mess registration request model * minor changes * added model and view for registeration * url fixed * fixed rebate * added new form for registration request * fixed gitignore resolved conflicts * context * Registration UI Changes * registration UI changes * restored migration file * completed registration * made some ui changes * migration fix * done things about payments * changed some views * Added Registration Remark and Dropdown * Changed id in reg * rectified error with rebate response frontend * fixed datetime in reg * worked on manage reg * deregistration request functionality added * rectified the backend issues for generate bills * added registration list * completed dereg * student bill functionality addded * rectified error of previous commit * added view reg records * added filter in view mess students * worked on bills caretaker side * changed development * Updated special food request * GAD -5 Dashboard Changes (FusionIIIT#1325) * Updated Special food Functionality * dashboard and usercard updated (FusionIIIT#1329) * minor ui fixes * added search * updated manage registration * added view bills and payments of students for mess caretaker * added notification functionality in right rail * Added Sem start and end date form (Harshul-25#26) * added start date to registration form * made some ui changes * added modal for details of a student * made some ui improvements * tested crontab * added excel upload for bill and reg * added add student to mess * fixes * update bill added and dates added (Harshul-25#32) Co-authored-by: Harshul Choudhary <[email protected]> * Some UI changes (Harshul-25#35) Co-authored-by: Harshul Choudhary <[email protected]> * merge fixes * added remove * some ui fixes * fixed cronjobs * semdate fixes * removed migrations * Fixing ui bugs (FusionIIIT#1335) * added django crontab to requirements.txt * automation of bills no new msg resolved some merge conflicts * useless commit for pulling no msg * completed automation of mess bill generation and payment history feature for student * resolved a merge error * bug fixes * bug fixes --------- Co-authored-by: Harshvardhan Singh <[email protected]> Co-authored-by: A Anunaya <[email protected]> Co-authored-by: Aksh Bansal <[email protected]> Co-authored-by: akshatnema <[email protected]> Co-authored-by: Harshit0009 <[email protected]> Co-authored-by: Harshul <[email protected]> Co-authored-by: hemantsinghhere <[email protected]> Co-authored-by: Hritik Yadav <[email protected]> Co-authored-by: Harshit0009 <[email protected]> Co-authored-by: Harshit Tiwari <[email protected]> Co-authored-by: hemantsinghhere <[email protected]> Co-authored-by: BlackHAWK2001 <[email protected]> Co-authored-by: Arpit Tak <[email protected]> Co-authored-by: Hritik Yadav <[email protected]> Co-authored-by: Harshul <[email protected]> Co-authored-by: SukulSarve <[email protected]>
1 parent ed63bb4 commit 335ee1f

File tree

9 files changed

+123
-282
lines changed

9 files changed

+123
-282
lines changed

FusionIIIT/applications/central_mess/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def add_mess_feedback(request, student):
8484
data: to record success or any errors
8585
"""
8686
date_today = datetime.now().date()
87-
mess_optn = Messinfo.objects.get(student_id=student)
87+
mess_optn = Reg_main.objects.get(student_id=student)
8888
description = request.POST.get('description')
8989
feedback_type = request.POST.get('feedback_type')
9090
feedback_object = Feedback(student_id=student, fdate=date_today,

FusionIIIT/applications/central_mess/views.py

Lines changed: 64 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
year_last_g = last_day_prev_month.year
4747
previous_month = last_day_prev_month.strftime('%B')
4848

49-
49+
@login_required
5050
def mess(request):
5151
"""
5252
This view get the access to the central mess dashboard. View all details and apply for any changes.
@@ -87,6 +87,9 @@ def mess(request):
8787

8888
de_reg_request = Deregistration_Request.objects.filter(student_id=student)
8989

90+
menu_data = Menu.objects.all()
91+
92+
9093
try:
9194
mess_optn = Reg_main.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').get(student_id=student)
9295
y = Menu.objects.filter(mess_option=mess_optn.mess_option)
@@ -141,6 +144,7 @@ def mess(request):
141144
# mess_optn = Messinfo.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').get(student_id=student)
142145
# y = Menu.objects.filter(mess_option=mess_optn.mess_option)
143146

147+
144148

145149
# bill = Monthly_bill.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(Q(student_id=student) & Q(month=month_g_l) & Q(year=year_g))
146150
# amount_c = MessBillBase.objects.latest('timestamp')
@@ -191,7 +195,9 @@ def mess(request):
191195
sprequest = Special_request.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(status='1').order_by('-app_date')
192196
sprequest_past = Special_request.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(status='2').order_by('-app_date')
193197
menuchangerequest= Menu_change_request.objects.select_related('student_id').filter().order_by('-app_date')
194-
menu_data = Menu.objects.all()
198+
199+
# menu_data = Menu.objects.all()
200+
195201
for f in feed:
196202
if f.feedback_type == 'Maintenance' :
197203
count1 += 1
@@ -262,7 +268,9 @@ def mess(request):
262268
sprequest = Special_request.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(status='1').order_by('-app_date')
263269
sprequest_past = Special_request.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(status='2').order_by('-app_date')
264270
menuchangerequest= Menu_change_request.objects.select_related('student_id').filter().order_by('-app_date')
265-
menu_data = Menu.objects.all().order_by()
271+
272+
# menu_data = Menu.objects.all().order_by()
273+
266274
count5=0
267275
count6=0
268276
count7=0
@@ -324,6 +332,7 @@ def mess(request):
324332
return render(request, "messModule/mess.html", context)
325333

326334
context = {
335+
'menu': menu_data,
327336
'reg_menu': y,
328337
'messinfo': mess_optn,
329338
'monthly_bill': monthly_bill,
@@ -439,49 +448,54 @@ def mess(request):
439448
return render(request, "messModule/mess.html", context)
440449

441450
elif extrainfo.user_type == 'faculty':
442-
meeting = Mess_meeting.objects.all()
443-
minutes = Mess_minutes.objects.select_related().all()
444-
feed1 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess1').order_by('-fdate')
445-
feed2 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess2').order_by('-fdate')
446-
y = Menu.objects.all()
451+
for d in desig:
452+
if(d.designation.name == 'mess_warden'):
453+
454+
feed1 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess1').order_by('-fdate')
455+
feed2 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess2').order_by('-fdate')
456+
y = Menu.objects.all()
447457

448-
for f in feed1:
449-
if f.feedback_type == 'Maintenance' :
450-
count1 += 1
458+
reg_main = Reg_main.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(current_mess_status='Registered')
459+
reg_record = Reg_records.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').all()
460+
bills = Monthly_bill.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').all()
451461

452-
elif f.feedback_type == 'Food' :
453-
count2 += 1
462+
for f in feed1:
463+
if f.feedback_type == 'Maintenance' :
464+
count1 += 1
454465

455-
elif f.feedback_type == 'Cleanliness' :
456-
count3 += 1
466+
elif f.feedback_type == 'Food' :
467+
count2 += 1
457468

458-
elif f.feedback_type == 'Others' :
459-
count4 += 1
469+
elif f.feedback_type == 'Cleanliness' :
470+
count3 += 1
460471

461-
for f in feed2:
462-
if f.feedback_type == 'Maintenance':
463-
count5 += 1
472+
elif f.feedback_type == 'Others' :
473+
count4 += 1
464474

465-
elif f.feedback_type == 'Food':
466-
count6 += 1
475+
for f in feed2:
476+
if f.feedback_type == 'Maintenance':
477+
count5 += 1
467478

468-
elif f.feedback_type == 'Cleanliness':
469-
count7 += 1
479+
elif f.feedback_type == 'Food':
480+
count6 += 1
481+
482+
elif f.feedback_type == 'Cleanliness':
483+
count7 += 1
484+
485+
elif f.feedback_type == 'Others':
486+
count8 += 1
487+
context = {
488+
'info': extrainfo,
489+
'desig': desig,
490+
'menu': y,
491+
'count1': count1,
492+
'count2': count2, 'count3': count3, 'feed1': feed1,'feed2':feed2,
493+
'count4': count4, 'form': form, 'count5': count5,
494+
'count6': count6, 'count7': count7, 'count8': count8, 'desig': desig,
495+
'reg_record':reg_record,'reg_main':reg_main,'bill': bills,
496+
}
497+
return render(request, 'messModule/mess.html', context)
470498

471-
elif f.feedback_type == 'Others':
472-
count8 += 1
473-
context = {
474-
'info': extrainfo,
475-
'menu': y,
476-
'meeting': meeting,
477-
'minutes': minutes,
478-
'count1': count1,
479-
'count2': count2, 'count3': count3, 'feed1': feed1,'feed2':feed2,
480-
'count4': count4, 'form': form, 'count5': count5,
481-
'count6': count6, 'count7': count7, 'count8': count8, 'desig': desig
482-
483-
}
484-
return render(request, 'messModule/mess.html', context)
485499

486500
@login_required
487501
@transaction.atomic
@@ -983,12 +997,18 @@ def post(self, request, *args, **kwargs):
983997
extra_info = ExtraInfo.objects.select_related().get(user=user)
984998
student = Student.objects.select_related('id','id__user','id__department').get(id=extra_info)
985999
# reg_student = Reg_records.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').get(student_id_id=student)
986-
monthly_bill = Monthly_bill.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(student_id=student)
987-
if monthly_bill.exists():
988-
context = {
989-
'student_bill': monthly_bill
990-
}
991-
return render_to_pdf('messModule/billpdfexport.html', context)
1000+
try:
1001+
monthly_bill = Monthly_bill.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(student_id=student)
1002+
if monthly_bill.exists():
1003+
context = {
1004+
'student_bill': monthly_bill
1005+
}
1006+
return render_to_pdf('messModule/billpdfexport.html', context)
1007+
else :
1008+
return HttpResponseRedirect('/mess')
1009+
except:
1010+
return HttpResponseRedirect('/mess')
1011+
9921012

9931013

9941014
def menu_change_request(request):

FusionIIIT/templates/messModule/de-registration.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@
4949
<table class="ui single line table" style="margin: auto;">
5050
<thead>
5151
<tr>
52-
<th>Student Id</th>dereg_date_input
53-
<th></th>
52+
<th>Student Id</th>
53+
<th>Remark</th>
54+
<th>Status</th>
5455
</tr>
5556
</thead>
5657
<tbody>

FusionIIIT/templates/messModule/menu_card.html

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
View Menu
77
</a>
88

9-
<!-- <a class="item" data-tab="fifteenth">
10-
Meeting information
11-
</a> -->
9+
<a class="item" data-tab="twentythree">
10+
View Registrations
11+
</a>
12+
13+
<a class="item" data-tab="twelfth">
14+
View Bills
15+
</a>
1216

1317
{% comment %} <a class="item" data-tab="sixteenth">
1418
Feedback Statistics
@@ -23,12 +27,16 @@
2327
{% if info.user_type == 'student' %}
2428
{% if d.designation.name == 'student' %}
2529

30+
<a class="active item" data-tab="thirteenth">
31+
View Menu
32+
</a>
2633

27-
<a class="active item" data-tab="fourth">
28-
Menu | Bill
34+
<a class="item" data-tab="fourth">
35+
View Bill and Payments
2936
</a>
3037

31-
<a class=" item" data-tab="first">
38+
<a class=" item" data-tab="first" {%if reg_main_stud.current_mess_status == "Deregistered" %} style="display: none;" {% endif %}
39+
>
3240
Feedback
3341
</a>
3442

@@ -37,7 +45,7 @@
3745
Apply For Non-veg | Check History
3846
</a> {% endcomment %}
3947

40-
<a class="item" data-tab="second">
48+
<a class="item" data-tab="second" {%if reg_main_stud.current_mess_status == "Deregistered" %} style="display: none;" {% endif %}>
4149
Applications
4250
</a>
4351

FusionIIIT/templates/messModule/mess.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
{% endcomment %}
5353
<div class="eight wide column">
5454
{% comment %}The ... start here!{% endcomment %}
55-
<div class="ui tab segment {% if messinfo.mess_option == 'no-mess' %}disabled {% endif %}" data-tab="first">
55+
<div class="ui tab segment {% if reg_main_stud.current_mess_status == 'Deregistered' %}disabled {% endif %}" data-tab="first">
5656
{% block feedback %}
5757
{% include 'messModule/feedback.html' %}
5858
{% endblock %}
@@ -69,7 +69,7 @@
6969

7070

7171
{% comment %}The ... starts here!{% endcomment %}
72-
<div class="ui {% if info.user_type == 'student' %}active {% endif %}tab segment" data-tab="fourth">
72+
<div class="ui tab segment" data-tab="fourth">
7373
{% block views %}
7474
{% include 'messModule/views.html' %}
7575
{% endblock %}
@@ -143,7 +143,7 @@
143143
{% comment %}The ... ends here!{% endcomment %}
144144

145145
{% comment %}The ... starts here!{% endcomment %}
146-
<div class="ui {% if info.user_type == 'staff' or info.user_type == 'faculty' %}active {% endif %} tab segment" data-tab="thirteenth">
146+
<div class="ui active tab segment" data-tab="thirteenth">
147147
{% block viewmenu %}
148148
{% include 'messModule/viewmenu.html' %}
149149
{% endblock %}
@@ -310,8 +310,8 @@ <h1>Announcements will be displayed here...</h1>
310310
data: {
311311
labels: ["Food", "Hygiene", "Maintenance", "Others"],
312312
datasets: [{
313-
label: 'Feedback',
314-
data: [c1,c2,c3,c4],
313+
label: 'Feedback',
314+
data: [c2,c3,c1,c4],
315315
backgroundColor: [
316316
'rgba(255, 99, 132, 0.2)',
317317
'rgba(54, 162, 235, 0.2)',
@@ -348,7 +348,7 @@ <h1>Announcements will be displayed here...</h1>
348348
labels: ["Food", "Hygiene", "Maintenance", "Others"],
349349
datasets: [{
350350
label: 'Feedback',
351-
data: [c5,c6,c7,c8],
351+
data: [c6,c7,c5,c8],
352352
backgroundColor: [
353353
'rgba(255, 99, 132, 0.2)',
354354
'rgba(54, 162, 235, 0.2)',

FusionIIIT/templates/messModule/messactivities.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,27 @@
66
<!-- <a class="ui active item" data-tab="mess committee" id="mm">
77
Mess Committee
88
</a> -->
9-
<a class="ui active item" data-tab="monthly bill">
9+
{% for d in desig %}
10+
{% if d.designation.name == 'mess_manager' %}
11+
<a class="ui {% for d in desig %} {% if d.designation.name == 'mess_manager' %} active {% endif %} {% endfor %} item item" data-tab="monthly bill">
1012

1113
Bill Base and Excel Upload
1214

1315
</a>
14-
<a class="ui item" data-tab="View Student Bills">
15-
View Students Bills
16-
</a>
1716
<a class="ui item" data-tab="Update Bill">
1817
Update Bill
1918
</a>
19+
{% endif %}
20+
{% endfor %}
21+
<a class="ui {% for d in desig %} {% if d.designation.name == 'mess_warden' %} active {% endif %} {% endfor %} item" data-tab="View Student Bills">
22+
View Students Bills
23+
</a>
2024
</div>
2125

2226

23-
<div class="ui tab" data-tab="View Student Bills">
24-
27+
28+
<div class="ui tab {% for d in desig %} {% if d.designation.name == 'mess_warden' %} active {% endif %} {% endfor %}" data-tab="View Student Bills">
29+
2530
{% block reg_list_bills %}
2631
{% include 'messModule/view_payments_bills.html' %}
2732
{% endblock %}
@@ -75,7 +80,8 @@
7580

7681
</div>
7782
</div>
78-
<div class="ui tab active" data-tab="monthly bill" id="mbs">
83+
84+
<div class="ui tab {% for d in desig %} {% if d.designation.name == 'mess_manager' %} active {% endif %} {% endfor %}" data-tab="monthly bill" id="mbs">
7985
<div class="ui vertical segment">
8086

8187
<form method="post">

FusionIIIT/templates/messModule/registered_student.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
<!-- <a class="active item" data-tab="searchOrRemove"> Search/Remove Student </a> -->
55
<!-- <a class="item" data-tab="addMess1"> Register for Mess1 </a> -->
66
<!-- <a class="item" data-tab="addMess2"> Register for Mess2 </a> -->
7-
<a class="active item" data-tab="add_remove">Add/Remove from mess</a>
8-
<a class="item" data-tab="regList"> View Registration List</a>
7+
{% for d in desig %}
8+
{% if d.designation.name == 'mess_manager' %}
9+
<a class="{% for d in desig %} {% if d.designation.name == 'mess_manager' %} active {% endif %} {% endfor %} item" data-tab="add_remove">Add/Remove from mess</a>
10+
{% endif %}
11+
{% endfor %}
12+
<a class="{% for d in desig %} {% if d.designation.name == 'mess_warden' %} active {% endif %} {% endfor %}item" data-tab="regList"> View Registration List</a>
913
</div>
1014
<!-- <div class="ui active tab" data-tab="searchOrRemove">
1115
<div class="ui vertical segment">
@@ -198,14 +202,20 @@
198202
</div>
199203
</div> -->
200204

201-
<div class="ui tab" data-tab="regList">
205+
206+
207+
208+
209+
210+
<div class="ui {% for d in desig %} {% if d.designation.name == 'mess_warden' %} active {% endif %} {% endfor %} tab" data-tab="regList">
202211
{% block reg_list %}
203212
{% include 'messModule/reg_list.html' %}
204213
{% endblock %}
205214
</div>
206215
<br />
207216

208-
<div class="ui active tab" data-tab="add_remove">
217+
218+
<div class="ui {% for d in desig %} {% if d.designation.name == 'mess_manager' %} active {% endif %} {% endfor %} tab" data-tab="add_remove">
209219
{% block add_remove %}
210220
{% include 'messModule/add_remove.html' %}
211221
{% endblock %}

FusionIIIT/templates/messModule/viewmenu.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</a>
1212
</div>
1313

14-
<div class="ui tab" data-tab="m1-tab" id="m2tab">
14+
<div class="ui active tab" data-tab="m1-tab" id="m2tab">
1515
<div class="ui vertical segment">
1616
<table class="ui definition table" style="margin: auto;">
1717
<thead>
@@ -249,7 +249,8 @@
249249
</div>
250250
</div>
251251

252-
<div class="ui active tab" data-tab="m2-tab" id="m1tab">
252+
253+
<div class="ui tab" data-tab="m2-tab" id="m1tab">
253254
<div class="ui vertical segment">
254255
<table class="ui definition table" style="margin: auto;">
255256
<thead>

0 commit comments

Comments
 (0)