Skip to content

Commit

Permalink
modified hostel table
Browse files Browse the repository at this point in the history
  • Loading branch information
Pancham1603 committed Dec 25, 2023
1 parent 94b6ca4 commit 1d3613b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
11 changes: 11 additions & 0 deletions apps/nightpass/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,17 @@ footer {
.badge {
color: white;
padding: 5px 10px;
border-radius: 5px;
}

.table-container {
max-width: 800px; /* Adjust the maximum width as needed */
margin: 10px auto; /* Center the container horizontally */
padding: 20px; /* Add some padding for spacing */
overflow-x: auto; /* Add horizontal scrolling for small screens */
background-color: #fff;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);

}

@media (max-width: 768px) {
Expand Down
68 changes: 32 additions & 36 deletions apps/nightpass/templates/caretaker.html
Original file line number Diff line number Diff line change
@@ -1,45 +1,41 @@
{% extends 'base.html' %}

{% block content %}
<div class="table-responsive">
<table class="custom-table">
<thead>
<tr>
<th>Roll Number</th>
<th>Name</th>
<th>Room Number</th>
<th>Mobile Number</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for pass in hostel_passes %}
<tr>
<td>{{ pass.user.student.registration_number }}</td>
<td>{{ pass.user.student.name }}</td>
<td>{{ pass.user.student.room_number }}</td>
<td>{{ pass.user.student.contact_number }}</td>

{% if pass.user.student.is_checked_in %}
<td><span class="badge green">Inside Hostel {{ pass.user.student.hostel }}</span></td>
{% else %}
{% if pass %}
{% if pass.check_in and not pass.check_out %}
<td><span class="badge yellow">In {{ pass.campus_resource }}</span></td>
<div class="table-container">
<div class="table-responsive">
<table class="custom-table">
<thead>
<tr>
<th>Name</th>
<th>Room No</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for pass in hostel_passes %}
<tr>
<td>{{ pass.user.student.name }}</td>
<td>{{ pass.user.student.room_number }}</td>
{% if pass.user.student.is_checked_in %}
<td><span class="badge green">Checked In</span></td>
{% else %}
{% if pass %}
{% if pass.check_in and not pass.check_out %}
<td><span class="badge yellow">{{ pass.campus_resource }}</span></td>
{% else %}
<td><span class="badge red">Outside</span></td>
{% endif %}
{% else %}
<td><span class="badge red">Outside Hostel</span></td>
<td><span class="badge red">Outside</span></td>
{% endif %}
{% else %}
<td><span class="badge red">Outside Hostel</span></td>
{% endif %}
{% endif %}
<td><button>Details</button></td>
</tr>
{% endfor %}
</tbody>
</table>
<td><a href="tel:{{ pass.user.student.contact_number }}"><button>Call</button></td>
</tr>
{% endfor %}
</tbody>
</table>

</div>
</div>

{% endblock %}

0 comments on commit 1d3613b

Please sign in to comment.