Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ node_modules/

FusionIIIT/static/
package-lock.json
migrations/

migrations/
4 changes: 4 additions & 0 deletions FusionIIIT/Fusion/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,7 @@
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
}


MEDIA_URL = "/media/"
MEDIA_ROOT=os.path.join(BASE_DIR,"media/")
7 changes: 7 additions & 0 deletions FusionIIIT/applications/central_mess/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django import forms

from .models import Mess_minutes
from .models import Registration_Request


class MinuteForm(forms.ModelForm):
Expand All @@ -15,3 +16,9 @@ class MessInfoForm(forms.Form, ):
]
mess_option = forms.CharField(label='Mess Option', widget=forms.Select(
choices=MESS_CHOICES, attrs={'style': 'border-radius:1rem;padding:7px;'}))


class RegistrationRequest(forms.ModelForm):
class Meta:
model = Registration_Request
fields = ('Txn_no','amount','img')
1 change: 1 addition & 0 deletions FusionIIIT/applications/central_mess/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
url(r'^api', include('applications.central_mess.api.urls')),

url(r'^registeredstudent', views.searchAddOrRemoveStudent, name='registeredstudent'),
url(r'^registrationRequest', views.reg_request, name='reg_request'),
# url(r'^uploadpayment', views.uploadPaymentDue, name='uploadpayment')
url(r'^respond_to_reg_req',views.respond_to_reg, name='reg_response')

Expand Down
25 changes: 21 additions & 4 deletions FusionIIIT/applications/central_mess/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
from .utils import render_to_pdf
from applications.academic_information.models import Student
from applications.globals.models import ExtraInfo, HoldsDesignation, Designation
from .forms import MinuteForm, MessInfoForm
from .forms import MinuteForm, MessInfoForm,RegistrationRequest
from .models import (Feedback, Menu, Menu_change_request, Mess_meeting,
Mess_minutes, Mess_reg, Messinfo, Monthly_bill,
Payments, Rebate,
Special_request, Vacation_food, MessBillBase)
Special_request, Vacation_food, MessBillBase,Registration_Request)
from .handlers import (add_mess_feedback, add_vacation_food_request,
add_menu_change_request, handle_menu_change_response, handle_vacation_food_request,
add_mess_registration_time, add_leave_request, add_mess_meeting_invitation,
Expand Down Expand Up @@ -73,6 +73,7 @@ def mess(request):
payments = Payments.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(student_id=student)
rebates = Rebate.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(student_id=student).order_by('-app_date')
splrequest = Special_request.objects.select_related('student_id','student_id__id','student_id__id__user','student_id__id__department').filter(student_id=student).order_by('-app_date')
reg_form = RegistrationRequest()
monthly_bill=monthly_bill[::-1]

tot_am=0
Expand Down Expand Up @@ -211,7 +212,8 @@ def mess(request):
'count7': count7,
'count8': count8,
'form': form,
'desig': desig
'desig': desig,
'reg_form':reg_form
}
return render(request, "messModule/mess.html", context)

Expand Down Expand Up @@ -276,7 +278,8 @@ def mess(request):
'count7': count7,
'count8': count8,
'form': form,
'desig': desig
'desig': desig,
'reg_form':reg_form
}
return render(request, "messModule/mess.html", context)

Expand All @@ -299,6 +302,7 @@ def mess(request):
'desig': desig,
'minutes': minutes,
'meeting': meeting,
'reg_form':reg_form,

}

Expand Down Expand Up @@ -1387,3 +1391,16 @@ def respond_to_reg(request):
return JsonResponse(data)


def reg_request(request):

user = request.user
extra_info = ExtraInfo.objects.select_related().get(user=user)
student = Student.objects.select_related('id','id__user','id__department').get(id=extra_info)
if request.method == 'POST':
form = RegistrationRequest(request.POST, request.FILES)

if form.is_valid():
temp=form.save(commit=False)
temp.student_id=student
temp.save()
return HttpResponseRedirect("/mess")
4 changes: 3 additions & 1 deletion FusionIIIT/templates/messModule/menu_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
<!-- <a class="item" data-tab="fifteenth">
View Meeting Minutes
</a> -->


<a class="item" data-tab="Registration">
Registration
</a>

{% endif %}
{% if d.designation.name == 'mess_committee' or d.designation.name == 'mess_committee_mess2' %}
Expand Down
8 changes: 8 additions & 0 deletions FusionIIIT/templates/messModule/mess.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@
</div>
{% comment %}The ... ends here!{% endcomment %}

{% comment %}The ... start here!{% endcomment %}
<div class="ui tab segment {% if messinfo.mess_option == 'no-mess' %}disabled {% endif %}" data-tab="Registration">
{% block Registration %}
{% include 'messModule/registration.html' %}
{% endblock %}
</div>
{% comment %}The ... end here!{% endcomment %}

{% comment %}The ... starts here!{% endcomment %}
{% comment %} <div class="ui tab segment" data-tab="sixth">
{% block nonvegfood %}
Expand Down
130 changes: 130 additions & 0 deletions FusionIIIT/templates/messModule/registration.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{#{% extends 'globals/base.html'%}#}
{% load static %}
{#{% block body %}#}
{% block Registration %}
{% comment %}The tab menu starts here!{% endcomment %}
<div class="ui pointing secondary menu">
<a class="active item" data-tab="apply_registration">
Apply for Registration
</a>

<a class="item" data-tab="view_registration">
Previous Registration
</a>
</div>

<div class="ui active tab" data-tab="" id="">
<div class="ui vertical segment">

{% comment %}Form Tag starts here!{% endcomment %}
<form method = "post" action="registrationRequest" enctype="multipart/form-data">
{% csrf_token %}
{{ reg_form.as_p }}
<button type="submit">Upload</button>
</form>
{% comment %}Form Tag ends here!{% endcomment %}


<div class="ui divider"></div>

</div>
</div>

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

<div id="feedback_history" class="ui very relaxed fluid selection list" style="padding-left: 24px; padding-top: 16px; padding-bottom: 16px; max-height: 70vh; overflow-y: auto;">
<a class="header" id="user_name" style="display: none">{{info.user.username}}</a>
{% for app in feedback %}
<!--<img class="ui mini circular image" src="{% static 'globals/img/zlatan.jpg' %}"> --->
<div class="item">

<div class="left floated content">
<a class="header">{{info.user.username}}</a>
<a class="meta">{{app.feedback_type}}</a>

<div class="description">
{{app.description}}
</div>
</div>

<div class="right floated content">
<span class="meta">{{app.fdate}}</span>
</div>

</div>
{% endfor %}
</div>

<div class="ui divider"></div>
</div>

{% endblock %}
{#{% endblock %}#}

{% block javascript %}
<script type="text/javascript" src="{% static 'globals/js/jquery.min.js' %}"></script>

<script>
function required_check_feedback(){
if ($("#description").val().length == 0) {
check = 0;
return check;
}
else {
check = 1;
}
}
function feedback(){
check = required_check_feedback();
if(check == 0){
alert("Please add description");
}
else {
$.ajax({
type: 'POST',
url: 'submitmessfeedback/',
dataType: 'json',
data: {
'csrfmiddlewaretoken': '{{ csrf_token }}',
'feedback_type': $("#feedback_type").val(),
'description': $("#description").val()
},
success: function (data) {
if (data.status) {

$("#feedback").load(location.href + " #feedback>*", "");

var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
var name = $("#user_name").text();
var today_date = new Date();
var t_date = monthNames[today_date.getMonth()] + " " + today_date.getDate() + ", " + today_date.getFullYear();
$("#feedback_history").prepend("<div class='item'><div class='left floated content'>" +
"<a class='header'>" + name + "</a>" +
"<a class='meta'>" + $("#feedback_type").val() +"</a><div class='description'>"
+ $("#description").val() + "</div></div><div class='right floated content'>" +
"<span class='meta'>" + t_date + "</span></div></div>");

alert("Data Inserted Successfully");

document.getElementById('feedback_type').value = "";
document.getElementById('description').value = "";

}
},
error: function (data, err) {
alert(err.message);
$("#feedback").load(location.href + " #feedback>*", "");
}
});
}
return false;
}



</script>
{% endblock %}