Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CS699_project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
YADNYESH SANTOSH PATIL
CS699_project
Commits
15555813
Commit
15555813
authored
Nov 27, 2019
by
ASHISH KUMAR GOYAL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dynamic Homepage view
parent
52644d23
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
121 additions
and
38 deletions
+121
-38
hostel_mess/db.sqlite3
hostel_mess/db.sqlite3
+0
-0
hostel_mess/templates/apprebate.html
hostel_mess/templates/apprebate.html
+0
-9
hostel_mess/templates/appreq.html
hostel_mess/templates/appreq.html
+13
-14
hostel_mess/templates/viewreq.html
hostel_mess/templates/viewreq.html
+66
-13
hostel_mess/usermgmt/__pycache__/utils.cpython-36.pyc
hostel_mess/usermgmt/__pycache__/utils.cpython-36.pyc
+0
-0
hostel_mess/usermgmt/__pycache__/views.cpython-36.pyc
hostel_mess/usermgmt/__pycache__/views.cpython-36.pyc
+0
-0
hostel_mess/usermgmt/utils.py
hostel_mess/usermgmt/utils.py
+38
-0
hostel_mess/usermgmt/views.py
hostel_mess/usermgmt/views.py
+4
-2
No files found.
hostel_mess/db.sqlite3
View file @
15555813
No preview for this file type
hostel_mess/templates/apprebate.html
View file @
15555813
...
...
@@ -172,15 +172,6 @@
<button
type=
"button"
class=
"btn btn-outline-danger"
>
REJECT
</button>
</td>
</tr>
{% endfor %}
<tr>
<td>
2011/04/25
</td>
<td>
2011/04/29
</td>
<td>
192302323
</td>
<td>
Ramesh SUresh
</td>
<td>
4
</td>
<td><button
type=
"button"
class=
"btn btn-outline-success"
>
APPROVE
</button>
<button
type=
"button"
class=
"btn btn-outline-danger"
>
REJECT
</button>
</td>
</tr>
</tbody>
</table>
</div>
...
...
hostel_mess/templates/appreq.html
View file @
15555813
...
...
@@ -122,6 +122,7 @@
<h6
class=
"m-0 font-weight-bold text-primary"
><b>
STATUS OF PENDING REQUESTS
</b></h6>
</div>
<div
class=
"card-body"
>
{% if pending_overheads %}
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered"
id=
"dataTable"
width=
"100%"
cellspacing=
"0"
>
<thead>
...
...
@@ -145,27 +146,25 @@
</tr>
</tfoot>
<tbody>
{% for overhead in pending_overheads %}
<tr>
<td>
2011/04/25
</td>
<td>
193020012
</td>
<td>
Ramesh Suresh
</td>
<td>
L
</td>
<td>
3
</td>
<td><button
type=
"button"
class=
"btn btn-outline-success"
>
APPROVE
</button>
<button
type=
"button"
class=
"btn btn-outline-danger"
>
REJECT
</button>
</td>
</tr>
<tr>
<td>
2011/04/25
</td>
<td>
193020011
</td>
<td>
SRK
</td>
<td>
D
</td>
<td>
3
</td>
<td>
{{ overhead.date }}
</td>
<td>
{{ overhead.ldap }}
</td>
<td>
{{ overhead.name }}
</td>
<td>
{{ overhead.mealType }}
</td>
<td>
{{ overhead.count }}
</td>
<td><button
type=
"button"
class=
"btn btn-outline-success"
>
APPROVE
</button>
<button
type=
"button"
class=
"btn btn-outline-danger"
>
REJECT
</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div
class=
"text-center"
>
<h5>
No pending Overhead requests currently.
</h5>
</div>
{% endif %}
</div>
</div>
<!--DATA table ends here -->
...
...
hostel_mess/templates/viewreq.html
View file @
15555813
...
...
@@ -134,47 +134,100 @@
<div
class=
"container-fluid"
>
<!-- DataTales Example -->
<div
class=
"row d-flex justify-content-center"
>
<div
class=
"col-md-
6
"
>
<div
class=
"col-md-
8
"
>
<div
class=
"card shadow mb-4"
>
<div
class=
"card-header py-3"
>
<h6
class=
"m-0 font-weight-bold text-primary"
><b>
STATUS OF PREVIOUS REQUESTS
</b></h6>
<h6
class=
"m-0 font-weight-bold text-primary"
><b>
STATUS OF PREVIOUS
OVERHEAD
REQUESTS
</b></h6>
</div>
<div
class=
"card-body"
>
{% if prev_overheads %}
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered"
id=
"dataTable"
width=
"100%"
cellspacing=
"0"
>
<thead>
<tr>
<th>
DATE
</th>
<th>
APPROVED/REJECTED
</th>
<th>
MEAL
</th>
<th>
COUNT
</th>
<th>
APPROVED/HOLD/REJECTED
</th>
</tr>
</thead>
<tfoot>
<tr>
<th>
DATE
</th>
<th>
APPROVED/REJECTED
</th>
<th>
MEAL
</th>
<th>
COUNT
</th>
<th>
APPROVED/HOLD/REJECTED
</th>
</tr>
</tfoot>
<tbody>
{% for ovr in prev_overheads %}
<tr>
<td>
2011/04/25
</td>
<td>
Y
</td>
<td>
{{ ovr.date }}
</td>
<td>
{{ ovr.meal }}
</td>
<td>
{{ ovr.count }}
</td>
<td>
{{ ovr.status }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div
class=
"text-center"
>
<h5>
No Overhead requests history.
</h5>
</div>
{% endif %}
</div>
</div>
</div>
</div>
<!--DATA table ends here -->
<!-- DataTales Example -->
<div
class=
"row d-flex justify-content-center"
>
<div
class=
"col-md-8"
>
<div
class=
"card shadow mb-4"
>
<div
class=
"card-header py-3"
>
<h6
class=
"m-0 font-weight-bold text-primary"
><b>
STATUS OF PREVIOUS REBATE REQUESTS
</b></h6>
</div>
<div
class=
"card-body"
>
{% if prev_rebates %}
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered"
id=
"dataTable"
width=
"100%"
cellspacing=
"0"
>
<thead>
<tr>
<td>
2011/07/25
</td>
<td>
Y
</td>
<th>
FROM
</th>
<th>
TO
</th>
<th>
APPROVED/HOLD/REJECTED
</th>
</tr>
</thead>
<tfoot>
<tr>
<td>
2009/01/12
</td>
<td>
N
</td>
<th>
FROM
</th>
<th>
TO
</th>
<th>
APPROVED/HOLD/REJECTED
</th>
</tr>
</tfoot>
<tbody>
{% for reb in prev_rebates %}
<tr>
<td>
{{ reb.from }}
</td>
<td>
{{ reb.to }}
</td>
<td>
{{ reb.status }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% else %}
<div
class=
"text-center"
>
<h5>
No Rebate requests history.
</h5>
</div>
{% endif %}
</div>
<!--DATA table ends here -->
</div>
</div>
</div>
</div
>
<!--DATA table ends here --
>
</div>
<!-- /.container-fluid -->
...
...
hostel_mess/usermgmt/__pycache__/utils.cpython-36.pyc
View file @
15555813
No preview for this file type
hostel_mess/usermgmt/__pycache__/views.cpython-36.pyc
View file @
15555813
No preview for this file type
hostel_mess/usermgmt/utils.py
View file @
15555813
...
...
@@ -26,6 +26,44 @@ def generate_pending_rebates():
else
:
return
context
def
generate_pending_overheads
():
context
=
{
'pending_overheads'
:[]}
for
ovr
in
OverheadReq
.
objects
.
filter
(
status
=
'W'
):
context
[
"pending_overheads"
]
.
extend
([{
'date'
:
str
(
ovr
.
date
),
'ldap'
:
ovr
.
student
.
user
.
username
,
'name'
:
f
'{ovr.student.user.first_name+ovr.student.user.last_name}'
,
'mealType'
:
ovr
.
mealType
,
'count'
:
ovr
.
count
}])
if
len
(
context
[
"pending_overheads"
])
==
0
:
return
None
else
:
return
context
def
generate_my_requests
(
user
):
context
=
{
'prev_overheads'
:[],
'prev_rebates'
:[]}
status
=
{
'W'
:
'HOLD'
,
'Y'
:
'APPROVED'
,
'N'
:
'REJECTED'
}
student
=
Student
.
objects
.
filter
(
user
=
user
)[
0
]
for
ovr
in
OverheadReq
.
objects
.
filter
(
student
=
student
):
context
[
"prev_overheads"
]
.
extend
([{
'date'
:
str
(
ovr
.
date
),
'meal'
:
ovr
.
mealType
,
'status'
:
status
[
ovr
.
status
],
'count'
:
ovr
.
count
}])
for
reb
in
RebateReq
.
objects
.
filter
(
student
=
student
):
context
[
"prev_rebates"
]
.
extend
([{
'from'
:
str
(
reb
.
fromDate
),
'to'
:
str
(
reb
.
toDate
),
'status'
:
status
[
reb
.
status
]
}])
if
len
(
context
[
"prev_overheads"
])
==
0
:
context
.
pop
(
"prev_overheads"
)
elif
len
(
context
[
"prev_rebates"
])
==
0
:
context
.
pop
(
"prev_rebates"
)
return
context
def
homepage_redirect
(
request
):
user
=
request
.
user
if
is_manager
(
user
):
...
...
hostel_mess/usermgmt/views.py
View file @
15555813
...
...
@@ -48,7 +48,8 @@ def logout_view(request):
@
login_required
@
user_passes_test
(
is_student
)
def
student_homepage_view
(
request
):
return
render
(
request
,
'viewreq.html'
,
context
=
None
)
context
=
generate_my_requests
(
request
.
user
)
return
render
(
request
,
'viewreq.html'
,
context
=
context
)
@
login_required
@
user_passes_test
(
is_manager
)
...
...
@@ -59,7 +60,8 @@ def manager_homepage_view(request):
@
login_required
@
user_passes_test
(
is_worker
)
def
worker_homepage_view
(
request
):
return
render
(
request
,
'appreq.html'
,
context
=
None
)
context
=
generate_pending_overheads
()
return
render
(
request
,
'appreq.html'
,
context
=
context
)
@
login_required
...
...
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