Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
General_Allocation_Portal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
codemafia
General_Allocation_Portal
Commits
b4193374
Commit
b4193374
authored
Oct 25, 2017
by
KUNAL GOYAL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update, delete applicant
parent
787c83d5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
0 deletions
+56
-0
project/allocation/__pycache__/urls.cpython-36.pyc
project/allocation/__pycache__/urls.cpython-36.pyc
+0
-0
project/allocation/__pycache__/views.cpython-36.pyc
project/allocation/__pycache__/views.cpython-36.pyc
+0
-0
project/allocation/templates/allocation/applicant_confirm_delete.html
...cation/templates/allocation/applicant_confirm_delete.html
+19
-0
project/allocation/templates/allocation/applicant_detail.html
...ect/allocation/templates/allocation/applicant_detail.html
+6
-0
project/allocation/templates/allocation/applicant_update.html
...ect/allocation/templates/allocation/applicant_update.html
+19
-0
project/allocation/urls.py
project/allocation/urls.py
+2
-0
project/allocation/views.py
project/allocation/views.py
+10
-0
project/db.sqlite3
project/db.sqlite3
+0
-0
No files found.
project/allocation/__pycache__/urls.cpython-36.pyc
View file @
b4193374
No preview for this file type
project/allocation/__pycache__/views.cpython-36.pyc
View file @
b4193374
No preview for this file type
project/allocation/templates/allocation/applicant_confirm_delete.html
0 → 100644
View file @
b4193374
{% extends "allocation/admin1.html" %}
{% load i18n admin_urls static admin_list %}
{% block breadcrumbs %}
<div
class=
"breadcrumbs"
>
<a
href=
"{% url 'allocation:admin1' %}"
>
{% trans 'Home' %}
</a>
›
<a
href=
"{% url 'allocation:applicant_list' %}"
>
{% trans 'Applicants' %}
</a>
›
{{ applicant.name }}
</div>
{% endblock %}
{% block content %}
{% if applicant.institute.name == request.user.username %}
<form
action=
""
method=
"post"
>
{% csrf_token %}
<p>
Are you sure you want to delete "{{ object }}"?
</p>
<input
type=
"submit"
value=
"Confirm"
/>
</form>
{% else %}
Unauthorised access
{% endif %}
{% endblock %}
project/allocation/templates/allocation/applicant_detail.html
View file @
b4193374
...
...
@@ -15,6 +15,12 @@
{% for choice in applicant.alloted_choice.all %}
{{choice}}
{% endfor %}
<form
action=
"{% url 'allocation:applicant-update' applicant.pk %}"
>
<input
type=
"submit"
value=
"Update"
/>
</form>
<form
action=
"{% url 'allocation:applicant-delete' applicant.pk %}"
>
<input
style=
"background-color: red;"
type=
"submit"
value=
"Delete"
/>
</form>
{% else %}
Unauthorised access
{% endif %}
...
...
project/allocation/templates/allocation/applicant_update.html
0 → 100644
View file @
b4193374
{% extends "allocation/admin1.html" %}
{% load i18n admin_urls static admin_list %}
{% block breadcrumbs %}
<div
class=
"breadcrumbs"
>
<a
href=
"{% url 'allocation:admin1' %}"
>
{% trans 'Home' %}
</a>
›
<a
href=
"{% url 'allocation:applicant_list' %}"
>
{% trans 'Applicants' %}
</a>
›
{{ applicant.name }}
</div>
{% endblock %}
{% block content %}
{% if applicant.institute.name == request.user.username %}
<form
action=
""
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
value=
"Update"
/>
</form>
{% else %}
Unauthorised access
{% endif %}
{% endblock %}
project/allocation/urls.py
View file @
b4193374
...
...
@@ -15,6 +15,8 @@ urlpatterns = [
url
(
r'^choice/create$'
,
views
.
ChoiceCreateView
.
as_view
(),
name
=
'choice-create'
),
url
(
r'^choice/(?P<pk>\d+)/update$'
,
views
.
ChoiceUpdate
.
as_view
(),
name
=
'choice-update'
),
url
(
r'^choice/(?P<pk>\d+)/delete$'
,
views
.
ChoiceDelete
.
as_view
(),
name
=
'choice-delete'
),
url
(
r'^applicant/(?P<pk>\d+)/update$'
,
views
.
ApplicantUpdate
.
as_view
(),
name
=
'applicant-update'
),
url
(
r'^applicant/(?P<pk>\d+)/delete$'
,
views
.
ApplicantDelete
.
as_view
(),
name
=
'applicant-delete'
),
url
(
r'^choice_make$'
,
views
.
choice_make
,
name
=
'choice_make'
),
url
(
r'^applicant_make$'
,
views
.
applicant_make
,
name
=
'applicant_make'
),
url
(
r'^button_action$'
,
views
.
button_action
,
name
=
'button_action'
),
...
...
project/allocation/views.py
View file @
b4193374
...
...
@@ -191,5 +191,15 @@ class ChoiceDelete(DeleteView):
model
=
Choice
success_url
=
reverse_lazy
(
'allocation:choice_list'
)
class
ApplicantUpdate
(
UpdateView
):
model
=
Applicant
fields
=
[
'name'
,
'rank'
]
template_name_suffix
=
'_update'
success_url
=
reverse_lazy
(
'allocation:applicant_list'
)
class
ApplicantDelete
(
DeleteView
):
model
=
Applicant
success_url
=
reverse_lazy
(
'allocation:applicant_list'
)
project/db.sqlite3
View file @
b4193374
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment