Commit c92e8e88 authored by KUNAL GOYAL's avatar KUNAL GOYAL

comments

parent e6a94a04
No preview for this file type
...@@ -6,8 +6,6 @@ from django.core.validators import MaxValueValidator, MinValueValidator ...@@ -6,8 +6,6 @@ from django.core.validators import MaxValueValidator, MinValueValidator
import csv import csv
import os import os
## Models file
# It contains all the models used to define the database
## Institute Model ## Institute Model
# @brief Stores information about all institutes in a table # @brief Stores information about all institutes in a table
class Institute(models.Model): class Institute(models.Model):
......
...@@ -18,6 +18,24 @@ ...@@ -18,6 +18,24 @@
<form action="{% url 'allocation:choice-delete' choice.pk %}"> <form action="{% url 'allocation:choice-delete' choice.pk %}">
<input style="background-color: red;" type="submit" value="Delete" /> <input style="background-color: red;" type="submit" value="Delete" />
</form> </form>
<br>
<p>List of Applicants who have been allocated {{ choice.choice_name }} choice: </p>
<ul>
{% for applicant in choice.alloted_applicant.all %}
<table style="width:100%">
<tr>
<th>Name</th>
<th>Rank</th>
</tr>
{% for applicant in choice.alloted_applicant.all %}
<tr>
<td> <a href="{% url 'allocation:applicant-detail' applicant.pk %}">{{ applicant.name }}</a></td>
<td> {{ applicant.rank }}</td>
</tr>
{% endfor %}
</table>
{% endfor %}
</ul>
{% else %} {% else %}
Unauthorised access Unauthorised access
{% endif %} {% endif %}
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<!-- Header --> <!-- Header -->
<div id="header"> <div id="header">
<div id="branding"> <div id="branding">
<h1>Student Portal</h1> <h1>Applicant Portal</h1>
</div> </div>
{% block usertools %} {% block usertools %}
<div id="user-tools"> <div id="user-tools">
...@@ -55,24 +55,27 @@ ...@@ -55,24 +55,27 @@
</form> </form>
{% endif %} {% endif %}
{% if success %} {% if success %}
<p style="color:green">update successfull</p> <p style="color:green">Your choices have been registered.</p>
{% endif %} {% endif %}
<p> <b>Name:</b> {{applicant.name}}<br> <p> <b>Name:</b> {{applicant.name}}<br>
<b>Institute:</b> {{applicant.institute}}<br>
<b>Rank:</b> {{applicant.rank}}<br> <b>Rank:</b> {{applicant.rank}}<br>
<b>Allocated choice:</b> <b>Allocated choice:</b>
{% for choice in applicant.alloted_choice.all %} {% for choice in applicant.alloted_choice.all %}
{{choice}} {{choice}}
{% endfor %} {% endfor %}
</p> </p>
<p>Fill your choices and priorities:</p>
<form action="/allocation/" method="post">{% csrf_token %} <form action="/allocation/" method="post">{% csrf_token %}
{{ formset.management_form }} {{ formset.management_form }}
<ul>
{% for form in formset %} {% for form in formset %}
{{ form.non_field_errors }} {{ form.non_field_errors }}
{% for hidden in form.hidden_fields %} {% for hidden in form.hidden_fields %}
{{ hidden }} {{ hidden }}
{% endfor %} {% endfor %}
<li>
{% for field in form.visible_fields %} {% for field in form.visible_fields %}
<div class="fieldWrapper"> <div class="fieldWrapper">
{{ field.errors }} {{ field.errors }}
...@@ -82,6 +85,7 @@ ...@@ -82,6 +85,7 @@
<!-- {{ form.applicant }} {{ form.choice }} {{ form.priority }}<br> --> <!-- {{ form.applicant }} {{ form.choice }} {{ form.priority }}<br> -->
<br> <br>
{% endfor %} {% endfor %}
</ul>
{% if not applicant.institute.is_allocated %} {% if not applicant.institute.is_allocated %}
<input type="submit" value="Submit"> <input type="submit" value="Submit">
{% endif %} {% endif %}
......
...@@ -16,8 +16,7 @@ urlpatterns = [ ...@@ -16,8 +16,7 @@ urlpatterns = [
url(r'^admin/applicants$', views.ApplicantListView.as_view(), name='applicant_list'), #< creates URL to display all applicants in Institute Login url(r'^admin/applicants$', views.ApplicantListView.as_view(), name='applicant_list'), #< creates URL to display all applicants in Institute Login
url(r'^choice/(?P<pk>\d+)$', views.ChoiceDetailView.as_view(), name='choice-detail'), #< creates URL to display a particular choice in Institute Login url(r'^choice/(?P<pk>\d+)$', views.ChoiceDetailView.as_view(), name='choice-detail'), #< creates URL to display a particular choice in Institute Login
url(r'^applicant/(?P<pk>\d+)$', views.ApplicantDetailView.as_view(), name='applicant-detail'), #< creates URL to display a particular applicant in Institute Login url(r'^applicant/(?P<pk>\d+)$', views.ApplicantDetailView.as_view(), name='applicant-detail'), #< creates URL to display a particular applicant in Institute Login
url(r'^choice/create$', views.ChoiceCreateView.as_view(), name='choice-create'), #< creates URL to create a particular choice in Institute Login url(r'^choice/(?P<pk>\d+)/update$', views.ChoiceUpdate.as_view(), name='choice-update'), #< creates URL to update a particular choice in Institute Login
url(r'^choice/(?P<pk>\d+)/update$', views.ChoiceUpdate.as_view(), name='choice-update'), #< creates URL to update a particular choice in Institute Login
url(r'^choice/(?P<pk>\d+)/delete$', views.ChoiceDelete.as_view(), name='choice-delete'), #< creates URL to deleten a particular choice in Institute Login url(r'^choice/(?P<pk>\d+)/delete$', views.ChoiceDelete.as_view(), name='choice-delete'), #< creates URL to deleten a particular choice in Institute Login
url(r'^applicant/(?P<pk>\d+)/update$', views.ApplicantUpdate.as_view(), name='applicant-update'), #< creates URL to update a particular applicant in Institute Login url(r'^applicant/(?P<pk>\d+)/update$', views.ApplicantUpdate.as_view(), name='applicant-update'), #< creates URL to update a particular applicant in Institute Login
url(r'^applicant/(?P<pk>\d+)/delete$', views.ApplicantDelete.as_view(), name='applicant-delete'), #< creates URL to delete a particular applicant in Institute Login url(r'^applicant/(?P<pk>\d+)/delete$', views.ApplicantDelete.as_view(), name='applicant-delete'), #< creates URL to delete a particular applicant in Institute Login
......
This diff is collapsed.
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment