Skip to content

Commit

Permalink
Sa 2 bug fixes (#1414)
Browse files Browse the repository at this point in the history
* GAD-5: Fix responsiveness (#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 (#1325)

* Updated Special food Functionality

* dashboard and usercard updated (#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 (#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 (#32)

Co-authored-by: Harshul Choudhary <[email protected]>

* Some UI changes (#35)

Co-authored-by: Harshul Choudhary <[email protected]>

* merge fixes

* added remove

* some ui fixes

* fixed cronjobs

* semdate fixes

* removed migrations

* Fixing ui bugs (#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]>
  • Loading branch information
17 people authored Apr 10, 2024
1 parent ed63bb4 commit 335ee1f
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 282 deletions.
2 changes: 1 addition & 1 deletion FusionIIIT/applications/central_mess/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def add_mess_feedback(request, student):
data: to record success or any errors
"""
date_today = datetime.now().date()
mess_optn = Messinfo.objects.get(student_id=student)
mess_optn = Reg_main.objects.get(student_id=student)
description = request.POST.get('description')
feedback_type = request.POST.get('feedback_type')
feedback_object = Feedback(student_id=student, fdate=date_today,
Expand Down
108 changes: 64 additions & 44 deletions FusionIIIT/applications/central_mess/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
year_last_g = last_day_prev_month.year
previous_month = last_day_prev_month.strftime('%B')


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

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

menu_data = Menu.objects.all()


try:
mess_optn = Reg_main.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').get(student_id=student)
y = Menu.objects.filter(mess_option=mess_optn.mess_option)
Expand Down Expand Up @@ -141,6 +144,7 @@ def mess(request):
# mess_optn = Messinfo.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').get(student_id=student)
# y = Menu.objects.filter(mess_option=mess_optn.mess_option)



# 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))
# amount_c = MessBillBase.objects.latest('timestamp')
Expand Down Expand Up @@ -191,7 +195,9 @@ def mess(request):
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')
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')
menuchangerequest= Menu_change_request.objects.select_related('student_id').filter().order_by('-app_date')
menu_data = Menu.objects.all()

# menu_data = Menu.objects.all()

for f in feed:
if f.feedback_type == 'Maintenance' :
count1 += 1
Expand Down Expand Up @@ -262,7 +268,9 @@ def mess(request):
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')
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')
menuchangerequest= Menu_change_request.objects.select_related('student_id').filter().order_by('-app_date')
menu_data = Menu.objects.all().order_by()

# menu_data = Menu.objects.all().order_by()

count5=0
count6=0
count7=0
Expand Down Expand Up @@ -324,6 +332,7 @@ def mess(request):
return render(request, "messModule/mess.html", context)

context = {
'menu': menu_data,
'reg_menu': y,
'messinfo': mess_optn,
'monthly_bill': monthly_bill,
Expand Down Expand Up @@ -439,49 +448,54 @@ def mess(request):
return render(request, "messModule/mess.html", context)

elif extrainfo.user_type == 'faculty':
meeting = Mess_meeting.objects.all()
minutes = Mess_minutes.objects.select_related().all()
feed1 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess1').order_by('-fdate')
feed2 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess2').order_by('-fdate')
y = Menu.objects.all()
for d in desig:
if(d.designation.name == 'mess_warden'):

feed1 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess1').order_by('-fdate')
feed2 = Feedback.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(mess='mess2').order_by('-fdate')
y = Menu.objects.all()

for f in feed1:
if f.feedback_type == 'Maintenance' :
count1 += 1
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')
reg_record = Reg_records.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').all()
bills = Monthly_bill.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').all()

elif f.feedback_type == 'Food' :
count2 += 1
for f in feed1:
if f.feedback_type == 'Maintenance' :
count1 += 1

elif f.feedback_type == 'Cleanliness' :
count3 += 1
elif f.feedback_type == 'Food' :
count2 += 1

elif f.feedback_type == 'Others' :
count4 += 1
elif f.feedback_type == 'Cleanliness' :
count3 += 1

for f in feed2:
if f.feedback_type == 'Maintenance':
count5 += 1
elif f.feedback_type == 'Others' :
count4 += 1

elif f.feedback_type == 'Food':
count6 += 1
for f in feed2:
if f.feedback_type == 'Maintenance':
count5 += 1

elif f.feedback_type == 'Cleanliness':
count7 += 1
elif f.feedback_type == 'Food':
count6 += 1

elif f.feedback_type == 'Cleanliness':
count7 += 1

elif f.feedback_type == 'Others':
count8 += 1
context = {
'info': extrainfo,
'desig': desig,
'menu': y,
'count1': count1,
'count2': count2, 'count3': count3, 'feed1': feed1,'feed2':feed2,
'count4': count4, 'form': form, 'count5': count5,
'count6': count6, 'count7': count7, 'count8': count8, 'desig': desig,
'reg_record':reg_record,'reg_main':reg_main,'bill': bills,
}
return render(request, 'messModule/mess.html', context)

elif f.feedback_type == 'Others':
count8 += 1
context = {
'info': extrainfo,
'menu': y,
'meeting': meeting,
'minutes': minutes,
'count1': count1,
'count2': count2, 'count3': count3, 'feed1': feed1,'feed2':feed2,
'count4': count4, 'form': form, 'count5': count5,
'count6': count6, 'count7': count7, 'count8': count8, 'desig': desig

}
return render(request, 'messModule/mess.html', context)

@login_required
@transaction.atomic
Expand Down Expand Up @@ -983,12 +997,18 @@ def post(self, request, *args, **kwargs):
extra_info = ExtraInfo.objects.select_related().get(user=user)
student = Student.objects.select_related('id','id__user','id__department').get(id=extra_info)
# 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)
monthly_bill = Monthly_bill.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(student_id=student)
if monthly_bill.exists():
context = {
'student_bill': monthly_bill
}
return render_to_pdf('messModule/billpdfexport.html', context)
try:
monthly_bill = Monthly_bill.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(student_id=student)
if monthly_bill.exists():
context = {
'student_bill': monthly_bill
}
return render_to_pdf('messModule/billpdfexport.html', context)
else :
return HttpResponseRedirect('/mess')
except:
return HttpResponseRedirect('/mess')



def menu_change_request(request):
Expand Down
5 changes: 3 additions & 2 deletions FusionIIIT/templates/messModule/de-registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@
<table class="ui single line table" style="margin: auto;">
<thead>
<tr>
<th>Student Id</th>dereg_date_input
<th></th>
<th>Student Id</th>
<th>Remark</th>
<th>Status</th>
</tr>
</thead>
<tbody>
Expand Down
22 changes: 15 additions & 7 deletions FusionIIIT/templates/messModule/menu_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
View Menu
</a>

<!-- <a class="item" data-tab="fifteenth">
Meeting information
</a> -->
<a class="item" data-tab="twentythree">
View Registrations
</a>

<a class="item" data-tab="twelfth">
View Bills
</a>

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

<a class="active item" data-tab="thirteenth">
View Menu
</a>

<a class="active item" data-tab="fourth">
Menu | Bill
<a class="item" data-tab="fourth">
View Bill and Payments
</a>

<a class=" item" data-tab="first">
<a class=" item" data-tab="first" {%if reg_main_stud.current_mess_status == "Deregistered" %} style="display: none;" {% endif %}
>
Feedback
</a>

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

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

Expand Down
12 changes: 6 additions & 6 deletions FusionIIIT/templates/messModule/mess.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
{% endcomment %}
<div class="eight wide column">
{% comment %}The ... start here!{% endcomment %}
<div class="ui tab segment {% if messinfo.mess_option == 'no-mess' %}disabled {% endif %}" data-tab="first">
<div class="ui tab segment {% if reg_main_stud.current_mess_status == 'Deregistered' %}disabled {% endif %}" data-tab="first">
{% block feedback %}
{% include 'messModule/feedback.html' %}
{% endblock %}
Expand All @@ -69,7 +69,7 @@


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

{% comment %}The ... starts here!{% endcomment %}
<div class="ui {% if info.user_type == 'staff' or info.user_type == 'faculty' %}active {% endif %} tab segment" data-tab="thirteenth">
<div class="ui active tab segment" data-tab="thirteenth">
{% block viewmenu %}
{% include 'messModule/viewmenu.html' %}
{% endblock %}
Expand Down Expand Up @@ -310,8 +310,8 @@ <h1>Announcements will be displayed here...</h1>
data: {
labels: ["Food", "Hygiene", "Maintenance", "Others"],
datasets: [{
label: 'Feedback',
data: [c1,c2,c3,c4],
label: 'Feedback',
data: [c2,c3,c1,c4],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
Expand Down Expand Up @@ -348,7 +348,7 @@ <h1>Announcements will be displayed here...</h1>
labels: ["Food", "Hygiene", "Maintenance", "Others"],
datasets: [{
label: 'Feedback',
data: [c5,c6,c7,c8],
data: [c6,c7,c5,c8],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
Expand Down
20 changes: 13 additions & 7 deletions FusionIIIT/templates/messModule/messactivities.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,27 @@
<!-- <a class="ui active item" data-tab="mess committee" id="mm">
Mess Committee
</a> -->
<a class="ui active item" data-tab="monthly bill">
{% for d in desig %}
{% if d.designation.name == 'mess_manager' %}
<a class="ui {% for d in desig %} {% if d.designation.name == 'mess_manager' %} active {% endif %} {% endfor %} item item" data-tab="monthly bill">

Bill Base and Excel Upload

</a>
<a class="ui item" data-tab="View Student Bills">
View Students Bills
</a>
<a class="ui item" data-tab="Update Bill">
Update Bill
</a>
{% endif %}
{% endfor %}
<a class="ui {% for d in desig %} {% if d.designation.name == 'mess_warden' %} active {% endif %} {% endfor %} item" data-tab="View Student Bills">
View Students Bills
</a>
</div>


<div class="ui tab" data-tab="View Student Bills">


<div class="ui tab {% for d in desig %} {% if d.designation.name == 'mess_warden' %} active {% endif %} {% endfor %}" data-tab="View Student Bills">

{% block reg_list_bills %}
{% include 'messModule/view_payments_bills.html' %}
{% endblock %}
Expand Down Expand Up @@ -75,7 +80,8 @@

</div>
</div>
<div class="ui tab active" data-tab="monthly bill" id="mbs">

<div class="ui tab {% for d in desig %} {% if d.designation.name == 'mess_manager' %} active {% endif %} {% endfor %}" data-tab="monthly bill" id="mbs">
<div class="ui vertical segment">

<form method="post">
Expand Down
18 changes: 14 additions & 4 deletions FusionIIIT/templates/messModule/registered_student.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
<!-- <a class="active item" data-tab="searchOrRemove"> Search/Remove Student </a> -->
<!-- <a class="item" data-tab="addMess1"> Register for Mess1 </a> -->
<!-- <a class="item" data-tab="addMess2"> Register for Mess2 </a> -->
<a class="active item" data-tab="add_remove">Add/Remove from mess</a>
<a class="item" data-tab="regList"> View Registration List</a>
{% for d in desig %}
{% if d.designation.name == 'mess_manager' %}
<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>
{% endif %}
{% endfor %}
<a class="{% for d in desig %} {% if d.designation.name == 'mess_warden' %} active {% endif %} {% endfor %}item" data-tab="regList"> View Registration List</a>
</div>
<!-- <div class="ui active tab" data-tab="searchOrRemove">
<div class="ui vertical segment">
Expand Down Expand Up @@ -198,14 +202,20 @@
</div>
</div> -->

<div class="ui tab" data-tab="regList">





<div class="ui {% for d in desig %} {% if d.designation.name == 'mess_warden' %} active {% endif %} {% endfor %} tab" data-tab="regList">
{% block reg_list %}
{% include 'messModule/reg_list.html' %}
{% endblock %}
</div>
<br />

<div class="ui active tab" data-tab="add_remove">

<div class="ui {% for d in desig %} {% if d.designation.name == 'mess_manager' %} active {% endif %} {% endfor %} tab" data-tab="add_remove">
{% block add_remove %}
{% include 'messModule/add_remove.html' %}
{% endblock %}
Expand Down
5 changes: 3 additions & 2 deletions FusionIIIT/templates/messModule/viewmenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</a>
</div>

<div class="ui tab" data-tab="m1-tab" id="m2tab">
<div class="ui active tab" data-tab="m1-tab" id="m2tab">
<div class="ui vertical segment">
<table class="ui definition table" style="margin: auto;">
<thead>
Expand Down Expand Up @@ -249,7 +249,8 @@
</div>
</div>

<div class="ui active tab" data-tab="m2-tab" id="m1tab">

<div class="ui tab" data-tab="m2-tab" id="m1tab">
<div class="ui vertical segment">
<table class="ui definition table" style="margin: auto;">
<thead>
Expand Down
Loading

0 comments on commit 335ee1f

Please sign in to comment.